Method, device and equipment for adjusting service data, and storage medium

CN119211355BActive Publication Date: 2026-08-11CHINA UNITED NETWORK COMM GRP CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

目标网络设备的数据与业务数据转换往往较为复杂

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119211355B_ABST
    Figure CN119211355B_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, device, and storage medium for adjusting service data, relating to the field of wireless communication technology. Applied to a network device controller, the method includes: receiving service data of different structures used by multiple network devices when performing a target service function; adjusting the structure of the service data of each network device according to a preset data format to obtain adjusted service data for the network device; the preset data format is a data format supported by each network device; and sending the adjusted service data to each network device respectively, so that each network device uses the adjusted service data for data processing when performing the target service function. Thus, service data of multiple network devices under the network device controller can be uniformly queried according to the preset data format.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a method, apparatus, device and storage medium for adjusting service data. Background Technology

[0002] The network device controller connects to multiple network devices, and each network device has different business requirements, resulting in different storage formats in the database.

[0003] When querying service requests, network device controllers often need to receive data from the target network device and convert its format before they can retrieve the target data. The conversion between the target network device's data and the service data is often quite complex. This adds complexity to the network device controller's query process. Summary of the Invention

[0004] This application provides a method, apparatus, device, and storage medium for adjusting business data, which can reduce the complexity of network device controller queries.

[0005] To achieve the above objectives, this application adopts the following technical solution:

[0006] In a first aspect, this application provides a method for adjusting service data, applied to a network device controller. The method includes: receiving service data with different structures used by multiple network devices when performing a target service function; adjusting the structure of the service data of each network device according to a preset data format to obtain the adjusted service data of the network device; the preset data format is a data format supported by each network device; and sending the adjusted service data to each network device respectively, so that each network device uses the adjusted service data for data processing when performing the target service function.

[0007] Based on the aforementioned technical means, this application can, after receiving service data from multiple network devices, adjust the structure of the service data of each network device according to a preset data format to obtain the adjusted service data of the network device, and then send the adjusted service data to the network device. Thus, the data format of the service data from multiple network devices can be adjusted to a preset data format, facilitating unified querying by users through the preset data format.

[0008] In one possible implementation, the method further includes: saving the adjusted business data in the form of key-value pairs.

[0009] Based on the above technical means, the adjusted business data can be stored in the form of key-value pairs, making it convenient to search by keywords of the key-value pairs when querying.

[0010] In one possible implementation, the above-mentioned "saving the adjusted business data in the form of key-value pairs" includes: using the data name of the business data as the key of the key-value pair; and using the data parameter corresponding to the data name as the data value corresponding to the key.

[0011] Using the aforementioned technical methods, the data name of the business data can be used as the key of the key-value pair; the data parameter corresponding to the data name can be used as the data value corresponding to the key. Therefore, the data value can be accurately determined based on the keyword query.

[0012] In one possible implementation, the method further includes: determining a keyword corresponding to the parameter value in response to a user input parameter value; and determining a data value corresponding to the keyword based on the keyword.

[0013] Based on the aforementioned technical means, the data value corresponding to the parameter value can be accurately determined by the user's input of the parameter value.

[0014] Secondly, this application provides a method for adjusting service data, applied to a network device. The method includes: sending service data with different structures used when performing a target service function to a network device controller; receiving the adjusted service data; performing data processing based on the adjusted service data; and the structure of the adjusted service data is a preset data format.

[0015] Using the aforementioned technical methods, network devices can send service data to the network device controller and receive adjusted service data. This allows the structure of service data on network devices to be uniformly adjusted to a preset data format.

[0016] In one possible implementation, the method further includes: parsing the adjusted business data to determine the data name of the business data and the data parameters corresponding to the data name; generating a configuration file corresponding to the business data based on the data name and the data parameters corresponding to the data name; and making adjustments based on the configuration file.

[0017] Based on the aforementioned technical means, network devices can parse the adjusted service data upon receiving it, determine the data name and corresponding data parameters, generate a configuration file for the service data, and then make adjustments based on the configuration file. This allows for accurate determination of the adjusted configuration file.

[0018] In one possible implementation, the above-mentioned "adjustment according to configuration file" includes: adjusting the code file corresponding to the business data according to the configuration file; compiling the code file and installing the compiled file.

[0019] Using the aforementioned technical methods, the code files corresponding to the business data can be adjusted according to the configuration file; the code files can be compiled, and the compiled files can be installed. This allows for accurate adjustment of the code files and their installation into network devices.

