CN110262833B - Method for configuring application program function - Google Patents

Method for configuring application program function Download PDF

Info

Publication number
CN110262833B
CN110262833B CN201910542895.4A CN201910542895A CN110262833B CN 110262833 B CN110262833 B CN 110262833B CN 201910542895 A CN201910542895 A CN 201910542895A CN 110262833 B CN110262833 B CN 110262833B
Authority
CN
China
Prior art keywords
function
configuration file
product model
state
function configuration
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
CN201910542895.4A
Other languages
Chinese (zh)
Other versions
CN110262833A (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.)
Sichuan Changhong Electric Co Ltd
Original Assignee
Sichuan Changhong Electric 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 Sichuan Changhong Electric Co Ltd filed Critical Sichuan Changhong Electric Co Ltd
Priority to CN201910542895.4A priority Critical patent/CN110262833B/en
Publication of CN110262833A publication Critical patent/CN110262833A/en
Application granted granted Critical
Publication of CN110262833B publication Critical patent/CN110262833B/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/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Abstract

The invention discloses a method for configuring application program functions, which comprises the following steps: A. designing a function configuration file, B, dividing the function configuration file into a product model function configuration file and a system default function configuration file, C, integrating the function configuration file into system software, and programming the function configuration file into a specific product model together with the system software; D. when starting up, the system software writes the function information in the product model function configuration file into a storage medium according to the product model name, the corresponding product model function configuration file and the system default function configuration file and the principle of function state priority; E. modifying the storage medium to a read-only state; F. and the application program only reads the function information in the storage medium irrelevant to the product model information during running and performs corresponding operation according to the read information. The method of the invention solves the problem of mutual dependence of application programs and product models by adopting a function configuration method.

Description

