Partition-based hardware identification method, system, storage medium and electronic device

By writing and parsing hardware information in the software partition of the mobile terminal, the problem that hardware automatic identification technology cannot be compatible with multiple software is solved, and hardware compatibility is converted into software compatibility is realized, which improves hardware operability and compatibility.

CN114895854BActive Publication Date: 2024-12-10无锡宇宁科技集团股份有限公司
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202210632024.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-06
Publication Date
2024-12-10
Estimated Expiration
2042-06-06

AI Technical Summary

Technical Problem

In actual applications, existing hardware automatic identification technology is limited by hardware design and cannot be compatible with multiple software, resulting in increased R&D cycle and cost. In addition, different batches of hardware equipment have conflicts in register and pin level detection, and compatibility cannot be achieved. .

Method used

By writing hardware information in the software partition of the mobile terminal, analyzing and loading the hardware information flag bits, driving hardware initialization and operation logic information, hardware compatibility is realized to convert hardware compatibility into software compatibility, expanding hardware compatibility, so that one software can be compatible with multiple hardware.

Benefits of technology

It improves the operability of hardware, reduces R&D cycle and cost, solves the compatibility problems of different batches of hardware equipment, and realizes the function of software compatibility with multiple hardware.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114895854B_ABST
    Figure CN114895854B_ABST
Patent Text Reader

Abstract

The present invention discloses a partition-based hardware identification method, system, storage medium and electronic device. The method comprises: firstly obtaining hardware information written in a software partition position, wherein the written hardware information comprises hardware-specific string information, then parsing the hardware information, and obtaining a hardware information flag according to the parsed hardware information, loading the hardware information flag, and driving hardware initialization information and operation logic information corresponding to the hardware information flag. By using the embodiment of the present invention, it is possible to convert hardware compatibility into a software compatibility method, expand the hardware compatibility method, realize one software compatibility with multiple hardware, and increase operability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of automatic hardware identification, and in particular to a partition-based hardware identification method, system, storage medium and electronic equipment. Background Art

[0002] Automatic identification of hardware is a key technology for hardware compatibility and is widely used in the field of hardware control. However, in the existing technology, due to the limitations of hardware design, the detection technology cannot be used in more practical scenarios, which brings great constraints to actual use. For example, if more software is compatible with the hardware design by changing it, then re-examination and hardware testing are required, which will not only increase the R&D cycle, but also increase the R&D cost; in addition, in the early stage of the project, when selecting hardware equipment, it may not be considered very comprehensively, and different batches of the same hardware equipment will be purchased. Then, for the same equipment, the registers, the levels of the hardware pins, and the voltage detection methods of the hardware pins will conflict and cannot be compatible. This is a problem that needs to be solved urgently. Summary of the invention

[0003] The purpose of the present invention is to provide a partition-based hardware identification method, system, storage medium and electronic device to address the deficiencies in the prior art. It can convert hardware compatibility into software compatibility methods, expand the hardware compatibility methods, and make one software compatible with multiple hardware, thereby increasing operability.

[0004] An embodiment of the present application provides a partition-based hardware identification method, which is applied to a mobile terminal connected to a server for communication, wherein the mobile terminal includes software for creating partitions, and the method includes:

[0005] Obtaining hardware information written in the software partition location, wherein the written hardware information includes hardware specific string information;

[0006] Parsing the hardware information, and obtaining a hardware information flag bit according to the parsed hardware information;

[0007] The hardware information flag is loaded, and the hardware initialization information and operation logic information corresponding to the hardware information flag are driven.

[0008] Optionally, obtaining the hardware information written in the software partition location includes:

[0009] Creating a readable and writable software partition by compiling and sending a hardware information writing request of the software partition;

[0010] A hardware information writing request of the software partition is received, and the hardware information is written and read at any position of the software partition through a text editor.

[0011] Optionally, the file name and suffix of the created software partition is: pad.bin; the filling format of the software partition is: LCM=ILI981D.

[0012] Optionally, parsing the hardware information and obtaining a hardware information flag bit according to the parsed hardware information includes:

[0013] The hardware information is parsed, and the parsed hardware information is recorded in a variable form, so as to obtain a hardware information flag bit according to the parsed hardware information.

[0014] Optionally, the loading of the hardware information flag and driving the hardware initialization information and operation logic information corresponding to the hardware information flag includes:

[0015] Presetting a programmable storage space in the software partition, and assigning hardware initialization information and operation logic information corresponding to the hardware information flag bit to the programmable storage space according to preset parameters;

[0016] The mobile terminal drives the system program, and reads the hardware information flag pre-programmed in the programmable storage space, and sets the hardware information flag in the driving system program by means of variables;

[0017] When the mobile terminal starts the Kernel, the hardware information flag is transferred to the Kernel, and the hardware initialization information and operation logic information corresponding to the hardware information flag supported by the mobile terminal are parsed in the Kernel.

[0018] Optionally, the transferring the hardware information flag to a kernel, and parsing in the kernel to obtain hardware initialization information and operation logic information corresponding to the hardware information flag supported by the mobile terminal, includes:

[0019] Generate the hardware information flag parameter tags linked list, and pass the first address of the linked list to the Kernel, parse the command line parameters through the memory initialization interface of the Kernel layer and copy the command line parameters to boot_command_line, use the proc file system interface to read the content in boot_command_line into the global variable saved_command_line, and parse out the hardware initialization information and operation logic information corresponding to the hardware information flag supported by the mobile terminal.

[0020] Another embodiment of the present application provides a partition-based hardware identification system, which is applied to a mobile terminal connected to a server for communication, wherein the mobile terminal includes software for creating partitions, and the system includes:

[0021] An acquisition module, used for acquiring hardware information written in the software partition location, wherein the written hardware information includes hardware specific character string information;

[0022] A parsing module, used to parse the hardware information and obtain a hardware information flag bit according to the parsed hardware information;

[0023] The loading module is used to load the hardware information flag and drive the hardware initialization information and operation logic information corresponding to the hardware information flag.

[0024] Optionally, the obtaining module includes:

[0025] A creation unit, used to create a readable and writable software partition by compiling and send a hardware information write request of the software partition;

[0026] The writing unit is used to receive a request for writing the hardware information of the software partition, and write and read the hardware information at any position of the software partition through a text editor.

[0027] Optionally, the parsing module includes:

[0028] The parsing unit is used to parse the hardware information and record the parsed hardware information in the form of variables, so as to obtain the hardware information flag bit according to the parsed hardware information.

[0029] Optionally, the loading module includes:

[0030] An initialization unit, used to preset a programmable storage space in the software partition, and assign hardware initialization information and operation logic information corresponding to the hardware information flag bit to the programmable storage space according to preset parameters;

[0031] A driving unit, used for driving a system program of a mobile terminal, and reading a hardware information flag pre-programmed in the programmable storage space, and setting the hardware information flag in the driving system program by means of a variable;

[0032] The transmitting unit is used to transmit the hardware information flag to the Kernel when the mobile terminal starts the Kernel, and parse the hardware initialization information and operation logic information corresponding to the hardware information flag supported by the mobile terminal in the Kernel.

[0033] Optionally, the transmission unit includes:

[0034] The parsing subunit is used to generate the hardware information flag parameter tags linked list, and pass the first address of the linked list to the Kernel, parse the command line parameters of the Kernel layer through the memory initialization interface and copy the command line parameters to boot_command_line, use the proc file system interface to read the content in boot_command_line into the global variable saved_command_line, and parse out the hardware initialization information and operation logic information corresponding to the hardware information flag supported by the mobile terminal.

[0035] Yet another embodiment of the present application provides a storage medium, wherein the storage medium stores a computer program, wherein the computer program is configured to execute any of the above methods when running.

[0036] Yet another embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute any of the methods described above.

[0037] Compared with the prior art, the present invention first obtains the hardware information written in the software partition location, the written hardware information includes hardware-specific string information, and then parses the hardware information, and obtains the hardware information flag according to the parsed hardware information, loads the hardware information flag, and drives the hardware initialization information and running logic information corresponding to the hardware information flag. By using the embodiment of the present invention, it is possible to convert hardware compatibility into a software compatibility method, expand the hardware compatibility method, realize one software compatibility with multiple hardware, and increase operability. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 A hardware structure block diagram of a computer terminal according to a partition-based hardware identification method provided by an embodiment of the present invention;

