Terminal device LED lamp logic management method, system, device and medium
Through the customized LED logic management language, the LED characteristic scene logic strategy is constructed and registered, and the display effect of terminal devices and LED lights is decoupled, which solves the problems of single display effect and difficult management of LED lights in the existing technology, achieving lower R&D and production costs, as well as stronger personalized functions and user experience.
Patent Information
- Application Number
- CN202411779958.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-04-15
AI Technical Summary
The LED light display effect of existing terminal equipment is single, the user-defined scenes are not effective, and the software management is difficult, which leads to high R&D costs and maintenance difficulties, reducing the price competitiveness of the product.
The LED characteristic scene logic policies are built through a custom LED logic management language, and these policies are registered to decouple the display effect of the LED light from the terminal device to achieve dynamic control of the LED light display effect.
It improves the portability, maintainability and scalability of the LED light logic system of terminal equipment, reduces R&D and production costs, and enhances the personalized functions and user experience of the product.
Smart Images

Figure CN119835816A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a terminal device LED lamp logic management method, system, device and medium. Background Art
[0002] The mainstream home gateway terminal devices on the market generally carry more LED lights, but the display effect is single, the user-defined scene is effective, and the software management is difficult. These LEDs, as key indicator signs of terminal devices, are usually ignored by the software development and management field, and it is impossible to conduct in-depth system management and development of the display effect of LED lights. With the evolution of broadband access, terminal devices such as home gateways are becoming more and more popular, and market competition is becoming increasingly fierce. How to reduce material costs, enrich product personality functions, enhance customer experience, and improve product competitiveness is an urgent problem to be solved. In order to enrich and maximize the presentation of the LED display effect of terminal devices, the existing technology directly manages the GPIO drive pins and hard-codes the scene effects in the terminal devices. Although the LED display effects of different scenes can be achieved, it invisibly increases the R&D cost of the product, increases the difficulty of equipment maintenance, reduces the competitiveness of the product price advantage, and also increases the economic burden of the target users. Summary of the invention
[0003] To solve the above problems, the present invention provides a terminal device LED light logic management method, system, device and medium, which decouple the display effect of the LED light from the terminal device, improve the portability, maintainability and scalability of the terminal device LED light logic system, and reduce the R&D cost and production cost of the terminal device.
[0004] To achieve the above object, the present invention adopts the following technical solutions:
[0005] In a first aspect, the present invention provides a terminal device LED lamp logic management method, comprising:
[0006] Build LED feature scene logic strategy based on custom LED logic management language, and register LED feature scene logic strategy;
[0007] The LED characteristic status under the LED characteristic scenario is presented in a digital form and used as the data source for executing the LED characteristic scenario logic strategy;
[0008] Monitor the changes in the LED characteristic state in the data source, and execute the corresponding logical tasks in the LED characteristic scene logic strategy according to the changed LED characteristic state;
[0009] Adapt the virtual LED logo to the actual physical LED lamp pin, and control the virtual LED logo to respond to the corresponding logic task in the LED characteristic scene logic strategy;
[0010] Based on the adaptation of the virtual LED logo and the actual physical LED lamp pin, the physical LED lamp pin is controlled to respond to the corresponding logical tasks in the LED characteristic scene logic strategy.
[0011] Furthermore, after building the LED characteristic scene logic strategy based on the customized LED logic management language and registering the LED characteristic scene logic strategy, it also includes:
[0012] Store the registered LED feature scene logic strategy in the specified path and load the LED feature scene logic strategy.
[0013] Furthermore, after the LED characteristic state under the LED characteristic scene is presented in a digital form and used as a data source for executing the LED characteristic scene logic strategy, it also includes:
[0014] Monitor the changes of LED characteristic states during the operation of the terminal equipment, and modify the LED characteristic states in the data source according to the changes of the LED characteristic states.
[0015] Furthermore, before monitoring the LED characteristic state change in the data source and executing the corresponding logic task in the LED characteristic scene logic strategy according to the changed LED characteristic state, it also includes:
[0016] Respond to the modification of the LED characteristic state in the data source in real time, and send unicast messages according to the change status of the LED characteristic state.
[0017] Further, responding to the modification of the LED characteristic state in the data source in real time and sending a unicast message according to the change state of the LED characteristic state includes:
[0018] Respond to the modification of the LED characteristic state in the data source in real time. If the received LED characteristic state has not changed compared with the current LED characteristic state, no processing is performed; if the received LED characteristic state has changed compared with the current LED characteristic state, the current LED characteristic state is modified to the received LED characteristic state, and a unicast message of the LED characteristic state change is sent.
[0019] Furthermore, the LED characteristic scene logic strategy is a script described in a custom LED logic management language, which is loaded and parsed by a custom LED characteristic interpreter.
[0020] Furthermore, it also includes: recording the log of the logical tasks in the execution of the LED characteristic scene logic strategy and the log of the system operation.
[0021] In a second aspect, the present invention further provides a terminal device LED lamp logic management system, comprising:
[0022] Application module, used to build LED feature scene logic strategy based on custom LED logic management language and register LED feature scene logic strategy;
[0023] The presentation module is used to present the LED characteristic status in the LED characteristic scenario in a digital form and serve as a data source for executing the LED characteristic scenario logic strategy;
[0024] The logic module is used to monitor the changes in the LED characteristic state in the data source, and execute the corresponding logic tasks in the LED characteristic scene logic strategy according to the changed LED characteristic state;
[0025] An abstract module is used to adapt the virtual LED logo to the actual physical LED lamp pin, and control the virtual LED logo to respond to the corresponding logic task in the LED characteristic scene logic strategy;
[0026] The physical module is used to control the physical LED lamp pins to respond to the corresponding logical tasks in the LED characteristic scene logic strategy based on the adaptation of the virtual LED logo and the actual physical LED lamp pins.
[0027] In a third aspect, the present invention further provides an electronic device, comprising: a processor and a memory;
[0028] The processor is coupled to the memory;
[0029] The processor is used to read and execute the program or instructions stored in the memory, so that the device executes the method of the first aspect.
[0030] In a fourth aspect, the present invention further provides a computer-readable storage medium storing a computer program, which implements the method of the first aspect when executed by a processor.
[0031] The technical solution provided by the present invention has at least the following technical effects or advantages:
[0032] The present invention provides a terminal device LED light logic management system. According to the proximity of the underlying hardware and user interaction, a five-layer terminal LED logic management system is established to manage the display effect of the LED light, including a physical module, an abstract module, a logic module, a representation module, and an application module. A customized LED logic management language is used to customize the LED characteristic scene logic strategy of different functions. The application module registers the customized LED characteristic scene logic strategy to the logic module, and modifies the LED characteristic state in the data source of the representation module by real-time monitoring the changes of the LED characteristic state during operation. The logic module executes the corresponding logic task in the LED characteristic scene logic strategy according to the modified LED characteristic state. The abstract layer and the physical layer respond to the corresponding logic task, and finally realize the dynamic control of the display effect of the LED light. This scheme can decouple the display effect of the LED light from the terminal device by means of a customized LED characteristic scene logic strategy, greatly reducing the development cost of the terminal device and the coupling problem in the development process; the abstract module constructs a virtual identifier corresponding to the physical LED light. By adapting the virtual identifier to the pin of the physical LED light, the cross-platform inheritance problem of the LED logic management system and the customization and maintenance problems of multi-operator equipment types can be solved. The technical solution of the present invention decouples the display effect of the LED lamp from the terminal device, improves the portability, maintainability and scalability of the LED lamp logic system of the terminal device, and reduces the research and development cost and production cost of the terminal device.
[0033] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0035] Figure 1 A schematic diagram of a process flow of a method for logical management of LED lights of a terminal device according to an embodiment of the present invention;
[0036] Figure 2 This is a schematic diagram of the structure of a terminal device LED light logic management system in an embodiment of the present invention;
[0037] Figure 3A schematic diagram of a five-layer structure of a terminal device LED logic management system in an embodiment of the present invention;
[0038] Figure 4 This is a schematic diagram of the marquee effect of the LED light of the terminal device in an embodiment of the present invention;
[0039] Figure 5 A schematic diagram of the control flow of LED characteristics by the local control unit and the remote control unit in the application module in an embodiment of the present invention;
[0040] Figure 6 The present invention is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0042] In actual applications, home gateway terminal devices have different business scenarios, and different business scenarios correspond to different LED light display effects. LED characteristics represent specific functions or capabilities related to LED light display. LED characteristics can be determined based on actual product requirements and business scenarios. According to the LED characteristics of different scenarios, corresponding LED characteristic scene logic strategies can be constructed to describe the basic properties and logical tasks of the LED characteristics in the scenario. In existing terminal devices, the LED characteristic scene logic strategy is bound to the terminal device in a hard-coded manner, and the LED characteristic scene logic strategy cannot be customized, that is, the logic strategy and display effect of the LED light cannot be further adjusted dynamically. Therefore, with the gradual intensification of competitive pressure on home gateway terminal devices, how to reduce product R&D costs, enrich personalized product functions, and enhance product competitiveness in the ultra-low-cost market is an urgent problem to be solved.
[0043] Figure 1 A terminal LED light logic management method according to an embodiment of the present invention is shown in the figure. The method includes:
[0044] S101, constructing an LED characteristic scene logic strategy based on a custom LED logic management language, and registering the LED characteristic scene logic strategy;
[0045] S102, presenting the LED characteristic state under the LED characteristic scene in a digital form, and using it as a data source for executing the LED characteristic scene logic strategy;
[0046] S103, monitoring the change of the LED characteristic state in the data source, and executing the corresponding logic task in the LED characteristic scene logic strategy according to the changed LED characteristic state;
[0047] S104, adapting the virtual LED identifier to the actual physical LED lamp pin, and controlling the virtual LED identifier to respond to the corresponding logic task in the LED characteristic scene logic strategy;
[0048] S105 . Based on the adaptation between the virtual LED identifier and the actual physical LED lamp pin, control the physical LED lamp pin to respond to the corresponding logic task in the LED characteristic scene logic strategy.
[0049] Furthermore, after building the LED characteristic scene logic strategy based on the customized LED logic management language and registering the LED characteristic scene logic strategy, it also includes:
[0050] Store the registered LED feature scene logic strategy in the specified path and load the LED feature scene logic strategy.
[0051] Furthermore, after the LED characteristic state under the LED characteristic scene is presented in a digital form and used as a data source for executing the LED characteristic scene logic strategy, it also includes:
[0052] Monitor the changes of LED characteristic states during the operation of the terminal equipment, and modify the LED characteristic states in the data source according to the changes of the LED characteristic states.
[0053] Furthermore, before monitoring the LED characteristic state change in the data source and executing the corresponding logic task in the LED characteristic scene logic strategy according to the changed LED characteristic state, it also includes:
[0054] Respond to the modification of the LED characteristic state in the data source in real time, and send unicast messages according to the change status of the LED characteristic state.
[0055] Further, responding to the modification of the LED characteristic state in the data source in real time and sending a unicast message according to the change state of the LED characteristic state includes:
[0056] Respond to the modification of the LED characteristic state in the data source in real time. If the received LED characteristic state has not changed compared with the current LED characteristic state, no processing is performed; if the received LED characteristic state has changed compared with the current LED characteristic state, the current LED characteristic state is modified to the received LED characteristic state, and a unicast message of the LED characteristic state change is sent.
[0057] Furthermore, the LED characteristic scene logic strategy is a script described in a custom LED logic management language, which is loaded and parsed by a custom LED characteristic interpreter.
[0058] Furthermore, it also includes: recording the log of the logical tasks in the execution of the LED characteristic scene logic strategy and the log of the system operation.
[0059] Based on the same technical concept of the above-mentioned terminal LED light logic management method, Figure 2 This is a schematic diagram of the structure of a terminal device LED light logic management system according to an embodiment of the present invention. As shown in the figure, the system includes:
[0060] An application module, used to construct an LED characteristic scene logic strategy based on a custom LED logic management language, and register the LED characteristic scene logic strategy;
[0061] A representation module, used to present the LED characteristic state under the LED characteristic scenario in a digital form and serve as a data source for executing the LED characteristic scenario logic strategy;
[0062] A logic module, used to monitor the change of LED characteristic state in the data source, and execute corresponding logic tasks in the LED characteristic scene logic strategy according to the changed LED characteristic state;
[0063] An abstract module, used to adapt the virtual LED logo to the actual physical LED lamp pin, and control the virtual LED logo to respond to the corresponding logic task in the LED characteristic scene logic strategy;
[0064] The physical module is used to control the physical LED lamp pins to respond to the corresponding logical tasks in the LED characteristic scene logic strategy based on the adaptation of the virtual LED identifier and the actual physical LED lamp pins.
[0065] It should be noted that, for the sake of convenience, Figure 2 For example, only the main modules of the terminal LED light logic management system structure are shown. In actual applications, the system may also include modules or components not shown in the figure; the system is not limited to the above module structure, but may also be other module structures that implement the above method embodiments.
[0066] The present invention provides a terminal device LED light logic management system, which establishes a five-layer terminal device LED logic management system (such as Figure 3 As shown), the display effect of LED lights is managed, including physical modules, abstract modules, logic modules, representation modules, and application modules. A customized LED logic management language is used to customize LED characteristic scene logic strategies with different functions. The application module registers the customized LED characteristic scene logic strategy to the logic module, and modifies the LED characteristic state in the data source of the representation module by real-time monitoring of the changes in the LED characteristic state during operation. The logic module executes the corresponding logic tasks in the LED characteristic scene logic strategy according to the modified LED characteristic state. The abstract layer and the physical layer respond to the corresponding logic tasks, and finally realize the dynamic control of the display effect of the LED light. This solution can decouple the display effect of the LED light from the terminal device by means of a customized LED characteristic scene logic strategy, greatly reducing the development cost of the terminal device and the coupling problem in the development process; the abstract module constructs a virtual identifier corresponding to the physical LED light. By adapting the virtual identifier to the pin of the physical LED light, the cross-platform inheritance problem of the LED logic management system, the customization and maintenance of multiple operator equipment types can be solved. The technical solution of the present invention decouples the display effect of the LED lamp from the terminal device, improves the portability, maintainability and scalability of the LED lamp logic system of the terminal device, and reduces the research and development cost and production cost of the terminal device.
[0067] The application module registers the LED feature scene logic strategy built based on the custom LED logic management language to the logic module. According to the product requirements and business scenarios of the terminal equipment, common scenarios of the terminal equipment are planned, including the Internet broadband address status scenario, the Internet broadband connection scenario, the device MESH connection scenario, the connection scenario of the downstream device, etc.; the LED features corresponding to common scenarios include:
[0068] (1) Internet broadband address feature, marked as LED_FEATURE_INTERNET_ADDRESS, indicating whether the broadband has obtained the address;
[0069] (2) Internet broadband connection Internet feature, marked as LED_FEATURE_INTERNET_STATUS;
[0070] (3) MESH connection scene feature, marked as LED_FEATURE_MESH_STATUS, indicating whether the terminal device MESH networking is successful;
[0071] (4) Characteristics of the devices connected to the terminal, wherein the connection status characteristic of the connected device DEV1 is identified as LED_FEATURE_LAN_DEV1; the connection status characteristic of the connected device DEV2 is identified as LED_FEATURE_LAN_DEV2; and the connection status characteristic of the connected device DEV3 is identified as LED_FEATURE_LAN_DEV3, which respectively represent the connection status of the LAN side devices DEV1, DEV2, and DEV3.
[0072] LED characteristics can also be determined based on actual product requirements and business scenarios, and are not limited to the above-mentioned LED characteristics.
[0073] In order to better describe the LED characteristic scene logic strategy corresponding to the LED characteristics, a customized LED logic management language is created, and the LED logic management language is used to define the LED to determine the specific LED characteristic scene logic strategy. The LED logic management language fled syntax is as follows:
[0074] Data structure: Data is stored in the form of key-value pairs; data items are separated by commas ","; objects are represented by "{}"; arrays are represented by "[]";
[0075] Key-value pair: The key must be a string; the key name and value are separated by ":"; the value can be a string, number, Boolean value, null, array, or object;
[0076] String: Strings are wrapped in """; they can contain any characters, including special characters; special characters in strings need to be escaped, such as "\n" for line breaks and "\"" for double quotes themselves;
[0077] Value: The value can be an integer;
[0078] Boolean type: can only be "true" or "false";
[0079] "null": indicates no value or empty value;
[0080] Array: The elements in the array can be any elements that conform to the fled syntax; the elements are separated by ",";
[0081] Object: The keys in an object must be strings; key-value pairs are separated by “,”.
[0082] A custom LED logic management language is used to describe the LED characteristic scene logic strategy corresponding to the LED characteristic. The LED characteristic scene logic strategy includes the basic properties and logic tasks of the LED characteristics under the scenario, including: LED state machine name, LED characteristic identifier, LED characteristic state, and LED characteristic logic task. The LED characteristic identifier registered in the LED characteristic scene logic strategy can be one or more LED characteristic identifiers; the LED characteristic logic task corresponds to the LED characteristic identifier and the LED characteristic state. The state machine name refers to the name corresponding to the state machine in the system that ultimately executes the LED characteristic logic task.
[0083] For example, the LED feature scene logic strategy is a script written in the LED logic management language. Taking the LED feature "LED_FEATURE_INTERNET_ADDRESS" corresponding to the Internet broadband address feature as an example, the LED display requirement is "green light for Internet address acquisition and red light for no address", and the script product_internet.fled is:
[0084]
[0085]
[0086] in,
[0087] states: indicates the state machine object corresponding to the LED feature scene logic strategy. It is an array type. One LED feature scene logic strategy can contain multiple state machine objects.
[0088] name: indicates the name of the LED state machine;
[0089] description: A detailed description of the state machine, describing the specific tasks to be done. Here, it means that the state machine needs to complete the task "Internet obtains an address and displays a green light, and no address displays a red light";
[0090] transitions: mainly describes which LED characteristic identifiers the state machine needs to process. The LED characteristics included here can be one LED characteristic identifier or a combination of multiple LED characteristic identifiers.
[0091] Actions: describes the state of the state machine and the logical tasks corresponding to the LED characteristics that need to be performed during the process, such as:
[0092] LED_FEATURE_INTERNET_ADDRESS":{
[0093] "state":"on"
[0094] "type":"light_on"
[0095] "description":"green"
[0096] "parameters":{
[0097] "leds":[GPIO_LED_1]
[0098] }
[0099] }
[0100] state: indicates the state value on / off of each LED characteristic state machine. This state corresponds to the LED characteristic state. When the LED characteristic state is 0, it corresponds to off, and when the LED characteristic state is 1, it corresponds to on.
[0101] type: indicates the task to be executed when the state value of the LED characteristic state machine is met. The task provides three corresponding operations: light_null, light_sequence, light_on and light_off; light_null means no execution; light_sequence means sequential loop execution; light_on and light_off mean the execution of displaying green light and red light;
[0102] description: indicates the display effect of the state machine corresponding to the LED characteristic state;
[0103] parameters: indicates the parameters when executing the task, defining the specific task target object and the corresponding task parameters; leds: indicates the target task object;
[0104] When the state of the LED feature LED_FEATURE_INTERNET_ADDRESS is on, the virtual LED identifier GPIO_LED_1 executes the light_on task, and at the same time, the physical LED pin GPIO is pulled high, and the LED light is displayed as green (that is, the display effect described in description);
[0105] LED_FEATURE_INTERNET_ADDRESS":{
[0106] "state":"off"
[0107] "type":"light_off"
[0108] "description":"red"
[0109] "parameters":{
[0110] "leds":[GPIO_LED_1]
[0111] },
[0112] }
[0113] When the state of the LED feature LED_FEATURE_INTERNET_ADDRESS is off, the virtual LED identifier GPIO_LED_1 executes the light_off task, and at the same time, the physical LED pin GPIO is pulled down, and the LED light is displayed as red (that is, the display effect described in description);
[0114] LED_FEATURE_INTERNET_ADDRESS":{
[0115] "state":"off"
[0116] "type":"light_sequence"
[0117] "parameters":{
[0118] "leds":[GPIO_LED_1, GPIO_LED_2, GPIO_LED_3, GPIO_LED_4, GPIO_LED_5, GPIO_LED_6, GPIO_LED_7, GPIO_LED_8]
[0119] "interval":300
[0120] }
[0121] },
[0122] When the state of LED feature LED_FEATURE_INTERNET_ADDRESS is on, the virtual LEDs are labeled GPIO_LED_1-GPIO_LED_8, and the light_sequence task is executed. The corresponding physical LED lights are lit in sequence at an interval of 300ms to achieve a marquee effect (such as Figure 4 shown).
[0123] The business module of the application module includes a local control unit and a remote control unit. The local control unit registers the LED characteristic scene logic policy to the local device, and the remote control unit registers the LED characteristic scene logic policy to the downstream terminal device. After the LED characteristic scene logic policy is constructed using a custom LED logic management language, the control unit in the application module calls the registration interface provided by the logic module to register the LED characteristic scene logic policy to the logic module; the local control unit in the application module registers the LED characteristic scene logic policy to the logic module of the local device; the remote control unit registers the LED characteristic scene logic policy to the logic module of the downstream terminal device. The functions of each control unit of the application module also include being responsible for monitoring the changes in the LED characteristic status of the terminal device during operation in the background, and interacting with the representation module through the interface, and calling the modification interface of the representation module to modify the corresponding LED characteristic status data according to the changes in the LED characteristic status. The local control unit interacts with the representation module of the local device; the remote control unit interacts with the representation module in the downstream device. Such as Figure 5 shown.
[0124] Based on the common scenarios and corresponding LED characteristics planned above, the representation module uses the TR181 data model representation method commonly used in the industry to present LED characteristics data. The sub-object Led.Feature is defined under the root object Device during system operation to represent a specific LED feature object. The LED feature object holds the LED feature status. Exemplarily, the definition of the above LED characteristics in the representation module is as follows:
[0125] (1) Storage and definition of LED_FEATURE_INTERNET_ADDRESS feature:
[0126] The data storage path is Device.Led.Feature.Internet_address, Boolean type, default is 0; Device.Led.Feature.Internet_address is 0, which means that the broadband does not obtain the address; Device.Led.Feature.Internet_address is 1, which means that the broadband obtains the address;
[0127] (2) LED_FEATURE_INTERNET_STATUS feature representation layer storage and definition:
[0128] The data storage path is Device.Led.Feature.Internet_status, Boolean type, default value is 0; Device.Led.Feature.Internet_status is 0, which means that the broadband cannot connect to the Internet; Device.Led.Feature.Internet_status is 1, which means that the broadband can connect to the Internet;
[0129] (3) LED_FEATURE_MESH_STATUS feature representation layer storage and definition:
[0130] The data storage path is Device.Led.Feature.Mesh_status, Boolean type, default is 0; Device.Led.Feature.Mesh_status is 0, indicating that Wi-Fi mesh networking is not successful; Device.Led.Feature.Mesh_status is 1, indicating that Wi-Fi mesh networking is successful;
[0131] (4) LED_FEATURE_DEV1 feature representation layer storage and definition:
[0132] The data storage path is Device.Led.Feature.Dev1_status, Boolean type, default is 0; Device.Led.Feature.Dev1_status is 0, which means Dev1 is not connected; Device.Led.Feature.Dev1_status is 1, which means Dev1 is connected;
[0133] (5) LED_FEATURE_DEV2 feature representation layer storage and definition:
[0134] The data storage path is Device.Led.Feature.Dev2_status, Boolean type, default is 0; Device.Led.Feature.Dev2status is 0, which means Dev2 is not connected; Device.Led.Feature.Dev2_status is 1, which means Dev2 is connected;
[0135] (6) LED_FEATURE_DEV3 feature representation layer storage and definition:
[0136] The data storage path is Device.Led.Feature.Dev3_status, Boolean type, default is 0; Device.Led.Feature.Dev3_status is 0, which means that Dev3 is not connected; Device.Led.Feature.Dev3_status is 1, which means that Dev3 is connected.
[0137] The representation module stores, modifies, reads, and other operations on the defined LED characteristic objects through database management. The representation module also provides a data modification interface for interacting with the application module; for the LED characteristic objects, there are corresponding control units in the application module to operate them, and the control units are single when performing operations, that is, the operations of each control unit are independent and there is no conflict. The application module modifies the corresponding LED characteristic status through the data modification interface provided by the representation module. Exemplarily, when the system starts, the representation module initializes the LED characteristic data and initializes the LED characteristic status to 0. The business module (WANCC control unit) of the application module is only responsible for broadband connection control, and is resident in the background to monitor the broadband status of the device, including obtaining the IP address, Internet connection status, etc. The WANCC control unit monitors the IP address, that is, monitors the state change of the LED feature LED_FEATURE_INTERNET_ADDRESS. When the IP address changes, the WANCC control unit modifies the state of the corresponding LED feature LED_FEATURE_INTERNET_ADDRESS in the presentation module. When the broadband obtains the address, the interface is called to set the state of the LED feature LED_FEATURE_INTERNET_ADDRESS to 1; when the broadband does not obtain the address, the interface is called to set the state of the LED feature LED_FEATURE_INTERNET_ADDRESS to 0.
[0138] The presentation module also provides an LED characteristic data reading interface, defines multiple LED characteristic objects as a characteristic list, and serves as the data source of the logic module to interact with the logic module; it can also be used as a data source for system queries and as a data source for other visualization software such as WEB UI.
[0139] When the representation module interacts with the application module, it responds to the modification of the LED characteristic state by the control unit of the application module in real time. If the received LED characteristic state has not changed compared with the current LED characteristic state, no processing is performed; if the received LED characteristic state has changed compared with the current LED characteristic state, the current LED characteristic state is modified to the received LED characteristic state, and a unicast message of the LED characteristic state change is sent to the logic module through the ubus process communication (ubus process communication is a common technology in the industry) bus in the system. Exemplarily, the unicast message can be represented as: led_feature_change:{"LED_FEATURE_INTERNET_STATUS":"1"}.
[0140] The logic module provides a registration interface for the LED feature scene logic policy, which is used to interact with the application module; after receiving the script corresponding to the LED feature scene logic policy registered by the application module, the script is stored in the specified path, and the LED feature scene logic policy in the script is reloaded. Exemplarily, the application module calls the registration interface register_fled(const char*path) provided by the logic module, where path is the script path that needs to be loaded by the logic layer; the above product_internet.fled script is registered to the logic module; after the logic module receives the script, it stores it in the directory of the mount point, such as / config / led / product_internet.fled; the LED feature interpreter corresponding to the LED logic management language in the logic module parses the content in the script and reloads the LED feature scene logic policy in the script. In addition to being registered and provided by the application module, the LED feature scene logic policy stored in the logic module can also be the LED feature scene logic policy preset by the terminal device.
[0141] The logic module monitors the LED characteristic state changes in the presentation module, and executes the corresponding logic tasks in the LED characteristic scene logic strategy according to the changed LED characteristic state. The logic module reads the data in the LED characteristic scene logic strategy through the LED logic management language interpreter, queries the state machine objects corresponding to all LED characteristics from the data, and executes the corresponding logic tasks in the LED characteristic scene logic strategy according to the changed LED characteristic state, that is, executes the state machine transfer. The state machine transfer process is to control the virtual LED identification in the abstract module. Exemplarily, the LED characteristic interpreter in the logic module is resident in the background after the system is started, and monitors the unicast message sent by the presentation module in real time. When the unicast message led_feature_change carrying the LED feature LED_FEATURE_INTER NET_ADDRESS state change is received, the LED state machine corresponding to the LED feature LED_FEATURE_INTER NET_ADDRESS is found through the content of states.transitions.led_feature in the LED characteristic scene logic strategy, and the LED state machine is controlled to execute the logic task corresponding to the LED feature LED_FEATURE_INTERNET_ADDRESS.
[0142] During system operation, the logic module is also used to record the logs of the logical tasks in the LED feature scene logic strategy and the system operation log. The change log of the LED feature state of the presentation layer is recorded in real time. The log information includes key information such as the change source, change time, and change scene, which is convenient for feature tracing. It also records the LED state machine loading information, the reason for each state change, the state machine execution action, hardware operation information and other key log information.
[0143] The abstract module plans a certain number of virtual LED logos according to the product requirements of the terminal device, adapts the virtual LED logos to the actual physical LED lamp pins, and controls the virtual LED logos to respond to the logical tasks performed by the logic module. The adaptation of the corresponding relationship means that a certain virtual LED logo represents a certain actual physical LED lamp pin. The adaptation rules of the virtual LED logo and the actual physical LED lamp pins are determined according to the product requirements. The virtual LED logo in the abstract module is adapted to the actual physical LED lamp pins in the physical module to perform the linkage of logical tasks, and the actual physical LED lamp pins change in real time following the virtual LED logo status.
[0144] The adaptation relationship between the virtual LED identification of the physical module and the actual physical LED lamp pin controls the physical LED lamp to respond to the logical task performed by the logic module.
[0145] Exemplarily, based on the script product_internet.fled corresponding to the above-mentioned LED feature scene logic strategy, the logic module executes the corresponding logic task according to the state of the changed LED feature "LED_FEATURE_INTERNET_ADDRESS", that is, when the changed LED feature state is ON / OFF, the corresponding logic task is executed. Specifically, when LED_FEATURE_INTERNET_ADDRESS changes to ON, the state machine whose states.name is Internet LED enters the on state, GPIO_LED_1 executes the light_on task, and displays as a green light. The physical LED lamp pin GPIO that is compatible with the virtual pin GPIO_LED_1 in the physical module pulls the level high, so that the LED light displays as a green light; when LED_FEATURE_INTERNET_ADDRESS changes to OFF, the state machine whose states.name is Internet LED enters the off state, GPIO_LED_1 executes the light_off task, and displays as a red light. The physical LED lamp pin GPIO that is compatible with the virtual pin GPIO_LED_1 in the physical module pulls the level low, so that the LED light displays as a red light. In the script, light_on and light_off are task types, which correspond to the logic of operating the virtual pin GPIO_LED_1 and the physical pin GPIO. The logic module can cyclically execute the logic tasks in the LED feature scene to achieve the effect of cyclic display of LED lights.
[0146] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. As shown in the figure, the electronic device includes: a processor and a memory;
[0147] The processor is used to read and execute programs and instructions stored in the memory, so that the electronic device executes the above method embodiment.
[0148] It should be noted that, for the sake of convenience, Figure 6 For example, only the main components of the electronic device are shown. In actual applications, the electronic device may also include components or assemblies not shown in the figure.
[0149] The present invention also provides a computer-readable storage medium storing a program or instruction. When a computer reads and executes the program or instruction, the computer executes the above method embodiment.
[0150] Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent substitutions for some of the technical features therein; and these modifications or substitutions do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A terminal device LED light logic management method, characterized in that: include: Constructing an LED characteristic scene logic strategy based on a custom LED logic management language, and registering the LED characteristic scene logic strategy; The LED characteristic state under the LED characteristic scene is presented in a digital form and used as a data source for executing the LED characteristic scene logic strategy; Monitor the LED characteristic state changes in the data source, and execute corresponding logic tasks in the LED characteristic scene logic strategy according to the changed LED characteristic state; Adapting the virtual LED identifier to the actual physical LED lamp pin, and controlling the virtual LED identifier to respond to the corresponding logic task in the LED characteristic scene logic strategy; Based on the adaptation of the virtual LED identifier and the actual physical LED lamp pin, the physical LED lamp pin is controlled to respond to the corresponding logical task in the LED characteristic scene logic strategy.
2. The terminal device LED light logic management method according to claim 1, characterized in that: After the LED characteristic scene logic strategy is constructed based on the customized LED logic management language and the LED characteristic scene logic strategy is registered, the method further includes: The registered LED characteristic scene logic strategy is stored in a specified path, and the LED characteristic scene logic strategy is loaded.
3. The terminal device LED light logic management method according to claim 1, characterized in that: After the LED characteristic state under the LED characteristic scene is presented in a digital form and used as a data source for executing the LED characteristic scene logic strategy, the method further includes: Monitor the changes of LED characteristic states during the operation of the terminal device, and modify the LED characteristic states in the data source according to the changes of the LED characteristic states.
4. The terminal device LED light logic management method according to claim 1, characterized in that: Before monitoring the change of the LED characteristic state in the data source and executing the corresponding logic task in the LED characteristic scene logic strategy according to the changed LED characteristic state, the method further includes: Respond in real time to the modification of the LED characteristic state in the data source, and send a unicast message according to the change state of the LED characteristic state.
5. The terminal device LED light logic management method according to claim 4, characterized in that: The real-time response to the modification of the LED characteristic state in the data source and sending a unicast message according to the change state of the LED characteristic state includes: The real-time response is to the modification of the LED characteristic state in the data source. If the received LED characteristic state is not changed compared with the current LED characteristic state, no processing is performed; if the received LED characteristic state is changed compared with the current LED characteristic state, the current LED characteristic state is modified to the received LED characteristic state, and a unicast message of the LED characteristic state change is sent.
6. The terminal device LED light logic management method according to any one of claims 1 to 5, characterized in that: The LED characteristic scene logic strategy is a script described in a custom LED logic management language, which is loaded and parsed by a custom LED characteristic interpreter.
7. The terminal device LED light logic management method according to claim 6, characterized in that: Also includes: Records the logs of executing the logic tasks in the LED feature scene logic strategy and the system operation logs.
8. A terminal device LED light logic management system, characterized in that: include: An application module, used to construct an LED characteristic scene logic strategy based on a custom LED logic management language, and register the LED characteristic scene logic strategy; A representation module, used to present the LED characteristic state under the LED characteristic scenario in a digital form and serve as a data source for executing the LED characteristic scenario logic strategy; A logic module, used to monitor the change of LED characteristic state in the data source, and execute corresponding logic tasks in the LED characteristic scene logic strategy according to the changed LED characteristic state; An abstract module, used to adapt the virtual LED logo to the actual physical LED lamp pin, and control the virtual LED logo to respond to the corresponding logic task in the LED characteristic scene logic strategy; The physical module is used to control the physical LED lamp pins to respond to the corresponding logical tasks in the LED characteristic scene logic strategy based on the adaptation of the virtual LED identifier and the actual physical LED lamp pins.
9. An electronic device, characterized in that: include: Processor and memory; The processor is coupled to a memory; The processor is used to read and execute the program or instruction stored in the memory, so that the device executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: A computer program is stored, and when the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.