[0020] In one possible implementation, the method further includes: setting functional parameters; comparing the results corresponding to the functional parameters before adjustment with the results after adjustment, and verifying the correctness of the adjusted business data.

[0021] Using the aforementioned technical methods, the correctness of the adjusted business data can be verified by setting functional parameters and comparing the results before and after the adjustment. This allows for the timely detection of any problems that arise after the adjustment.

[0022] Thirdly, this application provides a service data adjustment device applied to a network device controller. The device includes: a receiving unit for receiving service data of different structures used by multiple network devices when performing a target service function; an adjustment unit for adjusting the structure of the service data of each network device according to a preset data format to obtain the adjusted service data of the network device; the preset data format is a data format supported by each network device; and a sending unit for sending the adjusted service data to each network device respectively, so that each network device uses the adjusted service data for data processing when performing the target service function.

[0023] In one possible implementation, the adjustment unit is specifically used to save the adjusted business data in the form of key-value pairs.

[0024] In one possible implementation, the adjustment unit is specifically used to use the data name of the business data as the key of the key-value pair; and to use the data parameter corresponding to the data name as the data value corresponding to the key.

[0025] In one possible implementation, the adjustment unit is specifically used to determine the keyword corresponding to the parameter value in response to the user input parameter value; and to determine the data value corresponding to the keyword based on the keyword.

[0026] Fourthly, this application provides a service data adjustment device applied to a network device. The device includes: a sending unit for sending service data with different structures used when performing a target service function to a network device controller; a receiving unit for receiving the adjusted service data; and a processing unit for performing data processing based on the adjusted service data. The structure of the adjusted service data is a preset data format.

[0027] In one possible implementation, the processing unit is further configured to parse the adjusted business data, determine the data name of the business data and the data parameters corresponding to the data name; generate a configuration file corresponding to the business data based on the data name and the data parameters corresponding to the data name; and make adjustments based on the configuration file.

[0028] In one possible implementation, the processing unit is further configured to adjust the code file corresponding to the business data according to the configuration file; compile the code file; and install the compiled file.

[0029] In one possible implementation, the processing unit is further configured to set functional parameters; compare the results corresponding to the functional parameters before adjustment with the results corresponding to the functional parameters after adjustment, and verify the correctness of the adjusted business data.

[0030] Fifthly, this application provides an electronic device, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute instructions to implement the method described in the first aspect and any possible implementation thereof.

[0031] In a sixth aspect, this application provides a computer-readable storage medium that, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to perform the methods described in the first aspect and any of their possible implementations.

[0032] In a seventh aspect, this application provides a computer program product containing instructions that, when run on a communication device, enable the communication device to perform the methods described in the first aspect and any of its possible implementations. Attached Figure Description

[0033] Figure 1 A system framework diagram of a method for adjusting business data provided in an embodiment of this application;

[0034] Figure 2 A flowchart illustrating a method for adjusting business data provided in an embodiment of this application;

[0035] Figure 3 A flowchart illustrating another method for adjusting business data provided in this application embodiment;

[0036] Figure 4 A flowchart illustrating another method for adjusting business data provided in this application embodiment;

[0037] Figure 5 A schematic diagram of a business data adjustment device provided in an embodiment of this application;

[0038] Figure 6A schematic diagram of another business data adjustment device provided in an embodiment of this application;

[0039] Figure 7 A block diagram of an electronic device for adjusting business data provided in an embodiment of this application. Detailed Implementation

[0040] The following description, in conjunction with the accompanying drawings, details a method, apparatus, device, and storage medium for adjusting business data provided in an embodiment of this application.

[0041] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.

[0042] The terms "first" and "second," etc., used in the specification and drawings of this application are used to distinguish different objects or to distinguish different treatments of the same object, rather than to describe a specific order of objects.

[0043] Furthermore, the terms "comprising" and "having," and any variations thereof, used in the description of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus.

[0044] It should be noted that in the embodiments of this application, the words "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the words "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0045] Before introducing the embodiments of this application, the relevant technical terms involved in the embodiments of this application will be explained. It should be noted that these explanations are for the purpose of making the embodiments of this application easier to understand, and should not be regarded as limiting the scope of protection claimed by the embodiments of this application.

[0046] Software-defined network (SDN) is a network management approach that supports dynamically programmable network configuration. It enables the management of network devices, the orchestration of network services, and the scheduling of service traffic through controllers, thereby improving network performance and management efficiency and allowing network services to provide flexible customization capabilities similar to cloud computing.

