Data processing method and device, electronic equipment, medium and product

By acquiring configuration data and filtering, completing, and validating it according to configuration rules, target configuration data is generated, which solves the problem of insufficient configuration data security and realizes secure output and import of configuration data.

CN121967221APending Publication Date: 2026-05-01SHANGHAI LIANHONG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI LIANHONG TECH CO LTD
Filing Date
2025-12-15
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

In existing technologies, the security of configuration data is insufficient. Users can inject illegal configuration parameters through configuration import methods, and sensitive information may be leaked when the configuration data is exported. There is a lack of sufficient restrictions on special characters and effective protection during the configuration import process.

Method used

By acquiring configuration data, filtering out configuration items that cannot perform the target operation according to pre-determined configuration rules, supplementing missing attribute parameters, performing verification and repair processing, generating target configuration data, and executing the target operation.

Benefits of technology

It ensures secure output and import of configuration data, preventing the leakage of sensitive configuration items and the import of unauthorized configuration items, thus guaranteeing the stability and security of device configuration data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121967221A_ABST
    Figure CN121967221A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method, a data processing device, electronic equipment, a computer readable storage medium and a computer program product, and the method comprises the steps: obtaining first configuration data to be subjected to target operation; and filtering the configuration items which cannot execute the target operation in the first configuration data to obtain target configuration data, and executing the target operation on the target configuration data. Therefore, according to the method and the device, the configuration items which are not allowed to be output can be prevented from being output, and the configuration items which are not allowed to be imported into the target equipment can be prevented from being imported into the target equipment, so that leakage of sensitive configuration items is avoided, and the situation that some configuration item data are modified can be avoided; the data security in the data output process of the configuration data and the importing process of importing the configuration data into the target equipment is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Data processing methods, apparatus, electronic equipment, media and products Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a data processing method, a data processing apparatus, an electronic device, a computer-readable storage medium, and a computer program product. Background Technology

[0002] In related technologies, to prevent users from mistakenly modifying certain configuration items in the routing platform's configuration data (such as changing the network address to 256.256.256.256), the traditional solution is to set the configuration items to "read-only" status. However, although setting the configuration items to "read-only" status prevents users from directly modifying the configuration items, the data in the configuration items can still be modified through configuration import, which is not secure enough. Summary of the Invention

[0003] This application provides a data processing method, a data processing apparatus, an electronic device, a computer-readable storage medium, and a computer program product.

[0004] This application provides a data processing method comprising: acquiring first configuration data for a target operation, wherein the first configuration data is configuration data exported from a target device or configuration data to be imported into the target device, the target operation is a data output operation or a data import operation for the target device, and the first configuration data includes multiple configuration items; filtering configuration items in the first configuration data that cannot perform the target operation according to predetermined configuration rule data to obtain target configuration data, wherein the configuration rule data is used to determine the target operation types allowed and / or disallowed target operation types for each configuration item; and performing the target operation on the target configuration data.

[0005] Thus, in this embodiment of the application, first configuration data to be performed on the target operation can be obtained, and configuration items in the first configuration data that cannot be executed according to the predetermined configuration rule data can be filtered to obtain target configuration data. The target operation can then be performed on the target configuration data. This avoids the output of configuration items that are not allowed to be output, and also avoids the import of configuration items that are not allowed to be imported into the target device into the target device. This avoids the leakage of sensitive configuration items and the modification of some configuration item data, thus achieving data security in the data output process of configuration data and the import process of configuration data into the target device.

[0006] In some embodiments of this application, the step of filtering configuration items in the first configuration data that cannot perform the target operation according to predetermined configuration rule data to obtain target configuration data includes: performing padding processing on the first configuration data according to the configuration rule data to assign attribute parameters to target configuration items in the first configuration data that do not contain attribute parameters, thereby obtaining second configuration data, wherein the attribute parameters of the configuration items are used to indicate the type of target operation that the configuration items are allowed to perform; and filtering configuration items in the second configuration data whose attribute parameters do not match the target operation according to the attribute parameters of each configuration item, thereby obtaining the target configuration data.

[0007] Thus, in this embodiment of the application, the first configuration data can be supplemented according to the configuration rule data to allocate attribute parameters to target configuration items that do not contain attribute parameters in the first configuration data to obtain second configuration data, and the configuration items in the second configuration data whose attribute parameters do not match the target operation can be filtered according to the attribute parameters of each configuration item to obtain the target configuration data, thereby ensuring the validity of the target configuration data.

[0008] In some embodiments of this application, multiple configuration items in the first configuration data can be divided into multiple data levels. The step of performing a completion process on the first configuration data according to the configuration rule data to assign attribute parameters to target configuration items that do not contain attribute parameters in the first configuration data to obtain second configuration data includes: assigning attribute parameters corresponding to the data level to the target configuration item according to the configuration rule data and the data level where the target configuration item is located to obtain second configuration data, wherein the configuration rule data is used to determine the attribute parameters corresponding to the data level.

[0009] Thus, in this embodiment, attribute parameters corresponding to the data level can be assigned to the target configuration item according to the configuration rule data and the data level where the target configuration item is located, thereby obtaining the second configuration data. This ensures that the attribute parameters of configuration items at different data levels match the data level where the configuration item is located, thereby reducing the occurrence of false filtering and missed filtering to a certain extent.

[0010] In some embodiments of this application, the configuration rule data includes configuration item verification rules for each configuration item. The step of filtering configuration items in the second configuration data whose attribute parameters do not match the target operation, based on the attribute parameters of each configuration item, to obtain the target configuration data includes: verifying each configuration item in the second configuration data according to the configuration rule data; performing a preset data repair process on the second configuration data if there are abnormal configuration items in the second configuration data that fail the verification, to obtain third configuration data; and filtering configuration items in the third configuration data whose attribute parameters do not match the target operation, based on the attribute parameters of each configuration item in the third configuration data, to obtain the target configuration data.

[0011] Thus, in this embodiment, each configuration item in the second configuration data can be verified according to the configuration rule data, and if there are abnormal configuration items in the second configuration data that fail verification, the second configuration data can be subjected to preset data repair processing to obtain the third configuration data. Furthermore, according to the attribute parameters of each configuration item in the third configuration data, configuration items in the third configuration data whose attribute parameters do not match the target operation can be filtered to obtain the target configuration data. This avoids the situation of importing or outputting abnormal configuration items.

[0012] In some embodiments of this application, the configuration rule data includes multiple sub-data, each of which is used to verify at least one of the configuration items. The step of verifying each of the configuration items in the second configuration data according to the configuration rule data includes: verifying the configuration item according to the sub-data corresponding to the configuration item.

[0013] Thus, in this embodiment of the application, the configuration item can be verified based on the sub-data corresponding to the configuration item, thereby avoiding the need to verify the sub-data corresponding to the current configuration item each time. Therefore, it is not necessary to load the complete configuration rule data, which can reduce resource consumption to a certain extent and improve verification efficiency.

[0014] In some embodiments of this application, the step of performing a preset data repair process on the second configuration data to obtain third configuration data when there is an abnormal configuration item in the second configuration data that fails the verification includes: when there is an abnormal configuration item in the second configuration data, performing a preset data repair process on the second configuration data according to the default data of the configuration item corresponding to the abnormal configuration item to obtain third configuration data.

[0015] Thus, in this embodiment of the application, if the abnormal configuration item exists in the second configuration data, the second configuration data can be subjected to a preset data repair process based on the default data of the configuration item corresponding to the abnormal configuration item to obtain the third configuration data, thereby realizing the repair of the second configuration data.

[0016] In some embodiments of this application, the method further includes: parsing the fourth configuration data of the target device to determine the configuration data parsing result; and generating the configuration rule data based on the configuration data parsing result.