Method for configuring application program function
Technical Field
The invention relates to the technical field of operating system software, in particular to a method for configuring functions of an application program.
Background
With the development of software technology and electronic products: the application program is gradually generalized; the products are diversified and the models are more and more abundant. This allows the same application to be installed in different product models, but in order to implement the differences between the product models, the same application needs to implement different functions on different product models. At present, the most common solution is that, as shown in fig. 1, an application program adds identification and judgment of product model information (such as product model name) to a code to distinguish different product models, and then implements a specific differentiation function according to the identified product models. This method is very inflexible, the code judgment logic of the application program will be bound with the product model, as shown in fig. 2, when a new product model is released, it must rely on the update of the application program code; and the development and maintenance workload of the application program is increased along with the increase of the number of the product models.
Disclosure of Invention
The present invention is directed to overcome the above-mentioned deficiencies in the prior art, and provides a method for configuring functions of an application, which solves the problem of interdependence between the application and a product model by using a function configuration method.
In order to achieve the technical effects, the invention adopts the following technical scheme:
a method of configuring application functionality, comprising the steps of:
A. designing a function configuration file, wherein the file content of the function configuration file comprises function information of all functions needing to be realized in a differentiated mode, and each function corresponds to one piece of function information;
B. since the same system software can be used for different product models, the function configuration files need to be divided into product model function configuration files and system default function configuration files, wherein the product model function configuration files are used for configuring the function states of the application programs in specific product models, each product model with differentiation requirements on the application programs is configured with one product model function configuration file, and a plurality of product model function configuration files can be integrated into the same system software; the system default function configuration file is used for configuring the default function state of the application program in the system software, and only one system default function configuration file is integrated in the same system software; meanwhile, due to the existence of the system default function configuration file, the specific product model can not be configured with the function items with the same state as the system default function configuration file;
C. integrating the function configuration file into system software, and programming the function configuration file into a specific product model together with the system software;
D. when a product is started, system software finds a corresponding product model function configuration file and a system default function configuration file in a function configuration file prefabricated by the system software according to the product model name of the product started at this time, and writes function information in the configuration file into a storage medium which is irrelevant to the product model information and can be read by an application program according to a principle that the function state in the product model function configuration file is prior;
E. after the writing is finished, the storage medium is modified into a read-only state;
F. and the application program only reads the function information in the storage medium irrelevant to the product model information during running and performs corresponding operation according to the read information.
Further, the function information in the step a includes a function name and a function state, where the function name is used to represent a function item that needs to be implemented differently; the function state is used for representing the state of the function item required to be realized.
Further, the performing, according to the read information, corresponding operations in the step F specifically include: and identifying the function items needing to be realized in a differentiated mode according to the function names in the specific function information, and realizing the state of the function according to the function state in the function information.
Further, the format of the function information in step a is: function name is function state or { function name: function state }.
Further, the functional status configuration of the same function has the following priority:
functional state of product model functional profile > functional state of system default functional profile.
Further, the file name and the product model name of the product model function configuration file in the step B are the same.
Further, the storage medium in step D is a shared memory or a file system.
Compared with the prior art, the invention has the following beneficial effects:
the method for configuring the functions of the application program uses the system software to transfer the function configuration information of the specific product model into the universal storage medium during initialization, so that the application program and the specific product model are thoroughly decoupled, and the development and maintenance cost of each application is reduced; the development and iteration progress of the product is accelerated.
Drawings
Fig. 1 is a flow chart illustrating a conventional method for implementing a function a in an application program.
Fig. 2 is a logic flow diagram illustrating a conventional approach for requiring an application to modify code during new product release.
Fig. 3 is a flow chart illustrating the method for configuring the application function according to the present invention when the application implements function a.
FIG. 4 is a block diagram of a configuration framework for applying program functionality on a product using the method of the present invention.
Detailed Description
The invention will be further elucidated and described with reference to the embodiments of the invention described hereinafter.
Example (b):
the first embodiment is as follows:
as shown in fig. 3, a method of configuring application functionality comprises the steps of:
A. designing a function configuration file, wherein the file content of the function configuration file comprises function information of all functions needing to be realized in a differentiated mode, and each function corresponds to one piece of function information; specifically, the function information includes a function name and a function state, and the function name is used for representing a function item which needs to be differentially realized; the function state is used for representing the state of the function item to be realized, wherein the format of the function information is as follows: function name is function state or { function name: function state }.
Preferably, the configuration of the functional status of the same function in the present embodiment has the following priority:
functional state of product model functional profile > functional state of system default functional profile.
B. Since the same system software can be used for different product models, the function configuration files need to be divided into product model function configuration files and system default function configuration files, wherein the product model function configuration files are used for configuring the function states of the application programs in specific product models, each product model with differentiation requirements on the application programs is configured with one product model function configuration file, and a plurality of product model function configuration files can be integrated into the same system software; the system default function configuration file is used for configuring the default function state of the application program in the system software, and only one system default function configuration file is integrated in the same system software; meanwhile, due to the existence of the system default function configuration file, the specific product model can not be configured with the function items with the same state as the system default function configuration file; and the file name of the product model function configuration file is the same as the product model name.
C. And integrating the function configuration file into system software, and programming the function configuration file into a specific product model together with the system software.
D. When a product is started, system software finds a corresponding product model function configuration file and a system default function configuration file in a function configuration file prefabricated by the system software according to the product model name of the product started at this time, and writes function information in the configuration file into a storage medium which is irrelevant to the product model information and can be read by an application program according to a principle that the function state in the product model function configuration file is prior; the storage medium includes, but is not limited to, a shared memory or a file system.
E. And modifying the storage medium into a read-only state after the writing is finished.
F. When the application program runs, only reading the function information in the storage medium irrelevant to the product model information, and carrying out corresponding operation according to the read information; specifically, the function item to be implemented differently is identified according to the function name in the specific function information, and the state of the function is implemented according to the function state in the function information.
As shown in fig. 4, in this embodiment, the application program is specifically required to implement the function a and the function B in the product 1; for example, without implementing the function C, the method steps of the present invention are specifically described, which specifically include the following steps:
the method comprises the following steps: in the product type function configuration file of the product 1, configuring the state of a function A as an implementation state and configuring the state of a function B as an implementation state; the file content is as follows: the function A is realized, and the function B is realized;
step two: in the default function configuration file of the system, the state of the configuration function A is not realized, the state of the configuration function B is not realized, and the state of the configuration function C is not realized; the file content is as follows: function a is not realized, function B is not realized, and function C is not realized;
step three: in the starting process of the product 1, system software reads a specific product model corresponding to the starting, and acquires a corresponding product model function configuration file and a product 1 system default function configuration file according to the model name;
step four: initializing the implementation states of the function A and the function B in the product model function configuration file of the product 1 into a read-only shared memory;
step five: supplementing the function state in the default function configuration file of the system to the unconfigured function state in the product type function configuration file of the product 1, and initializing the unrealized state of the function C to the read-only shared memory;
step six: when the application program runs, reading corresponding function information in the shared memory according to the function names (function A, function B and function C): function a is not realized, function B is not realized, and function C is not realized; and function A and function B are realized according to the state in the function information, and function C is not realized.
It will be understood that the above embodiments are merely exemplary embodiments taken to illustrate the principles of the present invention, which is not limited thereto. It will be apparent to those skilled in the art that various modifications and improvements can be made without departing from the spirit and substance of the invention, and these modifications and improvements are also considered to be within the scope of the invention.