[0047] YANG model (yet another next generation): A data modeling language used to model configuration data, status data, remote procedure calls, and notifications used by network configuration management protocols. It can describe data structures, data integrity constraints, and data operations.

[0048] JSON (JavaScript Object Notation): A lightweight data-interchange format that is easy to read and write and can be used to exchange data between multiple languages.

[0049] In the development of existing SDN network device controllers, JSON access data based on the YANG model definition is the foundation of project development. After services are deployed within the SDN system, the data storage of services cannot be unified, and it is impossible to query services data in a unified manner. However, as a critical underlying network, the critical SDN system needs to use service-level data as the basis for configuration auditing and verification. However, manually processing the conversion between database structure data and service request data is often quite complex, lacking a unified, efficient, and universal method.

[0050] Therefore, it is necessary to design a method and device for adjusting business data, which can be applied to network device controllers to set rules, standardize business data, and reduce the complexity of network device controller queries.

[0051] To address the aforementioned technical problems, this application provides a method for adjusting service data. Applied to a network device controller, the method includes: receiving service data of different structures used by multiple network devices when performing a target service function; adjusting the structure of the service data of each network device according to a preset data format to obtain adjusted service data for the network device; the preset data format is a data format supported by each network device; and sending the adjusted service data to each network device respectively, so that each network device uses the adjusted service data for data processing when performing the target service function. Therefore, service data of multiple network devices under the network device controller can be uniformly queried according to the preset data format.

[0052] The execution entity in this application embodiment can be a network device controller, and the following provides a detailed description of the embodiment.

[0053] To facilitate understanding, the following section, in conjunction with the accompanying drawings, provides a detailed explanation of the method for adjusting the business data provided in this application.

[0054] Figure 1 A system framework diagram of a business data adjustment method provided in this application embodiment is shown below. Figure 1As shown in the figure, the system framework diagram may include a network device controller 101 and a network device 102.

[0055] The network device controller 101 is used to manage multiple network devices connected to the network device controller, receive service data sent by the network device 102, and standardize the service data according to a unified format.

[0056] Network device 102 is used to implement multiple business functions such as data forwarding, data querying, data filtering, and data deduplication.

[0057] In this embodiment, the network device controller 101 can connect to multiple network devices 102. Network devices 102 may include switches, hubs, routers, etc., and are not limited thereto in this embodiment.

[0058] Figure 2 This is a flowchart illustrating a method for adjusting business data provided in an embodiment of this application. The method includes the following steps S201-S203.

[0059] S201. The network device controller receives service data with different structures used by multiple network devices when performing target service functions.

[0060] The business data can be code data related to data deduplication, data forwarding, data filtering, etc., and there are no restrictions in this application embodiment.

[0061] In one possible implementation, the network device controller sends request information to multiple network devices, requesting access to service data with different structures used by the network devices when performing a target service function. Correspondingly, upon receiving the request information from the network device controller, each network device sends its own service data to the controller. Thus, the network device controller receives the service data with different structures used by the multiple network devices when performing the target service function.

[0062] S202. For the service data of each network device, the network device controller adjusts the structure of the service data of the network device according to the preset data format to obtain the adjusted service data of the network device.

[0063] The preset data format is a data format supported by each network device.

[0064] In this embodiment, the preset data format may include a data format based on the YANG model, which is not limited here. This embodiment uses the data format based on the YANG model as an example for detailed explanation.

[0065] In one possible implementation, the network device controller can adjust the structure of the network device's service data according to the data format in the YANG model for each network device's service data.

[0066] In this embodiment, the YANG model is a tree structure, consisting of numerous leaves, lists, and containers that describe the entire device. The main data formats of the YANG model are described below, including leaf nodes, list nodes, and container nodes.

[0067] The data format of the leaf nodes is as follows: The leaf node is named "host-name". "type" indicates that the data type of "host-name" is string. "value" represents the data parameter. "description" is a description of "host-name".

[0068]

[0069] The data format of the list nodes is shown below. The data is named "user" in the list. The list contains three leaves: name, first-name, and full-name.

[0070]

[0071] The data format of the containers is as follows. A container named "system" contains a container named "login". The "login" container also contains a leaf named "message".

[0072]

[0073]

[0074] For example, the service data obtained by the network device controller is shown below. The data names are stu.num, stu.sex, and stu.score.

[0075]

[0076] The data format of the service data adjusted by the network device controller is shown below. The unified data format is a list with the data name "stu". "type" indicates whether "stu" is of data type int, char, or float. The list with the data name "stu" also includes the data parameters num, sex, and score of the leaf nodes.

[0077]

