CN106775734B - Andriod system engineering method and device - Google Patents

Andriod system engineering method and device Download PDF

Info

Publication number
CN106775734B
CN106775734B CN201611208004.4A CN201611208004A CN106775734B CN 106775734 B CN106775734 B CN 106775734B CN 201611208004 A CN201611208004 A CN 201611208004A CN 106775734 B CN106775734 B CN 106775734B
Authority
CN
China
Prior art keywords
interface
framework
interface adaptation
adaptation file
unit
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.)
Active
Application number
CN201611208004.4A
Other languages
Chinese (zh)
Other versions
CN106775734A (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.)
Beijing Digital Tianyu Science & Technology Co ltd
Original Assignee
Beijing Digital Tianyu Science & 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 Beijing Digital Tianyu Science & Technology Co ltd filed Critical Beijing Digital Tianyu Science & Technology Co ltd
Priority to CN201611208004.4A priority Critical patent/CN106775734B/en
Publication of CN106775734A publication Critical patent/CN106775734A/en
Application granted granted Critical
Publication of CN106775734B publication Critical patent/CN106775734B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • G06F8/22Procedural
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/76Adapting program code to run in a different environment; Porting

Abstract

The invention discloses an Andriod system engineering method, which comprises the following steps: when a platform or a version is changed, an interface adaptation file is created and used for selecting an interface to be used; modifying the compiling script and loading the interface adaptation file; the Framework acquires the method and the attribute of the related interface through the interface adaptation file; and each module dynamically acquires the method and the attribute of the related interface through the Framework by using a JAVA reflection mechanism. The invention also discloses a device for Andriod system engineering. The method and the device can realize the independence of each module, reduce the coupling of the system and achieve the aims of quick engineering, quick transplantation and adaptation of the system.

Description