[0039] Figure 2 A schematic diagram of a process flow of a partition-based hardware identification method provided by an embodiment of the present invention;

[0040] Figure 3 A schematic diagram of the structure of a partition-based hardware identification system provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0041] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, but should not be construed as limiting the present invention.

[0042] The embodiment of the present invention first provides a partition-based hardware identification method, which can be applied to electronic devices such as computer terminals, specifically ordinary computers, mobile terminals, etc.

[0043] The following describes it in detail by taking running on a computer terminal as an example. Figure 1 The hardware structure block diagram of a computer terminal of a partition-based hardware identification method provided by an embodiment of the present invention. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the computer terminal may also include a transmission device 106 for communication functions and an input and output device 108. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0044] The memory 104 can be used to store software programs and modules of application software, such as program instructions / modules corresponding to a partition-based hardware identification method in an embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implementing the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to a computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0045] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0046] Automatic hardware identification is a key technology for hardware compatibility and is widely used in the field of mobile terminal control. According to different detection methods, the existing compatibility solutions can be divided into the following two types:

[0047] The first method is to achieve hardware compatibility by reading hardware registers. Since each hardware has fixed data in a specific register when it leaves the factory, after the hardware is powered on, the software will read the data solidified in the hardware's specific register during operation. After reading, the software will match and initialize the corresponding hardware to allow the device to work normally.

[0048] For example, in the project, the mobile phone camera is a commonly used peripheral. In order to be able to use the camera on the front and back of the mobile phone, the mobile phone software process uses the code to read the binary stored in the hardware register through the hardware interface (such as I2C) during detection. Each camera has a driver chip that allows the camera to take pictures and record videos normally. When the camera's hardware external signals and voltage are provided normally, after correctly obtaining the hardware information stored in the hardware register, the code is used to send initialization data that allows the camera to work normally. The optical image generated by the scene through the lens is projected onto the surface of the image sensor, and then converted into an electrical signal. After analog-to-digital conversion, it becomes a digital image signal, which is then sent to the digital signal processing chip for processing, and then the image can be seen through the mobile phone display.

[0049] The second method is to achieve hardware compatibility based on the level detection method of the hardware pin. Specifically, the level detection of the hardware pin uses the pull-up and pull-down of the resistor to make a judgment. When the resistor pull-up is used, when the hardware is powered on, the software will read whether the level of the hardware pin is high during the running period. If it is high, then the corresponding hardware initialization is performed to make the device work; if the low level is read, then another hardware initialization is performed to make it work; if the resistor pull-down is used, when the hardware is powered on, the software will read whether the level of the hardware pin is low during the running period. If it is low, then the corresponding hardware initialization is performed to make the device work; if the high level is read, then another hardware initialization is performed to make it work.

[0050] Among them, pull-up and pull-down resistors are collectively called pull resistors, and their function is to clamp the signal line with uncertain state to a high level (pull-up) or a low level (pull-down) through a resistor. In digital circuits, there are usually three states: 0 (low level), 1 (high level), and floating (uncertain, random). Because when the power is initially turned on, the IO port level is random, and the IO port may be a high level or a low level, which will cause interference and lead to detection errors. Therefore, by connecting a pull-up resistor, the initial state can be stabilized to a high level, and by connecting a pull-down resistor, the initial state can be stabilized to a low level.