[0017] Thus, in this embodiment of the application, the fourth configuration data of the target device can be parsed to determine the configuration data parsing result; based on the configuration data parsing result, the configuration rule data is generated, thereby realizing the automatic generation of configuration rule data.

[0018] In some embodiments of this application, the configuration data parsing result includes a first sub-result and a second sub-result. The step of parsing the fourth configuration data of the target device to determine the configuration data parsing result includes: parsing the decorator field in the fourth configuration data to determine the first sub-result; and parsing the fourth configuration data according to the target syntax rules to determine the second sub-result.

[0019] Thus, in this embodiment of the application, the decorator field in the fourth configuration data is parsed to determine the first sub-result; the fourth configuration data is parsed using the target syntax rules to determine the second sub-result, thereby completing the parsing of the fourth configuration data.

[0020] In some embodiments of this application, the fourth configuration data includes multiple configuration data modules, and generating the configuration rule data based on the configuration data parsing result includes: generating module configuration data corresponding to each configuration data module based on the first sub-result and the second sub-result; and merging the module configuration data corresponding to each configuration data module to obtain the configuration rule data.

[0021] Thus, in this embodiment of the application, module configuration data corresponding to each configuration data module can be generated based on the first sub-result and the second sub-result, and the module configuration data corresponding to each configuration data module can be merged to obtain configuration rule data, so that the module configuration data corresponding to each configuration data module can be merged, thereby reducing data redundancy to a certain extent.

[0022] In some embodiments of this application, the step of merging the module configuration data corresponding to each configuration data module to obtain the configuration rule data includes: mapping the module configuration data corresponding to multiple configuration data modules to a preset number of module configuration data according to a predetermined data mapping rule to obtain the configuration rule data, wherein the number of configuration data modules is greater than the preset number.

[0023] Thus, in this embodiment of the application, the module configuration data corresponding to multiple configuration data modules can be mapped to a preset number of module configuration data according to a predetermined data mapping rule to obtain the configuration rule data, thereby realizing the merging of module configuration data.

[0024] This application provides a data processing apparatus, comprising: an acquisition module, configured to acquire first configuration data for a target operation, wherein the first configuration data is configuration data exported from a target device or configuration data to be imported into the target device, the target operation is a data output operation or a data import operation for the target device, and the first configuration data includes multiple configuration items; a filtering module, configured to filter configuration items in the first configuration data that are not allowed to perform the target operation according to predetermined configuration rule data, to obtain target configuration data, wherein the configuration rule data is used to determine the target operation types allowed to be performed and / or the target operation types not allowed to be performed for each configuration item; and a processing module, configured to perform the target operation on the target configuration data.

[0025] This application provides an electronic device, including a memory and a processor. The memory stores a computer program, which, when executed by the processor, implements the data processing method described above.

[0026] This application provides a computer-readable storage medium storing a computer program that, when executed by one or more processors, implements the data processing method described above.

[0027] This application provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the data processing method described above.

[0028] The data processing method provided in this application can obtain first configuration data to be used for the target operation, and filter configuration items in the first configuration data that cannot be used for the target operation according to the predetermined configuration rule data to obtain target configuration data, and perform the target operation on the target configuration data. This can avoid the output of configuration items that are not allowed to be output, and can also avoid the import of configuration items that are not allowed to be imported into the target device into the target device, thereby avoiding the leakage of sensitive configuration items and the occurrence of some configuration item data being modified. This achieves data security in the data output process of configuration data and the import process of configuration data into the target device.

[0029] Additional aspects and advantages of embodiments of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of embodiments of this application. Attached Figure Description

[0030] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments in conjunction with the following drawings, in which: Figure 1 is a schematic flowchart of a data processing method in some embodiments of this application; Figure 2 is a schematic flowchart of a data processing method in some embodiments of this application; Figure 3 is a schematic flowchart of data repair processing in some embodiments of this application; Figure 4 is a schematic diagram of a data output configuration process in some embodiments of this application; Figure 5 is a schematic diagram of a data import configuration process in some embodiments of this application; Figure 6 is a schematic diagram of a data import configuration process in some embodiments of this application; Figure 7 is a schematic diagram of an application scenario in some embodiments of this application; Figure 8 is a schematic diagram of an application scenario in some embodiments of this application. Detailed Implementation

[0031] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the embodiments of this application, and should not be construed as limiting the embodiments of this application.

[0032] In related technologies, user configuration data on routing platforms exists as a single, monolithic entity (such as a complete configuration table), without clearly defining the boundaries between user-modifiable and non-modifiable configurations. Furthermore, there is a lack of sufficient restrictions on special characters and effective protection against potential attacks during the configuration import process. Consequently, in practical applications, users can modify parts of the configuration that should be read-only and re-import the modified configuration into the device. Therefore, although some restrictions are imposed through read-only settings, the scope of protection is limited. Attackers can still inject illegal configuration parameters through configuration import, resulting in insufficient security. Moreover, sensitive information may be exposed during the export of user configuration data.

[0033] Understandably, while related technologies have proposed improvements to the user configuration data export and import process, such as adding a hash allocation step in the export process and a hash verification step in the import process to ensure data security and consistency, these measures still have certain shortcomings. However, this method lacks the ability to intercept illegal configuration content and cannot verify the legality of the actual values ​​of configuration items, allowing attackers to still inject malicious information through configuration import. Furthermore, configuration export can only prevent the leakage of sensitive information in a rather crude way, such as directly deleting all configurations contained in certain modules, lacking granular management.

[0034] Based on the aforementioned potential problems, please refer to Figure 1. This application provides a data processing method, including: 01: acquiring first configuration data for a target operation, wherein the first configuration data is configuration data exported from a target device or configuration data to be imported into the target device, the target operation is a configuration data output operation or a configuration data import operation for the target device, and the first configuration data includes multiple configuration items; 02: filtering configuration items in the first configuration data that cannot perform the target operation according to predetermined configuration rule data to obtain target configuration data, wherein the configuration rule data is used to determine the target operation types allowed and / or disallowed target operation types for each configuration item; 03: performing the target operation on the target configuration data.

[0035] This application provides a data processing apparatus. The data processing method of this application can be implemented by the data processing apparatus of this application. Specifically, the data processing apparatus includes an acquisition module, a filtering module, and a processing module. The acquisition module is used to acquire first configuration data to be used for a target operation, wherein the first configuration data is configuration data exported from a target device or configuration data to be imported into the target device, and the target operation is a configuration data output operation or a configuration data import operation for the target device, and the first configuration data includes multiple configuration items. The filtering module is used to filter configuration items in the first configuration data that cannot perform the target operation according to predetermined configuration rule data, to obtain target configuration data, wherein the configuration rule data is used to determine the target operation types that are allowed to be performed and / or the target operation types that are not allowed to be performed for each configuration item. The processing module is used to perform the target operation on the target configuration data.

[0036] This application also provides an electronic device, which includes a memory and a processor. The data processing method of this application can be implemented by the electronic device of this application. Specifically, the memory stores a computer program, and the processor is used to acquire first configuration data to be used for a target operation, and to filter configuration items in the first configuration data that cannot be used for the target operation according to predetermined configuration rule data to obtain target configuration data, and to perform the target operation on the target configuration data. The first configuration data is configuration data exported from a target device or configuration data to be imported into the target device. The target operation is a configuration data output operation or a configuration data import operation for the target device. The first configuration data includes multiple configuration items, and the configuration rule data is used to determine the target operation types that are allowed to be executed and / or the target operation types that are not allowed to be executed for each configuration item.

[0037] Specifically, considering that externally imported configuration data may contain configuration items beyond the user's editing permissions, and that unauthorized import of these configuration items may lead to device malfunctions, security vulnerabilities, or even malicious attacks, similarly, considering that outputting configuration data exported from the device, such as read-only configurations or sensitive status configurations, may pose security risks, in some embodiments provided in this application, the electronic device can first obtain first configuration data for the target operation, then filter out configuration items in the first configuration data that are not allowed to perform the target operation according to pre-determined configuration rule data, thereby obtaining target configuration data matching the target operation, and finally performing the corresponding target operation on the target configuration data.

