CN105204866A - Equipment command calling method and system - Google Patents

Equipment command calling method and system Download PDF

Info

Publication number
CN105204866A
CN105204866A CN201510662637.1A CN201510662637A CN105204866A CN 105204866 A CN105204866 A CN 105204866A CN 201510662637 A CN201510662637 A CN 201510662637A CN 105204866 A CN105204866 A CN 105204866A
Authority
CN
China
Prior art keywords
device command
metadata
equipment
command
interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510662637.1A
Other languages
Chinese (zh)
Inventor
王传民
韩锋
殷菲
冷静
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CVIC Software Engineering Co Ltd
Original Assignee
CVIC Software Engineering Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by CVIC Software Engineering Co Ltd filed Critical CVIC Software Engineering Co Ltd
Priority to CN201510662637.1A priority Critical patent/CN105204866A/en
Publication of CN105204866A publication Critical patent/CN105204866A/en
Pending legal-status Critical Current

Links

Abstract

The embodiment of the invention provides an equipment command calling method and system. The method comprises the steps that upper-layer application sends a command calling instruction to a command execution interface, and the command execution interface determines a name of an equipment command needing to be called and a type name of execution equipment corresponding to the equipment command according to the command calling instruction, searches and executes metadata in configuration files according to the type name and the name of the equipment command, takes out a binding equipment command processing program, executes the binding equipment command processing program and sends the equipment command to the execution equipment. The upper-layer application calls the unified command execution interface to complete calling of equipment commands of various equipment, a metadata idea is adopted, command processing programs of the various equipment are searched and executed through the metadata, when new equipment is added in a system, new equipment command calling program codes do not need to be edited, original system program codes do not need to be modified, the workload is smaller, the extendibility is higher, and the maintainability and the reliability are better.

Description

