CN104049970A - Automatic identifying method and system for framework and platform at user mode - Google Patents

Automatic identifying method and system for framework and platform at user mode Download PDF

Info

Publication number
CN104049970A
CN104049970A CN201410236437.5A CN201410236437A CN104049970A CN 104049970 A CN104049970 A CN 104049970A CN 201410236437 A CN201410236437 A CN 201410236437A CN 104049970 A CN104049970 A CN 104049970A
Authority
CN
China
Prior art keywords
system information
user
state
data structure
kernel
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
Application number
CN201410236437.5A
Other languages
Chinese (zh)
Other versions
CN104049970B (en
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.)
Opzoon Technology Co Ltd
Original Assignee
Opzoon 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 Opzoon Technology Co Ltd filed Critical Opzoon Technology Co Ltd
Priority to CN201410236437.5A priority Critical patent/CN104049970B/en
Publication of CN104049970A publication Critical patent/CN104049970A/en
Application granted granted Critical
Publication of CN104049970B publication Critical patent/CN104049970B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention discloses an automatic identifying method and system for a framework and a platform at the user mode. The method comprises the steps of configuring a linux inner core; obtaining system information at the user mode; identifying the system framework and platform. According to the automatic identifying method and system for the framework and the platform at the user mode, the system framework or hardware platform can be automatically identified, and the function that an application module generated by compiling one set of codes can load a multi-system framework and a multi-hardware platform is realized, so the application programs in different versions do not need to be compiled according to different system frameworks or hardware platforms.

Description