[0038] In some implementations, the target device can be understood as a device capable of importing or exporting configuration data, and the operation of the target device depends on the various configuration items within the configuration data.

[0039] In some implementations, the target device includes, but is not limited to, routers, gateways, network switches, etc.

[0040] In some implementations, an electronic device can be understood as a device capable of importing configuration data into a target device, or as a device capable of filtering and outputting configuration data exported from a target device.

[0041] In some implementations, the electronic device includes, but is not limited to, a PC (Personal Computer) connected to the electronic device, a network management device, a remote server, etc., which can be configured according to the actual situation.

[0042] In some implementations, the electronic device is part of the target device, or the electronic device and the target device are the same device. In other words, the target device itself can filter the acquired first configuration data and output the filtered target configuration data to the outside, or import the target configuration data into its own internal system.

[0043] In some implementations, the target operation includes a data output operation or a data import operation for the target device. A data output operation can be understood as the process of converting configuration data exported from the target device into a separate file that can be used for backup, sharing, and other functions. A data import operation for the target device can be understood as the process of loading external configuration data into the target device and integrating it into the target device's existing configuration data.

[0044] In some implementations, the first configuration data can be understood as the original configuration data set to be executed for the target operation, which includes multiple configuration items for implementing the functions of the target device.

[0045] In some implementations, configuration items can be understood as the basic building blocks of configuration data, or as the parameters used by the target device to perform / implement a specific function.

[0046] In some implementations, the configuration items in the first configuration data include, but are not limited to, network IP (Internet Protocol) address, device MAC (Media Access Control) address, port number, protocol type, device serial number, etc., which can be set according to the actual situation.

[0047] In some implementations, configuration rule data can be used to determine the operation permission boundaries corresponding to each configuration item, i.e., the target operation types that are allowed to be executed (data import / data output) or the target operation types that are not allowed to be executed (data import / data output).

[0048] In some implementations, the first configuration data is an XML file obtained by converting the UCI (Unified Configuration Interface) configuration of the routing platform into XML format, while the configuration rule data is an XSD (XML Schema Definition) file used to describe and verify each configuration item in the XML file. The electronic device can then use the XSD file to verify whether the target operation type allowed to be executed by each node (i.e., configuration item) in the XML file is inconsistent with the target operation, and / or verify whether the target operation type not allowed to be executed by each node (i.e., configuration item) in the XML file is consistent with the target operation. Based on the verification results, nodes in the XML that are "inconsistent with the target operation type allowed to be executed" and / or nodes that are "consistent with the target operation type not allowed to be executed".

[0049] In some implementations, the target configuration data can be understood as the configuration data obtained after filtering the first configuration data through configuration rule data to filter out configuration items in the first configuration data that are not allowed to perform the target operation.

[0050] To more clearly illustrate the data import or data output process provided in the embodiments of this application, please refer to the following exemplary description: First, the electronic device acquires configuration data to be imported into the target device, or configuration data to be exported from the target device, i.e., first configuration data. It is understood that if the first configuration data is configuration data to be imported into the target device, then the first configuration data can be an external configuration file provided by the user (such as a configuration document in XML format). It is also understood that if the first configuration data is configuration data to be output, then the first configuration data can be understood as configuration data exported from the target device; in other words, the first configuration data is a complete set of configurations stored within the target device itself.

[0051] Then, based on the pre-defined configuration rules, permission checks are performed on each configuration item in the first configuration data, i.e., whether the configuration item is allowed to be imported or exported. During the filtering process, the electronic device will check each configuration item in the first configuration data one by one. If the configuration item does not match the target operation to be executed (i.e., the target operation is not allowed to be executed), the configuration item will be removed from the first configuration data, thus retaining the configuration items that can match the target operation (i.e., the target operation is allowed to be executed), thereby forming the target configuration data.

[0052] Finally, after the target configuration data is processed, the device performs the corresponding target operation on the target configuration data. Specifically, if the target operation is a data import operation for the target device, the target configuration data is imported into the target device to merge the target configuration data with the current configuration data of the target device. If the target operation is a data output operation, the target configuration data is output in a preset format (such as XML format), thereby obtaining a file that can be used by the user.

[0053] Thus, in this embodiment of the application, first configuration data to be used for the target operation can be obtained, and configuration items in the first configuration data that cannot be used for the target operation can be filtered according to the predetermined configuration rule data to obtain the target configuration data, and the target operation can be performed on the target configuration data. This can avoid the output of configuration items that are not allowed to be output, and can also avoid the import of configuration items that are not allowed to be imported into the target device into the target device, thereby avoiding the leakage of sensitive configuration items and the occurrence of some configuration item data being modified. This achieves data security in the data output process of configuration data and the import process of configuration data into the target device.

[0054] Alternatively, in data import scenarios, configuration items that are not allowed to be imported into the target device can be filtered out. This prevents unauthorized configuration items from being imported into the target device, thus avoiding device malfunctions or security vulnerabilities and ensuring the stability and security of the device configuration data. Similarly, in data output scenarios, sensitive configuration items that are not allowed to be exported from the target device can be filtered out, thereby preventing the leakage of sensitive configuration items and reducing security risks.

[0055] In some embodiments provided in this application, step 02 includes: performing a completion process on the first configuration data according to the configuration rule data, so as to assign attribute parameters to the target configuration items that do not contain attribute parameters in the first configuration data, thereby obtaining the second configuration data, wherein the attribute parameters of the configuration items are used to indicate the target operation type that the configuration items are allowed to perform; and filtering the configuration items in the second configuration data whose attribute parameters do not match the target operation according to the attribute parameters of each configuration item, thereby obtaining the target configuration data.

[0056] The filtering module in this embodiment is further configured to perform supplementation processing on the first configuration data according to the configuration rule data, so as to allocate attribute parameters to the target configuration items that do not contain attribute parameters in the first configuration data to obtain the second configuration data, and to filter the configuration items in the second configuration data whose attribute parameters do not match the target operation according to the attribute parameters of each configuration item to obtain the target configuration data, wherein the attribute parameters of the configuration item are used to indicate the target operation type that the configuration item is allowed to execute.

[0057] The processor in this embodiment is further configured to perform supplementation processing on the first configuration data according to the configuration rule data, so as to allocate attribute parameters to the target configuration items that do not contain attribute parameters in the first configuration data to obtain the second configuration data, and to filter the configuration items in the second configuration data whose attribute parameters do not match the target operation according to the attribute parameters of each configuration item to obtain the target configuration data, wherein the attribute parameters of the configuration items are used to indicate the target operation type that the configuration items are allowed to execute.

[0058] Specifically, considering that some configuration items in the first configuration data may lack attribute parameters, it is impossible to determine whether a configuration item is allowed to perform the aforementioned data import or data output operations when the attribute parameters are missing. If configuration items with missing attribute parameters are directly filtered, false filtering may occur, meaning that configuration items that are allowed to perform the target operation will be filtered out. Conversely, if configuration items with missing attribute parameters are not filtered, omissions may occur (i.e., configuration items that are not allowed to perform the target operation are retained), thus affecting the normal execution of the target operation.

[0059] Based on this, in some embodiments provided in this application, the electronic device can complete the first configuration data by configuring rule data, that is, assign corresponding attribute parameters to the configuration items that are missing attribute parameters, thereby obtaining the second configuration data in which all configuration items have attribute parameters. Then, based on the matching relationship between attribute parameters and target operation, the configuration items that do not match in the second configuration data are filtered out, and finally the target configuration data that can execute the target operation is obtained.