[0078] In the YANG model, the data format is defined as leaf nodes, list nodes, leaf-list nodes, and container nodes, primarily based on their data name definitions and data parameters. The YANG model is a data modeling language used for network configuration management; it defines the data format for network device configurations.

[0079] In the YANG model, leaf nodes are the basic data elements used to represent specific configuration data values, such as IP addresses and port numbers. Leaf nodes do not contain any child nodes; they directly contain the data values.

[0080] In the YANG model, list nodes represent data collections that can contain multiple instances. Each instance can have its own leaf nodes, forming branches in a tree structure. List nodes allow multiple configuration data of the same type to be defined within a single YANG module.

[0081] Container nodes are used to organize related configuration data. They can contain leaf nodes, other containers, and list nodes. Containers in the YANG model act as groupings, making configuration data more structured and easier to manage. A container can be viewed as a logical grouping used to organize related configuration items together.

[0082] In this embodiment, the adjusted business data is stored in key-value pairs. For example, the data name stu.sex can be stored in a key field, with each key corresponding to a unique value, and the data value corresponding to stu.sex stored in the value field. Thus, data can be queried uniformly using the data name in the key field.

[0083] Furthermore, the network device controller can respond to user input parameter values, determine the keywords corresponding to the parameter values, and determine the data values ​​corresponding to the keywords.

[0084] S203. The network device controller sends its adjusted service data to each network device so that each network device can use the adjusted service data for data processing when performing the target service function.

[0085] In one possible implementation, the network device controller adjusts the data format of the service data according to step S202, and then sends the adjusted service data to multiple network devices. Correspondingly, the multiple network devices receive the adjusted service data.

[0086] In this embodiment, when multiple network devices receive adjusted service data, they can parse the adjusted service data according to the rules of the YANG model to determine the data name of the service data and the data parameters corresponding to the data name. The network devices then generate a configuration file corresponding to the service data based on the data name and the corresponding data parameters.

[0087] The network device adjusts the code file corresponding to the service data according to the configuration file, compiles the code file, and installs the compiled file.

[0088] When the network device obtains the adjusted service data, the network device controller can verify the correctness of the adjusted service data by comparing the function results of the service data before and after the adjustment with the function results of the service data after the adjustment.

[0089] based on Figure 2 The technical solution shown in this embodiment allows the network device controller to receive service data from multiple network devices, adjust the structure of the service data for each network device according to a preset data format, obtain the adjusted service data, and then send the adjusted service data to the network devices. This allows the data format of the service data from multiple network devices to be adjusted to a preset data format, facilitating unified querying by the user.

[0090] like Figure 3 As shown, Figure 3 This is a flowchart illustrating another method for adjusting business data provided in an embodiment of this application, which includes the following steps S301-S304.

[0091] S301, The network device controller generates a data structure based on the YANG model.

[0092] In this embodiment, the YANG model includes field and data structure definitions for business data. The network device controller generates a basic JSON structure based on the YANG model, which is used to represent the network device's business data.

[0093] S302, Network device controller extended service data structure.

[0094] In the embodiments of this application, business data typically contains multiple business configurations, such as the LIST type, and the hierarchy is not fixed. Therefore, it is necessary to expand the basic JSON structure according to the actual situation of the business data to meet the loop requirements during subsequent layer-by-layer processing, ensure the correct data scale, and prevent data loss during reconstruction.

[0095] S303, Network device controller adjusts service data.

[0096] In this embodiment, the network device controller expands the service data structure through step S402, performs layer-by-layer loop processing on the service data structure, and obtains the actual data from the service database structure data according to the field concatenation rules, thereby realizing the adjustment of the service data.

[0097] S304, Network device controller outputs service data.

[0098] In this embodiment of the application, the network device controller processes the adjusted data again layer by layer, removes null values ​​Key from the service data, and outputs the service data after removing Key values.

[0099] based on Figure 3 The technical solution shown in this application embodiment can use the YANG model to uniformly define the business data structure, which facilitates business data query.

[0100] like Figure 4 As shown, Figure 4 This is a flowchart illustrating another method for adjusting business data provided in an embodiment of this application, which includes the following steps S401-S414.

[0101] S401, The network device controller generates JSON_BASE_TMP based on the YANG model.

[0102] In this embodiment, the YANG model defines the data structure for all business data within the scope of the business, including business data hierarchy and field types. Therefore, a basic business delivery data structure JSON_BASE_TMP can be generated based on the YANG model, containing all field information and structure of YANG. The original business data structure was JSON_VO.

[0103] S402. The network device controller preprocesses JSON_BASE_TMP.