Automatic identifying method and the system of user's state architecture platform
Technical field
The present invention relates to embedded OS field, relate in particular to a kind of automatic identifying method and system of user's state architecture platform.
Background technology
The current digital communication epoch, the system architecture difference that different vendor is used, also may same manufacturer support several system architecture platforms simultaneously, and a kind of architecture platform may derive different product form, so for a set of code, how to distinguish different system architectures and become from different hardware platforms the problem that all big enterprises all can face, the differentiating method difference of possible different vendor is generally to specify framework (MIPS, ARM, X86 etc.) by make menuconfig configuration kernel before use by kernel state; Or user's state is controlled the version executable file of compiling for different frameworks or hardware platform by compiling macro.
For different system framework or hardware platform, each compiling needs to specify or amendment compile option or compiling macro, needs the multiple different editions of compiling, time and effort consuming, trouble very.
Summary of the invention
The object of this invention is to provide a kind of automatic identifying method and system of user's state architecture platform, the method is identified and saved system relevant information by kernel, obtain and use this system related information in user's state, to solve the identification problem of different hardware platforms type.
In order to solve the problems of the technologies described above, the invention provides a kind of automatic identifying method of user's state architecture platform, comprise the steps: step S100, configuration linux kernel; Step S200, obtains system information in user's state; And step S300, recognition system architecture platform.
Wherein, the step that configures linux kernel in described step S100 comprises: the newly-built kernel data structure that comprises system information variable, the kernel interface function that increases the system information for identifying current device, is stored in this system information in described kernel data structure.
Wherein, the step of obtaining system information in user's state in described step S200 comprises: from kernel data structure, obtain described system information in user's state by equipment ioctl function.
Wherein, in described step S300, the step of recognition system architecture platform comprises: define corresponding system information variable in user's state according to described system information; Utilize this system information variable as Rule of judgment to judge different system architecture platforms; Load the initialize routine of different system architecture platforms.
Wherein, described step S100 further comprises: step S110, newly-built kernel data structure; Step S120, newly-increased kernel interface function; Step S130, carries out assignment to newly-built kernel data structure.
Described step S200 further comprises step: step S210, newly-built user's state data structure; Step S220, obtains the system information of current device based on user's state data structure.
Optionally, described step S210 also comprises: the global variable array of statement user state data structure, increases user's state interface function.
Described step S300 further comprises: step S310, carries out assignment to the relevant variable in user's state data structure; Step S320, recognition system architecture platform type; Step S330, according to the type actuating equipment initialization of the system architecture platform of identification.
Preferably, in described step S320, user's state is carried out characteristic encoding by the global variable of the different system architecture platform of acquisition as the criterion of distinguishing different hardware equipment, with recognition system architecture platform type.
According to a further aspect in the invention, a kind of automatic recognition system of user's state architecture platform is provided, it is characterized in that, comprise: linux kernel setup unit, for the kernel data structure of newly-built system information variable, the kernel interface that increases the system information for identifying current device, this kernel interface is stored in the system information of the current device recognizing in described kernel data structure; System information acquiring unit, for obtaining described system information by equipment ioctl function from kernel data structure in user's state; System identification unit, utilizes user's state to define corresponding system information variable according to system information, as Rule of judgment, identifies different system architecture platforms by this system information variable, to load the initialize routine of different system architecture platforms.
The present invention, by configuration linux kernel, has set up the kernel interface function of the system information for identifying current device and the kernel data structure for storing system information, so that user's state read system information; Define corresponding system information variable by user's state according to described system information, utilize this system information variable to load the initialize routine of different system architecture platforms as Rule of judgment, to realize the automatic identification of architecture platform; Realize according to system architecture or the hardware platform judged many hardware platforms of the application program adaptive allocation multisystem framework function generating after a set of code compilation, thereby without compiling multiple different editions application programs according to different system framework or hardware platform again, time cost and software cost are saved.
Brief description of the drawings
Fig. 1 is the process flow diagram of automatic identifying method of the present invention;
Fig. 2 is the method flow diagram that configures linux kernel in the present invention in step S100;
Fig. 3 is the method flow diagram that obtains system information in the present invention in step S200;
Fig. 4 is the method flow diagram of step S300 in the present invention;
Fig. 5 shows the structural representation of automatic recognition system of the present invention.
Embodiment
For making the object, technical solutions and advantages of the present invention more cheer and bright, below in conjunction with embodiment and with reference to accompanying drawing, the present invention is described in more detail.Should be appreciated that, these descriptions are exemplary, and do not really want to limit the scope of the invention.In addition, in the following description, omitted the description to known features and technology, to avoid unnecessarily obscuring concept of the present invention.
Embodiment 1
Fig. 1 shows the process flow diagram of automatic identifying method of the present invention.
As shown in Figure 1, automatic identifying method of the present invention comprises the steps:
Step S100, configuration linux kernel.
The newly-built kernel data structure that comprises system information variable, and increase the kernel interface function that is used for the system information of identifying current device, this system information is stored in described kernel data structure simultaneously.
Step S200, obtains system information in user's state.
From kernel data structure, obtain described system information in user's state by equipment ioctl function.
In this step, described ioctl function is the function that in device driver, the I/O passage to equipment manages.
Step S300, recognition system architecture platform.
Define corresponding system information variable in user's state according to described system information.And, utilize this system information variable as Rule of judgment, judge different system architecture platforms, to load the initialize routine of different system architecture platforms, realize the automatic identification of architecture platform.
In the present embodiment, described system information is system architecture information and/or hardware platform information; Described system information variable is system architecture information variable and/or hardware platform variable; Wherein, described hardware platform information is cpu information and/or bus message; Described hardware platform variable is cpu information variable and/or bus message variable.
Fig. 2 shows the method flow diagram that configures linux kernel in step S100.
As shown in Figure 2, the step that configures linux kernel in above-mentioned steps S100 further comprises the steps:
Step S110, newly-built kernel data structure.
In this step, described kernel data structure comprises system architecture information variable, cpu information variable, bus variable etc.For example following data structure, struct platform_info{intsysterm_type; Int cpu_info (type can be as required also structure); Int bus_info (type can be as required also structure) }.
Step S120, newly-increased kernel interface function.
In this step, kernel interface function is for identifying the system information that current device is using, i.e. cpu information and the bus message of system architecture and hardware device.
Step S130, carries out assignment to newly-built kernel data structure.
After kernel interface function identifies said system information, these system informations are kept in newly-built kernel data structure.For example, linux kernel can configure kernel according to individual demand before use, can judge that system architecture assignment are to systerm_type according to CONFIG_MIPS, CONFIG_ARM, the CONFIG_X86 of configuration; Then the cpu information, bus message assignment that read hardware device by kernel function are to cpu_info, bus_info.
Fig. 3 shows user's state in described step S200 and obtains from kernel data structure by equipment ioctl function the process flow diagram of the method for described system information.
As described in Figure 3, in described step S200, user's state is obtained the method for described system information from kernel data structure by equipment ioctl function, comprises the steps:
Step S210, newly-built user's state data structure.
In this step, newly-built user's state data structure in user's state is stated the global variable array of this data structure simultaneously, increases user's state interface function.Described global variable array comprises system information variable.
Step S220, obtains the system information of current device based on user's state data structure.
In this step, before system initialization, issue described kernel interface function based on user's state data structure by equipment ioctl function, to obtain the system information of the current device in described step S100 in user's state.Described user's state data structure comprises system information variable, and described system information variable is system architecture information variable and/or hardware platform variable, and described system information is system architecture information and/or hardware platform information.
Fig. 4 shows the process flow diagram of step S300.
As shown in Figure 4, in described step S300, define the method for corresponding system information variable according to described system information in user's state, and the initialize routine of utilizing this system information variable to load different system architecture platforms as Rule of judgment specifically comprises the steps:
Step S310, carries out assignment to the relevant variable in user's state data structure.
In this step, the system information of the current device obtaining according to the user's state in described step S210, assignment is given the corresponding member variable of the global variable array of described user's state data structure, for judging different system architecture platforms.Specifically, the system architecture obtaining according to step S200 and cpu information, the bus message etc. of hardware device, the corresponding member variable (system architecture information variable and/or hardware platform variable) by corresponding contents assignment to the global variable of user's state data structure.
Step S320, recognition system architecture platform type.
In this step, the system information that utilization is obtained, as identifying feature, identifies different system architecture platforms,, user's state is carried out characteristic encoding by the global variable of the different architecture platforms of acquisition as the criterion of distinguishing different hardware equipment, to realize the automatic identification of architecture platform.Specifically, carry out characteristic encoding according to the global variable of the different architecture platforms of definition as the criterion of distinguishing different hardware equipment.For example, different hardware equipment number of ports difference, drives type difference, carries out feature development, to load different driving and initialization distinct interface number etc. according to the platform of judgement.
Step S330, according to the type actuating equipment initialization of the system architecture platform of identification.
In this step, when hardware device initialization, can determine according to the system architecture platform information recognizing type and the corresponding software version of architecture platform, determine the corresponding architecture platform of execution branch, realize version of a set of code compilation.Finally realize on multiple frameworks or multiple hardware platform distinct device is carried out to different initialization loadings.
Embodiment 2
The automatic recognition system of implementing on embodiment 1 basis.
Fig. 5 has gone out the structural representation of automatic recognition system of the present invention.
As shown in Figure 5, the automatic recognition system of identification user state architecture platform of the present invention comprises following assembly.
Linux kernel setup unit, for the kernel data structure of newly-built system information variable, and increasing the kernel interface that is used for the system information of identifying current device, this kernel interface is stored in the system information of the current device recognizing in described kernel data structure and identifies.
System information acquiring unit, for obtaining described system information by equipment ioctl function from kernel data structure in user's state.
System identification unit, utilize user's state to define corresponding system information variable according to system information, as Rule of judgment, identify different system architecture platforms by this system information variable, to load the initialize routine of different system architecture platforms, thereby realize the automatic identification of architecture platform.
In the present embodiment, described system information is system architecture information and/or hardware platform information; Described system information variable is system architecture information variable and/or hardware platform variable; Wherein, described hardware platform information is cpu information and/or bus message; Described hardware platform variable is cpu information variable and/or bus message variable.
In the present embodiment, in the operation that linux kernel setup unit, system information acquiring unit, system automatic identification unit are performed and embodiment 1, each step is similar, specifically referring to the specific implementation method of corresponding steps in step S100, step S200, step S300.
According to automatic identifying method of the present invention and system, can be by obtaining the configuration information of kernel, pass through read system information, the CPU information, the bus message that are system architecture information, hardware device judge system architecture or hardware platform, thereby realize according to the system architecture of judging or hardware platform many hardware platforms of the application program adaptive allocation multisystem framework function generating after a set of code compilation, and without compiling multiple different editions application programs according to different system framework or hardware platform again, realized the different loadings of a mirror image distinct device.Therefore, automatic identifying method of the present invention and system can be saved system operation time and construction cost.
Should be understood that, above-mentioned embodiment of the present invention is only for exemplary illustration or explain principle of the present invention, and is not construed as limiting the invention.Therefore any amendment of, making, be equal to replacement, improvement etc., within protection scope of the present invention all should be included in without departing from the spirit and scope of the present invention in the situation that.In addition, claims of the present invention are intended to contain whole variations and the modification in the equivalents that falls into claims scope and border or this scope and border.