[0060] In some implementations, configuration rule data can be understood as preset, determined data used to determine the attribute parameters of configuration items.

[0061] In some implementations, electronic devices can assign corresponding attribute parameters to configuration items based on configuration rule data, using certain attribute information (such as name) of the configuration items.

[0062] In some implementations, the first configuration data is an XML file obtained by converting the UCI configuration of the routing platform into XML format, while the configuration rule data is an XSD file used to describe and validate each configuration item in the XML file. Then, the electronic device can call the xmlSchemaValidateDoc function through the identifier parameter XML_SCHEMA_VAL_VC_I_CREATE to complete the XML file.

[0063] In some implementations, electronic devices can call pre-built functions by configuring rule data. These functions can assign corresponding attribute parameters to configuration items based on certain attribute information (such as name) of the configuration items.

[0064] In some implementations, the completion process can be understood as supplementing the corresponding attribute parameters according to the configuration rules for target configuration items that do not contain attribute parameters in the first configuration data, so that the target operation types that the target configuration item is allowed / not allowed to perform can be identified according to the assigned attribute parameters.

[0065] In some implementations, attribute parameters can be understood as parameters used to indicate the types of target operations that a configuration item is allowed and / or not allowed to perform.

[0066] In some implementations, the configuration item's attribute parameter includes a field named export, which can take the values ​​yes and no. When export is yes, the configuration item allows data import and data output operations to be performed, and when export is no, the configuration item does not allow import and data output operations to be performed.

[0067] In some implementations, the configuration item's attribute parameter includes a field named modify, which can take the values ​​yes and no. When modify is yes, the configuration item allows both write and read operations (i.e., "read-write"), and when modify is no, the configuration item only allows read operations (i.e., "read-only").

[0068] In some implementations, the second configuration data can be understood as the data formed after the first configuration data has been padded, and each configuration item in the second configuration data has corresponding attribute parameters.

[0069] In some implementations, the target configuration data can be understood as a set of data obtained by matching attribute parameters with target operations, filtering the second configuration data for configuration items whose "attribute parameters do not match the target operation (e.g., export is no, target operation is import)" based on the matching results, and retaining only the configuration items whose "attribute parameters match the target operation (e.g., export is yes, target operation is import)".

[0070] To more clearly illustrate the implementation method of this application, please refer to the following exemplary description: After obtaining the first configuration data, the pre-determined configuration rule data is called to check each configuration item in the first configuration data one by one, identify the target configuration items that do not contain attribute parameters, and assign corresponding attribute parameters to these target configuration items that are missing attribute parameters, so as to ensure that each configuration item can identify the target operation type that the configuration item is allowed and / or not allowed to perform through the attribute parameters, thereby obtaining complete configuration data in which each configuration item has attribute parameters, which is the second configuration data.

[0071] Then, for each configuration item in the second configuration data, the attribute parameters of the configuration item are compared with the target operation to be performed to determine whether the two match. Based on the matching result of each configuration item, configuration items in the second configuration data whose attribute parameters do not match the target operation are filtered out, and configuration items whose attribute parameters match the target operation are retained, thereby obtaining the target configuration data.

[0072] Thus, in this embodiment of the application, the first configuration data can be supplemented according to the configuration rule data to assign attribute parameters to the target configuration items that do not contain attribute parameters in the first configuration data to obtain the second configuration data. Furthermore, based on the attribute parameters of each configuration item, the configuration items in the second configuration data whose attribute parameters do not match the target operation are filtered to obtain the target configuration data, thereby ensuring the validity of the target configuration data.

[0073] In some embodiments of this application, the step of supplementing the first configuration data according to the configuration rule data to assign attribute parameters to the target configuration item that does not contain attribute parameters in the first configuration data to obtain the second configuration data includes: assigning attribute parameters corresponding to the data level to the target configuration item according to the configuration rule data and the data level where the target configuration item is located to obtain the second configuration data, wherein the configuration rule data is used to determine the attribute parameters corresponding to the data level.

[0074] The filtering module in this embodiment is further configured to assign attribute parameters corresponding to the data level to the target configuration item based on the configuration rule data and the data level where the target configuration item is located, thereby obtaining second configuration data, wherein the configuration rule data is used to determine the attribute parameters corresponding to the data level.

[0075] The processor in this embodiment is further configured to assign attribute parameters corresponding to the data level to the target configuration item based on the configuration rule data and the data level where the target configuration item is located, thereby obtaining second configuration data, wherein the configuration rule data is used to determine the attribute parameters corresponding to the data level.

[0076] Specifically, in the embodiments provided in this application, the configuration data has a clear hierarchical structure, and the importance of configuration items at different levels is different. Therefore, the target operation types that are allowed and / or not allowed to be performed by configuration items at different levels are different. Based on this, the electronic device in the embodiments of this application can assign corresponding attribute parameters to the target configuration item according to the data level where the target configuration item with missing attribute parameters is located, based on the "mapping relationship between data level and attribute parameters" pointed to by the configuration rule data. This ensures that the attribute parameters of the target configuration item are the same as the data level where the target configuration item is located.

[0077] In some implementations, the data hierarchy of a configuration item can be understood as the hierarchical position of the configuration item within the entire configuration data structure.

[0078] In some implementations, configuration data (including first configuration data and second configuration data) can be divided into three layers: a user configuration layer, a device configuration layer, and a read-only layer. Data in the user configuration layer is readable, writable, importable, and exportable; data in the device configuration layer is readable, writable, non-importable, and non-exportable; and data in the read-only layer is readable, non-importable, and non-exportable. Furthermore, when the configuration item attribute parameters include an export field and a modify field, the values ​​of the export field and the modify field of the configuration item in the user configuration layer are both "yes," the export field of the configuration item in the device configuration layer is "yes," and the modify field is "no." The values ​​of the export field and the modify field of the configuration item in the read-only layer are both "no." Therefore, when the electronic device detects a target configuration item that does not contain attribute parameters, it can assign corresponding attribute parameters to the target configuration item according to the data layer of the target configuration item. For example, if the export field and the modify field of the target configuration item are missing, and the target configuration item belongs to the read-only layer, then an export field and a modify field are assigned to the target configuration item, and the values ​​of both the export field and the modify field are set to "no."

[0079] Thus, in this embodiment, attribute parameters corresponding to the data level can be assigned to the target configuration item according to the configuration rule data and the data level where the target configuration item is located, thereby obtaining the second configuration data. This ensures that the attribute parameters of configuration items at different data levels match the data level where the configuration item is located, thereby reducing the occurrence of false filtering and missed filtering to a certain extent.

[0080] In some embodiments of this application, the configuration rule data includes configuration item verification rules for each configuration item. The step of filtering configuration items in the second configuration data whose attribute parameters do not match the target operation based on the attribute parameters of each configuration item to obtain the target configuration data includes: verifying each configuration item in the second configuration data according to the configuration rule data; performing preset data repair processing on the second configuration data if there are abnormal configuration items that fail verification in the second configuration data to obtain the third configuration data; and filtering configuration items in the third configuration data whose attribute parameters do not match the target operation based on the attribute parameters of each configuration item in the third configuration data to obtain the target configuration data.

[0081] The filtering module in this embodiment is further configured to verify each configuration item in the second configuration data according to the configuration rule data, and to perform preset data repair processing on the second configuration data to obtain the third configuration data if there are abnormal configuration items in the second configuration data that fail the verification, and to filter configuration items in the third configuration data whose attribute parameters do not match the target operation according to the attribute parameters of each configuration item in the third configuration data to obtain the target configuration data.

[0082] The processing module is also used to verify each configuration item in the second configuration data according to the configuration rule data, and to perform preset data repair processing on the second configuration data to obtain the third configuration data if there are abnormal configuration items in the second configuration data that fail the verification, and to filter out configuration items in the third configuration data whose attribute parameters do not match the target operation according to the attribute parameters of each configuration item in the third configuration data to obtain the target configuration data.