Device command call method and system
Technical field
The present invention relates to a kind of device command call method and system.
Background technology
Along with the increase of device type, in types of applications system, such as, monitor in application system, often need to carry out unified real time monitoring and control to equipment dissimilar in a large number, developer needs according to a set of supervisory system of concrete equipment development.Although there is more identical and similarity in different supervisory systems, but different device command forms is varied, order executive mode is also different, the equipment of every type all has its corresponding device command, when to dissimilar equipment transmitting apparatus order, need directly to call different device commands by upper layer application by different command calls methods.Therefore, when in system during newly added equipment, for the type of newly added equipment, need to write new device command handler code and device command calling program code, and the device command handler code of this being write by amendment original system program and device command calling program code are added in original system program, realize the interpolation of new device command and new device command call method, workload is larger, extensibility is poor, and because original system program will be revised, also make maintainability and the less reliable of system.
Summary of the invention
In view of this, the embodiment of the present invention provides a kind of device command call method and system, and comparatively large to solve workload in prior art, extensibility is poor, revise original system program, makes the maintainability of system and the problem of less reliable.
For achieving the above object, the embodiment of the present invention provides following technical scheme:
A kind of device command call method, by abstract for the descriptor of various kinds of equipment be that metadata store is in configuration file, described descriptor comprises: the typonym of equipment and the title of device command, and by metadata corresponding for various kinds of equipment and the binding of device command handling procedure, comprising:
Upper layer application sends command calls instruction to order executive's interface;
Described order executive's interface determines the typonym of the actuating equipment that the title of the device command that need call is corresponding with described device command according to described command calls instruction, and in configuration file, searches the corresponding execution metadata of described device command according to described typonym and the title of described device command;
Described order executive's interface takes out the bound device command processor with described execution bind meta-data according to described execution metadata, performs described bound device command processor, sends described device command to described actuating equipment.
Wherein, described execution metadata of searching described device command corresponding in configuration file according to described typonym and the title of described device command comprises:
Described order executive's interface searches the corresponding metadata of described typonym according to described typonym in configuration file, obtains device type metadata;
In all described device type metadata, inquire about the corresponding metadata of the title of described device command according to the title of described device command, obtain performing metadata.
Wherein, describedly in configuration file, search the corresponding metadata of described typonym according to described typonym, also comprise after obtaining device type metadata:
Described order executive's interface judges whether to find described device type metadata;
If not, then the first error message is returned to described upper layer application, end operation.
Wherein, the described title according to described device command inquires about the corresponding metadata of the title of described device command in all described device type metadata, also comprises after obtaining performing metadata:
Described order executive's interface judges whether to find described execution metadata;
If not, then the second error message is returned to described upper layer application, end operation.
Wherein, described order executive's interface comprises after taking out with described execution bind meta-data bound device command processor according to described execution metadata:
Described order executive's interface judges the whether instantiation of described bound device command processor;
If so, described bound device command processor is then performed;
If not, then bound device command processor described in instantiation, performs described bound device command processor.
Wherein, describedly also to comprise after described actuating equipment sends described device command:
Described upper layer application judges whether to receive in Preset Time the feedback information that described actuating equipment returns after receiving described device command;
If do not receive, then described order executive's interface sends described device command to described actuating equipment again.
If receive, then judge whether described actuating equipment performs described device command after receiving described device command according to described feedback information;
If do not perform, then generate the 3rd error message.
A kind of device command calling system, comprises upper layer application and order executive's interface; Wherein,
Described upper layer application comprises instruction sending unit, and described instruction sending unit is used for sending command calls instruction to order executive's interface;
Described order executive's interface comprises searches unit and performance element, wherein, described unit of searching for determining the typonym of the actuating equipment that the title of the device command that need call is corresponding with described device command according to described command calls instruction, and searches the corresponding execution metadata of described device command according to described typonym and the title of described device command in configuration file; Described performance element is used for taking out the bound device command processor with described execution bind meta-data according to described execution metadata, performs described bound device command processor, sends described device command to described actuating equipment.
Wherein, described device command calling system also comprises: configuration binding module, for by abstract for the descriptor of various kinds of equipment be that metadata store is in configuration file, described descriptor comprises: the typonym of equipment and the title of device command, and by metadata corresponding for various kinds of equipment and the binding of device command handling procedure.
Wherein, search unit described in comprise first and search subelement and second and search subelement; Wherein,
Described first searches subelement, for searching the corresponding metadata of described typonym according to described typonym in configuration file, obtains device type metadata;
Described second searches subelement, the metadata that the title for inquiring about described device command in all described device type metadata according to the title of described device command is corresponding, obtains performing metadata.
Wherein, described upper layer application also comprises: the first judging unit and the second judging unit; Wherein,
Described first judging unit, for judging whether to receive in Preset Time the feedback information that described actuating equipment returns after receiving described device command, if do not receive, then control described order executive's interface and again send described device command to described actuating equipment;
Described second judging unit, for when judging to receive in Preset Time the feedback information that described actuating equipment returns after receiving described device command, judge whether described actuating equipment performs described device command after receiving described device command according to described feedback information, if do not perform, then generate the 3rd error message.
Based on technique scheme, the device command call method that the embodiment of the present invention provides and system, by abstract for the descriptor of various kinds of equipment be that metadata store is in configuration file, the descriptor of various kinds of equipment comprises: the title of the typonym of equipment and all devices order corresponding to this kind equipment, and by after metadata corresponding for various kinds of equipment and the binding of device command handling procedure, when the order of needs invocation facility, upper layer application sends command calls instruction to order executive's interface, order executive's interface determines the typonym of the actuating equipment that the title of the device command that need call is corresponding with this device command according to this command calls instruction, and in configuration file, search the corresponding execution metadata of this device command according to the typonym of this actuating equipment and the title of this device command, then the bound device command processor with this execution bind meta-data is taken out according to this execution metadata, perform this bound device command processor, described device command is sent to this actuating equipment.When the order of needs invocation facility, the device command of calling no matter is needed to be the device command with kind equipment, upper layer application all only needs to call unified order executive's interface, command calls instruction is sent to this order executive's interface, just calling the device command of all types equipment can be realized, when in system during newly added equipment, upper layer application also only needs to call this order executive's interface, just can complete calling the device command of this newly added equipment, write new device command calling program code without the need to the type again for newly added equipment, adopt metadata thought, after order executive's interface receives the command calls instruction that upper layer application sends, metadata in order executive's interface query configuration file will be passed through, and then find the device command handling procedure with this bind meta-data, run this device command handling procedure to realize calling of device command, when in system during newly added equipment, only need to write device command handling procedure corresponding to this newly added equipment, and metadata corresponding for this newly added equipment is added in configuration file, just calling the device command of this newly added equipment can be realized, without the need to modifying to original system program code.To sum up, the device command call method that the embodiment of the present invention provides and system, upper layer application has carried out calling the device command of various kinds of equipment by calling unified order executive's interface, when in system during newly added equipment, new device command calling program code is write without the need to the type again for newly added equipment, adopt metadata thought, the device command handling procedure of each device command is found by metadata, perform this device command handling procedure and complete calling device command, when in system during newly added equipment, without the need to modifying to original system program code, workload is less, extensibility is higher, the maintainability of system and reliability are also better.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only embodiments of the invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to the accompanying drawing provided.
The process flow diagram of the device command call method that Fig. 1 provides for the embodiment of the present invention;
In configuration file, search the method flow diagram of the corresponding execution metadata of device command according to typonym and the title of device command in the device command call method that Fig. 2 provides for the embodiment of the present invention;
In the device command call method that Fig. 3 provides for the embodiment of the present invention, order executive's interface returns the method flow diagram of the first error message;
In the device command call method that Fig. 4 provides for the embodiment of the present invention, order executive's interface returns the method flow diagram of the second error message;
The method flow diagram of bound device command processor is performed in the device command call method that Fig. 5 provides for the embodiment of the present invention;
Fig. 6 applies the method flow diagram of generation the 3rd error message at the middle and upper levels for device command call method that the embodiment of the present invention provides;
The system chart of the device command calling system that Fig. 7 provides for the embodiment of the present invention;
Another system chart of the device command calling system that Fig. 8 provides for the embodiment of the present invention;
The structured flowchart of unit is searched in the device command calling system that Fig. 9 provides for the embodiment of the present invention;
The structured flowchart that Figure 10 applies at the middle and upper levels for the device command calling system that the embodiment of the present invention provides.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
The process flow diagram of the device command call method that Fig. 1 provides for the embodiment of the present invention, upper layer application has carried out calling the device command of various kinds of equipment by calling unified order executive's interface, when in system during newly added equipment, new device command calling program code is write without the need to the type again for newly added equipment, adopt metadata thought, the device command handling procedure of each device command is found by metadata, perform this device command handling procedure and complete calling device command, when in system during newly added equipment, without the need to modifying to original system program code, workload is less, extensibility is higher, the maintainability of system and reliability are also better, with reference to Fig. 1, this device command call method can comprise:
Step S100: upper layer application sends command calls instruction to order executive's interface;
When the order of needs invocation facility, the device command of calling no matter is needed to be which kind of class, mode by sending from command calls instruction to order executive's interface is called this order executive's interface by upper layer application, complete calling various kinds of equipment order by this order executive's interface, various kinds of equipment order is sent to various kinds of equipment.
Before upper layer application sends command calls instruction to order executive's interface, also should by abstract for the descriptor of various kinds of equipment be that metadata store is in configuration file, and metadata corresponding for various kinds of equipment and device command handling procedure are bound, wherein, descriptor corresponding to the metadata stored in configuration file comprises: the typonym of equipment and the title of device command.
Wherein, when only need not store metadata corresponding to the descriptor of certain kind equipment in configuration file, by abstract for the descriptor of this kind equipment be that metadata store is in configuration file, and device command handling procedure corresponding with this equipment for this metadata is bound, without the need to all performing during each invocation facility order by abstract for the descriptor of equipment for metadata store is in configuration file, and metadata and device command handling procedure are carried out the operation of binding.
Optionally, the descriptor process of equipment can comprise outside the typonym of equipment and the title of device command, can also comprise the title of input parameter, output parameter and device command handling procedure.
Step S110: described order executive's interface determines the typonym of the actuating equipment that the title of the device command that need call is corresponding with described device command according to described command calls instruction, and in configuration file, search the corresponding execution metadata of described device command according to described typonym and the title of described device command;
Order executive's interface is after receiving the command calls instruction that upper layer application sends, the typonym of the actuating equipment that the title of the device command that need call is corresponding with this device command will be determined according to this command calls instruction, and in configuration file, search the corresponding execution metadata of this device command according to the typonym determined and the title of device command.
Optionally, order executive's interface can find the metadata corresponding with the typonym that this is determined according to the typonym determined in configuration file, obtain device type metadata, in the metadata that the title of inquiring about this device command according to the title of this device command in all device type metadata obtained is corresponding, obtain performing metadata.
Optionally, because the metadata that the device command of calling needed for not necessarily storing in configuration file is corresponding, therefore, after order executive's interface searches the corresponding device type metadata of the type title according to typonym in configuration file, can by judging to search in configuration file whether find the corresponding device type metadata of the type title, judge the metadata that the device command of calling needed for whether storing in configuration file is corresponding.
If find, then can continue in the device type metadata found, to inquire about the corresponding execution metadata of the title of this device command according to the title of device command, by judging whether to find execution metadata in device type metadata, judge the metadata that the device command of calling needed for whether storing in configuration file is corresponding further; If do not search, then the metadata that the device command that not have to call needed for storage is corresponding is described in configuration file, and order executive's interface returns the first error message to upper layer application, end operation.
Optionally, if find the device type metadata that the type title is corresponding in configuration file, then at order executive's interface after the execution metadata that the title of inquiring about this device command according to the title of device command in device type metadata is corresponding, can be further advanced by and judge whether to find execution metadata in device type metadata, judge the metadata that the device command of calling needed for whether storing in configuration file is corresponding.
If find, the metadata that the device command of calling needed for then storing in explanation configuration file is corresponding, subsequent operation can be performed again, the bound device command processor with this execution bind meta-data is taken out according to this execution metadata found, if do not find, the metadata that the device command that not have to call needed for storage is corresponding is then described in configuration file, and order executive's interface returns the second error message to upper layer application, end operation.
Step S120: described order executive's interface takes out the bound device command processor with described execution bind meta-data according to described execution metadata, performs described bound device command processor, sends described device command to described actuating equipment.
Order executive's interface is after finding execution metadata corresponding to the device command that need call according to the command calls instruction received, the bound device command processor with this execution bind meta-data is taken out by according to this execution metadata, by performing this bound device command processor, send this device command to the actuating equipment that the device command that need call is corresponding.Further, general for this reception device command is performed this device command by actuating equipment.
Optionally, because only have the device command handling procedure after instantiation just can be performed, therefore, in order to ensure that device command handling procedure is performed normally, after order executive's interface takes out the bound device command processor with this execution bind meta-data according to execution metadata, order executive's interface first can judge the whether instantiation of this bound device command processor, if judge this bound device command processor instantiation, then perform this bound device command processor, if judge the also non-instantiation of this bound device command processor, then this bound device command processor of instantiation, bound device command processor after this instantiation will be performed.
Optionally, at order executive's interface after the order of actuating equipment transmitting apparatus, if actuating equipment receives this device command, to return with feedback information to upper layer application, therefore, at order executive's interface after the order of actuating equipment transmitting apparatus, by judging whether to receive in Preset Time the feedback information that actuating equipment returns after receiving device command, can judge whether actuating equipment successfully receives the device command that order executive's interface sends to it.
If upper layer application receives the feedback information that actuating equipment returns in Preset Time, then illustrate that actuating equipment successfully receives device command, otherwise, if upper layer application does not receive the feedback information that actuating equipment returns in Preset Time, then illustrate that actuating equipment fails and receive device command, order executive's interface sends this device command to this actuating equipment again.
Optionally, after upper layer application receives the feedback information that actuating equipment returns, the device command that upper layer application can be determined performed by this actuating equipment by this feedback information, and then whether identical by judging the device command that device command performed by this actuating equipment and order executive's interface send to this actuating equipment, judge whether this actuating equipment has and correctly perform this device command receiving order executive's interface after its device command sent.
If judge, the device command performed by this actuating equipment is identical with the device command that order executive's interface sends to this actuating equipment, illustrate that this actuating equipment has and correctly performs this device command receiving order executive's interface after its device command sent, if judge, the device command that device command performed by this actuating equipment and order executive's interface send to this actuating equipment is not identical, illustrate that this actuating equipment fails correctly to perform this device command receiving order executive's interface after its device command sent, now, upper layer application generates the 3rd error message.
Based on technique scheme, the device command call method that the embodiment of the present invention provides, by abstract for the descriptor of various kinds of equipment be that metadata store is in configuration file, the descriptor of various kinds of equipment comprises: the title of the typonym of equipment and all devices order corresponding to this kind equipment, and by after metadata corresponding for various kinds of equipment and the binding of device command handling procedure, when the order of needs invocation facility, upper layer application sends command calls instruction to order executive's interface, order executive's interface determines the typonym of the actuating equipment that the title of the device command that need call is corresponding with this device command according to this command calls instruction, and in configuration file, search the corresponding execution metadata of this device command according to the typonym of this actuating equipment and the title of this device command, then the bound device command processor with this execution bind meta-data is taken out according to this execution metadata, perform this bound device command processor, described device command is sent to this actuating equipment.When the order of needs invocation facility, the device command of calling no matter is needed to be the device command with kind equipment, upper layer application all only needs to call unified order executive's interface, command calls instruction is sent to this order executive's interface, just calling the device command of all types equipment can be realized, when in system during newly added equipment, upper layer application also only needs to call this order executive's interface, just can complete calling the device command of this newly added equipment, write new device command calling program code without the need to the type again for newly added equipment, adopt metadata thought, after order executive's interface receives the command calls instruction that upper layer application sends, metadata in order executive's interface query configuration file will be passed through, and then find the device command handling procedure with this bind meta-data, run this device command handling procedure to realize calling of device command, when in system during newly added equipment, only need to write device command handling procedure corresponding to this newly added equipment, and metadata corresponding for this newly added equipment is added in configuration file, just calling the device command of this newly added equipment can be realized, without the need to modifying to original system program code.To sum up, the device command call method that the embodiment of the present invention provides and system, upper layer application has carried out calling the device command of various kinds of equipment by calling unified order executive's interface, when in system during newly added equipment, new device command calling program code is write without the need to the type again for newly added equipment, adopt metadata thought, the device command handling procedure of each device command is found by metadata, perform this device command handling procedure and complete calling device command, when in system during newly added equipment, without the need to modifying to original system program code, workload is less, extensibility is higher, the maintainability of system and reliability are also better.
Optionally, Fig. 2 shows the method flow diagram searching the corresponding execution metadata of device command in the device command call method that the embodiment of the present invention provides according to typonym and the title of device command in configuration file, with reference to Fig. 2, this method of searching the corresponding execution metadata of device command according to typonym and the title of device command in configuration file can comprise:
Step S200: described order executive's interface searches the corresponding metadata of described typonym according to described typonym in configuration file, obtains device type metadata;
Order executive's interface can search the metadata corresponding with the type title according to the typonym determined in configuration file, and the metadata corresponding with the typonym of actuating equipment claiming this to be stored in find in configuration file is device type metadata.
Step S210: inquire about the corresponding metadata of the title of described device command according to the title of described device command in all described device type metadata, obtains performing metadata.
After order executive's interface finds the corresponding device type metadata of actuating equipment in configuration file, metadata that can be corresponding according to the title of inquiring about this device command in all device type metadata obtained of the title of device command, claim the metadata corresponding with the title of device command that this finds in all device type metadata obtained for perform metadata, order executive's interface can take out the bound device command processor with this execution bind meta-data according to this execution metadata, by performing this bound device command processor, to the order of actuating equipment transmitting apparatus.
Optionally, Fig. 3 shows order executive's interface in the device command call method that the embodiment of the present invention provides and returns the method flow diagram of the first error message, and with reference to Fig. 3, the method that this order executive's interface returns the first error message can comprise:
Step S300: described order executive's interface judges whether to find described device type metadata;
Because the metadata that the device command of calling needed for not necessarily storing in configuration file is corresponding, therefore, after order executive's interface searches the corresponding device type metadata of the type title according to typonym in configuration file, can by judging to search in configuration file whether find the corresponding device type metadata of the type title, judge the metadata that the device command of calling needed for whether storing in configuration file is corresponding.
Step S310: if not, then return the first error message to described upper layer application, end operation.
Do not find device type metadata if judge, then the metadata that the device command that not have to call needed for storage is corresponding is described in configuration file, and order executive's interface returns the first error message to upper layer application, end operation; It should be noted that, device type metadata is found if judge, also cannot directly determine also to need the metadata that the device command of calling needed for whether storing in configuration file is corresponding to judge whether further to find execution metadata in device type metadata.
Optionally, Fig. 4 shows order executive's interface in the device command call method that the embodiment of the present invention provides and returns the method flow diagram of the second error message, and with reference to Fig. 4, the method that this order executive's interface returns the second error message can comprise:
Step S400: described order executive's interface judges whether to find described execution metadata;
Because the metadata that the device command of calling needed for not necessarily storing in configuration file is corresponding, therefore, if find the device type metadata that the type title is corresponding in configuration file, then at order executive's interface after the execution metadata that the title of inquiring about this device command according to the title of device command in device type metadata is corresponding, can again by judging whether to find execution metadata in device type metadata, judge the metadata that the device command of calling needed for whether storing in configuration file is corresponding.
Step S410: if not, then return the second error message to described upper layer application, end operation.
Do not find execution metadata if judge, then the metadata that the device command that not have to call needed for storage is corresponding is described in configuration file, and order executive's interface returns the second error message to upper layer application, end operation; Execution metadata is found if judge, the metadata that the device command of calling needed for then storing in explanation configuration file is corresponding, subsequent operation can be performed again, take out the bound device command processor with this execution bind meta-data according to this execution metadata found.
Optionally, Fig. 5 shows the method flow diagram performing bound device command processor in the device command call method that the embodiment of the present invention provides, and with reference to Fig. 5, the method for this execution bound device command processor can comprise:
Step S500: described order executive's interface judges the whether instantiation of described bound device command processor;
Because only have the device command handling procedure after instantiation just can be performed, therefore, in order to ensure that device command handling procedure is performed normally, order executive's interface according to perform metadata take out with the bound device command processor of this execution bind meta-data after, order executive's interface first can judge the whether instantiation of this bound device command processor.
Step S510: if so, then perform described bound device command processor;
If judge this bound device command processor instantiation, then directly can perform this bound device command processor.
Step S520: if not, then bound device command processor described in instantiation, perform described bound device command processor.
If judge the also non-instantiation of this bound device command processor, then, after this bound device command processor of instantiation, perform the bound device command processor after this instantiation.
Optionally, the device command call method that Fig. 6 shows the embodiment of the present invention to be provided applies the method flow diagram of generation the 3rd error message at the middle and upper levels, and with reference to Fig. 6, the method that this upper layer application generates the 3rd error message can comprise:
Step S600: described upper layer application judges whether to receive in Preset Time the feedback information that described actuating equipment returns after receiving described device command;
At order executive's interface after the order of actuating equipment transmitting apparatus, if actuating equipment receives this device command, to return with feedback information to upper layer application, therefore, at order executive's interface after the order of actuating equipment transmitting apparatus, by judging whether to receive in Preset Time the feedback information that actuating equipment returns after receiving device command, can judge whether actuating equipment successfully receives the device command that order executive's interface sends to it.
Step S610: if do not receive, then described order executive's interface sends described device command to described actuating equipment again.
If upper layer application does not receive the feedback information that actuating equipment returns in Preset Time, then illustrate that actuating equipment fails and receive device command, order executive's interface sends this device command to this actuating equipment again.
According to described feedback information, step S620: if receive, then judge whether described actuating equipment performs described device command after receiving described device command;
If upper layer application receives the feedback information that actuating equipment returns in Preset Time, then illustrate that actuating equipment successfully receives device command, the device command that upper layer application can be determined performed by this actuating equipment further by this feedback information, and then whether identical by judging the device command that device command performed by this actuating equipment and order executive's interface send to this actuating equipment, judge whether this actuating equipment has and correctly perform this device command receiving order executive's interface after its device command sent.
Step S630: if do not perform, then generate the 3rd error message.
If judge, the device command performed by this actuating equipment is identical with the device command that order executive's interface sends to this actuating equipment, illustrate that this actuating equipment has and correctly performs this device command receiving order executive's interface after its device command sent, if judge, the device command that device command performed by this actuating equipment and order executive's interface send to this actuating equipment is not identical, illustrate that this actuating equipment fails correctly to perform this device command receiving order executive's interface after its device command sent, now, upper layer application generates the 3rd error message.
The device command call method that inventive embodiments provides, upper layer application has carried out calling the device command of various kinds of equipment by calling unified order executive's interface, when in system during newly added equipment, new device command calling program code is write without the need to the type again for newly added equipment, adopt metadata thought, the device command handling procedure of each device command is found by metadata, perform this device command handling procedure and complete calling device command, when in system during newly added equipment, without the need to modifying to original system program code, workload is less, extensibility is higher, the maintainability of system and reliability are also better.
Be introduced the device command calling system that the embodiment of the present invention provides below, device command calling system described below can mutual corresponding reference with above-described device command call method.
The system chart of the device command calling system that Fig. 7 provides for the embodiment of the present invention, with reference to Fig. 7, this device command calling system can comprise: upper layer application 100 and order executive's interface 200; Wherein,
Upper layer application 100, for sending command calls instruction to order executive's interface;
Order executive's interface 200, for determining the typonym of the actuating equipment that the title of the device command that need call is corresponding with described device command according to described command calls instruction, and in configuration file, search the corresponding execution metadata of described device command according to described typonym and the title of described device command; Take out the bound device command processor with described execution bind meta-data according to described execution metadata, perform described bound device command processor, send described device command to described actuating equipment.
With reference to Fig. 7, upper layer application 100 comprises instruction sending unit 110, and instruction sending unit 110 is for sending command calls instruction to order executive's interface;
Order executive's interface 200 comprises searches unit 210 and performance element 220, wherein,
Search unit 210, for determining the typonym of the actuating equipment that the title of the device command that need call is corresponding with described device command according to described command calls instruction, and in configuration file, search the corresponding execution metadata of described device command according to described typonym and the title of described device command;
Performance element 220, for taking out the bound device command processor with described execution bind meta-data according to described execution metadata, performing described bound device command processor, sending described device command to described actuating equipment.
Optionally, Fig. 8 shows another system chart of the device command calling system that the embodiment of the present invention provides, and with reference to Fig. 8, this device command calling system can also comprise: configuration binding module 300.
Configuration binding module 300, for by abstract for the descriptor of various kinds of equipment be that metadata store is in configuration file, described descriptor comprises: the typonym of equipment and the title of device command, and by metadata corresponding for various kinds of equipment and the binding of device command handling procedure.
Optionally, Fig. 9 shows the structured flowchart searching unit 110 in the device command calling system that the embodiment of the present invention provides, and with reference to Fig. 9, this is searched unit 110 and can comprise: first searches subelement 111 and second searches subelement 112; Wherein,
First searches subelement 111, for searching the corresponding metadata of described typonym according to described typonym in configuration file, obtains device type metadata;
Second searches subelement 112, the metadata that the title for inquiring about described device command in all described device type metadata according to the title of described device command is corresponding, obtains performing metadata.
Optionally, the device command calling system that Figure 10 shows the embodiment of the present invention to be provided applies the structured flowchart of 100 at the middle and upper levels, and with reference to Figure 10, this upper layer application 100 can also comprise: the first judging unit 120 and the second judging unit 130; Wherein,
First judging unit 120, for judging whether to receive in Preset Time the feedback information that described actuating equipment returns after receiving described device command, if do not receive, then control described order executive's interface and again send described device command to described actuating equipment;
Second judging unit 130, for when judging to receive in Preset Time the feedback information that described actuating equipment returns after receiving described device command, judge whether described actuating equipment performs described device command after receiving described device command according to described feedback information, if do not perform, then generate the 3rd error message.
The device command calling system that inventive embodiments provides, upper layer application has carried out calling the device command of various kinds of equipment by calling unified order executive's interface, when in system during newly added equipment, new device command calling program code is write without the need to the type again for newly added equipment, adopt metadata thought, the device command handling procedure of each device command is found by metadata, perform this device command handling procedure and complete calling device command, when in system during newly added equipment, without the need to modifying to original system program code, workload is less, extensibility is higher, the maintainability of system and reliability are also better.
In this instructions, each embodiment adopts the mode of going forward one by one to describe, and what each embodiment stressed is the difference with other embodiments, between each embodiment identical similar portion mutually see.For device disclosed in embodiment, because it corresponds to the method disclosed in Example, so description is fairly simple, relevant part illustrates see method part.
To the above-mentioned explanation of the disclosed embodiments, professional and technical personnel in the field are realized or uses the present invention.To be apparent for those skilled in the art to the multiple amendment of these embodiments, General Principle as defined herein can without departing from the spirit or scope of the present invention, realize in other embodiments.Therefore, the present invention can not be restricted to these embodiments shown in this article, but will meet the widest scope consistent with principle disclosed herein and features of novelty.