[0104] In this embodiment, the network device controller uses the generated JSON_BASE_TMP as a basis and processes it hierarchically, deleting all VALUEs in the JSON, retaining only the structure, and compressing all LIST levels to 1 for subsequent processing.

[0105] S403, The network device controller performs hierarchical processing of JSON_BASE_TMP.

[0106] In this embodiment, the network device controller starts processing layer by layer from the top level of JSON_BASE_TMP: it determines whether the current level is of type LIST. If it is of type LIST, it proceeds to step S404; otherwise, it proceeds to step S406.

[0107] S404. The network device controller determines whether the current level list needs to be expanded.

[0108] In this embodiment of the application, the network device controller determines whether the current layer LIST needs to be expanded, including: parsing the PARENT_KEY string of the current layer, concatenating the layer path of the current layer, querying the corresponding layer in JSON_VO if it is greater than 1, if it is greater than 1, it needs to be expanded, the expansion parameter is EXT_LAYER_NUM, and proceed to step S405; otherwise, proceed to step S406.

[0109] S405, Network Device Controller Extension Layer.

[0110] In this embodiment of the application, when the network device controller determines that the layer needs to be expanded according to the above step S404, it expands the current layer number to the corresponding layer in JSON_VO, that is, it copies the current layer structure and adds it to the current LIST until the LIST layer size reaches EXT_LAYER_NUM, indicating that the expansion is complete.

[0111] S406. The network device controller obtains the PARENT_KEY string array within the current layer.

[0112] In this embodiment, the network device controller obtains the PARENT_KEY string array in the current layer according to the YANG model, which contains the KEY value information of the current layer and all upper layers.

[0113] S407. The network device controller updates the current level LIST_INDEX.

[0114] In this embodiment, the network device controller updates the current level LIST_INDEX to record the level number of the current level in the LIST type. If the value is 0, it is a non-LIST type.

[0115] S408. The network device controller cyclically obtains the OBTAIN_KEY to be obtained in the current layer, which is used as the field to be used in subsequent PATH concatenation.

[0116] S409, Network device controller concatenates the fields corresponding to the KEY.

[0117] In this embodiment, the network device controller concatenates the corresponding KEY field to be obtained according to the names PARENT_KEY, LIST_INDEX, and OBTAIN_KEY of the data parameters, which is used to search for the corresponding VALUE in JSON_VO. The concatenated fields of JSON_VO_PATH can be as shown in business.group[3].userList[1].name.

[0118] S410, the network device controller obtains the corresponding value VALUE in JSON_VO based on JSON_VO_PATH.

[0119] S411. The network device controller updates VALUE in step S410 to JSON_BASE_TMP until all KEY values ​​in the current layer are updated, generating BUSS_JSON_TMP.

[0120] S412. The network device controller determines whether the update is complete.

[0121] In this embodiment of the application, the network device controller determines whether the current data structure layer is the bottom layer. If not, it executes step S414; if so, it executes step S413.

[0122] S413. The network device controller processes data hierarchically through BUSS_JSON_TMP, clearing unassigned keys, deleting empty value structures, and outputting BUSS_JSON as reconstructed data.

[0123] S414. If the level is not fully processed, the current PARENT_KEY will be retained before proceeding to the next level. If the level does not proceed to the next level, the current PARENT_KEY will be deleted, and only the correct PARENT_KEY string array will be retained.

[0124] based on Figure 4 The technical solution shown in this application embodiment can generate a basic JSON structure based on the YANG model, according to the actual business database structure data, and expand the scale of the basic structure according to the scale of business data. It can parse fields layer by layer, extract key-value values ​​according to field concatenation rules, and reconstruct JSON business data for business data with concatenation methods under fixed rules. Through a one-stop conversion method, it has high versatility for business systems, reduces the impact on business layer development, reduces repetitive code development, and improves project development efficiency.

[0125] The foregoing mainly describes the solutions provided by the embodiments of this application from a methodological perspective. To achieve the above functions, the business data adjustment device or electronic device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0126] This application embodiment can, based on the above method, exemplarily divide a business data adjustment device or electronic device into functional modules. For example, the business data adjustment device or electronic device may include functional modules corresponding to each functional division, or two or more functions may be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the module division in this application embodiment is illustrative and only represents one logical functional division; in actual implementation, there may be other division methods.

[0127] Figure 5 This application provides a schematic diagram of a service data adjustment device, applied to a network device controller. The device includes:

[0128] The receiving unit 501 is used to receive service data with different structures used by multiple network devices when performing target service functions.