Andriod system engineering method and device
Technical Field
The application relates to the field of software development, in particular to an Andriod system engineering method. The application also provides a device for Andriod system engineering.
Background
In the running state, for any one class, all the properties and methods of the class can be known; any method and attribute of any object can be called; the function of the dynamically acquired information and the method for dynamically calling the object is called a reflection mechanism of JAVA language, which is referred to as JAVA reflection mechanism for short.
In the existing Android intelligent operating system, due to the fact that Android versions change quickly, chip platforms (Qualcomm, MTK, SPRD and the like) are multiple, project periods are short, project adaptation is multiple, adaptation and test work of a B2B project are complex, project cost is high, dependence on an Android native base package is reduced by creating own frame, related res and related apps under a vendor directory, and platform compatibility adaptation is achieved by modifying an interface of a corresponding file on a frame layer or adding a method in a reconstruction mode. Although the traditional technology has a clear architecture, the coupling degree inside the system is still deep, multiple departments are required to cooperate in the transplanting process, various testing problems and version maintenance problems can occur after the transplanting is completed, and the system is difficult to adapt to new projects in a short time.
Due to the problems, the engineering of the existing platform has obvious problems of deep coupling degree inside the system and slow adaptation and transplantation speed.
Disclosure of Invention
The invention provides an Andriod system engineering method and device, and aims to solve the problems of deep coupling degree and low transplanting and adapting speed in the conventional system.
The invention provides an Andriod system engineering method, which comprises the following steps:
when a platform or a version is changed, an interface adaptation file is created and used for selecting an interface to be used;
modifying the compiling script and loading the interface adaptation file;
the Framework acquires the method and the attribute of the related interface through the interface adaptation file;
and each module dynamically acquires the method and the attribute of the related interface through the Framework by using a JAVA reflection mechanism.
Optionally, the method further includes:
and constructing the association relationship between the Framework and the interface by using a JAVA reflection mechanism.
Optionally, the interface adaptation file is used to adapt the relevant function interfaces of different hardware platforms.
Optionally, the hardware platform is a chip platform.
Optionally, the interface adaptation file is used to adapt the relevant function interfaces of different software platforms.
Optionally, the interface adaptation file is used to adapt the functional interfaces of different Andriod versions.
Optionally, the interface adaptation file is configured in the makefile.
Optionally, the method further includes:
res in the Framework is extracted in a middleware mode to form an independent component.
Optionally, the individual components are configured in the makefile.
The invention also provides a device for Andriod system engineering, which is characterized by comprising:
the system comprises a creating unit, a processing unit and a processing unit, wherein the creating unit is used for creating an interface adaptation file when a platform or a version changes, and the interface adaptation file is used for selecting an interface required to be used;
the configuration unit is used for modifying the compiling script and loading the interface adaptation file;
the first obtaining unit is used for obtaining the method and the attribute of the relevant interface by the Framework through the interface adaptation file; and the combination of (a) and (b),
and the second acquisition unit is used for dynamically acquiring the method and the attribute of the relevant interface by each module through the Framework by using a JAVA reflection mechanism.
Optionally, the apparatus further comprises:
and the construction unit is used for constructing the association relationship between the Framework and the interface by using a JAVA reflection mechanism.
Optionally, the creating unit is specifically configured to adapt, through the interface adaptation file, the relevant function interfaces of different hardware platforms.
Optionally, the hardware platform is a chip platform.
Optionally, the creating unit is specifically configured to adapt, through the interface adaptation file, the relevant function interfaces of different software platforms.
Optionally, the creating unit is specifically configured to adapt, through the interface adaptation file, the related function interfaces of different Andriod versions.
Optionally, the configuration unit is further configured to configure the interface adaptation file in the makefile.
Optionally, the method further includes:
and the extraction unit is used for extracting res in the Framework in a middleware mode to form an independent component.
Optionally, the configuration unit is further configured to configure the separate component in the makefile.
Compared with the prior art, the invention has the following advantages:
the invention can dynamically and flexibly configure the calling mode between the application layer and the packaging layer by utilizing a java reflection mechanism, and by adopting the technical scheme provided by the application, the dependency relationship of a single module on the frame can be reduced, the internal coupling of a related system can be reduced in a more convenient mode, so that the modules in the system are independent as much as possible, the dependency is reduced, and the purposes of quick engineering, quick transplanting and adapting of the system are achieved.
Drawings
FIG. 1 is a schematic flow chart diagram of an embodiment of a method for Andriod system engineering provided by the present invention;
fig. 2 is a schematic flow chart of an embodiment of the apparatus for Andriod system engineering provided by the present invention.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein, but rather construed as limited to the embodiments set forth herein.
The system described in the present invention is described in detail by taking an Andriod intelligent operating system as an example, but is not limited to the Andriod intelligent operating system.
The invention provides an Andriod system engineering method, which comprises the following specific embodiments:
as shown in fig. 1, which is a schematic flow chart of an embodiment of a method for engineering an Andriod system provided in the present application, the method includes the following steps:
step S101: when the platform or the version changes, an interface adaptation file is created, and the interface adaptation file is used for selecting the interface to be used.
And adapting the interface file related to the platform or version change in the interface adaptation file.
Optionally, the platform includes a software platform and a hardware platform.
Optionally, the version is Andriod version.
Since different platforms have their own interfaces, it is necessary to create relevant interface adaptation files according to the chip platform for those places depending on the platform interface changes.
Optionally, the interface adaptation file may be used to adapt the relevant function interfaces of different hardware platforms.
Optionally, the interface adaptation file may be used to adapt the functional interfaces of different chip platforms.
Since the Andriod version is fast in iteration, the interface adaptation file also needs to be created according to the relevant version for modification.
Optionally, the interface adaptation file may be used to adapt the relevant functional interfaces of different software platforms.
Optionally, the interface adaptation file may be used to adapt the functional interfaces of different Android versions.
If the interface is inconsistent, the frame layer does not need to be changed, and only compatibility adaptation is carried out in a single module, so that the aim of fast adapting to a manufacturer is fulfilled.
Only when the interface changes, the interface adaptation file needs to be created, and if only the interface name changes, the interface adaptation file can not be created again; if the number of parameters, the type of return, etc. are changed, a related interface adaptation file needs to be created again for processing related logic.
Before step S101, the method further includes: and constructing the association relationship between the Framework and the interface by using a JAVA reflection mechanism.
The incidence relation constructed by the reflection mechanism can improve the independence of each module, and each module can dynamically acquire an interface. After the JAVA reflection mechanism is constructed, when the interface is changed, only the relevant interface adaptation file needs to be compiled into the system, and the calling module does not need to modify codes.
Step S102: and modifying the compiling script and loading the interface adaptation file.
Optionally, a reference of the interface adaptation file may be configured in the makefile.
Optionally, the present invention further includes customizing the control. The control self-defining means that res in the Framework is extracted in a middleware mode to form an independent component, so that coupling is reduced; and configure the individual components in the makefile.
The individual components are customized components. Since many components in the native android system are google-sourced and standardized, customized components are required when the standardized components cannot meet the requirements when special requirements exist in the product requirements.
Step S103: and the Framework acquires the method and the attribute of the related interface through the interface adaptation file.
And adapting the interfaces of different platforms and versions in the interface adaptation file to provide a uniform interface for the Framework so as to call the Framework conveniently.
Step S104: and each module dynamically acquires the method and the attribute of the related interface through the Framework by using a JAVA reflection mechanism.
Reflection is a mechanism of JAVA, and is the calling of the application layer to the attributes and methods of the packaging layer classes, and the attributes and methods existing in Framework can be called in a reflection mode without repeatedly realizing the attributes and methods of the existing classes by the application layer.
The invention can dynamically and flexibly configure the calling mode between the application layer and the encapsulation layer by using a java reflection mechanism, and can reduce the dependency relationship of a single module on the frame, so that the modules are more independent.
Correspondingly, the invention also provides a device for Andriod system engineering, and the following is a specific embodiment of the device:
as shown in fig. 2, which is a schematic flowchart of an embodiment of an apparatus for Andriod system engineering provided in the present application, the apparatus includes a creating unit 201, a configuring unit 202, a first obtaining unit 203, and a second obtaining unit 204:
a creating unit 201, configured to create an interface adaptation file when a platform or a version changes, where the interface adaptation file is used to select an interface that needs to be used;
a configuration unit 202, configured to modify the compiling script and load the interface adaptation file;
a first obtaining unit 203, configured to obtain, by the Framework, a method and an attribute of a relevant interface through the interface adaptation file;
a second obtaining unit 204, configured to use a JAVA reflection mechanism to dynamically obtain, by each module, a method and an attribute of a relevant interface through a Framework.
Optionally, the platform includes a software platform and a hardware platform.
Optionally, the version is Andriod version.
Since different platforms have their own interfaces, it is necessary to create relevant interface adaptation files according to the chip platform for those places depending on the platform interface changes.
Optionally, the creating unit 201 is specifically configured to adapt, through the interface adaptation file, related function interfaces of different hardware platforms.
Optionally, the creating unit 201 is specifically configured to adapt, through the interface adaptation file, related function interfaces of different chip platforms.
Since the Andriod version is fast in iteration, the interface adaptation file also needs to be created according to the relevant version for modification.
Optionally, the creating unit 201 is specifically configured to adapt, through the interface adaptation file, related function interfaces of different software platforms.
Optionally, the creating unit 201 is specifically configured to adapt, through the interface adaptation file, the related function interfaces of different Andriod versions.
If the interface is inconsistent, the frame layer does not need to be changed, and only compatibility adaptation is carried out in a single module, so that the aim of fast adapting to a manufacturer is fulfilled.
Only when the interface changes, the interface adaptation file needs to be created, and if only the interface name changes, the interface adaptation file can not be created again; if the number of parameters, the type of return, etc. are changed, a related interface adaptation file needs to be created again for processing related logic.
Optionally, a constructing unit 205 is further included, configured to construct an association relationship between the Framework and the interface by using a JAVA reflection mechanism before the creating unit 201 creates the interface adaptation file.
The incidence relation constructed by the reflection mechanism can improve the independence of each module, and each module can dynamically acquire an interface. After the JAVA reflection mechanism is constructed, when the interface is changed, only the relevant interface adaptation file needs to be compiled into the system, and the calling module does not need to modify codes.
Optionally, the configuration unit 202 is further configured to configure the interface adaptation file in the makefile.
Optionally, an extracting unit 206 is further included, configured to extract res in the Framework in the form of middleware to form a separate component.
Optionally, the configuration unit 202 is further configured to configure the separate component in the makefile.
Optionally, the present invention further includes customizing the control. The control self-defining means that res in the Framework is extracted in a middleware mode to form an independent component, so that coupling is reduced; and configure the individual components in the makefile.
The individual components are customized components. Since many components in the native android system are google-sourced and standardized, customized components are required when the standardized components cannot meet the requirements when special requirements exist in the product requirements.
Optionally, the first obtaining unit 203 adapts interfaces of different platforms and versions in the interface adaptation file, and provides a uniform interface for the Framework, so that the Framework is called conveniently.
The invention can realize the calling of the attribute and the method existing in the Framework in a reflection mode without repeatedly realizing the attribute and the method of the existing class by the application layer.
The invention can dynamically and flexibly configure the calling mode between the application layer and the encapsulation layer by utilizing a java reflection mechanism, can reduce the dependency relationship of a single module on the frame, ensures that all modules in the system are independent as much as possible, and reduces the dependency, including a control relationship, a calling relationship, a data transfer relationship and the like. By adopting the technical scheme provided by the application, the internal coupling of the related Android system can be reduced in a more convenient mode, and each module is made to be independent as much as possible, so that the purposes of quick engineering and quick transplantation of the system are achieved. Once the project is developed and tested on the code base branch, the project can be quickly adapted to the hardware project of B2B, the research and development maintenance cost and the related test process are reduced, and the purpose of quick mass production is achieved.
Although the present invention has been described with reference to the preferred embodiments, it is not intended to be limited thereto, and variations and modifications may be made by those skilled in the art without departing from the spirit and scope of the present invention.