[0051] For example, in the project, the mobile phone screen is indispensable. As an important medium for interacting with the mobile phone, users communicate with the mobile phone through the screen at all times, so the quality of the screen is the most important and should be focused on. In the internal structure of each mobile phone screen, the pull-up and pull-down resistors are connected to a certain input pin of the mobile phone chip through the lead. During the boot process, the mobile phone software uses the code to read the level state (low level, high level) on a certain input pin of the mobile phone chip. The software can send different data of the mobile phone screen hardware registers according to the read level state, such as line field scanning data, mipi channel data, gamma data, etc., so that the mobile phone screen can normally interact with various information. Due to the limitations of hardware design, the above detection technology cannot be used in actual scenarios, which brings great constraints to actual use. If the hardware design is changed, it is necessary to re-examine and test the hardware, which will not only increase the R&D cycle, but also increase the R&D cost. In addition, in the early stages of a project, when selecting equipment, comprehensive considerations may not be taken into account, and different batches of the same equipment may be purchased. In this case, for the same equipment, conflicts may arise in registers, hardware pin levels, and hardware pin voltage detection methods, making compatibility impossible.

[0052] In view of the defects of the above-mentioned technology, the present invention provides a partition configuration hardware method based on production line operation, see Figure 2 , Figure 2 A flowchart of a partition-based hardware identification method provided by an embodiment of the present invention is applied to a mobile terminal connected to a server for communication, wherein the mobile terminal includes software for creating partitions, and may include the following steps:

[0053] S201: Obtaining hardware information written in a software partition location, wherein the written hardware information includes hardware specific character string information.

[0054] Wherein, obtaining the hardware information written in the software partition location may include:

[0055] Step 1: Create a readable and writable software partition by compiling and send a hardware information write request for the software partition.

[0056] Specifically, software partitioning can refer to using partition editing operations to divide the software to be partitioned into several logical parts. Once the software to be partitioned is divided into several readable and writable partitions, different types of directories and files can be stored in different partitions. The more partitions there are, the more different partition locations there are. At the same time, the nature of the files can be distinguished more finely and stored in different partition locations to manage different files or logical operations.

[0057] For example, during the production stage of the production line, the production line staff is responsible for editing the hardware information according to the hardware configuration of the product. The hardware information can be edited and stored in a text file in a preset format, and a hardware information write request for the software partition is sent.

[0058] Step 2: Receive a request to write the hardware information of the software partition, and write and read the hardware information at any location of the software partition through a text editor.

[0059] Specifically, an independent partition is planned within the software partition to store hardware information. That is, through partition design, it is logically isolated from other software partitions. From the software perspective, hardware information is a part of the product hardware, and the software only needs to read from the partition to obtain hardware information.

[0060] It should be noted that the file name and suffix of the created software partition may be: pad.bin, and the filling format of the software partition may be: LCM=ILI981D.

[0061] S202: Parse the hardware information, and obtain a hardware information flag bit according to the parsed hardware information.

[0062] Specifically, the hardware information is parsed, and the parsed hardware information is recorded in the form of a variable, so as to obtain a hardware information flag bit according to the parsed hardware information.

[0063] Exemplarily, when a partition with a file name and suffix of pad.bin and a format of LCM=ILI981D is created, 512 bytes can be read from the pad partition into pad_buf first, and the above pad_buf content is spliced ​​after ro.boot.scannermodel, and then assigned to cmdline_tmpbuf, wherein the attribute variable ro.boot.scannermodel is added and this attribute needs to be determined when the mobile terminal starts. If no value is assigned, but the spliced ​​content is directly searched, it is equivalent to directly using an unknown variable, which is not allowed in the code syntax. When the hardware information is parsed, the parsed hardware information is recorded in the form of a variable for obtaining the hardware information flag according to the parsed hardware information. If the ro.boot.scannermodel string is not parsed, then the parsing fails, and the hardware initialization of the non-compatible terminal is directly initialized. The hardware initialization will not affect the content in the partition, and the two are independent of each other.

[0064] S203: Load the hardware information flag bit, and drive the hardware initialization information and operation logic information corresponding to the hardware information flag bit.

[0065] Specifically, loading the hardware information flag bit and driving the hardware initialization information and operation logic information corresponding to the hardware information flag bit may include:

[0066] 1. Preset a programmable storage space in the software partition, and assign the hardware initialization information and operation logic information corresponding to the hardware information flag bit to the programmable storage space according to preset parameters.

[0067] 2. The mobile terminal drives the system program, and reads the hardware information flag bits pre-programmed in the programmable storage space, and sets the hardware information flag bits in the driving system program in the form of variables.

