Summary of the invention
The present invention provide a kind of can the sand table system of custom strategies, it is possible to generate required Policy model as required, and carry out the control of inner logic and calling of required outside hardware resource based on the strategy called. Solve tradition sand table system model limited, strategy can not be revised flexibly, the problems such as interactivity difference.
The present invention adopts following sand table system to realize: a kind of can the sand table system of custom strategies, comprising:
Core control unit, for generating and storage policy, carries out control and the execution of inner logic, and carries out calling of required outside hardware resource based on the strategy called;
IO actuator unit, for realizing the input and output function of data, and realizes peripheral hardware resource expansion;
Data communication and collecting unit, for completing data communication and data gathering;
Power supply Administrative Unit, comprises charging subelement and management subelement; Described charging subelement, comprising: charging management chip, wireless charging chip or battery; Described management subelement, comprising: the various power supply chips of the different voltage requirements of reply.
Further, described core control unit comprises for the carrier of storage policy: Flash, EEPROM, ferroelectric memory, memristor array or Graphene store.
Further, described data communication and collecting unit, comprising: data communication subelement and data gathering subelement;
Described data communication subelement, comprising: USB interface, WIFI interface, Ethernet interface, serial ports, I2C interface, SPI interface, PCIE interface or wireless communication interface;
Described data gathering subelement, comprising: sound sensor device, color sensor, rang sensor, image sensor, velocity sensor, temperature sensor, light sensor or gravity sensitive device.
The present invention adopts following controller to realize: a kind of can the controller of custom strategies, run in the core control unit of above-mentioned sand table system, comprising:
Hardware driving layer, for calling required outside hardware resource and carry out reasonable disposition; For for using the program of hardware resource to provide software interface;
System inner nuclear layer, for system administration hardware resource and software resource;
Policy learning layer, for generation strategy and extract strategy relevant information be stored in Policy Table; Described strategy relevant information, comprising: strategy ID, triggering condition, enter port address, operation function execution order and operation function information;
The output data of system coding form for the input data of different-format are converted to system coding form, and are converted to outside and can identify form by data encoding layers;
Script language parse layer, carrys out construction strategy for receiving and perform the outside shell script inputted or performs other retouching operations.
Further, described operation function comprises: the operation function that system is built-in or the operation function that script adds.
Further, described operation function information, comprising: operates ID, operating parameters, operate into port address.
Further, described strategy ID is, the operation of each operation function enters port address and arranges according to the execution order of described operation function, and calculate hash value, using described hash value as strategy ID.
The present invention adopts the customization realizing sand table strategy with the following method: a kind of can the method for custom strategies, comprising:
Choose the operation function treated needed for custom strategies;
Extraction operation function information;
Utilize described operation function information generation strategy ID;
By strategy ID, triggering condition, enter port address, operation function execution order and operation function information be stored in Policy Table.
Further, described operation function comprises: the operation function that system is built-in or the operation function that script adds.
Further, described operation function information, comprising: operates ID, operating parameters, operate into port address.
Further, described the described operation function information generation strategy ID is utilized to be: each to be operated and carry out arranging according to the execution order of described operation function into port address and calculate hash value, using described hash value as tactful ID.
Further, described strategy can increase newly as required, deletes or revise; Described operation function can increase newly as required, deletes or revise; The execution order of described operation function can be modified as required.
To sum up, the present invention provide a kind of can the sand table system of custom strategies, comprise core control unit, be mainly used in generating and storage policy, carry out control and the execution of inner logic based on the strategy called, and carry out calling of required outside hardware resource. The present invention gives a kind of operation in the controller of core control unit, be mainly used in generation strategy and storage policy to, in Policy Table, calling required strategy as required;And outside hardware resource and software interface is called according to policy requirement; And the input data of different-format are converted to system coding form; Or the output data of system coding form are converted to the form that outside can identify; User can utilize shell script to create new strategy or the existing strategy of amendment. Finally, The present invention gives a kind of can the method for custom strategies.
The useful effect of the present invention is: the present invention is by operation controller in sand table system, the strategy utilizing simple script language generation new as required, or the existing strategy in Policy Table is modified, avoids tradition sand table model single-point and trigger the shortcoming with single response. And improve in sand table between module and module, the interactivity between sand table and user.
Embodiment
The present invention gives a kind of can the sand table system embodiment of custom strategies, in order to make those skilled in the art understand the technical scheme in the embodiment of the present invention better, and the above-mentioned purpose of the present invention, feature and advantage are become apparent more, below in conjunction with accompanying drawing, technical scheme in the present invention is described in further detail:
The present invention provide firstly a kind of can the sand table system of custom strategies, as shown in Figure 1, comprising:
Core control unit 101, for generating and storage policy, carries out control and the execution of inner logic, and carries out calling of required outside hardware resource based on the strategy called;
IO actuator unit 102, for realizing the input and output function of data, and realizes peripheral hardware resource expansion;
Such as: utilize described IO actuator unit to be connected with LED and driving circuit thereof, LED can be driven; Or utilize described IO actuator unit to be connected with switch or button, for triggering the strategy displaying of customization;
Data communication and collecting unit 103, for completing data communication and data gathering;
Power supply Administrative Unit 104, comprises charging subelement and management subelement; Described charging subelement, comprising: charging management chip, wireless charging chip or battery; Described management subelement, comprising: the various power supply chips of the different voltage requirements of reply.
Wherein, the input terminus of various power supply chip is powered by lithium cell or by external stabilized power.
Such as: core control unit can export data to IO actuator unit, or receives the data of IO actuator unit input; Core control unit can utilize WIFI interface or USB interface externally model (or sand table) transmission or the reception data of data communication and collecting unit.
Preferably, described core control unit comprises for the carrier of storage policy: Flash, EEPROM, ferroelectric memory, memristor array or Graphene store.
Preferably, described data communication and collecting unit, comprising: data communication subelement and data gathering subelement;
Described data communication subelement, comprising: USB interface, WIFI interface, Ethernet interface, serial ports, I2C interface, SPI interface, PCIE interface or wireless communication interface;
Described data gathering subelement, comprising: sound sensor device, color sensor, rang sensor, image sensor, velocity sensor, temperature sensor, light sensor or gravity sensitive device.
Wherein, described core control unit can utilize and share inner strategy or data between other modules of described data communication and collecting unit and other sand tables outside or sand table.
To sum up, above-mentioned sand table system can custom strategies model as required, and strengthen between sand table, the interactivity between the module in sand table, between sand table and user.
The present invention secondly provide a kind of can the controller of custom strategies, run in the core control unit of above-mentioned sand table system, as shown in Figure 2, comprising:
Hardware driving layer 201, for calling required outside hardware resource and carry out reasonable disposition; For for using the program of hardware resource to provide software interface; Therefore, the program calling hardware resource does not need to be configured by hardware or the operation such as initialize, only just can directly need to call by accessing corresponding api function;
System inner nuclear layer 202, for system administration hardware resource and software resource; Comprise: the store management of primary storage, file system management, Portable Batch System or to the encapsulation of hardware drive program and management and running; Wherein, system core type comprises but is not limited only to: Unix, Linux, UCOS, Windows or iOS;
Policy learning layer 203, for generation strategy and extract strategy relevant information be stored in Policy Table; Described strategy relevant information, comprising: strategy ID, triggering condition, enter port address, operation function execution order and operation function information;
Wherein, when the triggering condition of the strategy in a certain Policy Table is met, then trigger the process that this strategy ID defines, from entering port address, perform one by one according to described operation function execution order by each operation function, thus realize the displaying process of this policy definition;
The output data of system coding form for the input data of different-format are converted to system coding form, and are converted to outside and can identify form by data encoding layers 204;
Wherein, input or output data layout, comprise but be not limited only to: Unicode, utf8, ANSI or ASCII;
Script language parse layer 205, carrys out construction strategy for receiving and perform the outside shell script inputted or performs other retouching operations. Such as: luau is explained, and device is transplanted in embedded environment and is realized.
Preferably, described operation function comprises: the operation function that system is built-in or the operation function that script adds.
Preferably, described operation function information, comprising: operates ID, operating parameters, operate into port address.
Described operating parameters can be the concrete operation that this operation function needs to perform.
Preferably, described strategy ID is, the operation of each operation function enters port address and arranges according to the execution order of described operation function, and calculate hash value, using described hash value as strategy ID.
To sum up, for driving, outside hardware resource realizes the input and output function of data to above-mentioned controller, according to the priority of system hardware or software resource, the resource of internal system is carried out properly distributed; The input data of the different-format received are carried out Unified coding; Can by the explanation device of embedded script language, it is achieved user is to the customization of the sand table strategy of system and amendment, and the triggering of strategy operates and execution.
The present invention finally provide a kind of can the method for custom strategies, as shown in Figure 3, comprising:
S301 chooses the operation function treated needed for custom strategies;
S302 extraction operation function information;
S303 utilizes described operation function information generation strategy ID;
S304 by strategy ID, triggering condition, enter port address, operation function execution order and operation function information be stored in Policy Table.
Preferably, described operation function comprises: the operation function that system is built-in or the operation function that script adds.
Preferably, described operation function information, comprising: operates ID, operating parameters, operate into port address.
More preferably, described the described operation function information generation strategy ID is utilized to be: each to be operated and carry out arranging according to the execution order of described operation function into port address and calculate hash value, using described hash value as tactful ID.
Preferably, described strategy can increase newly as required, deletes or revise; Described operation function can increase newly as required, deletes or revise; The execution order of described operation function can be modified as required.
Wherein, described by strategy ID, triggering condition, enter port address, operation function execution order and operation function information be stored in Policy Table, specifically comprise: after user is by operation function generation strategy, by the service condition according to Policy Table be this strategy distribution one piece of region, for storing this strategy relevant information; By the variate-value address of in this strategy first operation function entrance address and this operation function, video in range of distribution respectively; After operating function execution when first, can continue to perform other according to described operation function execution order and operate functions, until terminating.
To sum up, in above-mentioned sand table system can the method for custom strategies, comprising: treat custom strategies by analyzing, choose required operation function, and extraction operation function information, and calculate strategy ID based on operation function information; And by strategy ID, triggering condition, enter port address, operation function execution order and operation function information be stored in Policy Table; In follow-up displaying, it is possible to call required strategy as required.
Sand table system provided by the present invention, triggers different with the sand table of single response from traditional single strategy, single-point. Sand table system disclosed in this invention can custom strategies as required, and be stored in Policy Table; From Policy Table, strategy to be called is then chosen when needs; Described controller comes hardware management resource and software resource according to strategy to be called, and matches with the IO actuator unit of sand table system, data communication and collecting unit, power supply Administrative Unit further, shows the displaying effect of this policy definition. Thus achieve user and sand table, and between sand table and sand table, the dark interactivity between the inner each module of sand table and height autonomy.
The technical scheme of above embodiment unrestricted the present invention in order to explanation. Do not depart from any modification or partial replacement of spirit and scope of the invention, all should be encompassed in the middle of the right of the present invention.