Claims (10)

1. an automatic identifying method for user's state architecture platform, comprises the steps:
Step S100, configuration linux kernel;
Step S200, obtains system information in user's state; And
Step S300, recognition system architecture platform.
2. automatic identifying method according to claim 1, the step that configures linux kernel in described step S100 comprises: the newly-built kernel data structure that comprises system information variable, the kernel interface function that increases the system information for identifying current device, is stored in this system information in described kernel data structure.
3. automatic identifying method according to claim 1, the step of obtaining system information in user's state in described step S200 comprises: from kernel data structure, obtain described system information in user's state by equipment ioctl function.
4. automatic identifying method according to claim 1, in described step S300, the step of recognition system architecture platform comprises:
Define corresponding system information variable in user's state according to described system information;
Utilize this system information variable as Rule of judgment to judge different system architecture platforms;
Load the initialize routine of different system architecture platforms.
5. automatic identifying method according to claim 1 and 2, described step S100 further comprises:
Step S110, newly-built kernel data structure;
Step S120, newly-increased kernel interface function;
Step S130, carries out assignment to newly-built kernel data structure.
6. according to the automatic identifying method described in claim 1 or 3, described step S200 further comprises step:
Step S210, newly-built user's state data structure;
Step S220, obtains the system information of current device based on user's state data structure.
7. automatic identifying method according to claim 6, described step S210 also comprises: the global variable array of statement user state data structure, increases user's state interface function.
8. according to the automatic identifying method described in claim 1 or 4, described step S300 further comprises:
Step S310, carries out assignment to the relevant variable in user's state data structure;
Step S320, recognition system architecture platform type;
Step S330, according to the type actuating equipment initialization of the system architecture platform of identification.
9. automatic identifying method according to claim 8, in described step S320,
User's state is carried out characteristic encoding by the global variable of the different system architecture platform of acquisition as the criterion of distinguishing different hardware equipment, with recognition system architecture platform type.
10. an automatic recognition system for user's state architecture platform, is characterized in that, comprising:
Linux kernel setup unit, for the kernel data structure of newly-built system information variable, increases the kernel interface of the system information for identifying current device, and this kernel interface is stored in the system information of the current device recognizing in described kernel data structure;
System information acquiring unit, for obtaining described system information by equipment ioctl function from kernel data structure in user's state;
System identification unit, utilizes user's state to define corresponding system information variable according to system information, as Rule of judgment, identifies different system architecture platforms by this system information variable, to load the initialize routine of different system architecture platforms.
CN201410236437.5A 2014-05-29 2014-05-29 The automatic identifying method and system of User space architecture platform Active CN104049970B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410236437.5A CN104049970B (en) 2014-05-29 2014-05-29 The automatic identifying method and system of User space architecture platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410236437.5A CN104049970B (en) 2014-05-29 2014-05-29 The automatic identifying method and system of User space architecture platform

