Field configuration method, device and equipment of CPE (Customer Premise Equipment) and storage medium
By generating XML rule configuration files and parsing information, the configuration fields of CPE devices are automatically processed, which solves the problems of high maintenance cost and poor versatility of configuration tools in the existing technology, and achieves efficient configuration field management and multi-model support.
Patent Information
- Application Number
- CN202410935092.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-10-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing CPE device configuration tools need to frequently modify the program code when adding new configuration fields, resulting in high maintenance costs, easy introduction of bugs, poor versatility, and difficulty in supporting multiple models of CPE devices.
By generating an XML rule configuration file and sending the parsed information to the CPE device editing tool, automatic processing of custom configuration fields is realized, reducing direct modifications to program code and improving configuration efficiency.
It reduces the workload of developers, reduces the probability of bug introduction, improves the versatility and efficiency of configuration tools, and simplifies support for multiple types of CPE equipment.
Smart Images

Figure CN118779000A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of CPE equipment, and in particular to a field configuration method, device, equipment and storage medium for CPE equipment. Background Art
[0002] The configuration of CPE equipment consists of multiple configuration fields, each of which corresponds to an English string. The value of the configuration field is a string. During the operation of CPE, the configuration field is parsed and processed by itself. Each time a new configuration field is added, the program code needs to be modified, the GUI (Graphical User Interface) interface needs to be modified, the corresponding event handler needs to be added, and the new program needs to be recompiled and released.
[0003] Since there are different types of CPEs, which are maintained and developed by different development teams and based on different hardware platforms, it is necessary to develop multiple new functions to meet the various needs of different customers. As a result, it is often necessary to add support for new configuration fields for a specific type of CPE, resulting in a variety of CPE configuration editing tools required for each type of CPE, and poor versatility. For CPE configuration editing tools, it takes a lot of time to maintain support for multiple types of CPE. Every time a configuration option or configuration field is added, it is necessary to modify the program code, modify the GUI interface, add a new input box or selection box, or add more optional values to the selection box, add the corresponding event handler, and recompile and release a new program, which greatly increases the time cost of tool maintenance personnel. Every time a new configuration field and program processing code are added, new program code similar to the previous configuration field will be added. Once all configuration fields need to add some additional processing logic, it will increase the workload. Frequent program modifications like the above situation, once the program maintainer does not check the code carefully or test it carefully, it is easy to introduce new bugs, which is easy to cause great losses. Summary of the invention
[0004] In order to solve the above technical problems, the embodiments of the present invention provide a field configuration method, apparatus, device and storage medium for a CPE device, which realizes custom configuration of the configuration fields of the CPE device and improves the field configuration efficiency of the CPE device.
[0005] A first aspect of an embodiment of the present invention provides a field configuration method for a CPE device, the method comprising:
[0006] Configure XML rules according to the field information to be configured on the CPE device, and obtain an XML rule configuration file;
[0007] Inputting the XML rule configuration file into the CPE device so that the CPE device parses the XML rule configuration file to obtain parsing information;
[0008] Sending the parsed information to the CPE device editing tool, so that the CPE device editing tool performs field configuration on the CPE device according to the parsed information to obtain the configured fields;
[0009] Generate a configuration file based on the configured fields and upload the configuration file to the CPE device for configuration.
[0010] In a possible implementation manner of the first aspect, configuring an XML rule according to the field information to be configured of the CPE device to obtain an XML rule configuration file includes:
[0011] According to the field information to be configured on the CPE device, a root element tag of the XML configuration rule file is set, and multiple sub-tags are set according to the root element tag;
[0012] The first sub-tag is used to define a language list, the second sub-tag is used to set the format of outputting the field to be configured and the value of the field to be configured, and the third sub-tag is used to define the category of the field to be configured;
[0013] The fourth sub-tag is used to define the field to be configured, and the fifth sub-tag is used to define the maximum length of the field to be configured, the maximum length of the value of the field to be configured, the default language, and the preset number of the field to be configured;
[0014] The sixth sub-tag is used to define the configuration fields that only need to be identified among the fields to be configured.
[0015] In a possible implementation manner of the first aspect, enabling the CPE device to parse the XML rule configuration file to obtain parsing information includes:
[0016] Verify the first attribute of the root element tag in the XML rule configuration file to obtain a verification result, and determine whether the XML rule configuration file is valid according to the verification result. If valid, continue to traverse the second attribute of the root element tag in the XML rule configuration file to obtain a revision history of the XML rule configuration file;
[0017] Parse the first subtag to obtain a language list, parse the second subtag to obtain a format for outputting the field to be configured and the value of the field to be configured, and parse the third subtag to obtain a category of the field to be configured;
[0018] The fourth subtag is parsed to obtain the field to be configured, and the fifth subtag is parsed to obtain the maximum length of the field to be configured, the maximum length of the value of the field to be configured, the default language, and the preset number of the fields to be configured;
[0019] The sixth sub-tag is parsed to obtain only the configuration fields that need to be identified among the fields to be configured.
[0020] In a possible implementation manner of the first aspect, defining the field to be configured by using the fourth subtag includes:
[0021] Use the first attribute in the fourth sub-tag to define the name of the field to be configured;
[0022] The second attribute in the fourth sub-tag is used to define the type of the field to be configured, and the value of the field to be configured is obtained according to the type of the field to be configured;
[0023] The third attribute in the fourth subtag is used to define the description information of the field to be configured, the third attribute in the fifth subtag is used to define the length of the value of the field to be configured, the fourth attribute in the fourth subtag is used to define the category of the field to be configured, the fifth attribute in the fourth subtag is used to define whether the field to be configured is a key configuration, and the sixth attribute in the fourth subtag is used to define the format of the field to be configured.
[0024] In a possible implementation manner of the first aspect, obtaining the value of the to-be-configured field from the type of the to-be-configured field includes:
[0025] If the type is the first attribute value, the value of the field to be configured is the value in the option sub-tag in the fourth sub-tag. If the type is the second attribute value, the value of the field to be configured needs to be entered manually.
[0026] If the type is the third attribute value, the value of the field to be configured is synthesized according to the first method attribute in the fourth subtag; if the type is the fourth attribute value, the value of the field to be configured is synthesized according to the second method attribute value and the third method attribute value in the fourth subtag;
[0027] If the type is the fifth attribute value, the value of the field to be configured is a fixed value. If the type is the sixth attribute value, the value of the field to be configured is an integer within a preset range.
[0028] In a possible implementation manner of the first aspect, enabling a CPE device editing tool to perform field configuration on a CPE device according to parsed information to obtain configured fields includes:
[0029] According to the preset number of fields to be configured, a blank configuration table with the same number of rows as the preset number is obtained;
[0030] According to the configuration field classification column of the blank configuration table, a classification list of fields to be configured is obtained, and configuration is performed according to the classification list of fields to be configured to obtain the target configuration field category, and a list of fields to be configured is obtained according to the target configuration field category, and configuration is performed according to the list of fields to be configured to obtain the target configuration field;
[0031] Get a value list based on the target configuration field, select based on the value list, get the value corresponding to the target configuration field, and confirm that the target configuration field category, target configuration field, and the value corresponding to the target configuration field are configured fields.
[0032] A second aspect of an embodiment of the present invention provides a field configuration device for a CPE device, the device comprising:
[0033] An acquisition module is used to configure XML rules according to the field information to be configured on the CPE device to obtain an XML rule configuration file;
[0034] A parsing module, used for inputting the XML rule configuration file into the CPE device, so that the CPE device parses the XML rule configuration file to obtain parsing information;
[0035] A configuration module, used for sending the parsed information to the CPE device editing tool, so that the CPE device editing tool performs field configuration on the CPE device according to the parsed information to obtain the configured fields;
[0036] The generation module is used to generate a configuration file according to the configured fields and upload the configuration file to the CPE device for configuration.
[0037] In a possible implementation manner of the second aspect, configuring an XML rule according to the field information to be configured on the CPE device to obtain an XML rule configuration file includes:
[0038] According to the field information to be configured on the CPE device, a root element tag of the XML configuration rule file is set, and multiple sub-tags are set according to the root element tag;
[0039] The first sub-tag is used to define a language list, the second sub-tag is used to set the format of outputting the field to be configured and the value of the field to be configured, and the third sub-tag is used to define the category of the field to be configured;
[0040] The fourth sub-tag is used to define the field to be configured, and the fifth sub-tag is used to define the maximum length of the field to be configured, the maximum length of the value of the field to be configured, the default language, and the preset number of the field to be configured;
[0041] The sixth sub-tag is used to define the configuration fields that only need to be identified among the fields to be configured.
[0042] A third aspect of an embodiment of the present invention provides a computer device, including:
[0043] Memory for storing computer programs;
[0044] A processor is used to implement the field configuration method of the CPE device as described in the first aspect when executing a computer program.
[0045] A fourth aspect of an embodiment of the present invention provides a storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the field configuration method of the CPE device of the first aspect are implemented.
[0046] The embodiment of the present invention provides configuring XML rules according to field information to be configured on a CPE device, obtaining an XML rule configuration file, inputting the XML rule configuration file into the CPE device so that the CPE device parses the XML rule configuration file to obtain parsed information, sending the parsed information to a CPE device editing tool so that the CPE device editing tool performs field configuration on the CPE device according to the parsed information to obtain configured fields, generating a configuration file according to the configured fields, and uploading the configuration file to the CPE device for configuration. The embodiment of the present invention can improve the field configuration efficiency of the CPE device by realizing custom configuration of the configuration fields of the CPE device. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 : A flow chart of a configuration method for a field configuration method of a CPE device provided by the present invention in one embodiment;
[0048] Figure 2 : A schematic diagram of the main functions of a CPE configuration editing tool GUI interface of an embodiment of the field configuration method of a CPE device provided by the present invention;
[0049] Figure 3 : A device block diagram of an embodiment of the field configuration method of the CPE device provided by the present invention. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.
[0051] Please refer to Figure 1 , which is a flow chart of an embodiment of a method for configuring a field of a CPE device provided in an embodiment of the present invention, including steps S101 to S104, each of which is specifically as follows:
[0052] S101. Configure XML rules according to field information to be configured on a CPE device to obtain an XML rule configuration file.
[0053] In this embodiment, a general CPE configuration editing tool is developed to generate CPE field configurations, ensuring that other personnel only need to modify the XML configuration rule file to add new configuration fields without modifying the program code as much as possible. First, the XML rules are configured according to the configuration needs to obtain an XML rule configuration file XML configuration rule file. In the XML configuration rule file, the configuration fields can be classified, so that the configuration production personnel can quickly select a configuration field belonging to a certain type to add.
[0054] It should be noted that XML refers to eXtensible Markup Language, a text file format. XML configuration rule file refers to a customized XML file, which contains information such as the names of all configuration fields, the categories to which the configuration fields belong, whether they are key configuration fields, and the associated configuration fields of the specified configuration fields. The file complies with the XML specification and can be parsed using the XML parsing library.
[0055] In some embodiments, step S102 includes but is not limited to the following steps:
[0056] According to the field information to be configured on the CPE device, a root element tag of the XML configuration rule file is set, and multiple sub-tags are set according to the root element tag;
[0057] The first sub-tag is used to define a language list, the second sub-tag is used to set the format of outputting the field to be configured and the value of the field to be configured, and the third sub-tag is used to define the category of the field to be configured;
[0058] The fourth sub-tag is used to define the field to be configured, and the fifth sub-tag is used to define the maximum length of the field to be configured, the maximum length of the value of the field to be configured, the default language, and the preset number of the field to be configured;
[0059] The sixth sub-tag is used to define the configuration fields that only need to be identified among the fields to be configured.
[0060] Specifically, the root element tag of the XML configuration rule file is project, and the root element tag must be project. The project tag can set two attributes, name and version, where the value of the name attribute must be configset, and the version attribute is used to indicate the revision of the XML configuration rule file. The project tag of the XML configuration rule file can contain several sub-tags as needed. The sub-tags that the project tag can contain and the functions of the sub-tags are shown in Table 1:
[0061] Table 1 Sub-label information table
[0062]
[0063] The subtags that the langlist tag can contain and their functions are shown in Table 2:
[0064] Table 2 Subtags of the langlist tag and their functions
[0065] Label effect language Defines a language available for GUI interfaces default Define the default language
[0066] The attributes that can be set for the language tag contained in the langlist tag and their functions are shown in Table 3:
[0067] Table 3 The attributes that can be set for the language tag and their functions
[0068]
[0069] The attributes that can be set in the default tag contained in the langlist tag and their functions are shown in Table 4 below:
[0070] Table 4 The attributes that can be set for the default tag and their functions
[0071]
[0072] The attributes that can be set for the class tag and their functions are shown in Table 5 below:
[0073] Table 5 The attributes that can be set for the class tag and their functions
[0074]
[0075] The sub-tags that the class tag can contain and their functions are shown in Table 6:
[0076] Table 6 Subtags included in the class tag and their functions
[0077]
[0078]
[0079] The format tag is used to set the output configuration field and its value format. The specific format is saved by the value of its attribute value. The attributes that can be set and their functions are shown in Table 7:
[0080] Table 7 Attributes of the format tag
[0081] property effect value Set the output configuration fields and their value formats
[0082] For example, there is a configuration field CONFIG_FILE_VERSION, and the value of this configuration field is set to 1.0. Then the corresponding content in the output configuration text file is:
[0083] export CONFIG_FILE_VERSION=1.0
[0084] The set-default-attr-value tag is used to set the maximum length of the configuration field, the maximum length of the configuration value, the default language, the maximum number of configuration fields that can be added, and other information. The attributes that can be set and their functions are shown in Table 8:
[0085] Table 8 set-default-attr-value tag attributes
[0086] property effect name The attribute name is used to define which item is being set. value The attribute value is used to define the value of the item corresponding to the name attribute
[0087] It should be noted that the default language defined here has a higher priority than the default language defined in the langlist tag. That is, if the default language is defined in the set-default-attr-value tag and the default language of the field to be configured is also defined in the langlist tag, the default language defined in set-default-attr-value will be used first.
[0088] The recognizedfields tag is used to define configuration fields that only need to be recognized. These configuration fields do not need to be defined in detail using the config tag. It is used to tell the CPE configuration editing tool that if a configuration file is opened and the configuration fields defined in the recognizedfields tag cannot be recognized, do not report an error. These configuration fields are intentionally not required to be configured.
[0089] The recognizedfields tag contains several item subtags. The item tag uses the attribute value to define configuration fields that do not need to be defined in detail by the config tag.
[0090] Use the config tag to define configuration fields.
[0091] For example, the type attribute value of the configuration field CONFIG_DISABLE_NTP is select, which means that the value of this configuration field can only be the value attribute value of one of the option tags it contains.
[0092] In this example, the configuration fields CONFIG_DISABLE_NTP and CONFIG_NTP_SERVER are both classified as NTP_CONFIG_FIELD, and both use the zh and en tags to define the Chinese and English descriptions of the configuration fields; the two option tags contained in the configuration field CONFIG_DISABLE_NTP indicate that the value of this configuration field can only be yes or no, and the default tag contained indicates that the default value of this configuration field is no. The subtag shouldconfig contained in the configuration field CONFIG_DISABLE_NTP indicates that CONFIG_NTP_SERVER needs to be configured when CONFIG_DISABLE_NTP is configured. The subtag shouldconfig contained in the configuration field CONFIG_NTP_SERVER indicates that CONFIG_DISABLE_NTP needs to be configured when CONFIG_NTP_SERVER is configured. The type attribute value of the configuration field CONFIG_NTP_SERVER is text, indicating that the value of this configuration field needs to be entered manually. The maxlength attribute value of the configuration field CONFIG_NTP_SERVER is 160, indicating that the maximum input length of the configuration field value is 160. The critical_config attribute value of the configuration field CONFIG_DISABLE_NTP is yes, indicating that this configuration field is a critical configuration field and needs to be added when creating a new configuration file.
[0093] It should be noted that key configuration fields refer to the most basic configuration fields that must be added to the configuration file.
[0094] Then define a configuration field DHCP_EXPIRE_TIME, of type intrange, and define the DHCP lease time value to be a number in the range of 600 to 86400 according to the rangestart attribute value and the rangeend attribute value.
[0095] In some embodiments, step S101 includes but is not limited to the following steps:
[0096] Use the first attribute in the fourth sub-tag to define the name of the field to be configured;
[0097] The second attribute in the fourth sub-tag is used to define the type of the field to be configured, and the value of the field to be configured is obtained according to the type of the field to be configured;
[0098] The third attribute in the fourth subtag is used to define the description information of the field to be configured, the third attribute in the fifth subtag is used to define the length of the value of the field to be configured, the fourth attribute in the fourth subtag is used to define the category of the field to be configured, the fifth attribute in the fourth subtag is used to define whether the field to be configured is a key configuration, and the sixth attribute in the fourth subtag is used to define the format of the field to be configured.
[0099] Specifically, the config tag is used to define configuration fields. The attributes that can be set and their functions are shown in Table 9:
[0100] Table 9 Attributes of the config tag and their functions
[0101]
[0102]
[0103] The subtags that the config tag can contain and their functions are shown in Table 10:
[0104] Table 10 config tag subtags and their functions
[0105]
[0106]
[0107] It should be noted that a configuration field refers to a valid configuration file containing several name=value definitions. We call the name here the configuration field or configuration name, and the value is the configuration value.
[0108] Associated configuration fields refer to setting a certain function, which usually requires setting multiple configuration fields. For example, for the NTP (Network Time Protocol, a protocol used to synchronize computer time) function, usually one configuration field A controls the opening or closing of the NTP function, and the other configuration fields B, C, and D set the IP address or domain name of the NTP server. Then configuration field A and configuration fields B, C, and D are related, and configuration fields B, C, and D are the associated configuration fields of configuration field A.
[0109] In some embodiments, step S101 includes but is not limited to the following steps:
[0110] If the type is the first attribute value, the value of the field to be configured is the value in the option sub-tag in the fourth sub-tag. If the type is the second attribute value, the value of the field to be configured needs to be entered manually.
[0111] If the type is the third attribute value, the value of the field to be configured is synthesized according to the first method attribute in the fourth subtag; if the type is the fourth attribute value, the value of the field to be configured is synthesized according to the second method attribute value and the third method attribute value in the fourth subtag;
[0112] If the type is the fifth attribute value, the value of the field to be configured is a fixed value. If the type is the sixth attribute value, the value of the field to be configured is an integer within a preset range.
[0113] Specifically, if the type attribute value of a configuration field is select, the value of the configuration field can only be the value of the value attribute of an option subtag contained in the config tag.
[0114] If the type attribute value of a configuration field is text, the value of the configuration field needs to be entered manually.
[0115] If the type attribute value of a configuration field is composite, when generating a configuration file, the value of the configuration field is generated by the corresponding processing of the configuration fields it depends on according to the composite_method attribute, and the field names and corresponding values of these dependent configuration fields do not appear in the final generated configuration file. When editing a configuration file, for a configuration field of this type, the configuration field is not directly configured, but the configuration field and value information are indirectly generated in the final generated configuration file by configuring the configuration fields it depends on. When opening a configuration file, it is necessary to parse the configuration field of this type and disassemble it to restore it to the value of the corresponding configuration field it depends on, and the configuration field and its value information are not directly displayed.
[0116] If the type attribute value of a configuration field is bitcomposite, when generating a configuration file, the value of the configuration field is a digital value generated by the corresponding values of the bit_offset attribute and the bit_count attribute of the configuration field it depends on, and the field names and corresponding values of these dependent configuration fields do not appear in the final generated configuration file. When editing a configuration file, for a configuration field of this type, the configuration field is not directly configured, but the configuration field and value information are indirectly generated in the final generated configuration file by configuring the configuration field it depends on. When opening a configuration file, it is necessary to parse the configuration field of this type and disassemble it to restore it to the value of the corresponding configuration field it depends on, and the configuration field and value information are not directly displayed.
[0117] If the type attribute value of a configuration field is fixvalue, the value of the configuration field is a fixed value. This type is rarely used.
[0118] If the type attribute value of a configuration field is intrange, the value of the configuration field must be an integer within a range of integers. The range of integers is defined by the rangestart attribute value and the rangeend attribute value. The rangestart attribute value defines the minimum integer value that can be used, and the rangeend attribute value defines the maximum integer value that can be used.
[0119] For example, if a configuration field TZ_LOCK_CELL_ID is defined with the type attribute value as composite and the composite_method attribute value as comma, TZ_LOCK_CELL_ID depends on the three configuration fields TZ_LOCK_CELL_ID_2G, TZ_LOCK_CELL_ID_3G, and TZ_LOCK_CELL_ID_4G. If the values of TZ_LOCK_CELL_ID_2G, TZ_LOCK_CELL_ID_3G, and TZ_LOCK_CELL_ID_4G are 1, 0, and 1 respectively, then the final configuration value of TZ_LOCK_CELL_ID is 1, 0, 1.
[0120] If you define a configuration field CFG_SERVICE_PREFERENCE of type bitcomposite, it depends on the three configuration fields CFG_DMZ_WEB, CFG_DMZ_SSH, and CFG_DMZ_TELNET. The output format is hex, the output hexadecimal numbers need to be lowercase, and the output value is 16 characters long. If the value is less than 16 characters long, you need to add 0 in front.
[0121] The bit offset of CFG_DMZ_WEB is 0 and occupies 1 bit. If the value of this configuration field is 1, the value of bit 0 of the CFG_SERVICE_PREFERENCE value needs to be set to 1 in the final CFG_SERVICE_PREFERENCE value.
[0122] The bit offset of CFG_DMZ_SSH is 4 and occupies 1 bit. If the value of this configuration field is 1, the value of the 4th bit of the CFG_SERVICE_PREFERENCE value needs to be set to 1 in the final CFG_SERVICE_PREFERENCE value.
[0123] The bit offset of CFG_DMZ_TELNET is 8 and occupies 1 bit. If the value of this configuration field is 1, the value of the 8th bit of the CFG_SERVICE_PREFERENCE value needs to be set to 1 in the final CFG_SERVICE_PREFERENCE value.
[0124] If the values of CFG_DMZ_WEB, CFG_DMZ_SSH, and CFG_DMZ_TELNET are all 1, the final value of CFG_SERVICE_PREFERENCE is 0000000000000111.
[0125] S102: Input the XML rule configuration file into the CPE device, so that the CPE device parses the XML rule configuration file to obtain parsing information.
[0126] In this embodiment, the XML configuration rule file is placed in the CPE firmware device. Since different models of CPE firmware devices are maintained and developed by different development teams, there are differences in the XML configuration rule files used. By placing the XML configuration rule file directly inside the CPE firmware device, there is no need to worry about which XML configuration rule file a certain model of CPE firmware device uses. Then use the CPE configuration editing tool client, such as a mobile phone APP or PC GUI program to first log in to the dedicated account verification server. After the username and password are verified, a request is sent to the CPE firmware device via Ethernet, WIFI or Bluetooth to obtain information related to the CPE internal configuration field. The CPE CGI server begins to parse the XML configuration rule file, and returns the configuration information in the parsed XML configuration rule file to the CPE configuration editing tool client in JSON data format. The JSON data contains all necessary configuration information.
[0127] It should be noted that CGI refers to Common Gateway Interface, which is a standard interface for a web server host to provide information services. JSON refers to JavaScript Object Notation, which is a lightweight data exchange format.
[0128] In some embodiments, step S102 includes but is not limited to the following steps:
[0129] Verify the first attribute of the root element tag in the XML rule configuration file to obtain a verification result, and determine whether the XML rule configuration file is valid according to the verification result. If valid, continue to traverse the second attribute of the root element tag in the XML rule configuration file to obtain a revision history of the XML rule configuration file;
[0130] Parse the first subtag to obtain a language list, parse the second subtag to obtain a format for outputting the field to be configured and the value of the field to be configured, and parse the third subtag to obtain a category of the field to be configured;
[0131] The fourth subtag is parsed to obtain the field to be configured, and the fifth subtag is parsed to obtain the maximum length of the field to be configured, the maximum length of the value of the field to be configured, the default language, and the preset number of the fields to be configured;
[0132] The sixth sub-tag is parsed to obtain only the configuration fields that need to be identified among the fields to be configured.
[0133] Specifically, after the CPE internal CGI server is started, it reads the built-in XML configuration rule file and confirms whether the XML configuration rule file is valid by checking whether the name attribute value of the project tag is configset; confirms the revision history of the XML configuration rule file according to the version attribute value of the project tag; analyzes the format tag inside to obtain the output configuration fields and their value formats; analyzes the langlist tag to obtain the list of supported languages and the default language; analyzes the class tag to obtain the list of configuration field categories; analyzes the set-default-attr-value tag to obtain information such as the maximum length of the configuration field, the maximum length of the configuration value, the default language, and the maximum number of configuration fields that can be added. Analyze the recognizedfields tag to obtain a list of configuration fields that only need to be recognized. Analyze the config tag to obtain the name, type, description, detailed description, maximum length, key configuration, output value format, lowercase, length, bit offset (if the field type is bitcomposite), number of bits (if the field type is bitcomposite), how to synthesize a final value (if the field type is composite), minimum integer value (if the field type is intrange), maximum integer value (if the field type is intrange), etc.; analyze the configurations that the field depends on, the associated configurations, and default values.
[0134] In the implementation of this embodiment, the first attribute of the root element tag in the XML rule configuration file is verified to obtain the verification result, and whether the XML rule configuration file is valid is determined according to the verification result. If it is valid, the second attribute of the root element tag in the XML rule configuration file is traversed to obtain the revision history of the XML rule configuration file, and then the first sub-tag is parsed to obtain the language list, the second sub-tag is parsed to obtain the format of outputting the field to be configured and the value of the field to be configured, the third sub-tag is parsed to obtain the category of the field to be configured, the fourth sub-tag is parsed to obtain the field to be configured, the fifth sub-tag is parsed to obtain the maximum length of the field to be configured, the maximum length of the value of the field to be configured, the default language and the preset number of the field to be configured, and the sixth sub-tag is parsed to obtain the configuration field that only needs to be identified in the field to be configured. By parsing the XML configuration rule file, this method can analyze the associated configuration field of the specified configuration field to ensure that the related configuration field is not omitted when adding. In addition, the key configuration field can be marked, so that all key configuration fields can be added when generating the configuration file.
[0135] S103: Send the parsed information to the CPE device editing tool, so that the CPE device editing tool performs field configuration on the CPE device according to the parsed information to obtain configured fields.
[0136] After the configuration information is returned to the CPE configuration editing tool client in the JSON data format, the CPE configuration editing tool client performs field configuration according to the acquired configuration information to obtain the configured fields.
[0137] In some embodiments, step S103 includes but is not limited to the following steps:
[0138] According to the preset number of fields to be configured, a blank configuration table with the same number of rows as the preset number is obtained;
[0139] According to the configuration field classification column of the blank configuration table, a classification list of fields to be configured is obtained, and configuration is performed according to the classification list of fields to be configured to obtain the target configuration field category, and a list of fields to be configured is obtained according to the target configuration field category, and configuration is performed according to the list of fields to be configured to obtain the target configuration field;
[0140] Get a value list based on the target configuration field, select based on the value list, get the value corresponding to the target configuration field, and confirm that the target configuration field category, target configuration field, and the value corresponding to the target configuration field are configured fields.
[0141] Specifically, Figure 2 As shown, Figure 2This is a schematic diagram of the main functions of the CPE configuration editing tool GUI interface. The CPE configuration editing tool client initializes a blank configuration table with a corresponding number of rows based on the maximum number of configuration fields that can be added in the configuration information. The blank configuration table contains three columns: the category to which the configuration field belongs, the configuration field name, and the configuration value. The configuration table initializes the configuration field categories that can be selected, and initializes the list of configuration fields that can be selected under each configuration field category. After selecting a configuration field category in the first column of the configuration table, the configuration field list corresponding to the second column of the same row belonging to the configuration field category is updated for use by tool users. After selecting the configuration field in the second column of the same row in the configuration table, update the configuration value in the third column of the same row to an input box, a selection box, or a fixed value.
[0142] In addition, Figure 2 The functions of the various parts of the CPE configuration editing tool GUI are as follows:
[0143] A is an input box for saving the path of the currently opened configuration file. Button B is the open configuration file button. When clicked, a file dialog box will pop up to open a configuration file. After parsing, the content will be updated to table P.
[0144] Button C is the save configuration file button. After all required configuration fields in Form P are configured, click this button to save all configuration fields in Form P as a configuration file.
[0145] Button D is a button for quickly generating a default configuration, which is used to add all configuration fields to form P at once, and each configuration field uses its default value.
[0146] Button E is a clear configuration table button, which is used to clear the configuration field contents in table P.
[0147] Button F is a button for generating basic configurations, which is used to add all key configuration fields to table P, and each configuration field uses its default value.
[0148] Button G is a configuration item deletion button. You can first select one or more rows in table P, and then click this button to delete the selected configuration content.
[0149] Checkbox H is a checkbox for prohibiting editing. When a new configuration is opened, this checkbox will be selected to indicate that the current configuration content is in a state of prohibiting editing, so as to avoid modifying the content in table P by mistake and causing subsequent losses. Clicking this checkbox will make table P in a state of prohibiting editing, otherwise editing is allowed.
[0150] Button I is an add configuration row button, which is used to add a row before (when check box J is selected) or after (when check box J is not selected) the currently selected configuration row in table P. If no row is selected, a row is added at the end of the table.
[0151] Check box J is a check box before a specified row, which is used to indicate whether to add a row before a certain row in table P.
[0152] The drop-down box K is a list of configuration categories, which is used by button L (add specified category configuration).
[0153] Button L is a button for adding a specified class configuration to table P. The added configuration category is the category currently selected in the drop-down box K.
[0154] The input box M is used to input the name of the configuration field to be searched or the configuration field description keyword.
[0155] Button N is a configuration field search button. It matches the names and descriptions of all configuration fields according to the content in input box M, and lists all found configurations in table Q.
[0156] Table P is the table where the contents of the opened configuration file will be updated. You can add the required configuration field contents in the table. The first column of the table is the category to which the configuration field belongs. After the program is initialized, the cells in the first column will be initialized as a drop-down box for selecting a configuration field category. The second column of the table is used to select a configuration field. After selecting the configuration field category in the first column, the second column of the row where the configuration field category is located will be updated as a drop-down box for selecting a configuration field under the specified configuration field category. The third column of the table is used to set the value of the configuration field. After selecting the configuration field in the second column, the control in the third column of the corresponding row will be updated. According to the type attribute of the config tag, it is decided to initialize the third column of the row as an input box, a drop-down box, etc. For the row where the configuration field category and the configuration field name are selected at the same time, right-clicking the row will pop up a right-click menu for the tool user to select to check errors in the configuration rule file, list the associated configuration field list in Table Q, and list the configuration fields with blank characters at the beginning and end of the configuration value in Table Q. For the right-click operations related to the table, additional buttons or menus can also be added to achieve it. This table does not directly display configuration fields whose type attribute values are composite and bitcomposite.
[0157] Table Q is used to list all matching configuration field information. For the configuration fields in this list, you can add the configuration field to Table P by right-clicking the mouse. For the right-click operations related to this table, you can also add additional buttons or menus to implement them. This table does not list the configuration fields whose type attribute values are composite and bitcomposite.
[0158] In addition, for the button controls mentioned above, you can also use menu controls to implement corresponding functions.
[0159] Other common functions of the CPE configuration editing tool include: for existing configuration files, you can parse the values of all configuration fields and update the configuration content to the configuration table; in the configuration table, you can first select a configuration field, and then list the configuration fields associated with the configuration field by clicking a button or menu; you can add all configuration fields at once by clicking a button or menu, and all configuration fields are default values; you can add all key configuration fields at once by clicking a button or menu to form the most basic configuration, and all configuration fields are default values; you can clear all configuration fields added in the configuration table at once by clicking a button or menu; you can add configuration fields belonging to a certain category at once by clicking a button or menu; you can add a new configuration field before or after a row in the configuration table by clicking a button or menu; you can add searched configuration fields to the configuration table by clicking a button or menu.
[0160] S104: Generate a configuration file according to the configured fields, and upload the configuration file to the CPE device for configuration.
[0161] In this embodiment, after configuring all the configuration fields, the tool user can save the generated configuration file as a local file after obtaining the configured fields. The generated configuration file can also be uploaded to the CPE through the CPECGI server call to synchronize the latest configuration.
[0162] After the main functions of the CPE configuration editing tool are written, since adding new configuration fields only requires modifying the XML configuration rule file, there is no need to modify the CPE configuration editing tool program code, which reduces the workload of developers. Since the number of times the program code is directly modified is greatly reduced, the probability of introducing new bugs is reduced, and the workload of testers is reduced. Moreover, based on the XML configuration rule file, the developed CPE configuration editing tool has high versatility and is highly versatile in the processing of input boxes or selection boxes. Therefore, it is easy to uniformly add additional processing logic for all configuration fields.
[0163] It should be noted that the configuration file refers to the file used to customize the device. The CPE firmware parses the configuration file and applies the parameters set in it, such as the default APN used by the CPE, the username and password for logging into the CPE web page, and the NTP server IP address selected by default for the CPE.
[0164] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0165] In some embodiments, Figure 3 As shown, it shows a block diagram of a field configuration device 300 of a CPE device provided in an embodiment of the present application, including: an acquisition module 301, a parsing module 302, a configuration module 303 and a generation module 304, wherein:
[0166] The acquisition module 301 is used to configure the XML rule according to the field information to be configured on the CPE device to obtain the XML rule configuration file;
[0167] A parsing module 302, used for inputting the XML rule configuration file into the CPE device, so that the CPE device parses the XML rule configuration file to obtain parsing information;
[0168] The configuration module 303 is used to send the parsed information to the CPE device editing tool, so that the CPE device editing tool performs field configuration on the CPE device according to the parsed information to obtain the configured fields;
[0169] The generating module 304 is used to generate a configuration file according to the configured fields, and upload the configuration file to the CPE device for configuration.
[0170] In some embodiments, the XML rule is configured according to the field information to be configured on the CPE device to obtain the XML rule configuration file, including:
[0171] According to the field information to be configured on the CPE device, a root element tag of the XML configuration rule file is set, and multiple sub-tags are set according to the root element tag;
[0172] The first sub-tag is used to define a language list, the second sub-tag is used to set the format of outputting the field to be configured and the value of the field to be configured, and the third sub-tag is used to define the category of the field to be configured;
[0173] The fourth sub-tag is used to define the field to be configured, and the fifth sub-tag is used to define the maximum length of the field to be configured, the maximum length of the value of the field to be configured, the default language, and the preset number of the field to be configured;
[0174] The sixth sub-tag is used to define the configuration fields that only need to be identified among the fields to be configured.
[0175] In some embodiments, the CPE device is enabled to parse the XML rule configuration file to obtain parsed information, including:
[0176] Verify the first attribute of the root element tag in the XML rule configuration file to obtain a verification result, and determine whether the XML rule configuration file is valid according to the verification result. If valid, continue to traverse the second attribute of the root element tag in the XML rule configuration file to obtain a revision history of the XML rule configuration file;
[0177] Parse the first subtag to obtain a language list, parse the second subtag to obtain a format for outputting the field to be configured and the value of the field to be configured, and parse the third subtag to obtain a category of the field to be configured;
[0178] The fourth subtag is parsed to obtain the field to be configured, and the fifth subtag is parsed to obtain the maximum length of the field to be configured, the maximum length of the value of the field to be configured, the default language, and the preset number of the fields to be configured;
[0179] The sixth sub-tag is parsed to obtain only the configuration fields that need to be identified among the fields to be configured.
[0180] In some embodiments, the fourth sub-tag is used to define the field to be configured, including:
[0181] Use the first attribute in the fourth sub-tag to define the name of the field to be configured;
[0182] The second attribute in the fourth sub-tag is used to define the type of the field to be configured, and the value of the field to be configured is obtained according to the type of the field to be configured;
[0183] The third attribute in the fourth subtag is used to define the description information of the field to be configured, the third attribute in the fifth subtag is used to define the length of the value of the field to be configured, the fourth attribute in the fourth subtag is used to define the category of the field to be configured, the fifth attribute in the fourth subtag is used to define whether the field to be configured is a key configuration, and the sixth attribute in the fourth subtag is used to define the format of the field to be configured.
[0184] In some embodiments, the type of the field to be configured obtains the value of the field to be configured, including:
[0185] If the type is the first attribute value, the value of the field to be configured is the value in the option sub-tag in the fourth sub-tag. If the type is the second attribute value, the value of the field to be configured needs to be entered manually.
[0186] If the type is the third attribute value, the value of the field to be configured is synthesized according to the first method attribute in the fourth subtag; if the type is the fourth attribute value, the value of the field to be configured is synthesized according to the second method attribute value and the third method attribute value in the fourth subtag;
[0187] If the type is the fifth attribute value, the value of the field to be configured is a fixed value. If the type is the sixth attribute value, the value of the field to be configured is an integer within a preset range.
[0188] In some embodiments, the CPE device editing tool is enabled to perform field configuration on the CPE device according to the parsed information to obtain the configured fields, including:
[0189] According to the preset number of fields to be configured, a blank configuration table with the same number of rows as the preset number is obtained;
[0190] According to the configuration field classification column of the blank configuration table, a classification list of fields to be configured is obtained, and configuration is performed according to the classification list of fields to be configured to obtain the target configuration field category, and a list of fields to be configured is obtained according to the target configuration field category, and configuration is performed according to the list of fields to be configured to obtain the target configuration field;
[0191] Get a value list based on the target configuration field, select based on the value list, get the value corresponding to the target configuration field, and confirm that the target configuration field category, target configuration field, and the value corresponding to the target configuration field are configured fields.
[0192] In one embodiment of the present application, a computer device is provided, which includes a memory and a processor, wherein a computer program is stored in the memory, and the above steps are implemented when the processor executes the computer program; the computer device provided in this embodiment has an implementation principle and technical effects similar to those of the above method embodiments, and will not be repeated here.
[0193] In one embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and the above steps are implemented when the computer program is executed by a processor; the computer-readable storage medium provided in this embodiment has an implementation principle and technical effects similar to those of the above method embodiment, and will not be repeated here.
[0194] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0195] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0196] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for configuring a field of a CPE device, characterized in that: include: Configure XML rules according to the field information to be configured on the CPE device, and obtain an XML rule configuration file; Inputting the XML rule configuration file into the CPE device so that the CPE device parses the XML rule configuration file to obtain parsing information; Sending the parsed information to a CPE device editing tool, so that the CPE device editing tool performs field configuration on the CPE device according to the parsed information to obtain configured fields; A configuration file is generated according to the configured fields, and the configuration file is uploaded to the CPE device for configuration.
2. The field configuration method of the CPE device according to claim 1, characterized in that: The step of configuring the XML rule according to the field information to be configured on the CPE device to obtain the XML rule configuration file includes: According to the field information to be configured of the CPE device, a root element tag of the XML configuration rule file is set, and according to the root element tag, a plurality of sub-tags are set; The first sub-tag is used to define a language list, the second sub-tag is used to set the format of outputting the field to be configured and the value of the field to be configured, and the third sub-tag is used to define the category of the field to be configured; The fourth sub-tag is used to define the field to be configured, and the fifth sub-tag is used to define the maximum length of the field to be configured, the maximum length of the value of the field to be configured, the default language, and the preset number of the field to be configured; The sixth sub-tag is used to define the configuration fields that only need to be identified among the fields to be configured.
3. The field configuration method of the CPE device according to claim 2, characterized in that: The step of causing the CPE device to parse the XML rule configuration file to obtain parsed information includes: Verify the first attribute of the root element tag in the XML rule configuration file to obtain a verification result, and determine whether the XML rule configuration file is valid according to the verification result; if valid, continue to traverse the second attribute of the root element tag in the XML rule configuration file to obtain a revision history of the XML rule configuration file; Parsing the first subtag to obtain the language list, parsing the second subtag to obtain the output field to be configured and the format of the value of the field to be configured, and parsing the third subtag to obtain the category of the field to be configured; Parsing the fourth subtag to obtain the field to be configured, parsing the fifth subtag to obtain the maximum length of the field to be configured, the maximum length of the value of the field to be configured, the default language, and the preset number of the fields to be configured; The sixth sub-tag is parsed to obtain the configuration fields that only need to be identified among the fields to be configured.
4. The field configuration method of the CPE device according to claim 2, characterized in that: The using the fourth sub-tag to define the field to be configured includes: Using the first attribute in the fourth sub-tag to define the name of the field to be configured; Defining the type of the field to be configured by using the second attribute in the fourth sub-tag, and obtaining the value of the field to be configured according to the type of the field to be configured; The third attribute in the fourth subtag is used to define the description information of the field to be configured, the third attribute in the fifth subtag is used to define the length of the value of the field to be configured, the fourth attribute in the fourth subtag is used to define the category of the field to be configured, the fifth attribute in the fourth subtag is used to define whether the field to be configured is a key configuration, and the sixth attribute in the fourth subtag is used to define the format of the field to be configured.
5. The field configuration method of the CPE device according to claim 4, characterized in that: The obtaining a value of the field to be configured according to the type of the field to be configured includes: If the type is the first attribute value, the value of the field to be configured is the value in the option sub-tag in the fourth sub-tag; if the type is the second attribute value, the value of the field to be configured needs to be manually entered; If the type is the third attribute value, the value of the field to be configured is synthesized according to the first method attribute in the fourth subtag; if the type is the fourth attribute value, the value of the field to be configured is synthesized according to the second method attribute and the third method attribute in the fourth subtag; If the type is the fifth attribute value, the value of the field to be configured is a fixed value; if the type is the sixth attribute value, the value of the field to be configured is an integer within a preset range.
6. The field configuration method of the CPE device according to claim 3, characterized in that: The step of enabling the CPE device editing tool to configure fields of the CPE device according to the parsed information to obtain configured fields includes: According to the preset number of fields to be configured, a blank configuration table having the same number of rows as the preset number is obtained; According to the configuration field classification column of the blank configuration table, a classification list of fields to be configured is obtained, and configuration is performed according to the classification list of fields to be configured to obtain a target configuration field category, and according to the target configuration field category, a list of fields to be configured is obtained, and configuration is performed according to the list of fields to be configured to obtain a target configuration field; A value list is obtained according to the target configuration field, a selection is made according to the value list to obtain a value corresponding to the target configuration field, and it is confirmed that the target configuration field category, the target configuration field and the value corresponding to the target configuration field are configured fields.
7. A field configuration device for a CPE device, characterized in that: include: An acquisition module is used to configure XML rules according to the field information to be configured on the CPE device to obtain an XML rule configuration file; A parsing module, used for inputting the XML rule configuration file into the CPE device, so that the CPE device parses the XML rule configuration file to obtain parsing information; A configuration module, used for sending the parsed information to a CPE device editing tool, so that the CPE device editing tool performs field configuration on the CPE device according to the parsed information to obtain configured fields; The generating module is used to generate a configuration file according to the configured fields, and upload the configuration file to the CPE device for configuration.
8. The field configuration device of the CPE device according to claim 7, characterized in that: The step of configuring the XML rule according to the field information to be configured on the CPE device to obtain the XML rule configuration file includes: According to the field information to be configured of the CPE device, a root element tag of the XML configuration rule file is set, and according to the root element tag, a plurality of sub-tags are set; The first sub-tag is used to define a language list, the second sub-tag is used to set the format of outputting the field to be configured and the value of the field to be configured, and the third sub-tag is used to define the category of the field to be configured; The fourth sub-tag is used to define the field to be configured, and the fifth sub-tag is used to define the maximum length of the field to be configured, the maximum length of the value of the field to be configured, the default language, and the preset number of the field to be configured; The sixth sub-tag is used to define the configuration fields that only need to be identified among the fields to be configured.
9. A computer device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the field configuration method of the CPE device as described in any one of claims 1 to 6 when executing the computer program.
10. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the field configuration method of the CPE device according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Configuration page generation method and device, electronic device and readable storage medium
CN110673847A
Webpage content control method and device, computer equipment and storage medium
CN113901371A
CPE configuration adaptive method and device, computer equipment and storage medium
CN114567549A
Message generation method and device and nonvolatile storage medium
CN116932399A
Configuration rule prototyping tool
US20100082954A1