Claims (7)

1. A method for configuring application functionality, comprising the steps of:
A. designing a function configuration file, wherein the file content of the function configuration file comprises function information of all functions needing to be realized in a differentiated mode, and each function corresponds to one piece of function information;
B. dividing the function configuration files into product model function configuration files and system default function configuration files, wherein the product model function configuration files are used for configuring the function state of the application program in a specific product model, and each product model with differentiation requirements on the application program configures one product model function configuration file; the system default function configuration file is used for configuring the default function state of the application program in the system software, and only one system default function configuration file is integrated in the same system software;
C. integrating the function configuration file into system software, and programming the function configuration file into a specific product model together with the system software;
D. when a product is started, system software finds a corresponding product model function configuration file and a system default function configuration file in a function configuration file prefabricated by the system software according to the product model name of the product started at this time, and writes function information in the product model function configuration file into a storage medium which is irrelevant to the product model information and can be read by an application program according to the principle that the function state in the product model function configuration file is prior;
E. after the writing is finished, the storage medium is modified into a read-only state;
F. and the application program only reads the function information in the storage medium irrelevant to the product model information during running and performs corresponding operation according to the read information.
2. The method according to claim 1, wherein the function information in step a includes a function name and a function status, the function name is used to indicate a function item that needs to be implemented differently; the function state is used for representing the state of the function item required to be realized.
3. The method according to claim 2, wherein the performing corresponding operations according to the read information in step F specifically includes: and identifying the function items needing to be realized in a differentiated mode according to the function names in the specific function information, and realizing the state of the function according to the function state in the function information.
4. The method according to claim 2, wherein the format of the function information in step a is: function name is function state or { function name: function state }.
5. The method of claim 2, wherein the configuration of the function status of the same function has the following priority:
functional state of product model functional profile > functional state of system default functional profile.
6. The method of claim 1, wherein the file name and the product model name of the product model function configuration file in step B are the same.
7. The method according to claim 1, wherein the storage medium in step D is a shared memory or a file system.
CN201910542895.4A 2019-06-21 2019-06-21 Method for configuring application program function Active CN110262833B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910542895.4A CN110262833B (en) 2019-06-21 2019-06-21 Method for configuring application program function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910542895.4A CN110262833B (en) 2019-06-21 2019-06-21 Method for configuring application program function

Publications (2)

Publication Number Publication Date
CN110262833A CN110262833A (en) 2019-09-20
CN110262833B true CN110262833B (en) 2022-02-01

Family

ID=67920364

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910542895.4A Active CN110262833B (en) 2019-06-21 2019-06-21 Method for configuring application program function

Country Status (1)

