The content of the invention
Present invention solves the problem in that providing a kind of device compatibility method and system, embedded electronic product can be made simultaneous
Hold the device of more multi-vendor production, be conducive to reduce the production cost of embedded electronic product with the fluctuation in market, reduce production
Cost.
In order to solve the above technical problems, embodiments of the present invention provide a kind of device compatibility method, following step is included
Suddenly:
Identify the identity information of the device;Wherein, the identity information of the device include it is following any one or it is any
Combination:The identity of the device chips, the identity of hardware and production firm's information of the device;
According to the identity information of the device of identification, the corresponding driver of the device is loaded;Wherein, the device
Driver pre-save, and corresponded with the identity information of the device.
Embodiments of the present invention additionally provide a kind of device compatible system, comprising:Identification module, driver loading mould
Block and memory module;
The identification module, for identifying the identity information of the device;Wherein, the identity information of the device include with
Descend any one or any combination:The identity of the device chips, the identity of hardware and the production of the device
Manufacturer's information;
The driver load-on module, for the identity information of the device according to identification, loads the device pair
The driver answered;Wherein, the driver of the device is pre-stored in the memory module, and with the device
Identity information correspond.
In terms of existing technologies, the identity information of device can be the identity of device chips to embodiment of the present invention
Any one in production firm's information of mark, the identity of hardware and device or any combination.It is, it can use
Any one information or any combination in production firm's information of the identity of chip, the identity of hardware and device
Information, identity is carried out to device, and pre-saves the driver of the device of variant identity.In this way, no matter to device
How the identity of part chips, the identity of hardware, the production firm of device select, as long as the identity information of device can
With identified, and corresponding driver has been previously stored it, it is possible to which driving element works.Due to the core of different identity mark
Piece, hardware may be from different production firms, though chip, the hardware of common identity mark, and may by different vendor
Identical device is assembled into, and the present invention makes embedded electronic product not only to select the chip of different production firms, may be used also
To select the hardware of different production firms, while it is also an option that the device of different vendor's production.It is, embedded electronic produces
Product can compatible more multi-vendor production device, be conducive to reduce the production cost of embedded electronic product with the fluctuation in market,
Reduce production cost.
In addition, before the step of identifying the identity information of the device, comprise the steps of:Establish and preserve the device
The identity information of part preserves the mapping table of address with the driver;In the identity information of the device according to identification, add
In the step of carrying the device corresponding driver, following sub-step is included:According to the identity information of the definite device,
From the mapping table, the preservation address of the corresponding driver of the device is found out;According to the driver found
Address is preserved, loads the corresponding driver in the preservation address.By table look-up can quickly and easily acquisition device driving
Program address.
In addition, in the step of identifying the identity information of the device, institute can also be identified successively according to default order
Each information included in the identity information of device is stated, and the result to identifying each time is examined in the data pre-saved
Rope;If do not retrieve identification as a result, if terminate follow-up information identification, and export prompt message.In this way, it can find in time
And solve the problems, such as.
Embodiment
To make the object, technical solutions and advantages of the present invention clearer, each reality below in conjunction with attached drawing to the present invention
The mode of applying is explained in detail.However, it will be understood by those skilled in the art that in each embodiment of the present invention,
Many ins and outs are proposed in order to make reader more fully understand the application.But even if without these ins and outs and base
Many variations and modification in following embodiment, can also realize each claim of the application technical side claimed
Case.
The present inventor is in product development according to the difficulty that runs into, it is contemplated that considers the selection of device production manufacturer
The design of hardware and software of multifarious resolution policy, i.e. some device should be able to compatible multiple chip production manufacturers, multiple hardware moulds
Manufacturer is organized to ensure that product can select the high performance-price ratio device producer that price is lower, quality is more excellent, delivery cycle is more stable.
The first embodiment of the present invention is related to a kind of device compatibility method, applied to embedded electronic product, specific stream
Journey is as shown in Figure 1, comprise the steps of:
Step 101, establish the identity information of device and driver preserves the mapping table of address and preserved.Wherein,
In the mapping table, each identity information corresponds to a driver and preserves address.In this step, can be by common difference
The address of the driver of identity information device and the identity information of device are associated, and are preserved in the mapping table.Need
Bright, which can also be updated according to actual needs.
In the present embodiment, the identity information of device includes the identity of chip, the identity of hardware and device
Production firm's information.In practical application, the identity information of device can also be the identity of chip, the identity mark of hardware
Know the combination of any one information or any two kinds of information in production firm's information with device.
Step 102, the identity of the chip of recognition means.In the present embodiment, can according to the identification code of chip,
The identity of identification chip.In practical applications, the identity of chip is usually the model of chip, it is, can root
According to the identification code of chip, the model of identification chip.Again since under normal circumstances, a chip manufacturer only produces fixed one kind
Or the chip of several models, as long as identifying the model of chip, it is possible to know the production firm of chip.
For example the device of vendor A, B production is XXX, then the chip model that can be selected by recognition means XXX, area
The manufacturer for separating the XXX of embedded electronic product selection is A or B.
In practical application, the identification code of chip can also include the model and production firm's information of chip at the same time.In short,
In this step, by the identification code of identification chip, it can not only know the model of device chips, can also know chip
Production firm.
On the one hand, the model of chip is identified, it is possible to determine the control program of chip, realize to different model chip
It is compatible;Other hand, has known the production firm of chip, it is possible to the supply vendor of chip is made choice as needed, is subtracted
Dependence of the small embedded electronic product to chip manufacturer.
Step 103, the identity of the hardware of recognition means.In the present embodiment, can be according to the output electricity of hardware
Pressure, identifies the identity (ID) of hardware.Specifically, reserved level pin is included in hardware, the production firm of hardware can
To characterize the identification code of hardware by reserved level pin.So in this step, can be according to the reserved level pipe of hardware
The output voltage of foot, identifies the identity of hardware.
In general, the identity of hardware is the model of hardware, but not limited to this.Such as hardware manufacturer C productions
The hardware of 4 kinds of models, then, 2 level pins are just reserved within hardware, to distinguish the hardware of 4 kinds of models.Wherein, Mei Geyin
Foot can be connected to by a resistance high level (voltage 1.8V) or by a resistance be connected to (voltage 0
Level), in this way, the two pins there can be four kinds of states, 00,01,10 and 11 can be expressed as with binary system, this shape in four
State corresponds to 4 kinds of models respectively.For another example, hardware manufacturer D produces the hardware of 8 kinds of models, then, 3 are just reserved within hardware
Level pin, to distinguish the hardware of 8 kinds of models.
Again since under normal circumstances, a hardware production firm only produces the hardware of fixed one or more of models,
As long as identify the model of hardware, it is possible to know the production firm of hardware.
So in this step, the model of hardware can be identified by reserving level pin, can also know the life of hardware
Produce manufacturer.
On the one hand, the model of hardware is identified, it is possible to determine the driver of hardware, realize to different model hardware
It is compatible;Other hand, has known the production firm of hardware, it is possible to the supply vendor of hardware is made choice as needed, is subtracted
Dependence of the small embedded electronic product to hardware vendor.
Certainly, the identity of hardware can also not only include the model of hardware, but also production firm's information comprising hardware.This
Sample, by identifying the identity of hardware, can know model and the production firm of hardware at the same time.
Step 104, according to OTP (One Time Programmable) information of burning in hardware, production firm's information of recognition means.
Wherein, OTP information is to carry out burning according to the rule made an appointment.
Specifically, device module different mould of programming in the first data memory module toward device module internal before dispatching from the factory
Group information distinguishes different devices, requires different components producer must burning early period in the conceptual design of embedded electronic product
The device that OTP information is produced using indicating this device as the producer, and the OTP information of different manufacturers burning must differ
Sample, such as the OTP information of E producers burning is MMM, then the OTP information of F producers burning cannot be MMM, can be NNN, as long as
The OTP information of discord E producers is identical.
Step 105, according to the identity of the chip of identification, the identity of hardware and OTP information, the body of device is determined
Part information.
Specifically, on the one hand, such as, it is determined that the model of chip, the model of hardware and device are included in device
Production firm's information, has determined that the identity information of device, can thus determine the driver of device.On the other hand, than
Such as, in 2 devices, chip, the hardware of different model of different model can be used respectively, is grown up to be a useful person in the assembling of same manufacturer
Part, but chip, the hardware of same model of same model can also be used, and device is assembled into by different vendor.So as long as
It can determine the identity information of device, it is possible to which the device of compatible more production firm's productions, reduces embedded electronic product pair
The dependence of device manufacturer.
Step 106, according to the identity information of definite device, from mapping table, the corresponding driver of device is found out
Preservation address.Wherein, the identity information of the driver of device and device preserves in the mapping table correspondingly.When knowing
During the identity information of device, the preservation address of the corresponding driver of device from mapping table, can be found out.Inquired about according to table,
It is simple and convenient.
Specifically, when searching the preservation address of the corresponding driver of device from mapping table, bag can first be found out
The preservation address of the corresponding driver of identity information of the device of the identity of chip containing identification;Again from including identification
In the preservation address of the corresponding driver of identity information of the device of the identity of chip, find out while include the core of identification
The preservation address of the identity of piece driver corresponding with the identity information of the device of the identity of the hardware of identification;Most
Afterwards from identity, the corresponding drive of identity information of the device of the identity of the hardware of identification at the same time comprising the chip identified
In the preservation address of dynamic program, identity, the identity and knowledge of the hardware of identification finding out while include the chip of identification
The preservation address of the corresponding driver of identity information of the device of other production firm's information.
Step 107, according to the preservation address of the driver found, loading preserves the corresponding driver in address.Only
The identity information of device is determined, it is possible to load corresponding driver, driving element work, is realized to more different bodies
The compatibility of the device of part information, in fact, realizing the device of compatible more production firms' productions, reduces embedded electronic production
Degree of dependence of the product to device supplier.
So far, device compatibility method introduction of the invention finishes.
Compared with prior art, the identity information of device can be the identity of device chips, the identity mark of hardware
Know any one in production firm's information with device or any combination.It is, the identity of chip, hard can be used
The identity of part and any one information or the information of any combination in production firm's information of device, carry out device
Identity, and pre-save the driver of the device of variant identity.In this way, no matter to the identity marks of device chips
How knowledge, the identity of hardware, the production firm of device select, if the identity information of device can not identify, and in advance
Store corresponding driver, it is possible to which driving element works.Since the chip of different identity mark, hardware may be from
Different production firms, though chip, the hardware of common identity mark, and identical device may be assembled into by different vendor,
And present embodiment recognition means chips, hardware identity and device in production firm's information after, comprehensive identification
Information last identity carried out to device determine, embedded electronic product is not only selected the chip of different production firms,
It is also an option that the hardware of different production firms, while it is also an option that the device of different vendor's production.It is, embedded-type electric
Sub- product can compatible more multi-vendor production device, be conducive to reduce the production cost of embedded electronic product with the ripple in market
It is dynamic, reduce production cost.
The step of various methods divide above, be intended merely to describe it is clear, can be merged into when realizing a step or
Some steps are split, are decomposed into multiple steps, as long as including identical logical relation, all protection domain in this patent
It is interior;To either adding inessential modification in algorithm in flow or introducing inessential design, but its algorithm is not changed
Core design with flow is all in the protection domain of the patent.
Second embodiment of the present invention is related to a kind of device compatibility method, and idiographic flow is as shown in Figure 2.The of the present invention
Two embodiments have made further improvement on the basis of first embodiment, mainly the improvement is that:In the second embodiment party
In formula, according to production firm's information of the identity of default order identification chip, the identity of hardware and device, and
Retrieved in the data pre-saved it is first identifying as a result, if do not retrieve identification as a result, if terminate to identify follow-up information,
And export prompt message.In this way, it can find and solve the problems, such as in time.
In the present embodiment, default recognition sequence is:The identity of identification chip, the identity mark for identifying hardware
Know, production firm's information of recognition means.In practical applications, the recognition sequence being not limited in present embodiment.
Specifically, in the present embodiment, comprising step 201~214, wherein, step 201,202,205,208,
211st, 213,214 is similar to the step 101 in first embodiment~107 respectively, and details are not described herein.Below only to difference
Place is introduced:
Step 203:The identity of the chip of retrieval in the mapping table.
Step 204, the identity of the chip in retrieval result with the presence or absence of identification is judged.If so, then perform step
205, otherwise, perform step 206.
Step 206, prompt message of the output there is no the identity of the chip of identification.In this way, user can learn
The reason for device cannot be by compatibility:Do not prestore driver corresponding with the chip of the identity.
Step 207, the identity of the hardware in retrieval result with the presence or absence of identification is judged.If so, then perform step
208, otherwise, perform step 209.
Step 209, prompt message of the output there is no the identity of the hardware of identification.In this way, user can learn
The reason for device cannot be by compatibility:Do not prestore driver corresponding with the hardware of the identity.
Step 210, production firm's information of the device in retrieval result with the presence or absence of identification is judged.If so, then perform step
Rapid 211, otherwise, perform step 212.
Step 212, prompt message of the output there is no production firm's information of the device of identification.In this way, user can
Learn the reason for device is undesirable:Lack production firm's information of device, should burning OTP information again.
Third embodiment of the present invention is related to a kind of device compatibility method.Third embodiment of the present invention is real with first
It is roughly the same to apply mode, is in place of the main distinction:In the first embodiment, according to the electricity on the reserved level pin of hardware
Pressure, identifies the identification code of hardware.And in this second embodiment, according to the modulus of analog voltage on the reserved level pin of hardware
Transformed value (i.e. ADC values), identifies the identification code of hardware.Wherein, the ADC values for reserving analog voltage on level pin are by reading
The 16 system numbers that analog voltage is converted to.According to the ADC values for reading analog voltage on reserved level pin, hardware can also be identified
Identification code, enrich embodiments of the present invention, user can make choice according to actual conditions.
It should be noted that in practical applications, the identification code of hardware can also be identified by other means, is not limited to
2 kinds of embodiment of the present invention introduction.
Four embodiment of the invention is related to a kind of device compatible system, as shown in figure 3, comprising:Identification module, driving journey
Sequence load-on module and memory module.
Mapping table establishes module, for establishing the identity information and the mapping table of driver preservation address of device, and will
Mapping table preserves in a storage module.
Identification module, the identity information for recognition means.Wherein, the identity information of device include it is following any one or
Any combination:Production firm's information of the identity of device chips, the identity of hardware and device.
Driver load-on module, for the identity information of the device according to identification, the corresponding driver of loading device;
Wherein, the driver of device pre-saves in a storage module, and is corresponded with the identity information of device.In this reality
Apply in mode, driver load-on module, according to the identity information of the device of identification, from mapping table, find out device correspondence
Driver preservation address, and according to the preservation address of the driver found, loading preserves the corresponding driving in address
Program.
It is not difficult to find that present embodiment is can be with the corresponding system embodiment of first embodiment, present embodiment
First embodiment is worked in coordination implementation.The relevant technical details mentioned in first embodiment still have in the present embodiment
Effect, in order to reduce repetition, which is not described herein again.Correspondingly, the relevant technical details mentioned in present embodiment are also applicable in
In first embodiment.
It will be understood by those skilled in the art that the respective embodiments described above are to realize the specific embodiment of the present invention,
And in practical applications, can to it, various changes can be made in the form and details, without departing from the spirit and scope of the present invention.