Claims (12)

1. A method of Andriod system engineering, comprising:
when a platform or a version is changed, an interface adaptation file is created and used for selecting an interface to be used;
modifying the compiling script and loading the interface adaptation file;
the method and the attribute for obtaining the relevant interface by the Framework through the interface adaptation file comprise the following steps: the method comprises the steps that interfaces of different platforms and versions are adapted in an interface adaptation file, a uniform interface is provided for the Framework, and the Framework can be called conveniently;
each module dynamically acquires the method and the attribute of a related interface through a Framework by using a JAVA reflection mechanism;
the method further comprises the following steps:
constructing an incidence relation between a Framework and an interface by using the JAVA reflection mechanism;
res in the Framework is extracted in a middleware mode to form an independent component; configuring the individual components in a makefile;
and when the interface changes, compiling the interface adaptation file into a system.
2. The method of claim 1, wherein the interface adaptation files are used to adapt the functional interfaces associated with different hardware platforms.
3. The method of claim 2, wherein the hardware platform is a chip platform.
4. The method according to claim 1, wherein the interface adaptation files are used to adapt the functional interfaces of different software platforms.
5. The method according to claim 1, wherein the interface adaptation file is used for adapting the related function interfaces of different Andriod versions.
6. The method of claim 1, wherein the interface adaptation file is configured in a makefile.
7. An apparatus for Andriod system engineering, comprising:
the system comprises a creating unit, a processing unit and a processing unit, wherein the creating unit is used for creating an interface adaptation file when a platform or a version changes, and the interface adaptation file is used for selecting an interface required to be used;
the configuration unit is used for modifying the compiling script and loading the interface adaptation file; the configuration unit is also used for configuring the independent components in the makefile;
the first obtaining unit is used for the Framework to obtain the method and the attribute of the relevant interface through the interface adaptation file, and comprises the following steps: the method comprises the steps that interfaces of different platforms and versions are adapted in an interface adaptation file, a uniform interface is provided for the Framework, and the Framework can be called conveniently; and the combination of (a) and (b),
the second acquisition unit is used for dynamically acquiring the method and the attribute of the relevant interface by each module through the Framework by using a JAVA reflection mechanism;
the device comprises a construction unit, a data processing unit and a data processing unit, wherein the construction unit is used for constructing the incidence relation between the Framework and the interface by using a JAVA reflection mechanism;
the extraction unit is used for extracting res in the Framework in a middleware mode to form the single component;
when the interface changes, compiling the interface adaptation file into a system.
8. The apparatus according to claim 7, wherein the creating unit is specifically configured to adapt the relevant functional interfaces of different hardware platforms through the interface adaptation file.
9. The apparatus of claim 8, wherein the hardware platform is a chip platform.
10. The apparatus according to claim 7, wherein the creating unit is specifically configured to adapt the relevant functional interfaces of different software platforms through the interface adaptation file.
11. The apparatus according to claim 7, wherein the creating unit is specifically configured to adapt, through the interface adaptation file, the function-related interfaces of different Andriod versions.
12. The apparatus according to claim 7, wherein the configuration unit is further configured to configure the interface adaptation file in makefile.
CN201611208004.4A 2016-12-23 2016-12-23 Andriod system engineering method and device Active CN106775734B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611208004.4A CN106775734B (en) 2016-12-23 2016-12-23 Andriod system engineering method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611208004.4A CN106775734B (en) 2016-12-23 2016-12-23 Andriod system engineering method and device