Claims (10)

1. a device command call method, it is characterized in that, by abstract for the descriptor of various kinds of equipment be that metadata store is in configuration file, described descriptor comprises: the typonym of equipment and the title of device command, and by metadata corresponding for various kinds of equipment and the binding of device command handling procedure, comprising:
Upper layer application sends command calls instruction to order executive's interface;
Described order executive's interface determines the typonym of the actuating equipment that the title of the device command that need call is corresponding with described device command according to described command calls instruction, and in configuration file, searches the corresponding execution metadata of described device command according to described typonym and the title of described device command;
Described order executive's interface takes out the bound device command processor with described execution bind meta-data according to described execution metadata, performs described bound device command processor, sends described device command to described actuating equipment.
2. device command call method according to claim 1, is characterized in that, described execution metadata of searching described device command corresponding in configuration file according to described typonym and the title of described device command comprises:
Described order executive's interface searches the corresponding metadata of described typonym according to described typonym in configuration file, obtains device type metadata;
In all described device type metadata, inquire about the corresponding metadata of the title of described device command according to the title of described device command, obtain performing metadata.
3. device command call method according to claim 2, is characterized in that, describedly in configuration file, searches the corresponding metadata of described typonym according to described typonym, also comprises after obtaining device type metadata:
Described order executive's interface judges whether to find described device type metadata;
If not, then the first error message is returned to described upper layer application, end operation.
4. device command call method according to claim 2, it is characterized in that, the described title according to described device command inquires about the corresponding metadata of the title of described device command in all described device type metadata, also comprises after obtaining performing metadata:
Described order executive's interface judges whether to find described execution metadata;
If not, then the second error message is returned to described upper layer application, end operation.
5. device command call method according to claim 1, is characterized in that, described order executive's interface comprises after taking out the bound device command processor with described execution bind meta-data according to described execution metadata:
Described order executive's interface judges the whether instantiation of described bound device command processor;
If so, described bound device command processor is then performed;
If not, then bound device command processor described in instantiation, performs described bound device command processor.
6. device command call method according to claim 1, is characterized in that, describedly also comprises after described actuating equipment sends described device command:
Described upper layer application judges whether to receive in Preset Time the feedback information that described actuating equipment returns after receiving described device command;
If do not receive, then described order executive's interface sends described device command to described actuating equipment again.
If receive, then judge whether described actuating equipment performs described device command after receiving described device command according to described feedback information;
If do not perform, then generate the 3rd error message.
7. a device command calling system, is characterized in that, comprises upper layer application and order executive's interface; Wherein,
Described upper layer application comprises instruction sending unit, and described instruction sending unit is used for sending command calls instruction to order executive's interface;
Described order executive's interface comprises searches unit and performance element, wherein, described unit of searching for determining the typonym of the actuating equipment that the title of the device command that need call is corresponding with described device command according to described command calls instruction, and searches the corresponding execution metadata of described device command according to described typonym and the title of described device command in configuration file; Described performance element is used for taking out the bound device command processor with described execution bind meta-data according to described execution metadata, performs described bound device command processor, sends described device command to described actuating equipment.
8. device command calling system according to claim 7, it is characterized in that, also comprise: configuration binding module, for by abstract for the descriptor of various kinds of equipment be that metadata store is in configuration file, described descriptor comprises: the typonym of equipment and the title of device command, and by metadata corresponding for various kinds of equipment and the binding of device command handling procedure.
9. device command calling system according to claim 7, is characterized in that, described in search unit and comprise first and search subelement and second and search subelement; Wherein,
Described first searches subelement, for searching the corresponding metadata of described typonym according to described typonym in configuration file, obtains device type metadata;
Described second searches subelement, the metadata that the title for inquiring about described device command in all described device type metadata according to the title of described device command is corresponding, obtains performing metadata.
10. device command calling system according to claim 8, is characterized in that, described upper layer application also comprises: the first judging unit and the second judging unit; Wherein,
Described first judging unit, for judging whether to receive in Preset Time the feedback information that described actuating equipment returns after receiving described device command, if do not receive, then control described order executive's interface and again send described device command to described actuating equipment;
Described second judging unit, for when judging to receive in Preset Time the feedback information that described actuating equipment returns after receiving described device command, judge whether described actuating equipment performs described device command after receiving described device command according to described feedback information, if do not perform, then generate the 3rd error message.
CN201510662637.1A 2015-10-14 2015-10-14 Equipment command calling method and system Pending CN105204866A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510662637.1A CN105204866A (en) 2015-10-14 2015-10-14 Equipment command calling method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510662637.1A CN105204866A (en) 2015-10-14 2015-10-14 Equipment command calling method and system