Country Link
CN (1) CN110262833B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1504889A (en) * 2002-11-28 2004-06-16 联想(北京)有限公司 Dynamic adjusting method for function of program module according to resource state
CN103049423A (en) * 2011-10-13 2013-04-17 上海可鲁系统软件有限公司 Method for configuration management of client application platforms and function modules and device thereof
CN104182222A (en) * 2014-08-18 2014-12-03 苏州赛腾精密电子有限公司 Universal software platform for automated equipment
CN104252342A (en) * 2013-06-27 2014-12-31 中兴通讯股份有限公司 Method and device for realizing embedding type application with configurable parameters
CN105204917A (en) * 2015-11-05 2015-12-30 北京奇虎科技有限公司 Method and device for loading configuration files at starting moment of application program

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9952832B2 (en) * 2016-01-22 2018-04-24 Wipro Limited Methods for generating smart archtecture templates and devices thereof
CN106095432B (en) * 2016-06-07 2020-02-07 北京小鸟看看科技有限公司 Method for identifying application type

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1504889A (en) * 2002-11-28 2004-06-16 联想(北京)有限公司 Dynamic adjusting method for function of program module according to resource state
CN103049423A (en) * 2011-10-13 2013-04-17 上海可鲁系统软件有限公司 Method for configuration management of client application platforms and function modules and device thereof
CN104252342A (en) * 2013-06-27 2014-12-31 中兴通讯股份有限公司 Method and device for realizing embedding type application with configurable parameters
CN104182222A (en) * 2014-08-18 2014-12-03 苏州赛腾精密电子有限公司 Universal software platform for automated equipment
CN105204917A (en) * 2015-11-05 2015-12-30 北京奇虎科技有限公司 Method and device for loading configuration files at starting moment of application program

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"Research and application of file structure based comparison method of configuration files in smart substation";Chen Jinshan 等;《2017 IEEE 9th International Conference on Communication Software and Networks (ICCSN)》;20171221;第1512-1515页 *
"Struts2 框架核心配置文件的研究与应用";刘艳春 等;《计算机技术与发展》;20130228;第23卷(第2期);第77-81页 *

Also Published As

Publication number Publication date
CN110262833A (en) 2019-09-20

Similar Documents

Publication Publication Date Title
CN100383737C (en) SCM online loading and updating method and system
CN101454746B (en) Method for communication with a multi-function memory card
CN105814541B (en) The method of computer equipment and computer equipment internal storage starting
CN102999350A (en) FPGA (field-programmable gate array) program upgrading and online downloading method in digital signal processing platform
CN103207797A (en) Capsule type custom-made updating method based on unified extensible firmware interface firmware system
CN103677915B (en) A method of card is started based on TF and carries out the automatic programming of flash mirror
US20100205599A1 (en) Mechanism to enable plug-and-play hardware components for semi-automatic software migration
CN100498708C (en) Firmware download method and device using personal computer
CN104111857A (en) Method for automatically configuring parameters of multi-model BIOS
CN103853586A (en) Method of realizing wireless card driver in UEFI (unified extensible firmware interface) layer
WO2015188586A1 (en) Data transmission method, electronic equipment, usb equipment and storage medium
CN103677912B (en) Chip and its startup method
CN106648758A (en) Multi-core processor BOOT starting system and method
US9672047B1 (en) Systems and methods for accessing a bootable partition on a serial peripheral interface device
CN105740139A (en) Virtual environment based embedded software debugging method
CN107329762A (en) A kind of method and system for describing to service with integrated software
CN102725749B (en) Method and device for enumerating input/output devices
CN103676911A (en) Equipment control system and control method
CN105278976B (en) A kind of FPGA reconstruct device, system and method
CN110262833B (en) Method for configuring application program function
TWI464583B (en) Method of obtaining command for triggering function
CN102681861B (en) Method and device for installing software
CN107771388A (en) Method for being communicated between component software in a motor vehicle
CN102129385B (en) Management method capable of dynamically expanding management function of virtual machine
WO1985005708A1 (en) Control integrated circuit

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