WO2017076052A1 - 一种代码处理方法及装置 - Google Patents
一种代码处理方法及装置 Download PDFInfo
- Publication number
- WO2017076052A1 WO2017076052A1 PCT/CN2016/089109 CN2016089109W WO2017076052A1 WO 2017076052 A1 WO2017076052 A1 WO 2017076052A1 CN 2016089109 W CN2016089109 W CN 2016089109W WO 2017076052 A1 WO2017076052 A1 WO 2017076052A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- hardware configuration
- code
- hardware
- feature parameter
- storage
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/36—Software reuse
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44536—Selecting among different versions
- G06F9/44542—Retargetable
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44589—Program code verification, e.g. Java bytecode verification, proof-carrying code
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44557—Code layout in executable memory
- G06F9/44563—Sharing
Definitions
- the present invention relates to the field of communications technologies, and in particular, to a code processing method and apparatus.
- Hardware configuration is used to represent the basic hardware configuration of load-balanced mobile terminals, such as LCD (Liquid Crystal Display), memory, hard disk, etc. Since the hardware configuration of the mobile terminal is adjusted according to the needs of different user groups, mobile terminals with different hardware configurations are generated.
- LCD Liquid Crystal Display
- the software code Since the hardware configuration of the mobile terminal is controlled by the software code, the software code supports the hardware configuration, that is, the hardware configuration in the mobile terminal needs to have a corresponding set of codes to support it. Play a role.
- the embodiment of the invention provides a code processing method and device, which are used to solve the defects that the prior art needs to develop multiple sets of different software codes according to different hardware configurations, resulting in a large workload of software code development and maintenance, and reducing movement.
- the amount of software code development and maintenance in the terminal is not limited.
- an embodiment of the present invention provides a code processing method, and a package include:
- the basic code is a code shared by mobile terminals of different hardware configurations.
- an embodiment of the present invention further provides a code processing apparatus, including:
- An obtaining unit configured to obtain storage information of a feature parameter of the hardware configuration
- a loading unit configured to load the feature parameters of the hardware configuration into the base code according to the storage information; wherein the basic code is a code shared by mobile terminals of different hardware configurations.
- a computer program comprising computer readable code that, when executed on a mobile terminal, causes the mobile terminal to perform the code processing method described above.
- a computer readable medium wherein the computer program described above is stored.
- a code processing method and apparatus provided by an embodiment of the present invention loads relevant feature parameters of a hardware configuration into a base code, so that the basic code becomes a complete software code capable of supporting hardware configuration of the mobile terminal, because
- the basic code is a code shared by mobile terminals of different hardware configurations, that is, a plurality of hardware configurations can share the basic code, and accordingly, corresponding to a corresponding set of mobile terminals of different hardware configurations in the prior art.
- the relevant feature parameters of the hardware configuration and the basic code shared by the hardware devices can be processed into a set of software codes, that is, a set of software codes is developed and stored in the mobile terminal, thereby reducing the number of the mobile terminals.
- FIG. 1 is a flow chart showing the steps of a first embodiment of a code processing method according to the present invention
- FIG. 2 is a flow chart of steps of a second embodiment of a code processing method according to the present invention.
- FIG. 3 is a flow chart showing the steps of a third embodiment of a code processing method according to the present invention.
- FIG. 4 is a schematic structural diagram of a hardware configuration tree according to the present invention.
- FIG. 5 is a schematic diagram of a code processing storage structure according to an embodiment of the present invention.
- FIG. 6 is a flow chart showing the steps of a fourth embodiment of a code processing method according to the present invention.
- FIG. 7 is a schematic structural diagram of Embodiment 1 of a code processing apparatus according to the present invention.
- FIG. 8 is a schematic structural diagram of a second embodiment of a code processing apparatus according to the present invention.
- FIG. 9 is a schematic structural diagram of a third embodiment of a code processing apparatus according to the present invention.
- FIG. 10 is a schematic structural diagram of Embodiment 4 of a code processing apparatus according to the present invention.
- Figure 11 shows schematically a block diagram of a mobile terminal for performing the method according to the invention
- Fig. 12 schematically shows a storage unit for holding or carrying program code implementing the method according to the invention.
- FIG. 1 a flow chart of the steps of the first embodiment of the code processing method of the present invention is shown.
- Step 101 Acquire storage information of a feature parameter of a hardware configuration.
- Step 102 Load the feature parameters of the hardware configuration into the base code according to the storage information, so that the basic code becomes a software code capable of supporting the hardware configuration; wherein the basic code is shared by mobile terminals with different hardware configurations. Code.
- the embodiment of the present invention can be applied to mobile terminals such as mobile phones and tablet computers, and is configured to load feature parameters of the hardware configuration of the mobile terminal into the basic code, so that the basic code becomes a software code capable of supporting the hardware configuration. Can reduce the workload of software code development and maintenance.
- the hardware configuration may be specifically used to represent a basic hardware configuration of the mobile terminal, such as an LCD, a memory, a hard disk, and the like.
- the present invention uses an LCD configuration as an example to describe the embodiment of the present invention.
- the characteristic parameters may specifically include: resolution, response time, input interface of the signal, contrast, brightness, and viewing angle, and the like.
- the foregoing basic code may be used to represent a code shared by a mobile terminal using different hardware configurations, and the hardware configuration parameter variable corresponding to the feature parameter of the hardware configuration is included in an optional implementation of the present invention.
- the step of loading the feature parameters of the hardware configuration into the basic code according to the foregoing storage information may specifically include:
- the foregoing basic code in the embodiment of the present invention may specifically include a hardware configuration parameter variable corresponding to a characteristic parameter of the hardware configuration LCD: a resolution variable, a response time variable, a signal input interface variable, a contrast variable, a brightness variable, and a visual
- a hardware configuration parameter variable corresponding to a characteristic parameter of the hardware configuration LCD a resolution variable, a response time variable, a signal input interface variable, a contrast variable, a brightness variable, and a visual
- the characteristic parameters of the hardware configuration LCD may include: a resolution of 2560 ⁇ 1440, a response time of 4 ms, an input interface of the signal as an audio input interface, and a contrast ratio.
- the resolution: 2560 ⁇ 1440 is assigned to the resolution variable
- the response time is: 50 million:1
- the brightness is 300 cd/m 2
- the viewing angle is 178/178°. 4ms is assigned to the response time variable
- the input interface of the signal the audio input interface is assigned to the input interface variable of the signal
- the contrast ratio: 50 million:1 is assigned to the contrast variable
- the brightness 300cd/m 2 is assigned to the signal.
- the brightness variable is assigned to the above-mentioned viewing angle 178/178° to the above-mentioned viewing angle variable or the like to make the above base
- the base code can be processed into a set of software code having the above-mentioned hardware configuration characteristic parameter values that can support the above hardware configuration.
- a code processing method loads relevant feature parameters of a hardware configuration into a base code, so that the foregoing basic code becomes a complete software code capable of supporting hardware configuration of the mobile terminal.
- the basic code is a code shared by mobile terminals of different hardware configurations, that is, multiple hardware configurations can share the basic code, corresponding to the mobile terminal corresponding to each different hardware configuration in the prior art.
- the relevant feature parameters of the hardware configuration and the basic code shared by the hardware devices can be processed into a set of software codes, that is, a set of software codes is developed and stored in the mobile terminal, thereby reducing the mobile terminal. The amount of work required to develop and maintain software code in software code;
- the steps of compiling complicated switches to control which set of software codes the mobile terminal starts are saved, and the workload is reduced; and the present invention adopts the characteristic parameters of the hardware configuration.
- the basic code is processed in the way of loading into the base code.
- the feature parameters corresponding to the hardware configuration in the base code can be updated. Therefore, when developing the software code, it is not necessary to rely too much on the hardware configuration and considering the hardware. Configuration changes.
- FIG. 2 a flow chart of the steps of the second embodiment of the code processing method of the present invention is shown.
- Step 201 Read a product type, a hardware version number, and an identifier of a hardware configuration of the mobile terminal from the hardware configuration index partition.
- Step 202 Matching the characteristics of the hardware configuration according to the product type and the hardware version number. The storage location of the parameter;
- Step 203 Load the feature parameters of the hardware configuration into the base code according to the foregoing storage information, to process the basic code into a set of software codes supporting the hardware configuration; wherein the basic code is shared by mobile terminals with different hardware configurations.
- the storage information may include: a storage location of the feature parameter of the hardware configuration and an identifier of the hardware configuration.
- the storage information is specifically refinement: the storage location of the feature parameter of the hardware configuration and the identifier of the hardware configuration, and the embodiment of the present invention searches through the step 201 and the step 202.
- the step of storing the information of the characteristic parameters of the hardware configuration is refined, so that the storage information of the feature parameters of the hardware configuration can be obtained by reading the product type, the hardware version number, and the identifier of the hardware configuration of the mobile terminal.
- the software code can be divided into two areas in advance by a person skilled in the art, one area can be specifically used to store the basic code, and the other area can be configured as an index partition of the hardware, which can be used for storing the above hardware.
- the configured product type, hardware version number, and identification of the hardware configuration can be divided into two areas in advance by a person skilled in the art, one area can be specifically used to store the basic code, and the other area can be configured as an index partition of the hardware, which can be used for storing the above hardware.
- the configured product type, hardware version number, and identification of the hardware configuration can be divided into two areas in advance by a person skilled in the art, one area can be specifically used to store the basic code, and the other area can be configured as an index partition of the hardware, which can be used for storing the above hardware.
- the step of matching the storage location of the feature parameter of the hardware configuration according to the product type and the hardware version number may specifically include:
- Step S1 parsing the foregoing product type and the foregoing hardware version number, and obtaining corresponding hardware configuration analysis information
- Step S2 searching for a code storage folder whose name corresponds to the hardware configuration resolution information described above;
- Step S3 determining that the code storage folder is a storage location of the feature parameter of the hardware configuration.
- the code storage folder may be used to store the feature parameters of the hardware configuration
- the mobile terminal may include multiple code storage folders for storing the feature parameters of the hardware configuration of different types of hardware configurations.
- the number of code storage folders can be two, which are used to store the characteristic parameters of the LCD and the memory, respectively.
- the corresponding hardware configuration parsing information obtained by parsing the product type and the hardware version number may be a string, and the search name is
- the process of the code storage folder corresponding to the foregoing hardware configuration analysis information may specifically include:
- the correspondence between the code storage folder and the hardware configuration analysis information may be stored in a database, that is, after the hardware configuration analysis information is parsed, the hardware configuration analysis information may be searched and represented from the database.
- the string exists in the corresponding code storage folder name to find the code storage folder whose name corresponds to the above hardware configuration resolution information.
- the code storage folder may be named by using the hardware configuration analysis information, that is, after the hardware configuration analysis information is parsed, the code storage folder having the same name as the string representing the hardware configuration analysis information may be searched for. Find the code storage folder whose name corresponds to the above hardware configuration resolution information.
- FIG. 3 a flow chart of the steps of the third embodiment of the code processing method of the present invention is shown.
- Step 301 Acquire storage information of a feature parameter of the hardware configuration, where the storage information includes: a storage location of the feature parameter of the hardware configuration and an identifier of the hardware configuration;
- Step 302 Search, in the foregoing storage location, a feature parameter of the hardware configuration corresponding to the identifier of the hardware configuration.
- Step 303 Load the feature parameters of the hardware configuration into the foregoing basic code.
- the foregoing storage information may include: a storage location of the feature parameter of the hardware configuration and an identifier of the hardware configuration, and in the embodiment of the present invention, the step 302 and the step 303 are performed according to the foregoing.
- the step of storing information loading the feature parameters of the hardware configuration into the base code is refined, so that the feature parameters of the hardware configuration can be found in the storage location according to the identifier of the hardware configuration, and then the feature parameters of the hardware configuration are further Loaded into the above basic code, so that the above basic code becomes a set of software code capable of supporting the above hardware configuration.
- the feature parameters of the hardware configuration may be stored in a hardware configuration setting tree.
- Root node hardware configuration setting tree 401
- child node feature parameter one 402, feature parameter two 403, feature parameter three 404 and feature parameter four 405;
- the root node of the hardware configuration setting tree is the hardware configuration setting tree one
- the child node is the characteristic parameter one, the characteristic parameter two, the characteristic parameter three and the characteristic parameter four are only used as the above hardware configuration in the embodiment of the present invention.
- An example of setting the structure of the tree is not understood as a limitation on the above hardware configuration setting tree.
- the root node of the hardware configuration setting tree may be an identifier of the hardware configuration, and the number of the above-mentioned child nodes is determined by hardware. The number of configured characteristic parameters is determined.
- the hardware configuration is an LCD of a certain brand
- the root node is an identifier of the LCD of the brand
- the child nodes include: a resolution variable, a response time variable, and an input interface variable of the signal.
- the structure of the hardware configuration setting tree is not specifically limited in the embodiment of the present invention.
- the step of searching for the feature parameter of the foregoing hardware configuration corresponding to the identifier of the hardware configuration in the foregoing storage location may specifically include:
- Step A1 In the foregoing storage location, searching for a hardware configuration setting tree corresponding to the identifier of the hardware configuration;
- Step A2 Read the feature parameters of the hardware configuration from the hardware configuration setting tree.
- the hardware configuration setting tree stores the parameters of the hardware configuration
- the storage location may store a plurality of hardware configuration setting trees for storing the characteristic parameters of the hardware configuration, for example, the storage location 1 (the LCD code storage folder) a hardware configuration tree storing a plurality of characteristic parameters of different models and different brands of LCDs, wherein the hardware configuration setting tree has a unique identifier to represent a hardware configuration corresponding to the characteristic parameter stored in the hardware configuration setting tree .
- the hardware configuration setting tree is read.
- the characteristic parameters of the above hardware configuration stored in the medium.
- the embodiment of the present invention may pass through the code.
- the device loads the feature parameters of the hardware configuration into the basic code, so that the basic code becomes a set of software code having the hardware parameter value of the hardware configuration and can support the hardware configuration;
- FIG. 5 a schematic diagram of a code processing storage structure according to an embodiment of the present invention is shown, which may include: a storage partition 501 of a hardware configuration characteristic parameter, a hardware configuration index partition 502, and a hardware configuration setting tree 503; wherein the hardware is
- the storage partition 501 of the configuration feature parameter may be used to store the hardware configuration tree 503;
- the hardware configuration index partition 502 may be used for storing information such as: product configuration, hardware version, and hardware configuration identifier;
- the hardware configuration setting tree 503 may be used.
- the code processing device may obtain the product type, the hardware version number, and the identifier of the hardware configuration of the hardware configuration from the hardware configuration index partition 502.
- the code processing device may obtain the foregoing according to the product type and the hardware version number of the hardware configuration.
- a storage location 501 of the feature parameter of the hardware configuration the code processing device may find a hardware configuration setting tree 503 corresponding to the identifier of the hardware configuration from the storage location 501 of the feature parameter of the hardware configuration; the code processing device may be configured from the hardware configuration Reading the feature parameter 504 of the hardware configuration in the tree 503, and loading the feature parameter 504 into the base code;
- the storage location of the feature parameter of the hardware configuration according to the product type and the hardware version number of the foregoing hardware configuration is an LCD folder, and the LCD folder stores three hardware configuration setting trees, including: a first hardware configuration setting tree. a second hardware configuration setting tree and a third hardware configuration setting tree respectively storing characteristic parameters of LCDs of three different manufacturers; if the LCD of the manufacturer is adapted to the mobile terminal, the identifier of the hardware configuration is first In the hardware configuration setting tree, the hardware configuration setting tree according to the identifier of the hardware configuration tree is the first hardware configuration setting tree, and the characteristic parameters in the first hardware configuration setting tree are written into the basic code, so that the basic code becomes A software code that can support the LCD of the above manufacturer;
- the hardware configuration setting tree that is found according to the identifier of the hardware configuration tree is the second hardware configuration setting tree.
- the feature parameters in the second hardware configuration setting tree are written into the basic code, so that the basic code becomes a software code capable of supporting the LCD of the above manufacturer.
- FIG. 6 a flow chart of the steps of the fourth embodiment of the code processing method of the present invention is shown.
- Step 601 Start a mobile terminal.
- the embodiment of the present invention is applicable to a mobile terminal.
- the feature parameters of the hardware configuration of the mobile terminal are loaded into the basic code, so that the basic code is processed into software code capable of supporting the hardware configuration of the mobile terminal.
- Step 602 Read a product type and a hardware version number of the hardware configuration from a hardware configuration index partition in an EMMC (Embedded Multi Media Card).
- EMMC embedded Multi Media Card
- Step 603 Analyze the product type and the hardware version number of the hardware configuration, and assign the parsed hardware configuration analysis information to the global variable.
- Step 604 Read an identifier of the hardware configuration from a hardware configuration index partition in the EMMC.
- Step 605 Assign the identifier of the hardware configuration to the hardware configuration setting tree variable.
- Step 606 Load an image file of the hardware configuration setting tree variable of the above-mentioned assignment into a memory (Memory);
- the hardware configuration setting tree variable after the assignment may be a hardware configuration setting tree corresponding to the hardware configuration, and the image file of the assigned hardware configuration setting tree variable is loaded into the memory, that is, the hardware is The image file of the configuration settings tree is loaded into memory.
- Step 607 Load the feature parameters of the corresponding hardware configuration in the hardware configuration setting tree into the base code.
- the code storage folder of different storage feature parameters can be accessed to obtain corresponding feature parameters of the hardware configuration, and the hardware configuration can be performed by loading the image file.
- the feature parameters are loaded into the base code, so that the feature parameters of the hardware configuration are loaded into the base code, so that the above basic code becomes a set of software code capable of supporting the above hardware configuration.
- FIG. 7 is a schematic structural diagram of a first embodiment of a code processing apparatus according to the present invention, which may further include: an obtaining unit 701 and a loading unit 702;
- the obtaining unit 701 may be configured to acquire storage information of a feature parameter of the hardware configuration.
- the loading unit 702 is configured to load the feature parameters of the hardware configuration into the base code according to the foregoing storage information; wherein the basic code is a code shared by the mobile terminal configured by different hardware.
- FIG. 8 is a schematic structural diagram of a second embodiment of a code processing apparatus according to the present invention, which may include: an obtaining unit 801 and a loading unit 802;
- the obtaining unit 801 may be configured to acquire storage information of a feature parameter of the hardware configuration.
- the loading unit 802 is configured to load the feature parameters of the hardware configuration into the base code according to the foregoing storage information; wherein the basic code is a code shared by the mobile terminal configured by different hardware;
- the foregoing storage information may include: a storage location of the feature parameter of the hardware configuration and an identifier of the hardware configuration;
- the obtaining unit 801 may specifically include:
- the reading subunit 8011 can be configured to read the product type, the hardware version number, and the identifier of the hardware configuration of the mobile terminal from the hardware configuration index partition;
- the first matching sub-unit 8012 can be configured to match the storage location of the feature parameter of the hardware configuration according to the product type and the hardware version number.
- the foregoing first matching sub-unit 8012 may specifically include:
- the parsing module can be used to parse the foregoing product type and the above hardware version number, and obtain corresponding hardware configuration parsing information;
- a first searching module configured to search for a code storage folder whose name corresponds to the hardware configuration parsing information
- a determining module configured to determine a storage location of the above-mentioned code storage folder as a feature parameter of the hardware configuration
- the foregoing hardware configuration analysis information may be a character string, and the foregoing first search module may specifically include:
- the first folder lookup submodule can be used to find a code storage folder with the same name as the above string; or
- the second folder search submodule can be used to search the database for the code storage folder name corresponding to the above string.
- FIG. 9 a schematic structural diagram of a third embodiment of a code processing apparatus according to the present invention is shown, which may include: an obtaining unit 901 and a loading unit 902;
- the obtaining unit 901 may be configured to acquire storage information of a feature parameter of a hardware configuration.
- the loading unit 902 is configured to load the feature parameters of the hardware configuration into the base code according to the foregoing storage information; wherein the basic code is a code shared by the mobile terminal configured by different hardware;
- the foregoing storage information may include: a storage location of the feature parameter of the hardware configuration and an identifier of the hardware configuration,
- the loading unit 902 may specifically include:
- the feature parameter finding sub-unit 9021 may be configured to search, in the foregoing storage location, a feature parameter of the hardware configuration corresponding to the identifier of the hardware configuration.
- the feature parameter loading sub-unit 9022 can be used to load the feature parameters of the hardware configuration described above into the basic code.
- the feature parameter searching subunit 9021 may specifically include:
- a second searching module configured to search, in the foregoing storage location, a hardware configuration setting tree corresponding to the identifier of the hardware configuration
- a feature parameter reading module which can be used to read the above hardware from the above hardware configuration setting tree Configured feature parameters.
- FIG. 10 is a schematic structural diagram of a fourth embodiment of a code processing apparatus according to the present invention, which may include: an obtaining unit 1001 and a loading unit 1002;
- the obtaining unit 1001 may be configured to acquire storage information of a feature parameter of a hardware configuration.
- the loading unit 1002 may be configured to load the feature parameters of the hardware configuration into the base code according to the foregoing storage information; wherein the basic code is a code shared by the mobile terminal configured by different hardware;
- the loading unit 1002 may specifically include:
- the assignment sub-unit 10021 may be configured to assign a feature parameter of the hardware configuration to a hardware configuration parameter variable corresponding to the feature parameter of the hardware configuration in the basic code, so that the basic code becomes a set of software code supporting the hardware configuration. .
- the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located A place, or it can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without deliberate labor.
- the various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof.
- a microprocessor or digital signal processor may be used in practice to implement some or all of the functionality of some or all of the components of the mobile terminal in accordance with embodiments of the present invention.
- the invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein.
- a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals. Such signals can be downloaded from the Internet website or on the carrier signal. Provided, or provided in any other form.
- FIG. 11 illustrates that a mobile terminal in accordance with the present invention can be implemented.
- the mobile terminal conventionally includes a processor 1110 and a computer program product or computer readable medium in the form of a memory 1120.
- the memory 1120 may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read Only Memory), an EPROM, a hard disk, or a ROM.
- Memory 1120 has a memory space 1130 for program code 1131 for performing any of the method steps described above.
- the storage space 1130 for program code may include respective program codes 1131 for implementing various steps in the above methods, respectively.
- the program code can be read from or written to one or more computer program products.
- Such computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks.
- Such a computer program product is typically a portable or fixed storage unit as described with reference to FIG.
- the storage unit may have a storage section, a storage space, and the like arranged similarly to the storage 1120 in the mobile terminal of FIG.
- the program code can be compressed, for example, in an appropriate form.
- the storage unit comprises computer readable code 1131 ', ie code readable by a processor, such as 1110, which when executed by the mobile terminal causes the mobile terminal to perform each of the methods described above step.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
- Telephone Function (AREA)
Abstract
一种代码处理方法及装置,其中的方法具体包括:获取硬件配置的特征参数的存储信息(101);根据所述存储信息将所述硬件配置的特征参数加载至基础代码中,以将上述基础代码处理成为一套能够支持上述硬件配置的软件代码;其中,所述基础代码为不同硬件配置的移动终端共用的代码(102)。上述方法能够减少移动终端中的软件代码开发和维护的工作量。
Description
本申请要求在2015年11月6日提交中国专利局、申请号为201510756759.7、发明名称为“一种代码处理方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本发明涉及通信技术领域,特别是涉及一种代码处理方法及装置。
随着信息技术的快速发展,移动终端已经在人们的生活中普及,硬件配置是用来表示负载均衡移动终端的硬件基本配置,例如:LCD(Liquid Crystal Display,液晶显示器)、内存、硬盘等;由于移动终端的硬件配置会依据不同用户群体的需求而做相应的调整,因此会产生不同硬件配置的移动终端。
由于移动终端的硬件配置受控于软件代码,因此有软件代码的支撑,方可使硬件配置发挥作用,也即移动终端中的硬件配置需要有相应的一套代码对其进行支撑,以使其发挥作用。
但是由于移动终端的硬件配置不同时,需要根据不同的硬件配置开发多套不同的软件代码,并需要在移动终端中存储上述多套软件代码,以使移动终端在启动时,可以根据编译开关来确定执行哪一套软件代码,这样一来,软件代码开发的工作量较大。并且,在进行软件代码的维护工作时,多套的软件代码会带来很大的工作量。
发明内容
本发明实施例提供一种代码处理方法及装置,用以解决现有技术需要根据不同的硬件配置开发多套不同的软件代码,导致软件代码开发和维护的工作量较大的缺陷,实现减少移动终端中的软件代码开发和维护的工作量。
根据本发明的一个方面,本发明实施例提供了一种代码处理方法,包
括:
获取硬件配置的特征参数的存储信息;
根据所述存储信息将所述硬件配置的特征参数加载至基础代码中;其中,所述基础代码为不同硬件配置的移动终端共用的代码。
根据本发明的另一个方面,本发明实施例还提供了一种代码处理装置,包括:
获取单元,用于获取硬件配置的特征参数的存储信息;及
加载单元,用于根据所述存储信息将所述硬件配置的特征参数加载至基础代码中;其中,所述基础代码为不同硬件配置的移动终端共用的代码。
根据本发明的又一个方面,提供了一种计算机程序,其包括计算机可读代码,当所述计算机可读代码在移动终端上运行时,导致所述移动终端执行上述的代码处理方法。
根据本发明的再一个方面,提供了一种计算机可读介质,其中存储了上述的计算机程序。
本发明的有益效果为:
本发明实施例提供的一种代码处理方法和装置,将硬件配置的相关特征参数加载至基础代码中,以使上述基础代码成为一套能够支持上述移动终端的硬件配置的完整的软件代码,由于基础代码为不同的硬件配置的移动终端所共用的代码,也即多个硬件配置可以共用这一套基础代码,因此,相对于现有技术中每个不同硬件配置的移动终端相应的对应一套软件代码,本发明实施例中可以将硬件配置的相关特征参数和各硬件设备共用的基础代码处理为一套软件代码,也即移动终端中开发并存储一套软件代码,因此减少了移动终端中的软件代码开发和维护软件代码的工作量。
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本发明一种代码处理方法实施例一的步骤流程图;
图2为本发明一种代码处理方法实施例二的步骤流程图;
图3为本发明一种代码处理方法实施例三的步骤流程图;
图4为本发明的一种硬件配置树的结构示意图;
图5为本发明实施例一种代码处理存储结构的示意图;
图6为本发明一种代码处理方法实施例四的步骤流程图;
图7为本发明一种代码处理装置实施例一的结构示意图;
图8为本发明一种代码处理装置实施例二的结构示意图;
图9为本发明一种代码处理装置实施例三的结构示意图;
图10为本发明一种代码处理装置实施例四的结构示意图;
图11示意性地示出了用于执行根据本发明的方法的移动终端的框图;以及
图12示意性地示出了用于保持或者携带实现根据本发明的方法的程序代码的存储单元。
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
方法实施例一
参照图1,示出了本发明一种代码处理方法实施例一的步骤流程图,具体可以包括:
步骤101、获取硬件配置的特征参数的存储信息;
步骤102、根据上述存储信息将上述硬件配置的特征参数加载至基础代码中,以使上述基础代码成为一套能够支持上述硬件配置的软件代码;其中,上述基础代码为不同硬件配置的移动终端共用的代码。
本发明实施例可以应用于手机、平板电脑等移动终端中,用于将移动终端的硬件配置的特征参数加载至基础代码中,以使上述基础代码成为一套能够支持上述硬件配置的软件代码,能够减少软件代码开发和维护的工作量。
本发明实施例中,上述硬件配置具体可用于表示移动终端内部的硬件基本配置,例如:LCD、内存、硬盘等;本发明以硬件配置为LCD为例,对本发明实施例加以说明,硬件配置LCD的特征参数具体可以包括:分辨率、响应时间、信号的输入接口、对比度、亮度及可视角度等等。
本发明实施例中,上述基础代码可用于表示采用不同硬件配置的移动终端共用的代码,其中包含与上述硬件配置的特征参数相对应的硬件配置参数变量,则在本发明的一种可选实施例中,上述根据上述存储信息将上述硬件配置的特征参数加载至基础代码中的步骤,具体可以包括:
将上述硬件配置的特征参数赋值给上述基础代码中与上述硬件配置的特征参数对应的硬件配置参数变量,以使得上述硬件配置的特征参数能够加载至上述基础代码中,使上述基础代码成为一套能够支持上述硬件配置的软件代码。
为了使本领域技术人员更好理解本发明的技术方案,以下通过具体示例对本发明实施例加以说明:
例如,本发明实施例中上述基础代码中具体可以包括与硬件配置LCD的特征参数对应的硬件配置参数变量:分辨率变量、响应时间变量、信号的输入接口变量、对比度变量、亮度变量及可视角度变量等等,当上述硬件配置为某一型号的LCD时,上述硬件配置LCD的特征参数具体可以包括:分辨率为2560×1440、响应时间为4ms、信号的输入接口为音频输入接
口、对比度为5000万∶1、亮度为300cd/m2及可视角度为178/178°等等,则本发明实施例中将上述分辨率:2560×1440赋值给上述分辨率变量,将上述响应时间:4ms赋值给上述响应时间变量,将上述信号的输入接口:音频输入接口赋值给上述信号的输入接口变量,将上述对比度:5000万∶1赋值给上述对比度变量,将上述亮度300cd/m2赋值给上述亮度变量,将上述可视角度178/178°赋值给上述可视角度变量等等,以使得上述基础代码可以被处理成一套具有上述硬件配置的特征参数值的、可以支持上述硬件配置的软件代码。
综上,本发明实施例提供的一种代码处理方法,将硬件配置的相关特征参数加载至基础代码中,以使上述基础代码成为一套能够支持上述移动终端的硬件配置的完整的软件代码,由于基础代码为不同的硬件配置的移动终端所共用的代码,也即多个硬件配置可以共用这一套基础代码,因此,相对于现有技术中每个不同硬件配置的移动终端相应的对应一套软件代码,本发明实施例中可以将硬件配置的相关特征参数和各硬件设备共用的基础代码处理为一套软件代码,也即移动终端中开发并存储一套软件代码,因此减少了移动终端中的软件代码开发和维护软件代码的工作量;
另一方面,由于移动终端中仅存储一套软件代码,因此节省了编译复杂的开关来控制移动终端启动哪一套软件代码的步骤,减少了工作量;并且本发明采用将硬件配置的特征参数加载至基础代码中的方式处理上述基础代码,在硬件配置变动时,更新基础代码中硬件配置对应的特征参数即可,因此在开发软件代码的时候,可以不必过多的依赖硬件配置和考虑硬件配置的变动。
方法实施例二
参照图2,示出了本发明一种代码处理方法实施例二的步骤流程图,具体可以包括:
步骤201、从硬件配置索引分区读取移动终端的产品类型、硬件版本号及硬件配置的标识;
步骤202、根据上述产品类型和硬件版本号,匹配得到硬件配置的特征
参数的存储位置;
步骤203、根据上述存储信息将上述硬件配置的特征参数加载至基础代码中,以将上述基础代码处理成一套支持所述硬件配置的软件代码;其中,上述基础代码为不同硬件配置的移动终端共用的代码;上述存储信息具体可以包括:上述硬件配置的特征参数的存储位置和所述硬件配置的标识。
相对于方法实施例一,本发明实施例中将存储信息具体细化为:上述硬件配置的特征参数的存储位置和所述硬件配置的标识,且本发明实施例通过步骤201及步骤202对查找硬件配置的特征参数的存储信息的步骤进行了细化,以使得可以通过读取移动终端的产品类型、硬件版本号及硬件配置的标识,进而获取到上述硬件配置的特征参数的存储信息。
本发明实施例中,可以由本领域技术人员预先将将软件代码分为两个区,一个区具体可以用于存储基础代码;另一个区,可以为硬件配置索引分区,具体可以用于存储上述硬件配置的产品类型、硬件版本号及硬件配置的标识。
在本发明的一种可选实施例中,上述根据上述产品类型和硬件版本号,匹配得到硬件配置的特征参数的存储位置的步骤,具体可以包括:
步骤S1、解析上述产品类型和上述硬件版本号,得到相应的硬件配置解析信息;
步骤S2、查找名称与上述硬件配置解析信息相对应的代码存储文件夹;
步骤S3、确定上述代码存储文件夹为上述硬件配置的特征参数的存储位置。
本发明实施例中,上述代码存储文件夹可以用来存储上述硬件配置的特征参数,移动终端中可以含有多个代码存储文件夹,分别用来存储不同类型的硬件配置的上述硬件配置的特征参数,例如:代码存储文件夹的个数可以为两个,分别用来存储LCD和内存的特征参数。
在本发明的一种可选实施例中,上述通过解析产品类型和上述硬件版本号,得到的相应硬件配置解析信息具体可以为字符串,则上述查找名称
与上述硬件配置解析信息相对应的代码存储文件夹的过程,具体可以包括:
查找名称与所述字符串相同的代码存储文件夹;或者
在数据库中查找与所述字符串存在对应关系的代码存储文件夹名称。
本发明实施例中,上述代码存储文件夹与上述硬件配置解析信息的对应关系可以存储在数据库中,也即在解析得到上述硬件配置解析信息后,可以从上述数据库中查找与表示硬件配置解析信息的字符串存在对应关系的代码存储文件夹名称,以查找到名称与上述硬件配置解析信息相对应的代码存储文件夹。或者,还可以以上述硬件配置解析信息对上述代码存储文件夹命名,也即在解析得到上述硬件配置解析信息后,可以查找名称与上述表示硬件配置解析信息的字符串相同的代码存储文件夹,以查找到名称与上述硬件配置解析信息相对应的代码存储文件夹。
方法实施例三
参照图3,示出了本发明一种代码处理方法实施例三的步骤流程图,具体可以包括:
步骤301、获取硬件配置的特征参数的存储信息;其中,上述存储信息包括:上述硬件配置的特征参数的存储位置和上述硬件配置的标识;
步骤302、在上述存储位置中查找与上述硬件配置的标识相对应的上述硬件配置的特征参数;
步骤303、将上述硬件配置的特征参数加载至上述基础代码中。
相对于实施例一,本发明实施例中,上述存储信息具体可以包括:上述硬件配置的特征参数的存储位置和上述硬件配置的标识,且本发明实施例中通过步骤302及步骤303对根据上述存储信息加载上述硬件配置的特征参数至基础代码中的步骤进行了细化,以使得可以根据硬件配置的标识在上述存储位置中查找到上述硬件配置的特征参数,进而将上述硬件配置的特征参数加载至上述基础代码中,以使上述基础代码成为一套能够支持上述硬件配置的软件代码。
在本发明的一种可选实施例中,上述硬件配置的特征参数可以存储在硬件配置设置树中,参照图4,示出了本发明的一种硬件配置树的结构示意图,具体可以包括:根节点:硬件配置设置树一401,子节点:特征参数一402、特征参数二403、特征参数三404及特征参数四405;
可以理解,上述硬件配置设置树的根节点为硬件配置设置树一,子节点为特征参数一、特征参数二、特征参数三及特征参数四仅作为本发明实施例中上述硬件配置设置树的结构的一种示例,而不理解为是对上述硬件配置设置树的一种限制,实际上,硬件配置设置树的根节点可以为硬件配置的标识,上述子节点的个数由硬件配置的特征参数的个数决定,例如:上述硬件配置为某一品牌的LCD,则上述根节点为该品牌的LCD的标识,子节点包括:分辨率变量、响应时间变量、信号的输入接口变量、对比度变量、亮度变量及可视角度变量等等;本发明实施例中,对上述硬件配置设置树的结构不做具体限制。
上述在上述存储位置中查找与上述硬件配置的标识相对应的上述硬件配置的特征参数的步骤,具体可以包括:
步骤A1、在上述存储位置中,查找与上述硬件配置的标识相对应的硬件配置设置树;
步骤A2、从上述硬件配置设置树中读取上述硬件配置的特征参数。
本发明实施例中,硬件配置设置树中存储有上述硬件配置的参数,上述存储位置中可以存储多个存储硬件配置的特征参数的硬件配置设置树,例如:存储位置1(LCD代码存储文件夹)中可以存储多个存储不同型号、不同品牌的LCD的特征参数的硬件配置树,其中,上述硬件配置设置树具有唯一的标识,以表示该硬件配置设置树中存储的特征参数对应的硬件配置。
本发明实施例中,可以通过读取硬件配置的标识,并根据上述硬件配置的标识在上述存储位置中查找到与上述硬件配置标识向对应的硬件配置设置树,进而读取上述硬件配置设置树中存储的上述硬件配置的特征参数。
本发明实施例中,在移动终端启动时,本发明实施例可以通过代码处
理装置将上述硬件配置的特征参数加载至上述基础代码中,以使上述基础代码成为一套具有上述硬件配置的特征参数值的、可以支持上述硬件配置的软件代码;
参照图5,示出了本发明实施例一种代码处理存储结构的示意图,具体可以包括:硬件配置的特征参数的存储分区501、硬件配置索引分区502及硬件配置设置树503;其中,上述硬件配置特征参数的存储分区501可以用于存储硬件配置树503;上述硬件配置索引分区502中可以用于存储:产品配型、硬件版本和硬件配置的标识等信息;上述硬件配置设置树503可以用于存储上述硬件配置的特征参数;
本发明实施例中,代码处理装置可以从硬件配置索引分区502中获取硬件配置的产品类型、硬件版本号和硬件配置的标识;代码处理装置可以根据上述硬件配置的产品类型、硬件版本号得到上述硬件配置的特征参数的存储位置501;代码处理装置可以从上述硬件配置的特征参数的存储位置501查找到与上述硬件配置的标识对应的硬件配置设置树503;代码处理装置可以从上述硬件配置设置树503里读取上述硬件配置的特征参数504,并将上述特征参数504加载至基础代码中;
例如:上述根据上述硬件配置的产品类型、硬件版本号得到上述硬件配置的特征参数的存储位置为LCD文件夹,上述LCD文件夹中存储有三个硬件配置设置树,包括:第一硬件配置设置树、第二硬件配置设置树和第三硬件配置设置树,其分别存储三个不同厂家的LCD的特征参数;若移动终端上适配的是厂家一的LCD时,上述硬件配置的标识为第一硬件配置设置树,则根据上述硬件配置树的标识查找的硬件配置设置树为第一硬件配置设置树,则将上述第一硬件配置设置树中的特征参数写入基础代码,以使基础代码成为一套能够支持上述厂家一的LCD的软件代码;
若移动终端上适配的是厂家二的LCD时,上述硬件配置的标识为第二硬件配置设置树,则根据上述硬件配置树的标识查找的硬件配置设置树为第二硬件配置设置树,则将上述第二硬件配置设置树中的特征参数写入基础代码,以使基础代码成为一套能够支持上述厂家二的LCD的软件代码。
方法实施例四
参照图6,示出了本发明一种代码处理方法实施例四的步骤流程图,具体可以包括:
步骤601、启动移动终端;
本发明实施例适用于移动终端中,在移动终端启动时,加载移动终端的硬件配置的特征参数至基础代码中,以使得基础代码被处理成能够支持移动终端的硬件配置的软件代码。
步骤602、从EMMC(Embedded Multi Media Card、嵌入式多媒体卡)中的硬件配置索引分区中读取上述硬件配置的产品类型和硬件版本号;
步骤603、解析上述硬件配置的产品类型和硬件版本号,并将解析获得的硬件配置解析信息赋值给全局变量;
步骤604、从EMMC中的硬件配置索引分区中读取上述硬件配置的标识;
步骤605、将上述硬件配置的标识赋值给硬件配置设置树变量;
步骤606、加载上述赋值后的硬件配置设置树变量的镜像文件至存储器(Memory)中;
本发明实施例中,上述赋值后的硬件配置设置树变量即可以为上述硬件配置对应的硬件配置设置树,将上述赋值后的硬件配置设置树变量的镜像文件加载至存储器中,也即将上述硬件配置设置树的镜像文件加载至存储器中。
步骤607、加载上述硬件配置设置树中对应的硬件配置的特征参数至基础代码中。
本发明实施例中,通过对全局变量进行赋值,使得可以对不同的存储特征参数的代码存储文件夹进行访问,以获得硬件配置相应的特征参数,并可以采用加载镜像文件的方式将上述硬件配置的特征参数加载至基础代码中,进而实现将硬件配置的特征参数加载至基础代码中,以使上述基础代码成为一套能够支持上述硬件配置的软件代码。
装置实施例一
参照图7,示出了本发明一种代码处理装置实施例一的结构示意图,具体可以包括:获取单元701及加载单元702;
其中,上述获取单元701,可以用于获取硬件配置的特征参数的存储信息;
加载单元702,可以用于根据上述存储信息将上述硬件配置的特征参数加载至基础代码中;其中,上述基础代码为不同硬件配置的移动终端共用的代码。
装置实施例二
参照图8,示出了本发明一种代码处理装置实施例二的结构示意图,具体可以包括:获取单元801及加载单元802;
其中,上述获取单元801,可以用于获取硬件配置的特征参数的存储信息;
加载单元802,可以用于根据上述存储信息将上述硬件配置的特征参数加载至基础代码中;其中,上述基础代码为不同硬件配置的移动终端共用的代码;
本发明实施例中,上述存储信息具体可以包括:上述硬件配置的特征参数的存储位置和上述硬件配置的标识;
则上述获取单元801具体可以包括:
读取子单元8011,可以用于从硬件配置索引分区读取移动终端的产品类型、硬件版本号及上述硬件配置的标识;
第一匹配子单元8012,可以用于根据上述产品类型和硬件版本号,匹配得到硬件配置的特征参数的存储位置。
在本发明的一种可选实施例中,上述第一匹配子单元8012,具体可以包括:
解析模块,可以用于解析上述产品类型和上述硬件版本号,得到相应的硬件配置解析信息;
第一查找模块,可以用于查找名称与上述硬件配置解析信息相对应的代码存储文件夹;
确定模块,可以用于确定上述代码存储文件夹为所述硬件配置的特征参数的存储位置;
其中,上述硬件配置解析信息具体可以为字符串,则上述第一查找模块,具体可以包括:
第一文件夹查找子模块,可以用于查找名称与上述字符串相同的代码存储文件夹;或者
第二文件夹查找子模块,可以用于在数据库中查找与上述字符串存在对应关系的代码存储文件夹名称。
装置实施例三
参照图9,示出了本发明一种代码处理装置实施例三的结构示意图,具体可以包括:获取单元901及加载单元902;
其中,上述获取单元901,可以用于获取硬件配置的特征参数的存储信息;
加载单元902,可以用于根据上述存储信息将上述硬件配置的特征参数加载至基础代码中;其中,上述基础代码为不同硬件配置的移动终端共用的代码;
本发明实施例中,上述存储信息具体可以包括:上述硬件配置的特征参数的存储位置和上述硬件配置的标识,
则上述加载单元902具体可以包括:
特征参数查找子单元9021,可以用于在上述存储位置中查找与上述硬件配置的标识相对应的上述硬件配置的特征参数;
特征参数加载子单元9022,可以用于将上述硬件配置的特征参数加载至上述基础代码中。
在本发明的一种可选实施例中,上述特征参数查找子单元9021,具体可以包括:
第二查找模块,可以用于在上述存储位置中,查找与上述硬件配置的标识相对应的硬件配置设置树;
特征参数读取模块,可以用于从上述硬件配置设置树中读取上述硬件
配置的特征参数。
装置实施例四
参照图10,示出了本发明一种代码处理装置实施例四的结构示意图,具体可以包括:获取单元1001及加载单元1002;
其中,上述获取单元1001,可以用于获取硬件配置的特征参数的存储信息;
加载单元1002,可以用于根据上述存储信息将上述硬件配置的特征参数加载至基础代码中;其中,上述基础代码为不同硬件配置的移动终端共用的代码;
其中,上述加载单元1002具体可以包括:
赋值子单元10021,可以用于将上述硬件配置的特征参数赋值给上述基础代码中与上述硬件配置的特征参数对应的硬件配置参数变量,以使上述基础代码成为一套支持上述硬件配置的软件代码。
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的移动终端中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上
提供,或者以任何其他形式提供。
例如,图11示出了可以实现根据本发明的移动终端。该移动终端传统上包括处理器1110和以存储器1120形式的计算机程序产品或者计算机可读介质。存储器1120可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。存储器1120具有用于执行上述方法中的任何方法步骤的程序代码1131的存储空间1130。例如,用于程序代码的存储空间1130可以包括分别用于实现上面的方法中的各种步骤的各个程序代码1131。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。这些计算机程序产品包括诸如硬盘,紧致盘(CD)、存储卡或者软盘之类的程序代码载体。这样的计算机程序产品通常为如参考图12所述的便携式或者固定存储单元。该存储单元可以具有与图11的移动终端中的存储器1120类似布置的存储段、存储空间等。程序代码可以例如以适当形式进行压缩。通常,存储单元包括计算机可读代码1131’,即可以由例如诸如1110之类的处理器读取的代码,这些代码当由移动终端运行时,导致该移动终端执行上面所描述的方法中的各个步骤。
本文中所称的“一个实施例”、“实施例”或者“一个或者多个实施例”意味着,结合实施例描述的特定特征、结构或者特性包括在本发明的至少一个实施例中。此外,请注意,这里“在一个实施例中”的词语例子不一定全指同一个实施例。
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下被实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元
件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。
此外,还应当注意,本说明书中使用的语言主要是为了可读性和教导的目的而选择的,而不是为了解释或者限定本发明的主题而选择的。因此,在不偏离所附权利要求书的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。对于本发明的范围,对本发明所做的公开是说明性的,而非限制性的,本发明的范围由所附权利要求书限定。
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。
Claims (16)
- 一种代码处理方法,其特征在于,包括:获取硬件配置的特征参数的存储信息;根据所述存储信息将所述硬件配置的特征参数加载至基础代码中;其中,所述基础代码为不同硬件配置的移动终端共用的代码。
- 根据权利要求1所述的方法,其特征在于,所述存储信息包括:所述硬件配置的特征参数的存储位置和所述硬件配置的标识,则所述获取硬件配置的特征参数的存储信息的步骤,包括:从硬件配置索引分区读取移动终端的产品类型、硬件版本号及所述硬件配置的标识;根据所述产品类型和硬件版本号,匹配得到硬件配置的特征参数的存储位置。
- 根据权利要求2所述的方法,其特征在于,所述根据所述产品类型和硬件版本号,匹配得到硬件配置的特征参数的存储位置的步骤,包括:解析所述产品类型和所述硬件版本号,得到相应的硬件配置解析信息;查找名称与所述硬件配置解析信息相对应的代码存储文件夹;确定所述代码存储文件夹为所述硬件配置的特征参数的存储位置。
- 根据权利要求3所述的方法,其特征在于,所述硬件配置解析信息为字符串,则所述查找与所述硬件配置解析信息相对应的代码存储文件夹名称的步骤,包括:查找名称与所述字符串相同的代码存储文件夹;或者在数据库中查找与所述字符串存在对应关系的代码存储文件夹名称。
- 根据权利要求1所述的方法,其特征在于,所述存储信息包括:所述硬件配置的特征参数的存储位置和所述硬件配置的标识,则所述根据所述存储信息加载所述硬件配置的特征参数至基础代码中的步骤,包括:在所述存储位置中查找与所述硬件配置的标识相对应的所述硬件配置的特征参数;将所述硬件配置的特征参数加载至所述基础代码中。
- 根据权利要求5所述的方法,其特征在于,所述在所述存储位置中 查找与所述硬件配置的标识相对应的所述硬件配置的特征参数的步骤,包括:在所述存储位置中,查找与所述硬件配置的标识相对应的硬件配置设置树;从所述硬件配置设置树中读取所述硬件配置的特征参数。
- 根据权利要求1所述的方法,其特征在于,所述根据所述存储信息将所述硬件配置的特征参数加载至基础代码中的步骤,包括:将所述硬件配置的特征参数赋值给所述基础代码中与所述硬件配置的特征参数对应的硬件配置参数变量,以使得上述硬件配置的特征参数加载至上述基础代码中,使所述基础代码成为一套支持所述硬件配置的软件代码。
- 一种代码处理装置,其特征在于,包括:获取单元,用于获取硬件配置的特征参数的存储信息;及加载单元,用于根据所述存储信息将所述硬件配置的特征参数加载至基础代码中;其中,所述基础代码为不同硬件配置的移动终端共用的代码。
- 根据权利要求8所述的装置,其特征在于,所述存储信息包括:所述硬件配置的特征参数的存储位置和所述硬件配置的标识,则所述获取单元,包括:读取子单元,用于从硬件配置索引分区读取移动终端的产品类型、硬件版本号及所述硬件配置的标识;及第一匹配子单元,用于根据所述产品类型和硬件版本号,匹配得到硬件配置的特征参数的存储位置。
- 根据权利要求9所述的装置,其特征在于,所述第一匹配子单元,包括:解析模块,用于解析所述产品类型和所述硬件版本号,得到相应的硬件配置解析信息;第一查找模块,用于查找名称与所述硬件配置解析信息相对应的代码存储文件夹;确定模块,用于确定所述代码存储文件夹为所述硬件配置的特征参数 的存储位置。
- 根据权利要求10所述的装置,其特征在于,所述硬件配置解析信息为字符串,则所述第一查找模块,包括:第一文件夹查找子模块,用于查找名称与所述字符串相同的代码存储文件夹;或者第二文件夹查找子模块,用于在数据库中查找与所述字符串存在对应关系的代码存储文件夹名称。
- 根据权利要求8所述的装置,其特征在于,所述存储信息包括:所述硬件配置的特征参数的存储位置和所述硬件配置的标识,则所述加载单元,包括:特征参数查找子单元,用于在所述存储位置中查找与所述硬件配置的标识相对应的所述硬件配置的特征参数;及特征参数加载子单元,用于将所述硬件配置的特征参数加载至所述基础代码中。
- 根据权利要求12所述的装置,其特征在于,所述特征参数查找子单元,包括:第二查找模块,用于在所述存储位置中,查找与所述硬件配置的标识相对应的硬件配置设置树;及特征参数读取模块,用于从所述硬件配置设置树中读取所述硬件配置的特征参数。
- 根据权利要求8所述的装置,其特征在于,所述加载单元,包括:赋值子单元,用于将所述硬件配置的特征参数赋值给所述基础代码中与所述硬件配置的特征参数对应的硬件配置参数变量,以使得上述硬件配置的特征参数加载至上述基础代码中,使所述基础代码成为一套支持所述硬件配置的软件代码。
- 一种计算机程序,包括计算机可读代码,当所述计算机可读代码在移动终端上运行时,导致所述移动终端执行根据权利要求1-7中的任一个所述的代码处理方法。
- 一种计算机可读介质,其中存储了如权利要求15所述的计算机程序。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US15/232,715 US20170132020A1 (en) | 2015-11-06 | 2016-08-09 | Code processing method and code processing device |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510756759.7 | 2015-11-06 | ||
| CN201510756759.7A CN105653258A (zh) | 2015-11-06 | 2015-11-06 | 一种代码处理方法及装置 |
Related Child Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| US15/232,715 Continuation US20170132020A1 (en) | 2015-11-06 | 2016-08-09 | Code processing method and code processing device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2017076052A1 true WO2017076052A1 (zh) | 2017-05-11 |
Family
ID=56482156
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2016/089109 Ceased WO2017076052A1 (zh) | 2015-11-06 | 2016-07-07 | 一种代码处理方法及装置 |
Country Status (3)
| Country | Link |
|---|---|
| US (1) | US20170132020A1 (zh) |
| CN (1) | CN105653258A (zh) |
| WO (1) | WO2017076052A1 (zh) |
Families Citing this family (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105653258A (zh) * | 2015-11-06 | 2016-06-08 | 乐视移动智能信息技术(北京)有限公司 | 一种代码处理方法及装置 |
| TWI650978B (zh) * | 2018-03-21 | 2019-02-11 | 和碩聯合科技股份有限公司 | 封包辨識方法及封包辨識裝置 |
| CN108874456A (zh) * | 2018-06-29 | 2018-11-23 | 郑州云海信息技术有限公司 | 一种服务器软件的生成方法、装置、设备及存储介质 |
| CN109144502A (zh) * | 2018-08-24 | 2019-01-04 | 百度在线网络技术(北京)有限公司 | 用于生成应用的方法和装置 |
| CN109544141A (zh) * | 2018-11-28 | 2019-03-29 | 艾体威尔电子技术(北京)有限公司 | 一种支付终端的硬件适配方法 |
| CN111694580B (zh) * | 2019-03-13 | 2023-03-10 | 杭州宏杉科技股份有限公司 | 存储设备升级及初始化的方法、装置、电子设备 |
| CN115129282B (zh) * | 2021-03-26 | 2026-04-03 | 北京小米移动软件有限公司 | 显示模组识别方法及装置、终端、存储介质 |
| CN114510339B (zh) * | 2022-04-20 | 2022-07-29 | 苏州浪潮智能科技有限公司 | 一种计算任务调度方法、装置、电子设备及可读存储介质 |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060136904A1 (en) * | 2004-12-22 | 2006-06-22 | Weidman Lawrence J | Systems and methods for generating software and hardware builds |
| CN103108243A (zh) * | 2012-12-28 | 2013-05-15 | 四川长虹电器股份有限公司 | 电视机显示屏参数独立和升级的方法及其系统 |
| CN104252342A (zh) * | 2013-06-27 | 2014-12-31 | 中兴通讯股份有限公司 | 一种可配置参数的嵌入式应用实现方法及装置 |
| CN104602121A (zh) * | 2014-12-09 | 2015-05-06 | 四川长虹电器股份有限公司 | 一种智能电视软硬件分离的方法 |
| CN104699487A (zh) * | 2015-03-20 | 2015-06-10 | 浪潮集团有限公司 | 一种易于bios代码维护管理的方法 |
| CN105653258A (zh) * | 2015-11-06 | 2016-06-08 | 乐视移动智能信息技术(北京)有限公司 | 一种代码处理方法及装置 |
-
2015
- 2015-11-06 CN CN201510756759.7A patent/CN105653258A/zh active Pending
-
2016
- 2016-07-07 WO PCT/CN2016/089109 patent/WO2017076052A1/zh not_active Ceased
- 2016-08-09 US US15/232,715 patent/US20170132020A1/en not_active Abandoned
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060136904A1 (en) * | 2004-12-22 | 2006-06-22 | Weidman Lawrence J | Systems and methods for generating software and hardware builds |
| CN103108243A (zh) * | 2012-12-28 | 2013-05-15 | 四川长虹电器股份有限公司 | 电视机显示屏参数独立和升级的方法及其系统 |
| CN104252342A (zh) * | 2013-06-27 | 2014-12-31 | 中兴通讯股份有限公司 | 一种可配置参数的嵌入式应用实现方法及装置 |
| CN104602121A (zh) * | 2014-12-09 | 2015-05-06 | 四川长虹电器股份有限公司 | 一种智能电视软硬件分离的方法 |
| CN104699487A (zh) * | 2015-03-20 | 2015-06-10 | 浪潮集团有限公司 | 一种易于bios代码维护管理的方法 |
| CN105653258A (zh) * | 2015-11-06 | 2016-06-08 | 乐视移动智能信息技术(北京)有限公司 | 一种代码处理方法及装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN105653258A (zh) | 2016-06-08 |
| US20170132020A1 (en) | 2017-05-11 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2017076052A1 (zh) | 一种代码处理方法及装置 | |
| CN106095592B (zh) | 一种前景应用程序场景同步方法及装置、系统 | |
| CN111241387B (zh) | 提高搜索结果的相关性 | |
| CN102761623B (zh) | 资源自适配下载方法、系统、数据存储服务器、以及通信系统 | |
| US20160232374A1 (en) | Permission control method and apparatus | |
| CN104423961B (zh) | 一种生成测试脚本的方法及系统 | |
| CN107133165B (zh) | 浏览器兼容性检测方法及装置 | |
| CN110652728B (zh) | 一种游戏资源管理方法、装置、电子设备及存储介质 | |
| US11048736B2 (en) | Filtering search results using smart tags | |
| EP4343583A1 (en) | Text input method and apparatus, and electronic device and storage medium | |
| WO2018040270A1 (zh) | 在Windows系统中加载Linux系统ELF文件的方法及装置 | |
| WO2016155379A1 (zh) | 动态获取app界面控件数据的方法、设备以及系统 | |
| CN105138649A (zh) | 数据的搜索方法、装置及终端 | |
| JP2018528634A (ja) | 動画像をプレビューする方法及びデバイス、並びに表現パッケージを表示する方法及びデバイス | |
| JP2016527615A (ja) | アプリケーション情報の検索方法及びその装置 | |
| CN106257452A (zh) | 基于上下文特征修改搜索结果 | |
| CN103135947A (zh) | 一种显示Windows盘符的方法和装置 | |
| CN103677931B (zh) | 一种软件搬家的方法及装置 | |
| CN112346761A (zh) | 前端资源上线方法、设备、系统及存储介质 | |
| CN107491309A (zh) | 应用程序的管理方法及装置、终端设备和云端服务器 | |
| CN106227769A (zh) | 数据存储方法及装置 | |
| US20170094022A1 (en) | Systems and methods for fingerprinting operating systems and software applications based on network resource access pattern | |
| WO2015196844A1 (zh) | 任务分配方法、装置、系统和服务器 | |
| WO2016091078A1 (zh) | 在Linux驱动中绑定内核符号的方法及装置 | |
| CN104636228A (zh) | 便于测试的电子装置及测试方法 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16861322 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 16861322 Country of ref document: EP Kind code of ref document: A1 |