Publications (2)

Publication Number Publication Date
CN104049970A true CN104049970A (en) 2014-09-17
CN104049970B CN104049970B (en) 2018-01-16

Family

ID=51502879

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410236437.5A Active CN104049970B (en) 2014-05-29 2014-05-29 The automatic identifying method and system of User space architecture platform

Country Status (1)

Country Link
CN (1) CN104049970B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104615493A (en) * 2015-01-14 2015-05-13 浪潮电子信息产业股份有限公司 Cross-platform server-side mode recognition tool and method
CN105491387A (en) * 2015-12-04 2016-04-13 武汉斗鱼网络科技有限公司 H264 hardware coding system based on three platforms of Intel, AMD and Nvidia

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1964526A (en) * 2005-11-09 2007-05-16 中兴通讯股份有限公司 A method for hardware drive program of intelligent loading mobile phone

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1964526A (en) * 2005-11-09 2007-05-16 中兴通讯股份有限公司 A method for hardware drive program of intelligent loading mobile phone

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
JONATHAN CORBET等: "Debugging and Querying", 《HTTPS://WEB.ARCHIVE.ORG/WEB/20131124015518/HTTP://WWW.MAKELINUX.NET/LDD3/CHP-4-SECT-3》 *
张敬东: "《Linux服务器配置与管理》", 31 March 2014 *
文全刚: "《嵌入式Linux操作系统原理与应用(第2版)》", 28 February 2014 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104615493A (en) * 2015-01-14 2015-05-13 浪潮电子信息产业股份有限公司 Cross-platform server-side mode recognition tool and method
CN105491387A (en) * 2015-12-04 2016-04-13 武汉斗鱼网络科技有限公司 H264 hardware coding system based on three platforms of Intel, AMD and Nvidia
CN105491387B (en) * 2015-12-04 2019-06-21 武汉斗鱼网络科技有限公司 A kind of H264 hardware encoding system based on tri- platform of Intel, AMD and Nvidia