Publications (2)

Publication Number Publication Date
CN106775734A CN106775734A (en) 2017-05-31
CN106775734B true CN106775734B (en) 2021-02-23

Family

ID=58919992

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611208004.4A Active CN106775734B (en) 2016-12-23 2016-12-23 Andriod system engineering method and device

Country Status (1)

Country Link
CN (1) CN106775734B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1916842A (en) * 2006-09-06 2007-02-21 上海科泰世纪科技有限公司 Method of packaging component for implementing reflection mechanism in structurized software system
CN101636710A (en) * 2007-02-27 2010-01-27 摩托罗拉公司 The adaptable user interface and the mechanism that are used for portable electric appts
CN105744511A (en) * 2014-12-11 2016-07-06 科大讯飞股份有限公司 Dynamic update method for Android system adaption module, client and server

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9015672B2 (en) * 2012-01-31 2015-04-21 The United States Of America As Represented By The Secretary Of The Navy Interface simulator for test rig in data distribution service
CN104899015A (en) * 2014-03-07 2015-09-09 上海高达星软件系统有限公司 Service component management system and method thereof
CN103970573A (en) * 2014-05-21 2014-08-06 百度在线网络技术(北京)有限公司 Light application program system for mobile device and program loading system and method thereof
CN105760151B (en) * 2014-12-19 2019-05-21 深圳市金蝶天燕中间件股份有限公司 Application and development method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1916842A (en) * 2006-09-06 2007-02-21 上海科泰世纪科技有限公司 Method of packaging component for implementing reflection mechanism in structurized software system
CN101636710A (en) * 2007-02-27 2010-01-27 摩托罗拉公司 The adaptable user interface and the mechanism that are used for portable electric appts
CN105744511A (en) * 2014-12-11 2016-07-06 科大讯飞股份有限公司 Dynamic update method for Android system adaption module, client and server

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于MVC模式的安卓系统工程结构设计;陈伟;《中国科技信息》;20161011(第19期);47-48 *
基于反射式软件中间件的运行时软件体系结构;黄罡 等;《中国科学E辑:技术科学》;20040220;第34卷;121-138 *

