Disclosure of Invention
The invention provides a sand table system capable of customizing a strategy, which can generate a required strategy model according to requirements, and control internal logic and call required external hardware resources based on a called strategy. The problems that a traditional sand table system model is limited, a strategy cannot be flexibly modified, and interactivity is poor are solved.
The invention is realized by adopting the following sand table system: a customizable policy sandboxed system comprising:
the core control unit is used for generating and storing strategies, controlling and executing internal logic based on the called strategies and calling required external hardware resources;
the IO execution unit is used for realizing the input and output functions of data and realizing the extension of peripheral resources;
the data communication and acquisition unit is used for finishing data communication and data acquisition;
the power supply management unit comprises a charging subunit and a management subunit; the charging subunit comprises: a charging management chip, a wireless charging chip or a battery; the management subunit includes: various power supply chips for different voltage requirements;
wherein the core control unit runs a controller therein, comprising:
the hardware driving layer is used for calling required external hardware resources and carrying out reasonable configuration; a software interface for providing a program using hardware resources;
the system kernel layer is used for managing hardware resources and software resources by a system;
the strategy learning layer is used for generating strategies and extracting strategy related information to store in the strategy table; the policy related information includes: strategy ID, trigger condition, entry address, operation function execution sequence and operation function information;
the data coding layer is used for converting input data in different formats into a system coding format and converting output data in the system coding format into an externally recognizable format;
and the script language analysis layer is used for receiving and executing an externally input script program to create a strategy or execute other modification operations.
Further, the carrier for storing the policy by the core control unit includes: flash, EEPROM, ferroelectric memory, memristor array, or graphene storage.
Further, the data communication and collection unit includes: the data communication subunit and the data acquisition subunit;
the data communication subunit comprises: the interface comprises a USB interface, a WIFI interface, an Ethernet interface, a serial port, an I2C interface, an SPI interface, a PCIE interface or a wireless communication interface;
the data acquisition subunit comprises: a sound sensor, a color sensor, a distance sensor, an image sensor, a speed sensor, a temperature sensor, a light sensor or a gravity sensor.
The invention is realized by adopting the following controllers: a controller capable of customizing a strategy, which runs in a core control unit of the sand table system, comprises:
the hardware driving layer is used for calling required external hardware resources and carrying out reasonable configuration; a software interface for providing a program using hardware resources;
the system kernel layer is used for managing hardware resources and software resources by a system;
the strategy learning layer is used for generating strategies and extracting strategy related information to store in the strategy table; the policy related information includes: strategy ID, trigger condition, entry address, operation function execution sequence and operation function information;
the data coding layer is used for converting input data in different formats into a system coding format and converting output data in the system coding format into an externally recognizable format;
and the script language analysis layer is used for receiving and executing an externally input script program to create a strategy or execute other modification operations.
Further, the operation function includes: built-in operation functions of the system or operation functions added by scripts.
Further, the operation function information includes: operation ID, operation parameters, operation entry address.
Further, the policy ID is obtained by arranging operation entry addresses of the operation functions according to an execution sequence of the operation functions, calculating a hash value, and using the hash value as the policy ID.
The invention adopts the following method to realize the customization of the sand table strategy: a method of customizable policies, comprising:
selecting an operation function required by a strategy to be customized;
extracting operation function information;
generating a policy ID by using the operation function information;
and storing the strategy ID, the trigger condition, the entry address, the execution sequence of the operation function and the operation function information into a strategy table.
Further, the operation function includes: an operation function built in the system or an operation function added by a script.
Further, the operation function information includes: operation ID, operation parameters, operation entry address.
Further, the generating the policy ID by using the operation function information is: and arranging the operation entry addresses according to the execution sequence of the operation functions, calculating a hash value, and taking the hash value as a strategy ID.
Further, the policy can be added, deleted, or modified as needed; the operation function can be added, deleted or modified according to the requirement; the execution order of the operation functions can be modified as needed.
In summary, the invention provides a sandbox system with customizable policies, which includes a core control unit, which is mainly used for generating and storing policies, controlling and executing internal logic based on invoked policies, and invoking required external hardware resources. The invention also provides a controller running in the core control unit, which is mainly used for generating the strategy, storing the strategy into the strategy table and calling the required strategy according to the requirement; external hardware resources and software interfaces are called according to strategy requirements; converting input data in different formats into a system coding format; or converting the output data in the system coding format into an externally recognizable format; the user may utilize a script program to create a new policy or modify an existing policy. Finally, the invention provides a method for customizing a strategy.
The invention has the beneficial effects that: the invention generates a new strategy by using a simple script language according to the requirement by operating the controller in the sand table system, or modifies the existing strategy in the strategy table, thereby avoiding the defects of single point triggering and single response of the traditional sand table model. And the interactivity between the modules in the sand table and the interactivity between the sand table and the user are improved.
Detailed Description
In order to make the technical solutions in the embodiments of the present invention better understood and make the above objects, features, and advantages of the present invention more obvious and understandable, the present invention provides an embodiment of a sand table system with customizable policies, and the technical solutions of the present invention are further described in detail below with reference to the accompanying drawings:
the invention firstly provides a sand table system with customizable strategies, as shown in figure 1, comprising:
a core control unit 101, configured to generate and store a policy, perform control and execution of internal logic based on a called policy, and call a required external hardware resource;
the IO execution unit 102 is used for realizing the input and output functions of data and realizing the extension of peripheral resources;
for example: the IO execution unit is connected with the LED lamp and the drive circuit thereof, so that the LED lamp can be driven; or the IO execution unit is connected with a switch or a key and used for triggering the strategy display customized by the user;
the data communication and acquisition unit 103 is used for completing data communication and data acquisition;
a power management unit 104 including a charging subunit and a management subunit; the charging subunit includes: a charging management chip, a wireless charging chip or a battery; the management subunit includes: and various power supply chips for different voltage requirements.
The input end of each power supply chip can be powered by a lithium battery or an external voltage-stabilized power supply.
For example: the core control unit can output data to the IO execution unit or receive data input by the IO execution unit; the core control unit can utilize a WIFI interface or a USB interface of the data communication and acquisition unit to send or receive data to an external model (or a sand table).
Preferably, the carrier for storing the policy by the core control unit includes: flash, EEPROM, ferroelectric memory, memristor array, or graphene storage.
Preferably, the data communication and collection unit includes: the data communication subunit and the data acquisition subunit;
the data communication subunit includes: the USB interface, the WIFI interface, the Ethernet interface, the serial port, the I2C interface, the SPI interface, the PCIE interface or the wireless communication interface;
the data acquisition subunit comprises: a sound sensor, a color sensor, a distance sensor, an image sensor, a speed sensor, a temperature sensor, a light sensor or a gravity sensor.
The core control unit can share internal strategies or data with other external sand tables or other modules of the sand tables by using the data communication and acquisition unit.
In conclusion, the sand table system can customize the strategy model according to the requirement, and strengthens the interactivity among the sand tables, among the modules in the sand table and between the sand table and the user.
The present invention further provides a controller capable of customizing policies, which operates in a core control unit of the sand table system, as shown in fig. 2, and includes:
the hardware driving layer 201 is used for calling required external hardware resources and carrying out reasonable configuration; a software interface for providing a program using hardware resources; therefore, the program for calling the hardware resources does not need to carry out operations such as configuration or initialization on the hardware, and can directly call the hardware resources only by accessing the corresponding API function;
a system kernel layer 202 for system management of hardware resources and software resources; the method comprises the following steps: storage management of a main memory, file system management, task scheduling management, or encapsulation and scheduling management of a hardware driver; among these, the system kernel types include, but are not limited to: unix, linux, UCOS, windows, or iOS;
the strategy learning layer 203 is used for generating strategies and extracting strategy related information to store in a strategy table; the policy related information includes: strategy ID, trigger condition, entry address, operation function execution sequence and operation function information;
when the trigger condition of the strategy in a certain strategy table is met, triggering the process defined by the strategy ID, and executing the operation functions one by one from the entry address according to the execution sequence of the operation functions, thereby realizing the display process defined by the strategy;
the data coding layer 204 is used for converting input data in different formats into a system coding format and converting output data in the system coding format into an externally recognizable format;
the input or output data format includes, but is not limited to: unicode, utf8, ANSI, or ASCII;
and the scripting language parsing layer 205 is used for receiving and executing externally input scripting programs to create strategies or perform other modification operations. For example: the luau interpreter is transplanted to the embedded environment for implementation.
Preferably, the operation function includes: an operation function built in the system or an operation function added by a script.
Preferably, the operation function information includes: operation ID, operation parameters, operation entry address.
The operating parameter may be a specific operation that the operating function needs to perform.
Preferably, the policy ID is obtained by arranging operation entry addresses of the operation functions according to an execution sequence of the operation functions, calculating a hash value, and using the hash value as the policy ID.
In summary, the controller is configured to drive external hardware resources to implement a data input/output function, and reasonably allocate resources within the system according to priorities of system hardware or software resources; carrying out unified coding on the received input data with different formats; the customization and modification of the sand table strategy of the system and the triggering operation and execution of the strategy can be realized by a user through an interpreter of the embedded script language.
The invention finally provides a method for customizing a policy, as shown in fig. 3, comprising:
s301, selecting an operation function required by a strategy to be customized;
s302, extracting operation function information;
s303, generating a strategy ID by using the operation function information;
s304 stores the policy ID, the trigger condition, the entry address, the execution order of the operation functions, and the operation function information into the policy table.
Preferably, the operation function includes: built-in operation functions of the system or operation functions added by scripts.
Preferably, the operation function information includes: operation ID, operation parameters, operation entry address.
More preferably, the generating a policy ID by using the operation function information is: and arranging the operation entry addresses according to the execution sequence of the operation functions, calculating a hash value, and taking the hash value as a strategy ID.
Preferably, the policy can be added, deleted or modified as needed; the operation function can be added, deleted or modified according to the requirement; the execution order of the operation functions can be modified as needed.
The storing the policy ID, the trigger condition, the entry address, the execution sequence of the operation function, and the operation function information into the policy table specifically includes: after a user generates a strategy through an operation function, distributing an area for the strategy according to the service condition of a strategy table, wherein the area is used for storing the relevant information of the strategy; mapping the entry address of the first operation function in the strategy and the variable value address of the operation function to the distributed area respectively; and after the first operation function is executed, other operation functions are continuously executed according to the execution sequence of the operation functions until the end.
In summary, the method for customizing the policy in the sand table system includes: selecting a required operation function by analyzing the strategy to be customized, extracting operation function information, and calculating to obtain a strategy ID based on the operation function information; storing the strategy ID, the trigger condition, the entry address, the execution sequence of the operation function and the information of the operation function into a strategy table; in subsequent demonstrations, the required policies may be invoked as needed.
The sand table system provided by the invention is different from the traditional sand table with a single strategy, a single point of trigger and a single response. The sand table system disclosed by the invention can customize the strategy according to the requirement and store the strategy into the strategy table; selecting a strategy to be called from the strategy table when needed; the controller manages hardware resources and software resources according to the strategy to be called, and further cooperates with an IO execution unit, a data communication and acquisition unit and a power management unit of the sand table system to display the display effect defined by the strategy. Therefore, deep interactivity and high autonomy between the user and the sand table, between the sand table and between modules in the sand table are achieved.
The above examples are intended to illustrate but not to limit the technical solutions of the present invention. Any modification or partial replacement without departing from the spirit and scope of the present invention should be covered in the claims of the present invention.