[0083] The processor in this embodiment is further configured to verify each configuration item in the second configuration data according to the configuration rule data, and, if there are abnormal configuration items in the second configuration data that fail verification, perform preset data repair processing on the second configuration data to obtain third configuration data, and filter configuration items in the third configuration data whose attribute parameters do not match the target operation according to the attribute parameters of each configuration item in the third configuration data to obtain target configuration data.

[0084] Specifically, considering that during the configuration data import or output process, the second configuration data obtained after attribute parameter completion may contain abnormal configuration items with anomalies, such as incorrect data types, values ​​outside the range, invalid formats, missing necessary content, or the presence of redundant or illegal content, it is understandable that if attribute parameter filtering is performed directly and the import operation is executed, the target device for the imported configuration may malfunction. Conversely, if attribute parameter filtering is performed directly and the data output operation is executed, the output configuration data may not be usable on other devices.

[0085] Based on this, in some embodiments provided in this application, each configuration item in the second configuration data can be verified based on the configuration rule data containing the verification rules for each configuration item. When some configuration items fail the verification, a preset data repair process is performed based on the default data of the configuration items, thereby obtaining the third configuration data in which all configuration items can pass the verification. Finally, configuration items whose attribute parameters do not match the target operation are filtered out according to the attribute parameters of the configuration items, thereby obtaining the target configuration data. Then, data import or data output operations can be performed based on the target configuration data.

[0086] In some implementations, the configuration item verification rules can be understood as pre-defined rules used to verify whether the data within the configuration item is valid.

[0087] In some implementations, the configuration item validation rules can cover the data type, value range, regular expression matching, enumeration value restrictions, and occurrence frequency constraints of the configuration item. Thus, the configuration item validation rules can be used to verify whether the data type, value range, enumeration value, and occurrence frequency of the configuration item meet the configuration item validation rules, thereby completing the configuration item validation.

[0088] In some implementations, an abnormal configuration item can be understood as a configuration item that, after being verified by the configuration item verification rules, fails to meet the configuration item verification rules (such as having an illegal enumeration value, a data format that does not conform to the regular expression requirements, a value that exceeds the predetermined range, or a missing necessary attribute).

[0089] In some implementations, the preset data repair process can be understood as a predefined operation flow for repairing abnormal configuration items in the second configuration data, such as using the default data of the abnormal configuration item to overwrite the data so that the abnormal configuration item is corrected into a configuration item that can pass the verification.

[0090] In some implementations, the third configuration data can be understood as the set of configuration data obtained after the second configuration data has undergone configuration item verification and preset data repair processing, in which all configuration items have passed the verification.

[0091] To more clearly illustrate the implementation methods provided in this application, please refer to the following exemplary description: First, the electronic device verifies all configuration items in the second configuration data one by one based on the configuration item verification rules contained or indicated in the configuration rule data for each configuration item. During the verification process, the verification operations that can be performed on the configuration items may include, but are not limited to: verifying whether string type configuration items conform to preset regular expressions, and verifying whether numeric type configuration items are within a predetermined range, etc.

[0092] During the validation process, if an abnormal configuration item fails validation, it is recorded. After validating each configuration item in the second configuration data, a preset data repair process is triggered to repair each recorded abnormal configuration item. For example, if the abnormal configuration item has an invalid value, its value is replaced with a default value. Or, if an abnormal configuration item is missing a necessary attribute, the corresponding attribute is extracted from the default data to supplement it.

[0093] Finally, after completing the data repair process of the second configuration data to obtain the third configuration data in which any configuration item can pass the verification, the configuration items whose attribute parameters match the target operation are selected based on the attribute parameters of each configuration item in the third configuration data, and the mismatched configuration items are filtered out (such as the configuration items with the export attribute "no" when the target operation is import). Thus, the target configuration data is obtained, and the corresponding data import operation or data output operation is performed based on the target configuration data.

[0094] Thus, in this embodiment, each configuration item in the second configuration data can be verified according to the configuration rule data, and if there are abnormal configuration items in the second configuration data that fail verification, the second configuration data can be subjected to preset data repair processing to obtain the third configuration data. Furthermore, according to the attribute parameters of each configuration item in the third configuration data, configuration items in the third configuration data whose attribute parameters do not match the target operation can be filtered to obtain the target configuration data. This avoids the situation of importing or outputting abnormal configuration items.

[0095] In some embodiments of this application, the configuration rule data includes multiple sub-data, each of which is used to verify at least one configuration item. The step of verifying each configuration item in the second configuration data according to the configuration rule data includes: verifying the configuration item according to the sub-data corresponding to the configuration item.

[0096] The filtering module in this application embodiment is also used to verify the configuration item based on the sub-data corresponding to the configuration item.

[0097] The processor in this embodiment is also configured to verify the configuration item based on the sub-data corresponding to the configuration item.

[0098] Specifically, considering that when performing configuration item verification, if the complete configuration rule data needs to be called for verification every time, the slow loading speed of the configuration rule data may lead to low verification efficiency, ultimately affecting the import or output efficiency of configuration data.

[0099] Based on this, in some embodiments provided in this application, the configuration rule data can be understood as a collection composed of multiple sub-data. Each sub-data may contain at least one verification rule for a configuration item. Therefore, when verifying each configuration item in the second configuration data, only the sub-data matching the configuration item is called to perform the verification operation. This avoids the situation where the verification efficiency is low due to loading the complete configuration rule data for verification, which ultimately affects the data import or data output operation of the configuration data.

[0100] In some implementations, the configuration rule data consists of multiple XSD files (i.e., sub-data). The configuration data (including first configuration data, second configuration data, and third configuration data) may include multiple modules. Each module includes at least one configuration item. The configuration item in each module can be verified through an XSD file. Thus, when verifying the configuration item in a certain module of the configuration data, the electronic device can call the XSD file corresponding to the configuration item.

[0101] Furthermore, in one embodiment, the electronic device stores a file named module_map.xml, which records the mapping relationship between the module name of each module and each XSD file. Thus, when verifying the configuration item in a certain module in the configuration data, the electronic device can call the XSD file corresponding to the module name to verify the module based on the module name and module_map.xml.

[0102] To illustrate this implementation more clearly, please refer to Figure 2. Figure 2 is a flowchart of the data processing method in some embodiments of this application. As shown in Figure 2, the electronic device can parse the received verification request and determine whether the verification request carries the module name of a certain module in the XML based on the verification result.

[0103] If the module name of a certain module in the XML is not included, the electronic device will directly load all XSD files and perform XML validation based on the loaded XSD files.

[0104] If the module name is included in the XML, the electronic device will use the module name and module_map.xml to call the corresponding XSD file to validate the module. For example, when the module name is "administration", the electronic device can find the XSD file named "System_Management.xsd" corresponding to "administration" based on the mapping relationship recorded in module_map.xml, and then load the file and perform the validation.

[0105] Thus, in this embodiment of the application, the configuration item can be verified based on the sub-data corresponding to the configuration item, thereby avoiding the need to verify the sub-data corresponding to the current configuration item each time. Therefore, it is not necessary to load the complete configuration rule data, which can reduce resource consumption to a certain extent and improve verification efficiency.

[0106] In some embodiments of this application, the step of performing a preset data repair process on the second configuration data to obtain the third configuration data when there are abnormal configuration items that fail verification in the second configuration data includes: when there are abnormal configuration items in the second configuration data, performing a preset data repair process on the second configuration data according to the default data of the configuration items corresponding to the abnormal configuration items to obtain the third configuration data.

[0107] The filtering module in this application embodiment is also used to perform preset data repair processing on the second configuration data according to the default data of the configuration item corresponding to the abnormal configuration item when there is an abnormal configuration item in the second configuration data, so as to obtain the third configuration data.