Also Published As

Publication number Publication date
CN106775734A (en) 2017-05-31

Similar Documents

Publication Publication Date Title
CN110825362B (en) Low-code application software development system and method
CN100543701C (en) A kind of method and system that realize embedded software unconventionality testing
CN105378689B (en) Method and apparatus for unified Extensible Firmware Interface (UEFI) driver and agreement
CN107704386B (en) Unit testing method and device of business process, computer equipment and storage medium
CN108614701B (en) Linux operating system customizing method and device
CN105117233A (en) API calling method and device
CN106775744B (en) Method and device for generating static library
CN104008060B (en) Method for detecting compatibility of plug-in and host, and detection server
CN106610839B (en) Method for issuing upgrade package, lightweight upgrade method, device and system
CN103970563A (en) Dynamic Android class loading method
CN104821954A (en) Cross-platform remote procedure call method
US10120660B2 (en) Systems and methods for producing launchers for a mobile terminal
CN106681718A (en) Toolkit-based desktop side plugin frame and implementation method thereof
CN112256321A (en) Static library packaging method and device, computer equipment and storage medium
CN111857801B (en) Construction method of mobile application
CN111399840A (en) Module development method and device
CN104133676A (en) Function execution method and function execution device based on scripts
CN106484452B (en) unified configuration management method and device for software platform
CN104699518A (en) Multi-purpose meter reading machine adapter based on microkernel plug-in and realization method thereof
CN107193565B (en) Method for developing native APP (application) across mobile terminals
CN112114896A (en) Plug-in framework and method for service function expansion
CN106648823B (en) Code publishing method and device
CN111596951A (en) Method and device for configuring engineering file
CN113760462A (en) Method and device for constructing verification environment of dispatching automation system
CN106775734B (en) Andriod system engineering method and device

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