[0129] The adjustment unit 502 is used to adjust the structure of the service data of each network device according to a preset data format to obtain the adjusted service data of the network device; the preset data format is a data format supported by each network device.

[0130] The sending unit 503 is used to send the adjusted service data to each network device respectively, so that each network device can use the adjusted service data for data processing when performing the target service function.

[0131] In one possible implementation, the adjustment unit 502 is further configured to save the adjusted business data in the form of key-value pairs.

[0132] In one possible implementation, the adjustment unit 502 is further configured to use the data name of the business data as the key of the key-value pair; and use the data parameter corresponding to the data name as the data value corresponding to the key.

[0133] In one possible implementation, the adjustment unit 502 is further configured to, in response to the user input parameter value, determine the keyword corresponding to the parameter value; and determine the data value corresponding to the keyword based on the keyword.

[0134] Figure 6 A schematic diagram of another service data adjustment device provided in this application embodiment, applied to a network device, the device comprising:

[0135] The sending unit 601 is used to send service data with different structures used when performing the target service function to the network device controller.

[0136] The receiving unit 602 is used to receive the adjusted service data.

[0137] The processing unit 603 is used to process data based on the adjusted business data; the structure of the adjusted business data is a preset data format.

[0138] In one possible implementation, the processing unit 603 is further configured to: parse the adjusted business data, determine the data name of the business data and the data parameters corresponding to the data name; generate a configuration file corresponding to the business data based on the data name and the data parameters corresponding to the data name; and make adjustments based on the configuration file.

[0139] In one possible implementation, the processing unit 603 is further configured to: adjust the code file corresponding to the business data according to the configuration file; compile the code file; and install the compiled file.

[0140] In one possible implementation, the processing unit 603 is further configured to set functional parameters; compare the results corresponding to the functional parameters before adjustment with the results corresponding to the functional parameters after adjustment, and verify the correctness of the adjusted business data.

[0141] Figure 7 A block diagram of an electronic device for adjusting service data according to the above embodiments is shown. The service data adjustment device includes a processor 701 and a communication interface 702. The processor 701 adjusts service data according to preset rules in a preset model in a network device controller, and the communication interface 702 facilitates communication between the network device controller and various network devices. The network devices may further include a memory 703 and a bus 704; the memory 703 stores the service data in the network device.

[0142] The memory 703 may be a memory in a business data adjustment device, and the memory may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, hard disk or solid-state drive; the memory may also include a combination of the above types of memory.

[0143] The processor 701 described above can implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor can be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computing functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.

[0144] The 704 bus can be an Extended Industry Standard Architecture (EISA) bus, etc. The 704 bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0145] Through the above description of the embodiments, those skilled in the art will clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0146] This application provides a computer program product containing instructions that, when run on a computer, cause the computer to execute the business data adjustment method described in the above method embodiments.

[0147] This application also provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the business data adjustment method in the method flow shown in the above method embodiments.

[0148] The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires; a portable computer disk drive; a hard disk drive; a random access memory (RAM); a read-only memory (ROM); an erasable programmable read-only memory (EPROM); a register; a hard disk drive; an optical fiber; a portable compact disc read-only memory (CD-ROM); an optical storage device; a magnetic storage device; or any suitable combination thereof; or any other form of computer-readable storage medium known in the art. An exemplary storage medium is coupled to a processor, enabling the processor to read a product from the storage medium and to write a product to the storage medium. Of course, the storage medium may also be a component of the processor. The processor and the storage medium may reside in an application-specific integrated circuit (ASIC). In the embodiments of this application, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0149] Embodiments of the present invention provide a computer program product containing instructions that, when executed on a computer, cause the computer to perform the business data adjustment method of the embodiments of this application.

[0150] Since the business data adjustment device, computer-readable storage medium, and computer program product in the embodiments of the present invention can be applied to the above method, the technical effects that can be obtained can also be referred to the above method embodiments. The embodiments of the present invention will not be described again here.

