CN104932930A - Method for using resource file in embedded system and system thereof - Google Patents

Method for using resource file in embedded system and system thereof Download PDF

Info

Publication number
CN104932930A
CN104932930A CN201510328891.8A CN201510328891A CN104932930A CN 104932930 A CN104932930 A CN 104932930A CN 201510328891 A CN201510328891 A CN 201510328891A CN 104932930 A CN104932930 A CN 104932930A
Authority
CN
China
Prior art keywords
file
resource file
dimensional array
resource
application program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510328891.8A
Other languages
Chinese (zh)
Inventor
项志远
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Feixun Data Communication Technology Co Ltd
Original Assignee
Shanghai Feixun Data Communication Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Feixun Data Communication Technology Co Ltd filed Critical Shanghai Feixun Data Communication Technology Co Ltd
Priority to CN201510328891.8A priority Critical patent/CN104932930A/en
Publication of CN104932930A publication Critical patent/CN104932930A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention presents a method for using a resource file in an embedded system and system of using the resource file in the embedded system. The method comprises the steps as follows: converting a resource file into a two-dimensional array and storing to a file of programming language; establishing a structural body array for storing a corresponding relation between the resource file and the two-dimensional array; compiling the file of programming language and a code file of an application program to generate final application program. The method of the invention could convert the resource file into the two-dimensional array and store in the file of programming language, and then compile in the application program together, and the resource file can be used by directly calling because the resource file is stored in the two-dimensional array. Compared with prior art, the method of the invention does not need to load and worry the problem that the resource file is lost and damaged, thereby improving the starting speed of the embedded system.

Description

Method and the system thereof of resource file is used in embedded system
Technical field
The present invention relates to application program in a kind of embedded system and load the method for resource file.
Background technology
In embedded systems, application program may use various resource file, as the page, js script, XML file, picture, the tinkle of bells, music, font, wallpaper, etc.Usually, these resource files are separated with application program.
Because resource file is separated with application program, so when application program uses these resource files, need first to load these resource files.Like this, then embedded system toggle speed can be caused slack-off.In addition when certain resource file is lost or damage, can cause loading unsuccessfully, application program occurs abnormal.When software upgrading, also relative complex is a little.
Summary of the invention
The technical matters that the present invention need solve is to provide and a kind ofly can promotes the method using resource file in the embedded system of embedded system toggle speed.
For solving above-mentioned technical matters, the present invention devises a kind of method using resource file in embedded system, and it comprises the following steps: step 1: resource file is converted to two-dimensional array and is saved in programming language file; Step 2: create an Array for structural body, for preserving the corresponding relation of resource file and two-dimensional array; Step 3: described programming language file is compiled together with the code file of application program, generates final application program.
Improve further as the present invention, in described step 1, resource file is converted to two-dimensional array and comprises: first described resource file is opened by binary mode, then the value read is saved in two-dimensional array.
Improve further as the present invention, described programming language file is the resource.c file of C language.
The present invention also provides the system using resource file in a kind of embedded system, and it comprises: modular converter, for resource file being converted to two-dimensional array and being saved in programming language file; Logging modle, for the corresponding relation of keeping records resource file and two-dimensional array; Collector, compiles described programming language file, generates final application program together with the code file of application program.
Improve further as the present invention, described programming language file is the resource.c file of C language.
Resource file is converted to two-dimensional array and is saved in programming language file by the present invention, then compiles in application program together; When embedded system starts, application program will use resource file, by finding corresponding two-dimensional array in Array for structural body, because resource file is kept in two-dimensional array, directly calling and can use.Compared with prior art, do not need to load, do not worry the problem that there is resource file loss and damage yet, thus, improve embedded system toggle speed.
Embodiment
Technical scheme of the present invention is understood better in order to make relevant technical staff in the field, below in conjunction with embodiment of the present invention, technical scheme in embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.
The invention provides a kind of method using resource file in embedded system, resource file is converted to two-dimensional array and is saved in programming language file, then compile in application program together; When embedded system starts, application program will use resource file, directly calls and can use, and does not need to load.
The method of resource file is used in embedded system of the present invention, first, described resource file is opened by binary mode, then the value read is saved in two-dimensional array, namely achieve and resource file is converted to two-dimensional array, this two-dimensional array is kept in programming language file.In the present embodiment, described embedded system is that C voice coder is translated into, and this programming language file is the resource.c file of C language, and resource file is converted to two-dimensional array, and two-dimensional array is kept in resource.c file.
The present invention creates an Array for structural body, for preserving the corresponding relation of resource file and two-dimensional array, because application program needs to use multiple resource file, when in two-dimensional array in preserving after the conversion of each resource file, then need the corresponding relation recording each resource file and two-dimensional array, to facilitate the position finding corresponding resource file in two-dimensional array.
Two-dimensional array is preserved in programming language file, can conveniently compile like this.Described programming language file compiles by the present invention together with the code file of application program, generates final application program.Because two-dimensional array is kept in programming voice document, like this, be equivalent to resource file to compile in application program.When application program uses resource file, in two-dimensional array, directly use can be called.
The present invention also provides the system using resource file in a kind of embedded system, comprising: modular converter, register system and compiling system.
Modular converter is used for resource file being converted to two-dimensional array and being saved in programming language file.
Logging modle, for the corresponding relation of keeping records resource file and two-dimensional array, in an embodiment of the present invention, records the corresponding relation of each resource file and two-dimensional array by Array for structural body ResourceIndex.
Collector, compiles by described programming language file, generates final application program together with the code file of application program.Because the resource file being converted to two-dimensional array preserved by programming language file, edited together with application program by programming language file, like this, namely resource file compiles in application program again, when application program uses resource file, in two-dimensional array, directly use can be called.
Resource file is converted to two-dimensional array and is saved in programming language file by the present invention, then compiles in application program together; When embedded system starts, application program will use resource file, by finding corresponding two-dimensional array in Array for structural body, because resource file is kept in two-dimensional array, directly calling and can use.Compared with prior art, do not need to load, do not worry the problem that there is resource file loss and damage yet, thus, improve embedded system toggle speed.
Below only have expressed one embodiment of the present invention, it describes comparatively concrete and detailed, but therefore can not be interpreted as the restriction to the scope of the claims of the present invention.It should be pointed out that for the person of ordinary skill of the art, without departing from the inventive concept of the premise, can also make some distortion and improvement, these all belong to protection scope of the present invention.Therefore, the protection domain of patent of the present invention should be as the criterion with claims.

