Summary of the invention
Fundamental purpose of the present invention is to provide a kind of home appliance and control method thereof of the script carried out with identical inventive concept, be intended to script operation instruction to be associated with corresponding driving circuit, realization utilizes the object of script operation instruction control home appliance operation, the present invention has improved the new functional development efficiency of home appliance, shortened the construction cycle, opened user individual customizing functions function, and new function expansibility and the ductility of home appliance are good.
For achieving the above object, the control method of the home appliance of carrying out script provided by the invention comprises:
Obtain script operation instruction, after described script operation instruction is resolved, map to first memory, and call corresponding driver in described first memory;
Drive home appliance to carry out the operation of mating with described script operation instruction according to described driver.
Preferably, described will be described script operation instruction map to first memory after resolving, and in described first memory, call corresponding driver and comprise:
Read the character string of described script operation instruction, and judge whether the described character string reading is steering order:
If described character string is steering order, in described first memory, call and the corresponding driver of described steering order;
If described character string is logical order,, after determining the redirect direction and jump location comprising in described logical order, moves to described jump location and continue to read the character string of described script operation instruction.
Preferably, described calling in described first memory with before the corresponding driver of described steering order also comprises: resolve control parameter corresponding to described steering order;
Described calling in described first memory with the corresponding driver of described steering order is specially: in described first memory according to described control parameter call and the corresponding driver of described steering order.
Preferably, the character string that reads described script operation instruction described in comprises:
Read CHAR, after the character of preset length, complete reading described CHAR reading;
Or
Read random length character string, in the time reading to length mark, complete reading described random length character string.
Preferably, the character string that reads described script operation instruction described in is specially: whether all character strings that judge described script operation instruction have read complete:
If read completely, call default driver;
If do not read completely, read the character string of described script operation instruction.
Preferably, all character strings of the described script operation instruction of described judgement have read complete being specially:
In the time reading the end mark defaulting in described script operation instruction, judge that all character strings of described script operation instruction have read complete.
Preferably, describedly in described first memory, call corresponding driver and be specially:
By corresponding api interface, in described first memory, call corresponding driver.
Preferably, described in, obtaining script operation instruction is specially:
Receive the script operation instruction of second memory transmission or receive the script operation instruction that network-side sends.
The present invention further provides a kind of home appliance of carrying out script, comprising:
Driving circuit, for driving home appliance to carry out different operating according to different drivers;
First memory, is connected in described driving circuit, for storing described driver;
Script resolver, for obtaining and resolve after script operation instruction its output;
Call circuit, be connected in described driving circuit, described script resolver and described first memory, for receiving after the script operation instruction after described script resolver resolves, in described first memory, call with the corresponding driver of described script operation instruction and transfer described driving circuit, make home appliance executable operations.
Preferably, also comprise network connection device or/and second memory, described network connection device is connected in described script resolver, is passed to script resolver for the described script of network-side is resolved to instruction; Described second memory is connected in described script resolver, for storing described script operation instruction.
The home appliance that the present invention can carry out script is mapped in first memory after by script resolver resolves script operation instruction, and in described first memory, call with the corresponding driver of described script operation instruction and transfer described driving circuit, make home appliance executable operations; The present invention is associated script operation instruction with corresponding driving circuit, realize the object of utilizing the operation of script operation instruction control home appliance, improve the new functional development efficiency of home appliance, shortened the construction cycle, opened user individual customizing functions function, and new function expansibility and the ductility of home appliance are good.
Embodiment
Further illustrate technical scheme of the present invention below in conjunction with Figure of description and specific embodiment.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
The invention provides a kind of home appliance of carrying out script.
With reference to Fig. 1, Fig. 1 is the structural representation that the present invention can carry out home appliance first embodiment of script; In described the first embodiment, this home appliance that can carry out script comprises:
Driving circuit 10, for driving home appliance to carry out different operating according to different drivers;
First memory 20, is connected in described driving circuit 10, for storing described driver;
Script resolver 30, for obtaining and resolve after script operation instruction its output;
Call circuit 40, be connected in described driving circuit 10, described script resolver 30 and described first memory 20, for receiving after the script operation instruction after described script resolver 30 is resolved, in described first memory 20, call with the corresponding driver of described script operation instruction and transfer described driving circuit 10, make home appliance executable operations.
After resolving script operation instruction by script resolver 30, the home appliance that the present embodiment can be carried out script mapped in first memory 20, and in described first memory 20, utilize and call circuit 40 and call with the corresponding driver of described script operation instruction and transfer described driving circuit 10, make home appliance executable operations; The present invention is associated script operation instruction with corresponding driving circuit 10, realize the object of utilizing the operation of script operation instruction control home appliance, improve the new functional development efficiency of home appliance, shortened the construction cycle, opened user individual customizing functions function, and new function expansibility and the ductility of home appliance are good.In the present invention, described home appliance can be electric cooker, fan, water dispenser, air-conditioning, TV etc.
Further, with reference to Fig. 2, Fig. 2 is the structural representation that the present invention can carry out home appliance second embodiment of script; In described the second embodiment, the described home appliance of carrying out script also comprises second memory 50, and described second memory 50 is connected in described script resolver 30, for storing described script operation instruction.Also, the script operation instruction that described script resolver 30 obtains is stored in the described second memory 50 that described home appliance carries, and in the time that needs are assigned script operation instruction, can directly from described second memory 50, call.In like manner, Fig. 3 is the structural representation that the present invention can carry out home appliance the 3rd embodiment of script; In described the 3rd embodiment, described first memory 20 is connected in described script resolver 30, and described first memory 20 is also for storing described script operation instruction; Also be, first memory 20 in described the 3rd embodiment has also been born the function of the second memory 50 in above-mentioned the second embodiment, the script operation instruction that described script resolver 30 obtains is stored in the described first memory 20 that described home appliance carries, in the time that needs are assigned script operation instruction, can directly from described first memory 20, call.
Further, Fig. 4 is the structural representation that the present invention can carry out home appliance the 4th embodiment of script; In described the 4th embodiment, the described home appliance of carrying out script also comprises network connection device 60, and described network connection device 60 is connected in described script resolver 30, is passed to script resolver 30 for the described script of network-side is resolved to instruction; Also, network-side is exported described script operation instruction to described script resolver 30, in the time that needs are assigned script operation instruction by described network connection device 60, only need to be by described home appliance networking, can be from network-side, such as, mobile phone, panel computer etc. are assigned script operation instruction.Described network connection device 60 is USB interface or radio receiver; Also, network-side can be assigned script operation instruction to described script resolver 30 by wired or wireless mode.
As shown in Figure 5, Fig. 5 is the structural representation that the present invention can carry out home appliance the 5th embodiment of script; The described home appliance of carrying out script also comprises network connection device 60 and second memory 50, and described network connection device 60 is connected in described script resolver 30, is passed to script resolver 30 for the described script of network-side is resolved to instruction; Described second memory 50 is connected in described script resolver 30, for storing described script operation instruction.From the above, the described home appliance of carrying out script also can arrange described network connection device 60 and described second memory 50 simultaneously, can according to circumstances utilize described network connection device 60 or described second memory 50 to select the mode of assigning script operation instruction.In like manner, as shown in Figure 6, Fig. 6 is the structural representation that the present invention can carry out home appliance the 6th embodiment of script, the described home appliance of carrying out script also comprises network connection device 60, described network connection device 60 is connected in described script resolver 30, is passed to script resolver 30 for the described script of network-side is resolved to instruction; By above-mentioned, described first memory 20 is connected in described script resolver 30, and in the 6th embodiment, described first memory 20 has also been born the function of the second memory 50 in above-mentioned the second embodiment, also for storing described script operation instruction.Also, the described home appliance of carrying out script also can according to circumstances utilize described network connection device 60 or described first memory 20 to select the mode of assigning script operation instruction.
The present invention further provides a kind of control method of the home appliance of carrying out script.
With reference to Fig. 7, Fig. 7 is the flowage structure schematic diagram of control method first embodiment of the present invention's home appliance that can carry out script; In described the first embodiment, this control method that can carry out the home appliance of script comprises:
Step S10, obtains after script operation instruction, enters step S20, maps to first memory 20, and call corresponding driver after described script operation instruction is resolved in described first memory 20;
Step S30, drives home appliance to carry out the operation of mating with described script operation instruction according to described driver.
The present embodiment is mapped in first memory 20 after resolving script operation instruction by script resolver 30, and in described first memory 20, call with the corresponding driver of described script operation instruction and transfer described driving circuit 10, make home appliance executable operations; Script operation instruction is associated with corresponding driving circuit 10, has realized the object of utilizing the operation of script operation instruction control home appliance.As preferably, in described step S10, obtaining script operation instruction is specially: the script operation instruction that reception second memory 50 transmits or the script operation instruction that receives network-side transmission, also be, described script operation instruction can be stored in described second memory 50, also can receive from network-side by network connection device 60; In the present invention, described script operation instruction also can be stored in described first memory 20, and described first memory 20 is connected to described script resolver 30, makes described first memory 20 can substitute described second memory 50.As preferably, in described step S20, in described first memory 20, calling corresponding driver is specially: the API(Application Programming Interface by corresponding: application programming interface) interface, in described first memory 20, call corresponding driver, also be, the corresponding corresponding api interface of each driver, described in call circuit 40 by corresponding api interface call driver.
With reference to Fig. 8, Fig. 8 is the flowage structure schematic diagram of control method second embodiment of the present invention's home appliance that can carry out script; In this second embodiment, will be described in described step S20 script operation instruction map to first memory 20 after resolving, and in described first memory 20, call corresponding driver and comprise:
Step S201, read the character string of described script operation instruction, because described script operation character string may be steering order (such as order electric cooker heating or stop the instruction of heating) or logical order (such as order electric cooker stops heating the instruction of 5 minutes after 20 minutes in heating), therefore, need to differentiate different character strings, therefore enter step S202, judge whether the described character string reading is steering order:
If described character string is steering order, also, now described in demand motive, home appliance operates accordingly, therefore enters step S203, calls and the corresponding driver of described steering order in described first memory 20; Afterwards, enter in step S30, drive home appliance to carry out the operation of mating with described script operation instruction according to described driver.Such as, receiving after order electric cooker heating instruction, the heater circuit that calls the heat driven driven by program electric cooker of electric cooker heats.
If described character string is logical order, due in a script steering order, may only there is a corresponding character string in each steering order, therefore, if need logically repeatedly to carry out a certain steering order, need repeatedly to read this character string, now, need to carry out logic control, also be, in the time that needs carry out a certain steering order again, after need to judging that character string corresponding to this steering order is positioned at which position of described script operation instruction, directly jumping to this position reads, therefore enter step S204, after determining the redirect direction and jump location comprising in described logical order, move to described jump location thereupon and enter step S201 relaying and resume studies and get the character string of described script operation instruction.Such as, receiving order electric cooker after heating stops heating the instruction of 5 minutes after 20 minutes, logical order is after heating 20 minutes, how the position of the current corresponding reading character string of heating steering order is jumped to the position that stops heating the corresponding reading character string of steering order, now judge that the position that its redirect direction directly moving to stops heating the corresponding reading character string of steering order reads.
With reference to Fig. 9, Fig. 9 is the flowage structure schematic diagram of control method the 3rd embodiment of the present invention's home appliance that can carry out script; In described step S203, in described first memory 20, call with the corresponding driver of described steering order before also comprise: step S205, resolve control parameter corresponding to described steering order; Also, steering order is corresponding is accompanied with corresponding control parameter, such as, electric cooker heating instruction comprises heating power, heating duration etc.; Now need to resolve controlling parameter.
In described step S203, in described first memory 20, call with the corresponding driver of described steering order and be specially: in described first memory 20 according to described control parameter call and the corresponding driver of described steering order, in the time parsing the corresponding control parameter of steering order, need to carry out call driver according to described control parameter, and utilize corresponding driving circuit 10 to drive home appliance to carry out relevant action.
Further, the character string that reads described script operation instruction in described step S201 comprises: read CHAR, complete reading described CHAR reading after the character of preset length; Or read random length character string, in the time reading to length mark, complete reading described random length character string.In the present invention, the character string of described script operation instruction comprises CHAR and random length character string, in the time that the character string of described script operation instruction is CHAR, can preset the length of the character string at every turn reading, in the present embodiment, it can be set is 3 bytes, therefore thinks and completes reading this character string reading after 3 bytes; But in the present invention, it is not defined as 3 bytes, also can be set is as required that the byte of 4,5 or other numbers all can; In the time that the character string of described script operation instruction is random length character string, after each character string that needs to switch, set up a length mark, in the time reading this length mark, think and completed reading this character string.
With reference to Figure 10, Figure 10 is the flowage structure schematic diagram of control method the 4th embodiment of the present invention's home appliance that can carry out script, in the 4th embodiment, the character string that reads described script operation instruction in described step S201 is specially: step S206, whether all character strings that judge described script operation instruction have read complete: if read complete, represent that operation corresponding to this script operation instruction is all finished, therefore enter step S207, call after default driver, enter step S30, also be, in the present invention, complete after every script operation instruction, all be preset with corresponding action, such as, after electric cooker heating is complete, enter holding state, now needing to call standby program drives stand-by circuit to make electric cooker enter holding state, if do not read completely, representative now also needs to carry out action below, therefore enters step S201 relaying and resumes studies and get the character string of described script operation instruction.
Further, the all character strings that judge described script operation instruction in described step S206 have read complete being specially: in the time reading the end mark defaulting in described script operation instruction, all character strings of judging described script operation instruction have read complete, also be, in the present embodiment, in each script operation instruction, be provided with an end mark, in the time reading this end mark, think and read complete described script operation instruction.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.Through the above description of the embodiments, those skilled in the art can be well understood to the mode that above-described embodiment method can add essential general hardware platform by software and realize, can certainly pass through hardware, but in a lot of situation, the former is better embodiment.Based on such understanding, the part that technical scheme of the present invention contributes to prior art in essence in other words can embody with the form of software product, this computer software product is stored in a storage medium (as ROM/RAM, magnetic disc, CD), comprise that some instructions (can be home appliance, mobile phone in order to make a station terminal equipment, computing machine, server, or the network equipment etc.) carry out the method described in each embodiment of the present invention.
The foregoing is only the preferred embodiments of the present invention; not thereby limit its scope of the claims; every equivalent structure or conversion of equivalent flow process that utilizes instructions of the present invention and accompanying drawing content to do; directly or indirectly be used in other relevant technical fields, be all in like manner included in scope of patent protection of the present invention.