[0151] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0152] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0153] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0154] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for adjusting business data, characterized in that, A network device controller applied in software-defined networking (SDN), the method comprising: Receive service data with different structures used by multiple network devices when performing target service functions; For the service data of each network device, a basic JSON structure with a preset data format is generated based on the YANG model; the basic JSON structure is extended according to the actual situation of the service data; the structure of the service data of the network device is adjusted according to the extended preset data format to obtain the adjusted service data of the network device; the preset data format is a data format supported by each network device. The extension of the basic JSON structure, adjusted according to the extended preset data format, includes: The basic JSON structure is preprocessed by removing all values ​​(VALUE) from the JSON and keeping only the structure, and compressing all lists (LIST) to a level of 1. Based on the preprocessed JSON structure, a layer-by-layer loop processing is performed, which includes: Determine if the current level is a LIST type; If the current level is of type LIST, then: parse the PARENT_KEY string of the current level, concatenate the level path of the current level, and query the actual level number of the corresponding level in the business data structure JSON_VO according to the concatenated level path; if the actual level number is greater than 1, then copy and add the structure of the current LIST level according to the extension parameter determined by the actual level number, until the level size of the LIST reaches the extension parameter; Get the PARENT_KEY string array of the parent key in the current level, and update the list index LIST_INDEX that records the level of the current level in the LIST type; Loop through and retrieve the key OBTAIN_KEY to be retrieved in the current level; based on the parent key PARENT_KEY string, the list index LIST_INDEX and the key OBTAIN_KEY to be retrieved, concatenate them to form a path JSON_VO_PATH for searching within the business data structure JSON_VO; Based on the path JSON_VO_PATH, retrieve the corresponding value VALUE from the business data structure JSON_VO, and update the value VALUE to the corresponding position in the basic JSON structure; After completing the loop processing of all levels, a temporary business JSON structure BUSS_JSON_TMP is generated; Clear the keys with null values ​​in the business JSON temporary structure BUSS_JSON_TMP, and output the business data after clearing the null keys as the adjusted business data; Each network device sends its own adjusted service data so that each network device can use the adjusted service data for data processing when executing the target service function; wherein the adjusted service data is stored in the form of key-value pairs.

2. The method according to claim 1, characterized in that, The adjusted business data is stored in key-value pairs, including: Use the data name of the business data as the key of the key-value pair; The data parameters corresponding to the data name are used as the data values ​​corresponding to the keyword.

3. The method according to claim 2, characterized in that, The method further includes: In response to a user inputting a parameter value, the keyword corresponding to the parameter value is determined; The data value corresponding to the keyword is determined based on the keyword.

4. A method for adjusting business data, characterized in that, The method, applied to network devices in Software-Defined Networking (SDN), includes: Send service data with different structures used when executing the target service function to the network device controller; Receive the adjusted service data; Data processing is performed based on the adjusted business data; the structure of the adjusted business data is a preset data format; The adjusted business data is an extension of the basic JSON structure, adjusted according to the extended preset data format; The extension of the basic JSON structure, adjusted according to the extended preset data format, includes: The basic JSON structure is preprocessed by removing all values ​​(VALUE) from the JSON and keeping only the structure, and compressing all lists (LIST) to a level of 1. Based on the preprocessed JSON structure, a layer-by-layer loop processing is performed, which includes: Determine if the current level is a LIST type; If the current level is of type LIST, then: parse the PARENT_KEY string of the current level, concatenate the level path of the current level, and query the actual level number of the corresponding level in the business data structure JSON_VO according to the concatenated level path; if the actual level number is greater than 1, then copy and add the structure of the current LIST level according to the extension parameter determined by the actual level number, until the level size of the LIST reaches the extension parameter; Get the PARENT_KEY string array of the parent key in the current level, and update the list index LIST_INDEX that records the level of the current level in the LIST type; Loop through and retrieve the key OBTAIN_KEY to be retrieved in the current level; based on the parent key PARENT_KEY string, the list index LIST_INDEX and the key OBTAIN_KEY to be retrieved, concatenate them to form a path JSON_VO_PATH for searching within the business data structure JSON_VO; Based on the path JSON_VO_PATH, retrieve the corresponding value VALUE from the business data structure JSON_VO, and update the value VALUE to the corresponding position in the basic JSON structure; After completing the loop processing of all levels, a temporary business JSON structure BUSS_JSON_TMP is generated; Clear the keys with null values ​​in the business JSON temporary structure BUSS_JSON_TMP, and output the business data after clearing the null keys as the adjusted business data.

5. The method according to claim 4, characterized in that, The method further includes: Parse the adjusted business data to determine the data name of the business data and the data parameters corresponding to the data name; Based on the data name and the data parameters corresponding to the data name, generate the configuration file corresponding to the business data; Adjust according to the configuration file.

6. The method according to claim 5, characterized in that, The adjustment based on the configuration file includes: Adjust the code file corresponding to the business data according to the configuration file; Compile the code file and install the compiled files.

7. The method according to claim 4, characterized in that, The method further includes: Set function parameters; By comparing the results corresponding to the functional parameters before and after the adjustment, the correctness of the adjusted business data is verified.