Claims (5)

1. use a method for resource file in embedded system, it is characterized in that: comprise the following steps:
Step 1: resource file is converted to two-dimensional array and is saved in programming language file;
Step 2: create an Array for structural body, for preserving the corresponding relation of resource file and two-dimensional array;
Step 3: described programming language file is compiled together with the code file of application program, generates final application program.
2. use the method for resource file in embedded system according to claim 1, it is characterized in that: in described step 1, resource file is converted to two-dimensional array and comprises:
First described resource file is opened by binary mode, then the value read is saved in two-dimensional array.
3. use the method for resource file in embedded system according to claim 1, it is characterized in that: described programming language file is the resource.c file of C language.
4. use a system for resource file in embedded system, it is characterized in that, comprising:
Modular converter, for being converted to two-dimensional array by resource file and being saved in programming language file;
Logging modle, for the corresponding relation of keeping records resource file and two-dimensional array;
Collector, compiles described programming language file, generates final application program together with the code file of application program.
5. use the system of resource file in embedded system according to claim 4, it is characterized in that, described programming language file is the resource.c file of C language.
CN201510328891.8A 2015-06-15 2015-06-15 Method for using resource file in embedded system and system thereof Pending CN104932930A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510328891.8A CN104932930A (en) 2015-06-15 2015-06-15 Method for using resource file in embedded system and system thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510328891.8A CN104932930A (en) 2015-06-15 2015-06-15 Method for using resource file in embedded system and system thereof

Publications (1)

Publication Number Publication Date
CN104932930A true CN104932930A (en) 2015-09-23

Family

ID=54120105

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510328891.8A Pending CN104932930A (en) 2015-06-15 2015-06-15 Method for using resource file in embedded system and system thereof

Country Status (1)

Country Link
CN (1) CN104932930A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115374188A (en) * 2022-10-24 2022-11-22 沐曦科技(成都)有限公司 Resource state query method and device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1996304A (en) * 2006-12-28 2007-07-11 杭州华为三康技术有限公司 Method and device for processing Web resource files in embedded device
CN101196811A (en) * 2007-12-07 2008-06-11 炬才微电子(深圳)有限公司 Embedded software developing method
CN101727491A (en) * 2009-12-30 2010-06-09 山东大学 Function improving method of browser based on embedded type web technology

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1996304A (en) * 2006-12-28 2007-07-11 杭州华为三康技术有限公司 Method and device for processing Web resource files in embedded device
CN101196811A (en) * 2007-12-07 2008-06-11 炬才微电子(深圳)有限公司 Embedded software developing method
CN101727491A (en) * 2009-12-30 2010-06-09 山东大学 Function improving method of browser based on embedded type web technology

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115374188A (en) * 2022-10-24 2022-11-22 沐曦科技(成都)有限公司 Resource state query method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107918666B (en) Data synchronization method and system on block chain
SG11201901760SA (en) Method and system for accessing out-of-chain data based on consortium block chain
WO2019041668A1 (en) Method, device and system for calling main project code by component-based software project and storage medium
CN103390005A (en) Method and system for merging documents
US20110145308A1 (en) System to improve numereical conversions and associated methods
CN102999370A (en) Method and system for executing script
CN109739508B (en) Source code compiling method, device, system and storage medium
CN107479878B (en) Lua modularization development method and development framework based on openness
CN104572781A (en) Method and device for generating transaction log
CN117251249A (en) Cross-virtual machine calling method based on multi-virtual machine blockchain platform
CN102929982A (en) Media scanned file indexing method and device
CN104932930A (en) Method for using resource file in embedded system and system thereof
CN109116828A (en) Model code configuration method and device in a kind of controller
CN111984595B (en) File processing method and device and storage medium
JP6703114B2 (en) Application program execution method and apparatus
CN112559186A (en) Novel Kubernetes container resource expansion and contraction method
CN102012821A (en) Secondary development adaptation method
CN104572876A (en) Method and device for reading configuration file corresponding to software
CN105740009B (en) Version upgrading method and terminal device
CN102520929A (en) Management method and device of system resource
CN106293862A (en) A kind of analysis method and device of expandable mark language XML data
CN116107578A (en) Method, device, electronic equipment and storage medium for executing intelligent contract
CN109033381A (en) A kind of execution method, device and equipment of service request
MX2021016158A (en) Context coding for information on transform kernel set in image coding system.
CN106681696B (en) A kind of large-scale parallel program optimization arrangement 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20150923

RJ01 Rejection of invention patent application after publication