[0108] The processor in this application embodiment is further configured to, in the event that there is an abnormal configuration item in the second configuration data, perform a preset data repair process on the second configuration data according to the default data of the configuration item corresponding to the abnormal configuration item, and obtain the third configuration data.

[0109] Specifically, in order to repair abnormal configuration items, in the embodiments provided in this application, the current data of the abnormal configuration item can be overwritten by the default data of the abnormal configuration item (i.e., the default data of the configuration item), thereby completing the data repair process of the second configuration data.

[0110] In some implementations, the default data of a configuration item can be understood as data that is pre-set for each configuration item and conforms to the configuration item verification rules, including but not limited to the default value, default attribute parameters, and default structure of the configuration item.

[0111] In some implementations, please refer to Figure 3 for details. Figure 3 is a schematic diagram of the data repair process in some implementations of this application. Specifically, as shown in Figure 3, in one example, the data repair process for the second configuration data may include the following steps: The electronic device verifies whether the element nesting, attribute type, and value range of each node (i.e., configuration item) in the XML file (i.e., the second configuration data) conform to the rules based on the XSD file (i.e., the configuration rule data). For example, if the XSD specifies that "the port number must be an integer between 0 and 65535", then "port number = 65536" in the configuration will be marked as an error.

[0112] If all nodes in the XML pass the XSD validation, the process ends and the XML file does not need to be repaired.

[0113] When an error node (i.e., an abnormal configuration item) is found during XSD validation, the node that caused the error is recorded. Then, after the entire XML file (or a module within the XML file) has been validated, the current data of each error node is overwritten with the default configuration (i.e., the default data of the configuration item) to repair the XML file. For example, for a node with an incorrect IP address format, the node's default IP (such as "192.168.1.1") is overwritten with the node's current IP address.

[0114] The "default configuration overwrite" step may specifically include: (1) overwrite the faulty node with the default configuration; (2) overwrite the parent node of the faulty node with the default configuration; (3) overwrite the parent node of the parent node of the faulty node with the default configuration; (4) repeat (1)-(3) until the maximum number of iterations is reached.

[0115] Understandably, without setting a maximum number of iterations, it might enter an infinite loop.

[0116] In some examples, the maximum number of iterations is 10.

[0117] It is worth noting that in this example, when a node is detected as an error node, there may be a situation where "the child node of the error node is actually an error node, but the verification of the child node fails". Based on this, the electronic device in the embodiment of this application can first repair the detected error node and then perform a new verification until there are no errors.

[0118] In some examples, there are four specific ways to "overwrite the faulty node (or parent node, or parent node's parent node) with the default configuration": replacing the node, merging child nodes, deleting the node, and resetting attributes. Replacing the node means copying the node corresponding to the default configuration and overwriting the faulty node. Merging child nodes means copying all child nodes corresponding to the default configuration and appending them to the faulty node's child node list. Deleting the node means deleting the faulty node. Resetting attributes means copying the attributes corresponding to the default configuration and overwriting the faulty node's attributes.

[0119] In some examples, the corrective actions for faulty nodes may include: (1) Imported configurations containing faulty enumeration values ​​are reset to their default values. (2) Imported configurations containing missing values ​​are supplemented. (3) Imported configurations containing extra values ​​are removed. (4) Imported configurations containing duplicate values ​​are removed. (5) Illegal attributes appearing in imported configurations are removed. (6) Text within composite elements in imported configurations is removed. (7) Composite elements appearing in simple elements in imported configurations are reset.

[0120] Thus, in this embodiment of the application, if there are abnormal configuration items in the second configuration data, the second configuration data can be repaired by performing a preset data repair process based on the default data of the configuration items corresponding to the abnormal configuration items, thereby obtaining the third configuration data and thus realizing the repair of the second configuration data.

[0121] In addition, to more clearly illustrate the configuration data output process in the embodiments of this application, please refer to Figure 4, which is a schematic diagram of the configuration data output process in some embodiments of this application. Specifically, in an example shown in Figure 4, the electronic device can first read the user configuration file and the XSD, that is, load the user-provided XML file (such as network device configuration) and read the corresponding XSD file.

[0122] Then, using the XML_SCHEMA_VAL_VC_I_CREATE identifier, xmlSchemaValidateDoc is invoked to generate XML, which assigns corresponding default attribute parameters to nodes in the XML that do not contain attribute parameters by using the default attribute parameters of each configuration item recorded in the XSD file, thus obtaining the complete XML.

[0123] Next, check for any error nodes that fail to validate the complete XML using XSD (such as element type mismatch, invalid attribute values, incorrect nesting of structures, etc.).

[0124] If an error exists, the current data of the erroneous node is overwritten with the default data of the erroneous node to restore the erroneous node. For example, the IP address of the node is overwritten with the default IP address (such as "192.168.1.1"), thereby achieving complete XML repair.

[0125] If the complete XML file has been repaired, or if there are no erroneous nodes in the complete XML file, filter out configuration items in the complete XML file that are exported as no.

[0126] Finally, the XML file containing the completed filtering operations will be output, thus ending the configuration data output process.

[0127] Furthermore, to more clearly illustrate the configuration data import process in the embodiments of this application, please refer to Figures 5 and 6, which are schematic diagrams of the configuration data import process in some embodiments of this application. Specifically, in one example shown in Figures 5 and 6, the electronic device can read the configuration file to be imported and the XSD file, that is, load the XML file to be imported and read the corresponding XSD file at the same time.

[0128] Then, using the XML_SCHEMA_VAL_VC_I_CREATE identifier, xmlSchemaValidateDoc is invoked to generate XML, which assigns corresponding default attribute parameters to nodes in the XML that do not contain attribute parameters by using the default attribute parameters of each configuration item recorded in the XSD file, thus obtaining the complete XML.

[0129] Next, check for any error nodes that fail to validate the complete XML using XSD (such as element type mismatch, invalid attribute values, incorrect nesting of structures, etc.).

[0130] If errors exist, the current data of the erroneous node is overwritten with its default data to restore it. For example, the IP address of the node is overwritten with a default IP address (such as "192.168.1.1"), thus achieving complete XML repair. It is worth noting that if an error that cannot be eliminated occurs during the repair process, the import process ends.

[0131] After repairing the complete XML file, or if there are no erroneous nodes in the complete XML file, iterate through each node and its child nodes in the complete XML to filter out configurations that cannot be imported, i.e., delete configuration items in the complete XML file that are marked as "export no".

[0132] Finally, after deleting the configuration items marked "export no" from the complete XML file, the complete XML file is written to the device, and the configuration data import process ends.

[0133] Furthermore, to more clearly illustrate the configuration data verification process in the embodiments of this application, please refer to Figures 7 and 8, which are schematic diagrams of application scenarios in some embodiments of this application. Specifically, as shown in Figures 7 and 8, Lua / C / C++ applications can call the verification code, XML parsing code, and error configuration repair code in the verification module by passing command-line parameters. This allows them to call functions in the libxml2 library for XML parsing (such as xmlReadFile) to parse each node in the XML, and / or call functions in the libxml2 library for XSD verification (such as xmlSchemaValidateDoc) to verify each node in the XML through XSD. When an error node is detected, functions in the libxml2 library for XML tree operations are called to modify the error node and the XML file.

[0134] Furthermore, when calling XSD, upper-layer applications can choose to use the root element rules (i.e., config.xsd) to validate the entire XML, or they can use rules for a single module (such as wireless.xsd) to validate only a portion of the complete XML. Additionally, the basic types file (types.xsd) defines the basic types required for validation and can be included in other files.

[0135] In some embodiments of this application, the data processing method further includes: parsing the fourth configuration data of the target device to determine the configuration data parsing result; and generating configuration rule data based on the configuration data parsing result.