[0068] 3. When the mobile terminal starts the Kernel, the hardware information flag is passed to the Kernel, and the hardware initialization information and operation logic information corresponding to the hardware information flag supported by the mobile terminal are parsed in the Kernel.

[0069] Specifically, transferring the hardware information flag to the Kernel, parsing the hardware initialization information and operation logic information corresponding to the hardware information flag supported by the mobile terminal in the Kernel, may include:

[0070] Generate the hardware information flag parameter tags linked list, and pass the first address of the linked list to the Kernel, parse the command line parameters through the memory initialization interface of the Kernel layer and copy the command line parameters to boot_command_line, use the proc file system interface to read the content in boot_command_line into the global variable saved_command_line, and parse out the hardware initialization information and operation logic information corresponding to the hardware information flag supported by the mobile terminal.

[0071] For example, the parameters to be passed to the kernel are made into a tags list and placed in RAM, and the first address of the list is passed to the kernel. The kernel layer can parse bootargs (command line parameters) through the early_init_dt_scan_chosen(unsigned long node, const char*uname, intdepth, void*data) memory initialization interface and copy it to boot_command_line, and read the content in boot_command_line to the global variable saved_command_line through the proc file system interface int__initproc_cmdline_init(void). Because the global variable here is in the kernel layer, and the pad partition is read in the lk layer, spanning two levels, the reason why cmdline_tmpbuf is passed to the global variable is to be parsed at any position in the kernel layer, thus breaking the locality of the parsing.

[0072] Among them, by parsing the proc / cmdline string, if there is a string containing LCM=ILI981D, then strstr(saved_command_line, "LCM=ILI981D") is not empty, and the preset initialization code corresponding to ILI981D can be run; if other hardware information is filled in the partition, for example, LCM=ST7703S, then the string will contain LCM=ST7703S, then strstr(saved_command_line, "LCM=ST7703S") is not empty, and the preset initialization code corresponding to ST7703S can be run.

[0073] It should be noted that after the software partition is successfully created, the production line personnel use a text editor to fill in the hardware information-specific string in the created software partition based on the confirmed hardware information. During the terminal startup process, the software will parse the string in the partition, set different hardware information flags based on the parsed hardware information string, and load the corresponding hardware device initialization and operation logic based on the hardware information flag. After processing a batch of hardware, the hardware information in the partition can be updated according to the hardware information of the next batch, and the steps of parsing the newly written string in the partition can be continued, different hardware information flags can be set, and the hardware device initialization and operation logic can be loaded. Therefore, one software can be compatible with multiple hardware and improve operability.

[0074] At the same time, the content defined in the software partition can be modified in a predetermined format before the terminal downloads the software. If there are multiple hardwares that need to be compatible, they can be added without overwriting the previously set hardware information.

[0075] The above steps can be implemented through the following procedures:

[0076] mboot_recovery_load_raw_part("pad", (unsignedlong*)pad_buf, 512);

[0077] snprintf(cmdline_tmpbuf, sizeof(pad_buf)+sizeof("ro.boot.scannermodel="), "ro.boot.scannermodel=%s", pad_buf);

[0078] cmdline_append(cmdline_tmpbuf).

[0079] Any hardware initialization information and operation logic information that can implement the above-mentioned driver hardware information flag bits corresponding to the hardware initialization information and operation logic information, without exceeding the core idea of ​​the present invention, also falls within the scope of protection of the present invention.

[0080] It can be seen that the present invention first obtains the hardware information written in the software partition location, the written hardware information includes hardware-specific string information, and then parses the hardware information, and obtains the hardware information flag according to the parsed hardware information, loads the hardware information flag, and drives the hardware initialization information and operation logic information corresponding to the hardware information flag. By using the embodiment of the present invention, it can convert hardware compatibility into software compatibility method, expand the hardware compatibility method, and can realize one software compatible with multiple hardware, thereby increasing operability.

[0081] Another embodiment of the present application provides a partition-based hardware identification system, which is applied to any of the partition-based hardware identification methods described above, such as Figure 3 A schematic diagram of a partition-based hardware identification system is shown, the system comprising:

[0082] An acquisition module 301 is used to obtain hardware information written in the software partition location, wherein the written hardware information includes hardware specific string information;

[0083] The parsing module 302 is used to parse the hardware information and obtain the hardware information flag according to the parsed hardware information;

[0084] The loading module 303 is used to load the hardware information flag bit and drive the hardware initialization information and operation logic information corresponding to the hardware information flag bit.

[0085] Specifically, the acquisition module includes:

[0086] A creation unit, used to create a readable and writable software partition by compiling and send a hardware information write request of the software partition;

[0087] The writing unit is used to receive a request for writing the hardware information of the software partition, and write and read the hardware information at any position of the software partition through a text editor.

[0088] Specifically, the parsing module includes:

[0089] The parsing unit is used to parse the hardware information and record the parsed hardware information in the form of variables, so as to obtain the hardware information flag bit according to the parsed hardware information.

[0090] Specifically, the loading module includes:

[0091] An initialization unit, used to preset a programmable storage space in the software partition, and assign hardware initialization information and operation logic information corresponding to the hardware information flag bit to the programmable storage space according to preset parameters;

[0092] A driving unit, used for driving a system program of a mobile terminal, and reading a hardware information flag pre-programmed in the programmable storage space, and setting the hardware information flag in the driving system program by means of a variable;

[0093] The transmitting unit is used to transmit the hardware information flag to the Kernel when the mobile terminal starts the Kernel, and parse the hardware initialization information and operation logic information corresponding to the hardware information flag supported by the mobile terminal in the Kernel.

[0094] Specifically, the transmission unit includes:

[0095] The parsing subunit is used to generate the hardware information flag parameter tags linked list, and pass the first address of the linked list to the Kernel, parse the command line parameters of the Kernel layer through the memory initialization interface and copy the command line parameters to boot_command_line, use the proc file system interface to read the content in boot_command_line into the global variable saved_command_line, and parse out the hardware initialization information and operation logic information corresponding to the hardware information flag supported by the mobile terminal.

[0096] Compared with the prior art, the present invention first obtains the hardware information written in the software partition location, the written hardware information includes hardware-specific string information, and then parses the hardware information, and obtains the hardware information flag according to the parsed hardware information, loads the hardware information flag, and drives the hardware initialization information and running logic information corresponding to the hardware information flag. By using the embodiment of the present invention, it is possible to convert hardware compatibility into a software compatibility method, expand the hardware compatibility method, realize one software compatibility with multiple hardware, and increase operability.

[0097] An embodiment of the present invention further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0098] Specifically, in this embodiment, the above storage medium may be configured to store a computer program for performing the following steps:

[0099] S201: Obtaining hardware information written in the software partition location, wherein the written hardware information includes hardware specific character string information;

[0100] S202: parsing the hardware information, and obtaining a hardware information flag bit according to the parsed hardware information;

[0101] S203: Load the hardware information flag bit, and drive the hardware initialization information and operation logic information corresponding to the hardware information flag bit.

[0102] Specifically, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.

[0103] Compared with the prior art, the present invention first obtains the hardware information written in the software partition location, the written hardware information includes hardware-specific string information, and then parses the hardware information, and obtains the hardware information flag according to the parsed hardware information, loads the hardware information flag, and drives the hardware initialization information and running logic information corresponding to the hardware information flag. By using the embodiment of the present invention, it is possible to convert hardware compatibility into a software compatibility method, expand the hardware compatibility method, realize one software compatibility with multiple hardware, and increase operability.

[0104] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0105] Specifically, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0106] Specifically, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0107] S201: Obtaining hardware information written in the software partition location, wherein the written hardware information includes hardware specific character string information;

[0108] S202: parsing the hardware information, and obtaining a hardware information flag bit according to the parsed hardware information;

[0109] S203: Load the hardware information flag bit, and drive the hardware initialization information and operation logic information corresponding to the hardware information flag bit.