Also Published As

Publication number Publication date
CN104049970B (en) 2018-01-16

Similar Documents

Publication Publication Date Title
US11086661B2 (en) Container chaining for automated process completion
US10216509B2 (en) Continuous and automatic application development and deployment
CN102915247B (en) APK plug-in unit management method
CN109062617B (en) Application method of platform supporting multiple types of equipment and mobile terminal
CN107733985B (en) Method and device for deploying functional components of cloud computing system
US8555280B2 (en) Terminal device of non-android platform for executing android applications, and computer readable recording medium for storing program of executing android applications on non-android platform
CN104008060B (en) Method for detecting compatibility of plug-in and host, and detection server
CN105988843A (en) Firmware upgrade method and firmware upgrade device for mobile terminal
CN104978271A (en) Automatic upgrade pressure measurement method and system for Android system
CN103365668B (en) A kind of dynamic link library loads and the method, apparatus of link
CN103902480A (en) Android phone driving method and system
CN103853586A (en) Method of realizing wireless card driver in UEFI (unified extensible firmware interface) layer
CN114721719B (en) Method and system for containerized deployment of heterogeneous applications in cluster
CN113076143B (en) Artificial intelligence environment adaptation method and compatibility test method for domestic platform
CN103885802A (en) Driver installation method and device and client
KR20240047468A (en) ECU upgrade method and device, and readable storage medium
CN110515671A (en) Initial method, apparatus for initializing, terminal device and readable storage medium storing program for executing
CN104049970A (en) Automatic identifying method and system for framework and platform at user mode
KR20150124530A (en) Application build system, control method thereof, and recording medium for recording program for executing the control method
CN107621946B (en) Software development method, device and system
CN116249962A (en) Pool management for in-vehicle device application launch
CN105630530A (en) Multilevel boot method and system of digital signal processor
CN103631585A (en) Method and system for developing application program
CN107688479B (en) Android system network cluster, construction method thereof, and Android system network cluster data processing method and system
CN102750167B (en) Application program launching method, device and computer system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
PP01 Preservation of patent right

Effective date of registration: 20180528

Granted publication date: 20180116

PP01 Preservation of patent right