[0136] The data processing apparatus of this application embodiment further includes a parsing module and a generation module. The parsing module is used to parse the fourth configuration data of the target device and determine the configuration data parsing result. The generation module is used to generate configuration rule data based on the configuration data parsing result.

[0137] The processor in this embodiment is further configured to parse the fourth configuration data of the target device, determine the configuration data parsing result, and generate configuration rule data based on the configuration data parsing result.

[0138] Specifically, to avoid users manually writing configuration rule data, in some embodiments provided in this application, the electronic device can parse the target device's native fourth configuration data, such as extracting key information like the structure, attributes, and constraints of each configuration item in the fourth configuration data to form a structured configuration data parsing result, and then automatically generate configuration rule data adapted to the target device based on the parsing result, thereby realizing the automated generation of configuration rule data.

[0139] In some implementations, the fourth configuration data can be understood as a set of raw data inherent to the target device itself, used to describe the basic information and constraint logic of the configuration items.

[0140] In some implementations, the fourth configuration data includes the hierarchical structure of each configuration item, data type (such as IP address, port number), version dependency, device family compatibility, operation permission association information, etc., and is the "source data" of the target device configuration system.

[0141] In some implementations, the configuration data parsing result can be understood as the intermediate data obtained after performing structured parsing on the fourth configuration data, which can be used to generate configuration rule data.

[0142] In some implementations, the configuration data parsing results may include fields such as "device family adaptation list", "version range constraint", and "data type constraint" for a certain configuration item.

[0143] In one example, the process of an electronic device generating configuration rule data can be illustrated as follows: First, the electronic device obtains the fourth configuration data of the target device. This fourth configuration data can be a .ucitype format file and may contain complete information about each configuration item in the target device.

[0144] Then, the electronic device parses the fourth configuration data to extract constraint information such as the device adaptation range and version dependency of the configuration items, as well as the metadata of the configuration items, thereby obtaining the configuration data parsing result.

[0145] Finally, the electronic device can generate corresponding configuration rule data based on the configuration data parsing results. For example, if the parsing result shows that the export field of a certain configuration item is no, the generated configuration rule data can be used to determine that the configuration item is not allowed to perform import and data output operations.

[0146] Thus, in this embodiment of the application, the fourth configuration data of the target device can be parsed to determine the configuration data parsing result; based on the configuration data parsing result, configuration rule data is generated, thereby realizing the automated generation of configuration rule data.

[0147] In some embodiments provided in this application, the configuration data parsing result includes a first sub-result and a second sub-result. Therefore, the above-mentioned step of parsing the fourth configuration data of the target device to determine the configuration data parsing result includes: parsing the decorator field in the fourth configuration data to determine the first sub-result; and parsing the fourth configuration data according to the target syntax rules to determine the second sub-result.

[0148] The parsing module in this application implementation is also used to parse the decorator field in the fourth configuration data to determine the first sub-result; and to parse the fourth configuration data according to the target syntax rules to determine the second sub-result.

[0149] The processor in this embodiment is further configured to parse the decorator field in the fourth configuration data to determine the first sub-result; and to parse the fourth configuration data according to the target syntax rules to determine the second sub-result.

[0150] Specifically, in some embodiments provided in this application, the parsing process of the fourth configuration data includes two independent parsing steps: parsing the decorator field in the fourth configuration data to extract the special constraint information therein as the first sub-result, and parsing the basic structure information in the fourth configuration data as the second sub-result according to the preset target syntax rules.

[0151] In some implementations, the decorator field can be understood as a marker field in the fourth configuration data used to carry special constraint information of the configuration item, usually starting with a specific symbol (such as "@").

[0152] In some implementations, the first sub-result can be understood as the data obtained after parsing the decorator field, such as the applicable device range, effective version range, read and write permissions, data output permissions, data merging strategy and other constraint information of the configuration item.

[0153] In some implementations, the target syntax rules can be understood as predefined syntax standards used to regulate the fourth configuration data infrastructure, including the declaration format of configuration items (such as the usage rules of keywords such as "config", "option", and "list"), naming rules, data type identification methods, hierarchical nesting logic, etc.

[0154] In some implementations, when parsing decorator fields, regular expressions can be used to parse decorator syntax in the configuration data (such as @version, @device_family, and / or by version number condition, and / or by device family filter).

[0155] In some implementations, the target grammar rule refers to the UCI grammar rule.

[0156] In some implementations, the second sub-result can be understood as the data obtained after parsing the fourth configuration data using the target syntax rules. It may include information such as the name of the configuration item, data type (e.g., string, IP address, port number, etc.), hierarchical relationship (e.g., the correspondence between parent and child configuration items), and occurrence constraints (e.g., minimum and maximum occurrences).

[0157] In some implementations, the process of parsing the fourth configuration data according to the target syntax rules may include, but is not limited to, parsing UCI syntax elements such as config / option / list and recording metadata such as element name, type, and number of occurrences.

[0158] Thus, in this embodiment of the application, the decorator field in the fourth configuration data is parsed to determine the first sub-result; the fourth configuration data is parsed according to the target syntax rules to determine the second sub-result, thereby completing the parsing of the fourth configuration data.

[0159] In some embodiments of this application, the fourth configuration data includes multiple configuration data modules. Therefore, the step of generating configuration rule data based on the configuration data parsing result includes: generating module configuration data corresponding to each configuration data module based on the first sub-result and the second sub-result; and merging the module configuration data corresponding to each configuration data module to obtain configuration rule data.

[0160] The generation module in this application is used to generate module configuration data corresponding to each configuration data module based on the first sub-result and the second sub-result; and to merge the module configuration data corresponding to each configuration data module to obtain configuration rule data.

[0161] The processor in this embodiment is further configured to generate module configuration data corresponding to each configuration data module based on the first sub-result and the second sub-result; and to merge the module configuration data corresponding to each configuration data module to obtain configuration rule data.

[0162] Specifically, considering that the fourth configuration data may include multiple configuration data modules, if the rule data corresponding to each module is not managed after generating the module configuration data of each configuration data module, it may be necessary to frequently switch and load the module configuration data of different configuration data modules during subsequent verification calls. This may easily lead to file search errors or loading omissions. In addition, a large number of independent module configuration data will occupy more storage resources and affect the overall efficiency of configuration verification.

[0163] Based on this, in the embodiments of this application, after generating corresponding module configuration data for each configuration data module in the fourth configuration data based on the configuration data parsing results (first sub-result and second sub-result), all module configuration data can be integrated and merged according to preset standards to finally form unified configuration rule data.

[0164] In some implementations, the configuration data module in the fourth configuration data can be understood as the module in the UCI configuration.

[0165] In some implementations, module configuration data can be understood as configuration rule data generated for a single configuration data module, which may include validation rules (such as data type constraints, numerical ranges, enumeration value lists, regular expressions, etc.), hierarchical attributes (modify / export attributes), and version / device adaptation conditions for all configuration items within the module.

[0166] In some implementations, merging can be understood as the process of integrating configuration data from multiple modules into one or more unified configuration rule data. This process needs to be based on a preset merging standard / strategy (such as unified definition of basic types, resolution of rule conflicts between modules, and sorting out of file reference relationships). It can eliminate rule redundancy or conflict between modules and form a final configuration rule data with complete structure and consistent logic.

[0167] Thus, in this embodiment of the application, module configuration data corresponding to each configuration data module can be generated based on the first sub-result and the second sub-result, and the module configuration data corresponding to each configuration data module can be merged to obtain configuration rule data, so that the module configuration data corresponding to each configuration data module can be merged, thereby reducing data redundancy to a certain extent.

[0168] In some embodiments provided in this application, the module configuration data corresponding to each configuration data module is merged to obtain configuration rule data, including: mapping the module configuration data corresponding to multiple configuration data modules to a preset number of module configuration data according to a predetermined data mapping rule to obtain configuration rule data, wherein the number of configuration data modules is greater than the preset number.