[0110] Compared with the prior art, the present invention first obtains the hardware information written in the software partition location, the written hardware information includes hardware-specific string information, and then parses the hardware information, and obtains the hardware information flag according to the parsed hardware information, loads the hardware information flag, and drives the hardware initialization information and running logic information corresponding to the hardware information flag. By using the embodiment of the present invention, it is possible to convert hardware compatibility into a software compatibility method, expand the hardware compatibility method, realize one software compatibility with multiple hardware, and increase operability.

[0111] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0112] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0113] In the several embodiments provided by the present invention, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the above units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0114] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0115] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0116] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the above-mentioned methods of each embodiment of the present invention. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

[0117] The embodiments of the present invention are described in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A partition-based hardware identification method, applied to a mobile terminal connected to a server, wherein the mobile terminal includes software for creating partitions, characterized in that: The method comprises: Creating a readable and writable software partition by compiling, and sending a hardware information write request for the software partition, wherein an independent partition is planned in the software partition for storing hardware information; receiving a hardware information writing request of the software partition, and writing and reading hardware information at any position of the software partition through a text editor, wherein the hardware information includes hardware specific string information; Parsing the hardware information, and obtaining a hardware information flag bit according to the parsed hardware information; The hardware information flag is loaded, and the hardware initialization information and operation logic information corresponding to the hardware information flag are driven.

2. The method according to claim 1, characterized in that The file name and suffix of the created software partition is: pad.bin; the filling format of the software partition is: LCM=ILI981D.

3. The method according to claim 2, characterized in that The parsing of the hardware information and obtaining the hardware information flag bit according to the parsed hardware information includes: The hardware information is parsed, and the parsed hardware information is recorded in a variable form, so as to obtain a hardware information flag bit according to the parsed hardware information.

4. The method according to claim 3, characterized in that The loading of the hardware information flag and driving the hardware initialization information and operation logic information corresponding to the hardware information flag include: Presetting a programmable storage space in the software partition, and assigning hardware initialization information and operation logic information corresponding to the hardware information flag bit to the programmable storage space according to preset parameters; The mobile terminal drives the system program, and reads the hardware information flag pre-programmed in the programmable storage space, and sets the hardware information flag in the driving system program by means of variables; When the mobile terminal starts the Kernel, the hardware information flag is transferred to the Kernel, and the hardware initialization information and operation logic information corresponding to the hardware information flag supported by the mobile terminal are parsed in the Kernel.

5. The method according to claim 4, characterized in that The transferring of the hardware information flag to the Kernel, and parsing in the Kernel to obtain hardware initialization information and operation logic information corresponding to the hardware information flag supported by the mobile terminal, includes: Generate the hardware information flag parameter tags linked list, and pass the first address of the linked list to the Kernel, parse the command line parameters through the memory initialization interface of the Kernel layer and copy the command line parameters to boot_command_line, use the proc file system interface to read the content in boot_command_line into the global variable saved_command_line, and parse out the hardware initialization information and operation logic information corresponding to the hardware information flag supported by the mobile terminal.

6. A partition-based hardware identification system, applied to a mobile terminal connected to a server for communication, the mobile terminal including software for creating partitions, characterized in that: The system comprises an acquisition module, a parsing module and a loading module, wherein the acquisition module comprises a creation unit and a writing unit; A creating unit, used for creating a readable and writable software partition by compiling and sending a hardware information writing request of the software partition, wherein an independent partition is planned in the software partition for storing hardware information; A writing unit, used for receiving a hardware information writing request of the software partition, and writing and reading hardware information at any position of the software partition through a text editor, wherein the hardware information includes hardware specific string information; A parsing module, used to parse the hardware information and obtain a hardware information flag bit according to the parsed hardware information; The loading module is used to load the hardware information flag and drive the hardware initialization information and operation logic information corresponding to the hardware information flag.

7. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 5 when executed.

8. An electronic device, comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Automatic matching method of hardware board card

    CN104123381A

  • Data interaction method, device and system, electronic equipment and storage medium

    CN112130911A

  • Method for enabling same ROM of Android terminal to be compatible with multiple models

    CN113157328A

  • System and method for limiting software installation on different computers and associated computer-readable storage media

    US20050081198A1

  • Method and apparatus for user customizable software deployment

    WO2009109925A2