8. A device for adjusting business data, characterized in that, Applied to a network device controller, the device includes: The receiving unit is used to receive service data with different structures used by multiple network devices when performing target service functions; The adjustment unit is used to generate a basic JSON structure in a preset data format based on the YANG model for the service data of each network device; extend the basic JSON structure according to the actual situation of the service data; and adjust the structure of the service data of the network device according to the extended preset data format to obtain the adjusted service data of the network device; the preset data format is a data format supported by each network device. The sending unit is used to send the adjusted service data to each network device respectively, so that each network device can use the adjusted service data for data processing when executing the target service function; wherein, the adjusted service data is stored in the form of key-value pairs; Specifically, the adjustment unit is used to: preprocess the basic JSON structure, delete all values ​​VALUE in the JSON and keep only the structure, and compress all list levels LIST to 1. Based on the preprocessed JSON structure, a layer-by-layer loop processing is performed, which includes: Determine if the current level is a LIST type; If the current level is of type LIST, then: parse the PARENT_KEY string of the current level, concatenate the level path of the current level, and query the actual level number of the corresponding level in the business data structure JSON_VO according to the concatenated level path; if the actual level number is greater than 1, then copy and add the structure of the current LIST level according to the extension parameter determined by the actual level number, until the level size of the LIST reaches the extension parameter; Get the PARENT_KEY string array of the parent key in the current level, and update the list index LIST_INDEX that records the level of the current level in the LIST type; Loop through and retrieve the key OBTAIN_KEY to be retrieved in the current level; based on the parent key PARENT_KEY string, the list index LIST_INDEX and the key OBTAIN_KEY to be retrieved, concatenate them to form a path JSON_VO_PATH for searching within the business data structure JSON_VO; Based on the path JSON_VO_PATH, retrieve the corresponding value VALUE from the business data structure JSON_VO, and update the value VALUE to the corresponding position in the basic JSON structure; After completing the loop processing of all levels, a temporary business JSON structure BUSS_JSON_TMP is generated; Clear the keys with null values ​​in the business JSON temporary structure BUSS_JSON_TMP, and output the business data after clearing the null keys as the adjusted business data.

9. A device for adjusting business data, characterized in that, Applied to network devices, the device includes: The sending unit sends service data with different structures used when executing the target service function to the network device controller; A receiving unit is configured to receive the adjusted service data; The processing unit is used to process the adjusted business data; the structure of the adjusted business data is a preset data format. The adjusted business data is an extension of the basic JSON structure, adjusted according to the extended preset data format; The extension of the basic JSON structure, adjusted according to the extended preset data format, includes: The basic JSON structure is preprocessed by removing all values ​​(VALUE) from the JSON and keeping only the structure, and compressing all lists (LIST) to a level of 1. Based on the preprocessed JSON structure, a layer-by-layer loop processing is performed, which includes: Determine if the current level is a LIST type; If the current level is of type LIST, then: parse the PARENT_KEY string of the current level, concatenate the level path of the current level, and query the actual level number of the corresponding level in the business data structure JSON_VO according to the concatenated level path; if the actual level number is greater than 1, then copy and add the structure of the current LIST level according to the extension parameter determined by the actual level number, until the level size of the LIST reaches the extension parameter; Get the PARENT_KEY string array of the parent key in the current level, and update the list index LIST_INDEX that records the level of the current level in the LIST type; Loop through and retrieve the key OBTAIN_KEY to be retrieved in the current level; based on the parent key PARENT_KEY string, the list index LIST_INDEX and the key OBTAIN_KEY to be retrieved, concatenate them to form a path JSON_VO_PATH for searching within the business data structure JSON_VO; Based on the path JSON_VO_PATH, retrieve the corresponding value VALUE from the business data structure JSON_VO, and update the value VALUE to the corresponding position in the basic JSON structure; After completing the loop processing of all levels, a temporary business JSON structure BUSS_JSON_TMP is generated; Clear the keys with null values ​​in the business JSON temporary structure BUSS_JSON_TMP, and output the business data after clearing the null keys as the adjusted business data.

10. An electronic device, characterized in that, The electronic device includes: processor; A memory configured to store processor-executable instructions; The processor is configured to execute the instructions to implement the business data adjustment method as described in any one of claims 1-3 or 4-7.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed by an electronic device, enable the electronic device to perform the business data adjustment method as described in any one of claims 1-3 or 4-7.

Citation Information

Patent Citations

  • Business data processing method and device, computer equipment and storage medium

    CN110765102A