[0169] In some embodiments of this application, the step of merging the module configuration data corresponding to each configuration data module to obtain configuration rule data includes: mapping the module configuration data corresponding to multiple configuration data modules to a preset number of module configuration data according to a predetermined data mapping rule to obtain configuration rule data, wherein the number of configuration data modules is greater than the preset number.

[0170] The generation module in this application embodiment is further configured to map the module configuration data corresponding to multiple configuration data modules to a preset number of module configuration data according to a predetermined data mapping rule, thereby obtaining configuration rule data, wherein the number of configuration data modules is greater than the preset number.

[0171] The processor in this embodiment is further configured to map the module configuration data corresponding to multiple configuration data modules to a preset number of module configuration data according to a predetermined data mapping rule, thereby obtaining configuration rule data, wherein the number of configuration data modules is greater than the preset number.

[0172] Specifically, in the embodiments of this application, a large number of module configuration data can be merged into a smaller number of preset number of module configuration data based on a pre-established data mapping rule that can determine the correspondence between module configuration data and target module configuration data of multiple configuration data modules.

[0173] In some implementations, the number of configuration data modules is 134, and the data mapping rule is the module_map.xml file in the example above. This file stores the mapping relationship between the module configuration data of the 134 configuration data modules and the 14 configuration data modules. Thus, the electronic device can map the module configuration data of the 134 configuration data modules to the 14 configuration data modules. These 14 configuration data modules can constitute the configuration rule data in the implementation of this application.

[0174] In one example, after generating the module configuration data for each configuration data module, the electronic device can load the module_map.xml file, which records data mapping rules (e.g., the configuration data for the wireless_schedule module and the configuration data for the Mesh_Networking module both correspond to "Wireless module configuration data"). Then, according to the data mapping rules recorded in the module_map.xml file, the module configuration data of all configuration data modules are assigned to the corresponding target module groups one by one. For example, the configuration data of modules such as "wireless_schedule" and "Mesh_Networking" are all mapped to "Wireless module configuration data", thereby merging a large number of module configuration data into a smaller number of preset module configuration data.

[0175] Thus, in this embodiment of the application, the module configuration data corresponding to multiple configuration data modules can be mapped to a preset number of module configuration data according to a predetermined data mapping rule to obtain the configuration rule data, thereby realizing the merging of module configuration data.

[0176] This application also provides a computer-readable storage medium storing a computer program that, when executed by one or more processors, implements the above-described data processing method.

[0177] This application also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the above-described data processing method.

[0178] In this specification, the terms "specifically," "furthermore," "particularly," "understandably," etc., refer to specific features, structures, materials, or characteristics described in connection with embodiments or examples that are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0179] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the function involved, as will be understood by those skilled in the art to which embodiments of this application pertain.

[0180] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.

Claims

1. A data processing method, characterized in that, include: First configuration data for the target operation to be performed is obtained, wherein the first configuration data is configuration data exported from the target device or configuration data to be imported into the target device, and the target operation is a data output operation or a data import operation for the target device. The first configuration data includes multiple configuration items. According to pre-determined configuration rule data, configuration items in the first configuration data that cannot perform the target operation are filtered to obtain target configuration data, wherein the configuration rule data is used to determine the target operation types that are allowed to be performed and / or the target operation types that are not allowed to be performed for each configuration item. The target operation is then performed on the target configuration data.

2. The method according to claim 1, characterized in that, The step of filtering configuration items in the first configuration data that cannot perform the target operation according to the predetermined configuration rule data to obtain target configuration data includes: performing a completion process on the first configuration data according to the configuration rule data to assign attribute parameters to target configuration items in the first configuration data that do not contain attribute parameters, thereby obtaining second configuration data, wherein the attribute parameters of the configuration items are used to indicate the type of target operation that the configuration items are allowed to perform; and filtering configuration items in the second configuration data whose attribute parameters do not match the target operation according to the attribute parameters of each configuration item, thereby obtaining the target configuration data.

3. The method according to claim 2, characterized in that, The first configuration data contains multiple configuration items that can be divided into multiple data levels. The step of performing a completion process on the first configuration data according to the configuration rule data to assign attribute parameters to target configuration items that do not contain attribute parameters in the first configuration data to obtain second configuration data includes: assigning attribute parameters corresponding to the data level to the target configuration item according to the configuration rule data and the data level where the target configuration item is located to obtain second configuration data, wherein the configuration rule data is used to determine the attribute parameters corresponding to the data level.

4. The method according to claim 3, characterized in that, The configuration rule data includes configuration item verification rules for each configuration item. The step of filtering configuration items in the second configuration data whose attribute parameters do not match the target operation, based on the attribute parameters of each configuration item, to obtain the target configuration data includes: verifying each configuration item in the second configuration data according to the configuration rule data; performing preset data repair processing on the second configuration data if there are abnormal configuration items that fail the verification, to obtain third configuration data; and filtering configuration items in the third configuration data whose attribute parameters do not match the target operation, based on the attribute parameters of each configuration item in the third configuration data, to obtain the target configuration data.

5. The method according to claim 4, characterized in that, The configuration rule data includes multiple sub-data, each of which is used to verify at least one of the configuration items. The step of verifying each configuration item in the second configuration data according to the configuration rule data includes: verifying the configuration item according to the sub-data corresponding to the configuration item.

6. The method according to claim 4, characterized in that, In the case where there is an abnormal configuration item in the second configuration data that fails the verification, the second configuration data is subjected to a preset data repair process to obtain the third configuration data, which includes: in the case where there is an abnormal configuration item in the second configuration data, the second configuration data is subjected to a preset data repair process based on the default data of the configuration item corresponding to the abnormal configuration item to obtain the third configuration data.

7. The method according to claim 1, characterized in that, The method further includes: parsing the fourth configuration data of the target device to determine the configuration data parsing result; and generating the configuration rule data based on the configuration data parsing result.

8. The method according to claim 7, characterized in that, The configuration data parsing result includes a first sub-result and a second sub-result. The step of parsing the fourth configuration data of the target device to determine the configuration data parsing result includes: parsing the decorator field in the fourth configuration data to determine the first sub-result; and parsing the fourth configuration data according to the target syntax rules to determine the second sub-result.

9. The method according to claim 8, characterized in that, The fourth configuration data includes multiple configuration data modules. The step of generating the configuration rule data based on the configuration data parsing result includes: generating module configuration data corresponding to each configuration data module based on the first sub-result and the second sub-result; and merging the module configuration data corresponding to each configuration data module to obtain the configuration rule data.

10. The method according to claim 9, characterized in that, The step of merging the module configuration data corresponding to each of the configuration data modules to obtain the configuration rule data includes: mapping the module configuration data corresponding to multiple configuration data modules to a preset number of module configuration data according to a predetermined data mapping rule to obtain the configuration rule data, wherein the number of configuration data modules is greater than the preset number.

11. A data processing apparatus, characterized in that, include: An acquisition module is used to acquire first configuration data for a target operation, wherein the first configuration data is configuration data exported from a target device or configuration data to be imported into the target device, and the target operation is a data output operation or a data import operation for the target device, and the first configuration data includes multiple configuration items; a filtering module is used to filter configuration items in the first configuration data that cannot perform the target operation according to pre-determined configuration rule data to obtain target configuration data, wherein the configuration rule data is used to determine the target operation types that are allowed to be performed and / or the target operation types that are not allowed to be performed for each configuration item; and a processing module is used to perform the target operation on the target configuration data.

12. An electronic device, characterized in that, The method includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, it implements the method according to any one of claims 1-10.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by one or more processors, implements the method according to any one of claims 1-10.

14. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the method described in any one of claims 1-10.