Configuration information management method and device based on embedded application program
By using a tree-like file name base class for configuration information management in embedded applications, the problem of limited resources in embedded applications is solved, and a unified interface and efficient configuration information management is realized, which is suitable for low-resource platforms.
Patent Information
- Application Number
- CN202110121835.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-28
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2041-01-28
AI Technical Summary
In embedded applications, it is difficult for the prior art to effectively manage a large amount of configuration information, especially on platforms with limited resources. Traditional file systems and database solutions consume a lot of resources and are difficult to maintain.
The file name base class with a tree structure is used to configure the file according to the format of the file name base class through each node in the tree structure as the data index path, so as to realize a unified data operation interface, and simplify the index of file data information and manage.
It realizes unified interface management of configuration information in embedded applications, takes up little memory, is easy to maintain, reduces resource consumption, and is suitable for low-resource platforms.
Smart Images

Figure CN112835638B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer operation and maintenance technology, and in particular to a configuration information management method, device, equipment and storage medium based on embedded application programs. Background Art
[0002] In embedded application development, there is usually some configuration information that needs to be kept in non-volatile memory (such as EEPROM, NAND FLASH, NOR FLASH, SD card, hard disk, etc.) to ensure that these configuration data are not lost when the power is off. For applications such as temperature control with a small amount of configuration data (such as a simple temperature controller, there may be only three configuration items: the set target temperature value, the upper temperature limit value and the lower temperature limit value), the data is usually directly saved using the offset address of the memory (such as EEPROM) as the index, such as Figure 1 As shown. Figure 1 It can be seen that when the user needs to obtain configuration information, he can directly read the information of the corresponding offset address. This method is equivalent to directly operating a specific hardware device (storing specific data at a specified address). No additional software is required to manage the configuration data, and resource consumption is extremely low. However, in embedded development, as the complexity of the application increases, the amount of data that needs to be configured also increases. Obviously, when a large amount of data is saved through the offset address of the memory, the user needs to record a large amount of data information and the address of the data storage, which cannot be obtained intuitively and is not easy to manage. In addition, the correspondence between the address and the information should be determined in the early stage of development (the correspondence between the address and the storage information is static). If the configuration items need to be dynamically added or deleted, it will be very cumbersome.
[0003] There are two common technologies for managing large amounts of configuration information. One is based on the file system and stores the configuration information in files. Managing configuration information in the form of files is the most widely used. Different file formats are proposed for different structures of configuration information, such as ini, json, xml, etc.
[0004] Using the file system, you can directly store both the data name and data information in the file, and the user can directly read the file for parsing. Different from storing with offset addresses, file storage intuitively represents the correspondence between data and data names, which is very convenient for management. For example, use JSON files to store configuration information:
[0005]
[0006] Using a file system to store data does bring great convenience, but it also has two major disadvantages: First, there are many types of file systems (such as FAT, LFFS, NTFS, YaFFS...), and before using the file system, you need to select a suitable file system for adaptation; second, when storing data, you need to use a specific format (such as JSON, INI, XML...), and add the parsing code of the corresponding format. This undoubtedly increases the difficulty of development. In addition, the file system itself and the parsing of the file format require a certain amount of resources, which limits its application to embedded platforms with extremely small resources.
[0007] For some more complex applications, you can also use a database to manage configuration information. The database unifies the data access interface and organizes, stores, and manages data according to a unified data structure. Each database has one or more different APIs for creating, accessing, managing, searching, and copying saved data. Currently, commonly used databases include MySQL, SQL Server, SQLite, Access, Qracle, etc. However, since a large amount of data is stored in memory when the database is running, it will take up a lot of hardware resources. Even SQLite, a lightweight database suitable for embedded applications, will take up hundreds of KB of memory. In addition, using the database API requires familiarity with its specific syntax rules (such as SQL), which increases the difficulty for users to get started and has a high learning cost.
[0008] Therefore, the above two configuration information management methods consume a lot of resources and are only applicable to high-resource platforms, but not to some low-resource platforms (such as Cortex-M0@48MHz, 8KRAM 32K FLASH). Summary of the invention
[0009] The embodiments of the present application provide a configuration information management method, apparatus, computer equipment and storage medium based on an embedded application to implement a tree structure management of application configuration information with a unified interface, which occupies a small space and is easy to maintain.
[0010] In a first aspect, an embodiment of the present application provides a configuration information management method based on an embedded application, comprising:
[0011] Generate a file name base class for indicating file index path information, wherein the file name base class is a tree structure including a main node and at least one level of child nodes, the main node and all child nodes of the tree structure constitute the data information of each file, and each child node is used to indicate the data index path corresponding to the current child node; all data index paths in the tree structure constitute the file index path information;
[0012] A configuration interface is assigned to the file name base class to retrieve a file through the configuration interface and form the configuration information of the file; the configuration interface is used to provide an interface for saving or reading a file corresponding to the configuration information, and the configuration interface includes a reading interface and a saving interface.
[0013] Furthermore, the tree structure of the file name base class is composed of multiple node base classes, one node base class corresponds to one node, each of the node base classes includes the current node name, the current node value, the node information of the previous node and the node information of the next node, and the node is a main node or a child node.
[0014] Furthermore, the data information includes different data attributes and data types, and different keywords are generated based on the data attributes and data types, respectively, and different keywords have different levels;
[0015] The child nodes in the tree structure constituting each of the file name base classes are respectively formed by different keywords in the data information, and the level of the keyword of the current child node is higher than the level of the keyword of the next-level child node.
[0016] Further, the file name base class configuration interface is assigned to retrieve the file through the configuration interface and form the configuration information of the file, including:
[0017] Assigned to the file name base class configuration interface;
[0018] Retrieving a file through the configuration interface and parsing the file to obtain data information of the file;
[0019] The keyword corresponding to the data information is obtained, and the keyword and the value corresponding to the keyword are configured in different child nodes of the file name base class according to the keyword level to form the configuration information of the file, and the configuration information includes a unified operation interface.
[0020] Furthermore, the keyword and the value corresponding to the keyword are configured in different child nodes of the file name base class according to the keyword level, including:
[0021] According to the keyword level, select the child node in the file name base class corresponding to the current keyword;
[0022] Get all the keywords of the previous level corresponding to the current keyword;
[0023] All keywords of the previous level and the current keyword are configured on the selected child node of the file name base class;
[0024] When the current keyword contains a value, the value of the keyword is configured on the selected child node.
[0025] Furthermore, different keywords configured on the same child node are arranged in order of their levels, and two adjacent keywords of different levels are divided by identifiers.
[0026] Furthermore, it also includes:
[0027] Receive user operations on files based on the configuration information and a unified operation interface of the configuration information, wherein the operations include querying, setting and deleting, and the unified operation interface includes a unified query interface, a unified setting interface and a unified deletion interface.
[0028] In a second aspect, an embodiment of the present application provides a configuration information management device based on an embedded application, comprising:
[0029] Base class generation module: used to generate a file name base class for indicating file index path information, the file name base class is a tree structure including a main node and at least one level of child nodes, the main node and all child nodes of the tree structure constitute the data information of each file, and each child node is used to indicate the data index path corresponding to the current child node; all data index paths in the tree structure constitute the file index path information;
[0030] Information configuration module: used to assign to the file name base class configuration interface to retrieve the file through the configuration interface and form the configuration information of the file; the configuration interface is used to provide an interface for saving or reading the file corresponding to the configuration information, and the configuration interface includes a reading interface and a saving interface.
[0031] Furthermore, the tree structure of the file name base class is composed of multiple node base classes, one node base class corresponds to one node, each of the node base classes includes the current node name, the current node value, the node information of the previous node and the node information of the next node, and the node is a main node or a child node.
[0032] Furthermore, the data information includes different data attributes and data types, and different keywords are generated based on the data attributes and data types, respectively, and different keywords have different levels;
[0033] The child nodes in the tree structure constituting each of the file name base classes are respectively formed by different keywords in the data information, and the level of the keyword of the current child node is higher than the level of the keyword of the next-level child node.
[0034] Further, the file name base class configuration interface is assigned to retrieve the file through the configuration interface and form the configuration information of the file, including:
[0035] Assigned to the file name base class configuration interface;
[0036] Retrieving a file through the configuration interface and parsing the file to obtain data information of the file;
[0037] The keyword corresponding to the data information is obtained, and the keyword and the value corresponding to the keyword are configured in different child nodes of the file name base class according to the keyword level to form the configuration information of the file, and the configuration information includes a unified operation interface.
[0038] Furthermore, the keyword and the value corresponding to the keyword are configured in different child nodes of the file name base class according to the keyword level, including:
[0039] According to the keyword level, select the child node in the file name base class corresponding to the current keyword;
[0040] Get all the keywords of the previous level corresponding to the current keyword;
[0041] All keywords of the previous level and the current keyword are configured on the selected child node of the file name base class;
[0042] When the current keyword contains a value, the value of the keyword is configured on the selected child node.
[0043] Furthermore, different keywords configured on the same child node are arranged in order of their levels, and two adjacent keywords of different levels are divided by identifiers.
[0044] Furthermore, it also includes:
[0045] User operation module: used to receive user operations on files based on the configuration information and the unified operation interface of the configuration information, the operations include query, setting and deletion, and the unified operation interface includes a unified query interface, a unified setting interface and a unified deletion interface.
[0046] In a third aspect, an embodiment of the present application provides a computer device, including: a memory and one or more processors;
[0047] The memory is used to store one or more programs;
[0048] When the one or more programs are executed by the one or more processors, the one or more processors implement the configuration information management method based on embedded application as described in the first aspect.
[0049] In a fourth aspect, an embodiment of the present application provides a storage medium containing computer executable instructions, which, when executed by a computer processor, are used to execute the configuration information management method based on an embedded application as described in the first aspect.
[0050] The embodiment of the present application provides a file name base class with a tree structure, and each node in the tree structure serves as a data index path. The retrieved file is configured according to the format of the file name base class to implement a unified data operation interface. The indexing of the entire file data information is implemented through the tree structure file name base class, which facilitates users to operate the file configuration information and makes subsequent file maintenance and management more convenient. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 is a flow chart of a configuration information management method based on an embedded application provided in an embodiment of the present application;
[0052] Figure 2 is a flowchart of another configuration information management method based on embedded application provided in an embodiment of the present application;
[0053] Figure 3 is a flowchart of another configuration information management method based on embedded application provided in an embodiment of the present application;
[0054] Figure 4 It is a structural diagram of a configuration information management device based on an embedded application provided in an embodiment of the present application;
[0055] Figure 5 It is a structural diagram of another configuration information management device based on embedded application provided in an embodiment of the present application;
[0056] Figure 6 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
[0058] The embodiment of the present application provides a configuration information management method, device, computer equipment and storage medium based on embedded application. The embodiment of the present application provides a file name base class with a tree structure, and each node in the tree structure is used as a data index path. The retrieved file is configured according to the format of the file name base class to implement a unified data operation interface. The index of the entire file data information is implemented through the file name base class with a tree structure, which is convenient for users to operate file configuration information, and the subsequent maintenance and management of files are more convenient.
[0059] The following are detailed explanations respectively.
[0060] Figure 1 A flowchart of a configuration information management method based on an embedded application provided in an embodiment of the present application is given. The configuration information management method based on an embedded application provided in an embodiment of the present application can be executed by a configuration information management device based on an embedded application. The configuration information management device based on an embedded application can be implemented in hardware and / or software and integrated in a computer device.
[0061] The following description is made by taking the configuration information management device based on embedded application program to execute the configuration information management method based on embedded application program as an example. Figure 1 , the configuration information management method based on embedded application includes:
[0062] 101: Generate a file name base class for indicating file index path information.
[0063] The file name base class is used in the embodiment of the present application to provide a template framework for the configuration information of the file, which usually adopts a fixed structure. Through the file name base class, the index path of the data information in the file can be obtained, and the data information and its corresponding value can be easily obtained through the index path.
[0064] Since the data is currently read and written with the offset address in the memory, the user needs to record the offset address of the data and the length of the data. When managing too much data, the recording of the offset address and length information of the data is too cumbersome and difficult to maintain. A unified interface is needed so that the user does not need to care about the secondary information (data length and data offset address) to complete the management of the data. At the same time, in view of the diversity of file systems and file formats, a unified read and write data interface is needed to facilitate the expansion of applications on different platforms, so that users do not need to care about the format of the storage information and the storage medium. Based on this, this embodiment unifies the data access interface by directly mapping the data information and the file name.
[0065] In this embodiment, the file name base class is a tree structure. The tree structure includes multiple nodes, including a main node and at least one level of child nodes. The main node is also the root node, and each level of child nodes only includes one child node. Each node saves the relevant information of the upper level node and its lower level node. For example, the tree structure of a file name base class includes a root node R and two levels of child nodes, the first level of child nodes includes child nodes A and child nodes B, and the parent nodes of child nodes A and child nodes B are both root nodes. Among them, the next level of child nodes of child node A includes child nodes a1 and child nodes a2, and the next level of child nodes of child node B includes child node b1, then child nodes a1, child nodes a2 and child nodes b1 all belong to the second level of child nodes. For example, on child node A, the relevant information of the root node and child nodes a1 and child nodes a2 is included, and on child node B, the relevant information of the root node and child node b1 is included.
[0066] Among them, the main node and all child nodes of the tree structure constitute the data information of each file, and each child node is used to indicate the data index path corresponding to the current child node; all data index paths in the tree structure constitute the file index path information.
[0067] Combined with the above example, in the root node R, child node A, child node B, child node a1, child node a2 and child node b1 in the tree structure, each node corresponds to different data information, and the tree structure of these node combinations corresponds to the entire file, so the data information of these nodes together constitute the data information of a file. For another example, the data information of the file includes user data and system data, wherein the user data includes the target temperature, and the system data includes time. Then the above data information is included in the tree structure, the user data and the system data are the same level data, the target temperature is the subordinate data of the user data, indicating that the target temperature is in the user data category, and the time is the subordinate data of the system data. Then the tree structure is formed including the root node, the first level child nodes user data and system data, the second level child node target temperature of the user data, and the second level child node time of the system data. When the user wants to find the target temperature, the corresponding child node can be located according to the "target temperature", that is, the data index path to the target temperature can be known as "root node-user data-target data". The data information of the file includes user data and system data, where the user data includes the target temperature and the system data includes the time. For example, the entire file index path information includes two data index paths: "root node-user data-target data" and "root node-system data-time".
[0068] As a preferred implementation, the tree structure of the file name base class described in the embodiment of the present application is composed of multiple node base classes, one node base class corresponds to one node, each of the node base classes includes the current node name, the value of the current node, the node information of the previous node and the node information of the next node, and the node is a main node or a child node.
[0069] In this application, the node base class code is conf_node_t, and the node base class includes "+next, +parent, -name, -value", where next is defined as the node information of the next node of the current node, and parent defines the node information of the previous node of the current node. Both next and parent can be used to provide path information of nodes at the same level when querying the data information of a file. Name defines the path information of the current node, and name is also part of the data name of the node. Value represents the value stored in the current node. For example, if the target temperature is 30 degrees Celsius, 30 degrees Celsius is the value of the corresponding node. When the target data is matched by searching the child node information of the user data node, the data stored at the target data node is finally obtained.
[0070] The complete file tree is established through the node base class, which is also the file name base class. The file name base class code is conf_doc_t. The file name base class contains "+root and -node_index", where root is the root node pointer, which is used to provide the node information of the entire file tree. Node_index records the position of the current node in the tree. The data of the corresponding node can be obtained through the index and the root node pointer. As long as the file name base class conf_doc_t is provided in the interface, the relevant information of all nodes can be obtained.
[0071] 102: Assign a configuration interface to the file name base class to retrieve a file through the configuration interface and form configuration information of the file; the configuration interface is used to provide an interface for saving or reading a file corresponding to the configuration information, and the configuration interface includes a reading interface and a saving interface.
[0072] After setting the file name base class, you also need to read and save the data information in the storage. You need to add the interface for reading and saving the data configuration to the file name base class conf_doc_t. Defined as conf_obj_t, the conf_obj_t includes "-doc, -save(), -load()", where doc inherits from the conf_doc_t class and is used to provide information about the entire file tree. The save() abstract method provides an interface for saving files, and the load() abstract method provides an interface for reading files. Depending on the file format and storage medium, save() and load() can be implemented by the user.
[0073] After being assigned to the file name base class configuration interface, the file can be retrieved and parsed from the memory through the configuration interface, and the file data information is formed into the file configuration information according to the format of the file name base class. The configuration information is a tree structure, including multiple nodes, which is convenient for subsequent data indexing. After the configuration information is formed and the subsequent operations are performed on the configuration, the configuration information can be saved in the memory through a unified configuration interface.
[0074] As a further preferred implementation, in the present application, the data information includes different data attributes and data types, and different keywords are generated based on the data attributes and data types, respectively, and different keywords have different levels.
[0075] For example, the data information of the file includes the following:
[0076]
[0077]
[0078] That is, the data information includes target temperature, upper limit temperature, lower limit temperature and date, wherein the target temperature, upper limit temperature and lower limit temperature correspond to user data "user", and the date corresponds to system data "system". User data and system data belong to different data types. The target temperature, upper limit temperature and the like are defined as different data attributes in this embodiment, corresponding to data values of different situations and different functions. In the above example, keywords are generated based on user data, system data, target temperature, upper limit temperature, lower limit temperature and date respectively. In this embodiment, data names are used as keywords, that is, the keywords are "user data", "system data", "target temperature", "upper limit temperature", "lower limit temperature" and "date". Different keywords correspond to different levels. For example, user data and system data have the same level and correspond to the same level of child nodes in the tree structure. For another example, target data, upper limit data, lower limit data and date are all at the same level and correspond to the same level of child nodes in the tree structure, while system data and date have different levels. The level of system data is higher than that of date. Both are located at child nodes of different levels in the tree structure, and the child node of system data is the upper level of the child node of date.
[0079] In an embodiment of the present application, the child nodes in the tree structure constituting each of the file name base classes are respectively formed by different keywords in the data information, and the level of the keyword of the current child node is higher than the level of the keyword of the next-level child node. That is, for example, the child node corresponding to the user data is composed of the keyword "user data", and the child node corresponding to the target temperature is composed of the keywords "user data, target temperature". For the keywords of each child node, it is easy to match the index path of the data, starting from the root node, first matching the user data or system data, matching the target data after matching the user data, and then matching the target data, so that the value of the target data can be obtained.
[0080] In this embodiment, different keywords configured on the same child node are arranged in order according to the level of the keywords, and two adjacent keywords of different levels are divided by identifiers.
[0081] That is, for example, in the subnode corresponding to the target data, its keywords include both user data and target data. Before the division, the keyword formed is "user data target data". In this case, the keyword is not clear, which causes certain obstacles for users when indexing data information. Therefore, the two keywords of user data and target data are divided by identifiers, so that there are separation marks between multiple keywords, making the direction of the data index path clearer. The identifier is, for example, a fixed number, space character, fixed letter, symbol, etc. For example, the identifier can be a dot ".", then the keyword of the subnode corresponding to the target data is "user data.target data".
[0082] like Figure 2 As shown, the embodiment of the present application provides another configuration information management method based on an embedded application, including:
[0083] 201: Generate a file name base class for indicating file index path information. Similarly, the file name base class is a tree structure including a main node and at least one level of child nodes. The main node and all child nodes of the tree structure constitute the data information of each file, and each child node is used to indicate the data index path corresponding to the current child node; all data index paths in the tree structure constitute the file index path information.
[0084] In this embodiment, the file name base class code is conf_doc_t, and each node in the tree structure has a specific node base class, and the node base class code is conf_node_t.
[0085] 202: Assign to the file name base class configuration interface.
[0086] By providing a configuration interface to the file name base class, the file can be retrieved from the storage device storing the file, thereby obtaining the file information and forming the configuration information of the file.
[0087] In order to make users not pay attention to storage formats and media, this application supports various files or storage formats, such as json, ubjson, ini, nvram, etc. After adding an interface to the file name base class conf_doc_t, it is defined as conf_obj_t, where -save() can specifically include different forms according to different file formats. For example, for the json format, it is -conf_json_save(), and for the ini format, it is -conf_ini_save(). In the conf_obj_t file, save() and load() abstract methods of various formats are implemented. Among them, the main function of load() is to read file information, parse data according to different data formats, generate corresponding nodes and trees, store them in the doc object, and provide them to users to directly obtain them from memory. When the user calls the interface and needs to change the configuration information, the save() method parses the changed node information from the doc object and imports it into the file or storage device. In the process of application management data, users do not need to care about the parsing of specific file formats or storage media, but only need to call the corresponding abstract method.
[0088] 203: Retrieve a file through the configuration interface, and parse the file to obtain data information of the file.
[0089] 204: Obtain the keyword corresponding to the data information, and configure the keyword and the value corresponding to the keyword in different child nodes of the file name base class according to the keyword level to form configuration information of the file, wherein the configuration information includes a unified operation interface.
[0090] After parsing the data information, the configuration information of the file in the file name base class is formed through the keywords corresponding to the data information.
[0091] In this step, further, the keywords and the values corresponding to the keywords are configured in different child nodes of the file name base class according to the keyword hierarchy, including: selecting the child node in the file name base class corresponding to the current keyword according to the keyword hierarchy; obtaining all the keywords of the previous hierarchy corresponding to the current keyword; configuring all the keywords of the previous hierarchy and the current keyword on the selected child node of the file name base class; and when the current keyword contains a value, configuring the value of the keyword on the selected child node.
[0092] For example, data information includes user data and system data, wherein user data includes target temperature, and system data includes time. The level of target temperature is lower than that of user data, and the child node of target temperature is the next-level child node of user data. Similarly, the level of time is lower than that of system data, and the child node of time is the next-level child node of system data. The file tree formed corresponding to the data information includes a root node, first-level child nodes, and second-level child nodes. The first-level child nodes are user data and system data, and the second-level child nodes are target temperature and time. When forming the keyword of the second-level child node corresponding to the target temperature, the keyword of the upper-level child node of the target temperature is obtained, that is, the user data, so the keyword corresponding to the target temperature is "user data, target temperature".
[0093] like Figure 3 As shown, the embodiment of the present application also provides another configuration information management method based on an embedded application, including:
[0094] 301: Generate a file name base class for indicating file index path information. Similarly, the file name base class is a tree structure including a main node and at least one level of child nodes. The main node and all child nodes of the tree structure constitute the data information of each file, and each child node is used to indicate the data index path corresponding to the current child node; all data index paths in the tree structure constitute the file index path information.
[0095] 302: Assign a configuration interface to the file name base class to retrieve a file through the configuration interface and form configuration information of the file; the configuration interface is used to provide an interface for saving or reading a file corresponding to the configuration information, and the configuration interface includes a reading interface and a saving interface.
[0096] 303: Receive a user's operation on a file based on the configuration information and a unified operation interface of the configuration information, wherein the operation includes query, setting and deletion, and the unified operation interface includes a unified query interface, a unified setting interface and a unified deletion interface.
[0097] In an embodiment of the present application, after setting a file name base class and forming the configuration information of the file based on the file name base class, when the user needs to operate the file, the relevant read and write operations can be directly performed through the unified interface of the configuration information. After the operation is completed, the configuration information after the operation is also stored in the memory through the unified configuration interface. For example, the code for setting the unified query interface is app_conf_get(key, value), where key is the keyword, that is, the path of the node in the file tree, and value is the value to be set or obtained. For another example, the code for setting the unified setting interface is app_conf_set(key, value); the setting in this embodiment includes adding and modifying. For another example, the code for setting the unified deletion interface is app_conf_remove(key). When the user needs to read and write the configuration information, just enter the above-mentioned pre-set codes respectively. For example, when the user needs to add new configuration information to a file, by setting the specified path name, the added node information is created in the tree structure, and saved to the memory through save(). For example, when deleting configuration information, according to the characteristics of the tree structure, when deleting a node, the connection between the previous child node and the next child node is disconnected, and the corresponding child node is destroyed. When modifying configuration information, when the specified node information is found, the input parameter is set to the value parameter of the node. Querying configuration information is similar to modifying configuration information, and the specified node information is also found in the file tree.
[0098] This application simplifies the data query interface, making the file easy to maintain, taking up less memory and saving hardware resources. Through a unified interface, users do not need to pay attention to storage formats and storage media, and supports multiple file formats.
[0099] like Figure 4 As shown, an embodiment of the present application provides a configuration information management device based on an embedded application, including a base class generation module 401 and an information configuration module 402. The base class generation module 401 is used to generate a file name base class for indicating file index path information, wherein the file name base class is a tree structure including a main node and at least one level of child nodes, wherein the main node and all child nodes of the tree structure constitute the data information of each file, and each child node is used to indicate the data index path corresponding to the current child node; all data index paths in the tree structure constitute the file index path information. The information configuration module 402 is used to assign a configuration interface to the file name base class so as to retrieve a file through the configuration interface and form the configuration information of the file; the configuration interface is used to provide an interface for saving or reading a file corresponding to the configuration information, and the configuration interface includes a reading interface and a saving interface.
[0100] In this embodiment, the tree structure of the file name base class is composed of multiple node base classes, one node base class corresponds to one node, each of the node base classes includes the current node name, the current node value, the node information of the previous node and the node information of the next node, and the node is a main node or a child node.
[0101] Further preferably, the data information includes different data attributes and data types, and different keywords are generated based on the data attributes and data types, respectively, and different keywords have different levels;
[0102] The child nodes in the tree structure constituting each of the file name base classes are respectively formed by different keywords in the data information, and the level of the keyword of the current child node is higher than the level of the keyword of the next-level child node.
[0103] In the information configuration module 402, the file name base class configuration interface is assigned to retrieve the file through the configuration interface and form the configuration information of the file, including: assigning to the file name base class configuration interface; retrieving the file through the configuration interface and parsing the file to obtain the data information of the file; obtaining the keyword corresponding to the data information, and configuring the keyword and the value corresponding to the keyword in different sub-nodes of the file name base class according to the keyword hierarchy to form the configuration information of the file, and the configuration information includes a unified operation interface.
[0104] As a further preferred implementation, keywords and values corresponding to the keywords are configured on different child nodes of the file name base class according to the keyword hierarchy, including: selecting a child node in the file name base class corresponding to the current keyword according to the keyword hierarchy; obtaining all keywords of the previous hierarchy corresponding to the current keyword; configuring all keywords of the previous hierarchy and the current keyword on the selected child node of the file name base class; and when the current keyword contains a value, configuring the value of the keyword on the selected child node.
[0105] In the embodiment of the present application, different keywords configured on the same sub-node are arranged in order according to the hierarchy of the keywords, and two adjacent keywords of different hierarchies are divided by identifiers.
[0106] like Figure 5As shown, the embodiment of the present application also provides another configuration information management device based on an embedded application, including a base class generation module 501, an information configuration module 502 and a user operation module 503. The base class generation module 501 is used to generate a file name base class for indicating file index path information, the file name base class is a tree structure including a main node and at least one level of child nodes, the main node and all child nodes of the tree structure constitute the data information of each file, and each child node is used to indicate the data index path corresponding to the current child node; all data index paths in the tree structure constitute the file index path information. The information configuration module 502 is used to assign a configuration interface to the file name base class to retrieve a file through the configuration interface and form the configuration information of the file; the configuration interface is used to provide an interface for saving or reading a file corresponding to the configuration information, and the configuration interface includes a reading interface and a saving interface. The user operation module 503 is used to receive the user's operation on the file based on the configuration information and the unified operation interface of the configuration information, the operation includes query, setting and deletion, and the unified operation interface includes a unified query interface, a unified setting interface and a unified deletion interface.
[0107] like Figure 6 As shown, an embodiment of the present application also provides a computer device, including: a memory 601 and one or more processors 602; the memory 601 is used to store one or more programs; when the one or more programs are executed by the one or more processors 602, the one or more processors implement the configuration information management method based on embedded applications as described in the present application.
[0108] An embodiment of the present application also provides a storage medium containing computer executable instructions, which, when executed by a computer processor, are used to execute a configuration information management method based on an embedded application as provided in the above embodiment, and the configuration information management method based on an embedded application includes: generating a file name base class for indicating file index path information, the file name base class is a tree structure containing a main node and at least one level of child nodes, the main node and all child nodes of the tree structure constitute the data information of each file, and each child node is used to indicate the data index path corresponding to the current child node; all data index paths in the tree structure constitute the file index path information; a configuration interface is assigned to the file name base class to retrieve a file through the configuration interface and form the configuration information of the file; the configuration interface is used to provide an interface for saving or reading a file corresponding to the configuration information, and the configuration interface includes a reading interface and a saving interface.
[0109] Storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media, such as CD-ROM, floppy disk or tape device; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (such as hard disk or optical storage); registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the first computer system in which the program is executed, or may be located in a different second computer system, which is connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations (for example, in different computer systems connected by a network). The storage medium may store program instructions (for example, embodied as a computer program) that can be executed by one or more processors.
[0110] Of course, the storage medium containing computer executable instructions provided in an embodiment of the present application, whose computer executable instructions are not limited to the configuration information management method based on embedded applications as described above, can also execute related operations in the configuration information management method based on embedded applications provided in any embodiment of the present application.
[0111] The configuration information management apparatus, device and storage medium based on embedded applications provided in the above embodiments can execute the configuration information management method based on embedded applications provided in any embodiment of the present application. For technical details not described in detail in the above embodiments, please refer to the configuration information management method based on embedded applications provided in any embodiment of the present application.
[0112] The above are only preferred embodiments of the present application and the technical principles used. The present application is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions that can be made by those skilled in the art will not deviate from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.
Claims
1. A configuration information management method based on embedded application, characterized in that: include: Generate a file name base class for indicating file index path information, the file name base class is a tree structure including a main node and at least one first-level child node, the main node and all child nodes of the tree structure constitute the data information of each file, and each child node is used to indicate the data index path corresponding to the current child node; all data index paths in the tree structure constitute the file index path information; wherein the data information includes different data attributes and data types, different keywords are generated based on the data attributes and data types, and different keywords have different levels; wherein the child nodes in the tree structure constituting each of the file name base classes are respectively formed by different keywords in the data information, and the level of the keyword of the current child node is higher than the level of the keyword of the next-level child node; Assigned to the file name base class configuration interface to call the file through the configuration interface and form the configuration information of the file; the configuration interface is used to provide an interface for saving or reading the file corresponding to the configuration information, and the configuration interface includes a reading interface and a saving interface, wherein the assigned to the file name base class configuration interface to call the file through the configuration interface and form the configuration information of the file includes: assigned to the file name base class configuration interface, calling the file through the configuration interface and parsing the file to obtain the data information of the file, obtaining the keyword corresponding to the data information, and configuring the keyword and the value corresponding to the keyword in different child nodes of the file name base class according to the keyword level to form the configuration information of the file, and the configuration information includes a unified operation interface, wherein the keyword and the value corresponding to the keyword are configured in different child nodes of the file name base class according to the keyword level, including: according to the keyword level, selecting the child node in the file name base class corresponding to the current keyword, obtaining all the keywords of the previous level corresponding to the current keyword, configuring all the keywords of the previous level and the current keyword on the selected child node of the file name base class, and when the current keyword contains a value, configuring the value of the keyword on the selected child node.
2. The configuration information management method according to claim 1, characterized in that: The tree structure of the file name base class is composed of multiple node base classes, one node base class corresponds to one node, each of the node base classes includes the current node name, the current node value, the node information of the previous node and the node information of the next node, and the node is a main node or a child node.
3. The configuration information management method according to claim 1, characterized in that: Different keywords configured on the same child node are arranged in order of their levels, and two adjacent keywords of different levels are divided by identifiers.
4. The configuration information management method according to claim 1, characterized in that: Also includes: Receive user operations on files based on the configuration information and a unified operation interface of the configuration information, wherein the operations include querying, setting and deleting, and the unified operation interface includes a unified query interface, a unified setting interface and a unified deletion interface.
5. A configuration information management device based on an embedded application, characterized in that: include: Base class generation module: used to generate a file name base class for indicating file index path information, the file name base class is a tree structure including a main node and at least one first-level child node, the main node and all child nodes of the tree structure constitute the data information of each file, and each child node is used to indicate the data index path corresponding to the current child node; all data index paths in the tree structure constitute the file index path information; wherein the data information includes different data attributes and data types, different keywords are generated based on the data attributes and data types, and different keywords have different levels; wherein the child nodes in the tree structure constituting each of the file name base classes are respectively formed by different keywords in the data information, and the level of the keyword of the current child node is higher than the level of the keyword of the next-level child node; Information configuration module: used to allocate to the file name base class configuration interface, so as to call the file through the configuration interface and form the configuration information of the file; the configuration interface is used to provide an interface for saving or reading the file corresponding to the configuration information, and the configuration interface includes a reading interface and a saving interface, wherein the allocation to the file name base class configuration interface to call the file through the configuration interface and form the configuration information of the file includes: allocating to the file name base class configuration interface, calling the file through the configuration interface and parsing the file to obtain the data information of the file, obtaining the keyword corresponding to the data information, and configuring the keyword and the value corresponding to the keyword in different child nodes of the file name base class according to the keyword level to form the configuration information of the file, and the configuration information includes a unified operation interface, wherein the keyword and the value corresponding to the keyword are configured in different child nodes of the file name base class according to the keyword level, including: selecting the child node in the file name base class corresponding to the current keyword according to the keyword level, obtaining all the keywords of the previous level corresponding to the current keyword, configuring all the keywords of the previous level and the current keyword on the selected child node of the file name base class, and when the current keyword contains a value, configuring the value of the keyword on the selected child node.
6. A computer device, characterized in that: include: memory and one or more processors; The memory is used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the configuration information management method based on embedded application programs as described in any one of claims 1-4.
7. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions are used to execute the configuration information management method based on embedded application programs as described in any one of claims 1 to 4 when executed by a computer processor.
Citation Information
Patent Citations
Method and device for obtaining program configuration information
CN103646055A
File index building method and system
CN104899337A
File searching method and file searching device
CN105279278A
Method of configuring wireless device and wireless device
CN106059785A
Method and device for improving retrieval efficiency of space science and application data
CN107066506A