Publications (1)

Publication Number Publication Date
CN105204866A true CN105204866A (en) 2015-12-30

Family

ID=54952572

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510662637.1A Pending CN105204866A (en) 2015-10-14 2015-10-14 Equipment command calling method and system

Country Status (1)

Country Link
CN (1) CN105204866A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109799776A (en) * 2018-12-13 2019-05-24 西安艾润物联网技术服务有限责任公司 Data configuration method and device
CN111091468A (en) * 2019-11-14 2020-05-01 泰康保险集团股份有限公司 Policy data processing method and device, storage medium and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050085193A1 (en) * 2002-02-18 2005-04-21 Infineon Technologies Ag Control system and method for operating a transceiver
CN101546264A (en) * 2009-04-27 2009-09-30 成都市华为赛门铁克科技有限公司 command line processing method, device and communication system
CN101588268A (en) * 2009-06-29 2009-11-25 杭州华三通信技术有限公司 Method and device for configuration files of universal extensible management device
CN103905231A (en) * 2012-12-26 2014-07-02 南京中兴力维软件有限公司 Method and device for unified management of device types

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050085193A1 (en) * 2002-02-18 2005-04-21 Infineon Technologies Ag Control system and method for operating a transceiver
CN101546264A (en) * 2009-04-27 2009-09-30 成都市华为赛门铁克科技有限公司 command line processing method, device and communication system
CN101588268A (en) * 2009-06-29 2009-11-25 杭州华三通信技术有限公司 Method and device for configuration files of universal extensible management device
CN103905231A (en) * 2012-12-26 2014-07-02 南京中兴力维软件有限公司 Method and device for unified management of device types

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
STPEACE: "学会利用"配置文件"优化我们的代码结构", 《HTTP://BLOG.CSDN.NET/STPEACE/ARTICLE/DETAILS/44246695》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109799776A (en) * 2018-12-13 2019-05-24 西安艾润物联网技术服务有限责任公司 Data configuration method and device
CN109799776B (en) * 2018-12-13 2020-10-27 西安艾润物联网技术服务有限责任公司 Data configuration method and device
CN111091468A (en) * 2019-11-14 2020-05-01 泰康保险集团股份有限公司 Policy data processing method and device, storage medium and electronic equipment
CN111091468B (en) * 2019-11-14 2023-08-22 泰康保险集团股份有限公司 Policy data processing method and device, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
CN104298602A (en) Method and device for debugging application program
CN110727581B (en) Crash positioning method and electronic equipment
CN107704256B (en) Method for realizing automatic installation of Python dependent system library on Ubuntu
CN110515620B (en) Automatic resource processing method and system
CN110297808B (en) File modification method and device for container application, computer equipment and storage medium
CN110955715A (en) ERP system, data conversion method and device of target platform and electronic equipment
CN105760289A (en) Debugging method and device of embedded system
CN111104387A (en) Method and device for acquiring data set on server
CN111569431A (en) Game engine resource processing method, electronic device and computer readable storage medium
CN105718307A (en) Process management method and process management device
US9411618B2 (en) Metadata-based class loading using a content repository
US20230267255A1 (en) Semiconductor equipment modeling method and device
CN105204866A (en) Equipment command calling method and system
CN111651352A (en) Warehouse code merging method and device
CN111045941A (en) Positioning method and device of user interface control and storage medium
CN113093748A (en) Robot elevator taking control method and device
CN105677331A (en) Task execution method and device
US11436004B2 (en) Calculating a patch target on an application server
US8527580B2 (en) Saving multiple data items using partial-order planning
CN112612474A (en) Product transplanting method and device, storage medium and electronic equipment
CN111506339A (en) Method and device for processing change information of Software Development Kit (SDK)
CN113032286A (en) Code quality scanning method and device and storage medium
KR101351867B1 (en) Method of handling step execution result in software and application control management object
CN105653290A (en) Data interaction method and system
CN110968566A (en) Migration tool-based domestic application system migration method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20151230

RJ01 Rejection of invention patent application after publication