Data Acquisition Method and Device

Directly locate and obtain specified paging data through the Netconf server, the problem of slow data acquisition and memory waste in the existing technology is solved, and rapid data acquisition and user experience improvement is achieved.

CN116132452BActive Publication Date: 2025-08-01XINHUASAN INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310030189.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-10
Publication Date
2025-08-01
Estimated Expiration
2043-01-10

AI Technical Summary

Technical Problem

In the prior art, when managing network devices through the Netconf protocol, the acquisition of specified page data is slow and the system memory is wasted, affecting the user experience.

Method used

After receiving the data acquisition request, the Netconf server directly locates and obtains the data of the specified paging based on the service identity and paging attributes, and sends a response to the Netconf client.

Benefits of technology

It improves the speed of data acquisition, saves system memory, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116132452B_ABST
    Figure CN116132452B_ABST
Patent Text Reader

Abstract

The present application provides a data acquisition method and apparatus. The method is applied to a Netconf server, and the method includes: receiving a first data acquisition request sent by a Netconf client, where the first data acquisition request includes a service identifier and a paging attribute; determining the service corresponding to the service identifier according to the service identifier; under the service, positioning a corresponding page from a data table of the service according to the paging attribute, and acquiring data from the corresponding page; and sending a first data acquisition response to the Netconf client, where the first data acquisition response includes the data acquired from the corresponding page.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technologies, and in particular, to a data acquisition method and apparatus. Background Art

[0002] With the development of SDN, it has gradually become the mainstream of network management for the controller to manage network devices using the Network Configuration Protocol (Netconf for short). As Figure 1 shown, Figure 1 is a networking schematic diagram between an existing controller and a network device. In Figure 1 , a Netconf client runs on the controller side, and a Netconf server runs on the network device side. Multiple Netconf plug-ins (PlugIns) are configured in the Netconf server, and each Netconf PlugIn is connected to an application (App) correspondingly.

[0003] The controller manages the control interface of the network device. Through the control interface, the controller can obtain the service functions currently configured by the network device, the specific configuration content, and so on. For services with a large amount of data (for example, interface services), since the amount of data displayed on one interface is limited, it cannot display all the data. Therefore, for services with a large data stream, the network device stores them in pages.

[0004] When the controller wants to view the data included in a specified page, the network device usually traverses all the data before the specified page. When it traverses to the specified page, it obtains the data included in the specified page and displays it on the control interface, so as to provide the data included in the specified page to the controller. At this time, the user can also view the specified page data through the control interface.

[0005] For example, an interface service includes 10,000 pieces of data, and each page includes 100 pieces of data. The controller wants to view the 100 pieces of data included in the 90th page. The controller sends a first data acquisition request to the network device. Since the controller cannot determine the starting position corresponding to the first piece of data included in the 90th page, the controller cannot directly instruct the network device to directly obtain the data included in the 90th page. Therefore, the first data acquisition request is used to instruct the network device to first obtain all the data before the 90th page. The network device feeds back all the data before the 90th page to the controller.

[0006] After the controller obtains all the data before the 90th page, it obtains the starting position corresponding to the first piece of data included in the 90th page. The controller sends a second data acquisition request to the network device again. The second data acquisition request is used to instruct the network device to obtain 100 pieces of data included in the 90th page. The network device obtains 100 pieces of data included in the 90th page and displays them on the control interface.

[0007] However, the above method of obtaining the data included in the specified page also exposes the following defects: 1) The speed of the network device to obtain data is slow; 2) Multiple mutual data acquisition requests waste the system memory of the controller and the network device, affecting the user experience. Summary of the Invention

[0008] In view of this, the present application provides a data acquisition method and device to solve the problems of slow data acquisition speed of the network device, waste of system memory of the controller and the network device, and affecting the user experience in the existing method of obtaining the data included in the specified page.

[0009] In a first aspect, the present application provides a data acquisition method, which is applied to a Netconf server, and the method includes;

[0010] Receiving a first data acquisition request sent by a Netconf client, where the first data acquisition request includes a service identifier and a paging attribute;

[0011] Determining the service corresponding to the service identifier according to the service identifier;

[0012] Under the service, positioning the corresponding page according to the paging attribute from the data table of the service, and obtaining data from the corresponding page;

[0013] Sending a first data acquisition response to the Netconf client, where the first data acquisition response includes the data obtained from the corresponding page.

[0014] In a second aspect, the present application provides a data acquisition device, which is applied to a Netconf server, and the method includes;

[0015] A receiving unit, configured to receive a first data acquisition request sent by a Netconf client, where the first data acquisition request includes a service identifier and a paging attribute;

[0016] A determining unit, configured to determine the service corresponding to the service identifier according to the service identifier;

[0017] An obtaining unit, configured to position the corresponding page according to the paging attribute from the data table of the service under the service, and obtain data from the corresponding page;

[0018] A sending unit, configured to send a first data acquisition response to the Netconf client, where the first data acquisition response includes the data obtained from the corresponding page.

[0019] In a third aspect, the present application provides a network device, including a processor and a machine-readable storage medium. The machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is urged by the machine-executable instructions to execute the method provided in the first aspect of the present application.

[0020] Therefore, by applying the data acquisition method and device provided by the present application, the Netconf server receives a first data acquisition request sent by the Netconf client. The first data acquisition request includes a service identifier and a paging attribute. According to the service identifier, the Netconf server determines the service corresponding to the service identifier. Under the service, according to the paging attribute, from the data table of the service, the Netconf server locates the corresponding page and acquires data from the corresponding page. The Netconf server sends a first data acquisition response to the Netconf client, and the first data acquisition response includes the data acquired from the corresponding page.

[0021] In this way, through the paging attribute included in the data acquisition request, the Netconf server can acquire data at a specified position and a specified quantity and feedback it to the Netconf client, so that the Netconf client can quickly acquire the specified data, saving the system memory at both ends and improving the user experience. Moreover, it also solves the problems in the existing method of acquiring data included in a specified page, such as slow data acquisition speed of the network device, wasting the controller and the system memory of the network device, and affecting the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 It is a schematic diagram of the networking between an existing controller and a network device;

[0023] Figure 2 It is a flowchart of the data acquisition method provided by an embodiment of the present application;

[0024] Figure 3 It is a structural diagram of the data acquisition device provided by an embodiment of the present application;

[0025] Figure 4 It is a hardware structure diagram of the network device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0026] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0027] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms "a", "the", and "said" used in this application and the appended claims are also intended to include the plural forms unless the context clearly dictates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the corresponding listed items.

[0028] It should be understood that although the terms first, second, third, etc. may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "when" or "while" or "in response to determining".

[0029] A data acquisition method provided by an embodiment of this application will be described in detail below. Refer to Figure 2 , Figure 2 which is a flowchart of the data acquisition method provided by an embodiment of this application. This method is applied to the Netconf server. The data acquisition method provided by an embodiment of this application may include the following steps.

[0030] Step 210: Receive a first data acquisition request sent by a Netconf client, where the first data acquisition request includes a service identifier and a paging attribute;

[0031] Specifically, the Netconf client runs in the controller, and the Netconf server runs in the network device. When the controller wants to view the specified page data in the data table of a certain service in the network device, the Netconf client generates and sends a first data acquisition request to the Netconf server, and the first data acquisition request includes a service identifier and a paging attribute.

[0032] After receiving the first data acquisition request, the Netconf server obtains the service identifier and the paging attribute therefrom.

[0033] Step 220: Determine the service corresponding to the service identifier according to the service identifier;

[0034] Specifically, according to the description in step 210, after obtaining the service identifier, the Netconf server determines the service corresponding to the service identifier according to the service identifier.

[0035] In one example, the service identifier is specifically "Interfaces", which means the interface service. The service identifier is specifically "HostName", which means the host name service.

[0036] Step 230: Under the said service, according to the paging attribute, locate the corresponding page from the data table of the service, and obtain data from within the corresponding page;

[0037] Specifically, according to the description in Step 220, after the Netconf server determines the service, under this service, according to the paging attribute, it locates the corresponding page from the data table of this service, and obtains data from within the corresponding page.

[0038] Optionally, the above paging attribute includes a paging identifier and the number of data to be obtained within the page indicated by the paging identifier.

[0039] The process by which the Netconf server locates the corresponding page from the data table of the service and obtains data from within the corresponding page according to the paging attribute is as follows:

[0040] According to the paging identifier, the Netconf server locates the corresponding page from the data table of the service; using the number of data, starting from the first data of the page, the Netconf server obtains the same amount of data as the number of data.

[0041] In an example, if the controller wants to view 100 pieces of data on the 5th page in the data table of the interface service, the data acquisition request generated by the Netconf client is as follows:

[0042]

[0043]

[0044] As shown above, the above data acquisition request is specifically in xml format. The service identifier is specifically "Interfaces"; the paging identifier is specifically "xc:page_id"; the number of data to be obtained within the page indicated by the paging identifier is specifically "xc:page_count". Among them, the value of "xc:page_id" is 5, indicating the 5th page in the data table; the value of "xc:page_count" is 100, indicating to obtain 100 pieces of data on the 5th page. Since the value of the interface index "Index" is empty, when the Netconf server obtains data, it starts from the first data on the 5th page and obtains 100 pieces of data in sequence.

[0045] In another example, if the controller wants to view 50 pieces of data on the 10th page in the data table of the interface service, the data acquisition request generated by the Netconf client is as follows:

[0046]

[0047]

[0048] As shown above, the above data acquisition request is specifically in XML format. The service identifier is specifically "Interfaces"; the paging identifier is specifically "xc:page_id"; the number of data to be acquired within the paging indicated by the paging identifier is specifically "xc:page_count". Among them, the value of "xc:page_id" is 10, indicating the 10th page in the data table; the value of "xc:page_count" is 50, indicating to acquire 50 pieces of data in the 10th page. Therefore, when the Netconf server acquires data, it sequentially acquires 50 pieces of data starting from the first data in the 10th page.

[0049] Step 240, send a first data acquisition response to the Netconf client, where the first data acquisition response includes the data acquired from the corresponding paging.

[0050] Specifically, according to the description of step 230, after the Netconf server acquires the corresponding data, it generates and sends a first data acquisition response to the Netconf client, and the first data acquisition response includes the acquired data above.

[0051] After the Netconf client receives the first data acquisition response, it acquires the data therefrom. The Netconf client can display the acquired data in the control interface for the convenience of the user to view.

[0052] Therefore, by applying the data acquisition method provided in this application, the Netconf server receives the first data acquisition request sent by the Netconf client, and the first data acquisition request includes a service identifier and paging attributes; according to the service identifier, the Netconf server determines the service corresponding to the service identifier; under the service, according to the paging attributes, from the data table of the service, the Netconf server locates the corresponding paging and acquires data from the corresponding paging; the Netconf server sends a first data acquisition response to the Netconf client, and the first data acquisition response includes the data acquired from the corresponding paging.

[0053] In this way, through the paging attributes included in the data acquisition request, the Netconf server can acquire data at a specified location and in a specified quantity and feedback it to the Netconf client, so that the Netconf client can quickly acquire the specified data, saving the system memory at both ends and also improving the user experience. Moreover, it also solves the problems that occur in the existing method of acquiring data included in a specified page, such as the slow speed of the network device to acquire data, wasting the system memory of the controller and the network device, and affecting the user experience.

[0054] Optionally, in the embodiments of the present application, it further includes the process of the Netconf server identifying the data table of the service, so that the Netconf server determines whether it can provide paged data for the Netconf client.

[0055] Specifically, after the Netconf server determines the service corresponding to the service identifier, under this service, the Netconf server obtains the data table of the service; the Netconf server determines the table type of the data table of the service. If the data table of the service is a non-global data table (or called a multi-instance table), the Netconf server executes step 230.

[0056] Optionally, if the data table of the service is a global data table, the Netconf server sends a second data acquisition response to the Netconf client, and the second data acquisition response includes an error prompt to prompt the Netconf client that the data table under the requested service does not support the paging attribute and cannot provide the specified page data.

[0057] In an example, if the controller wants to view 50 pieces of data on the 10th page in the data table of the host name service, the data acquisition request generated by the Netconf client is as follows:

[0058]

[0059] The Netconf server determines that the service corresponding to the service identifier is the host name service. Under the host name service, the Netconf server obtains the data table of the host name service. The Netconf server determines the table type of the data table. In this example, the data table of the host name service is a global data table, so the Netconf server sends a second data acquisition response to the Netconf client, and the second data acquisition response includes an error prompt to prompt the Netconf client that the data table under the requested host name service does not support the paging attribute and cannot provide the specified page data.

[0060] In an example, the second data acquisition response generated by the Netconf client is as follows:

[0061]

[0062] In the second data acquisition response, a clear error prompt has been given.

[0063] Based on the same inventive concept, the embodiments of the present application also provide a data acquisition device corresponding to the data acquisition method. See Figure 3 , Figure 3 For the data acquisition device provided by the embodiments of the present application, the device is applied to the Netconf server, and the device includes;

[0064] A receiving unit 310, configured to receive a first data acquisition request sent by a Netconf client, where the first data acquisition request includes a service identifier and a paging attribute;

[0065] A determining unit 320, configured to determine a service corresponding to the service identifier according to the service identifier;

[0066] A first acquisition unit 330, configured to locate a corresponding page from a data table of the service according to the paging attribute in the service, and acquire data from the corresponding page;

[0067] A sending unit 340, configured to send a first data acquisition response to the Netconf client, where the first data acquisition response includes the data acquired from the corresponding page.

[0068] Optionally, the paging attribute includes a paging identifier and the number of data to be acquired in the page indicated by the paging identifier;

[0069] The first acquisition unit 330 is specifically configured to locate a corresponding page from the data table of the service according to the paging identifier;

[0070] Using the number of data, starting from the first data in the page, acquire the same amount of data as the number of data.

[0071] Optionally, a second acquisition unit (not shown in the figure), configured to acquire a data table of the service in the service;

[0072] The first acquisition unit 330 is further configured to, if the data table of the service is not a global data table, locate a corresponding page from the data table of the service according to the paging attribute, and acquire data from the corresponding page.

[0073] Optionally, the sending unit 340 is further configured to, if the data table of the service is a global data table, send a second data acquisition response to the Netconf client, where the second data acquisition response includes an error prompt, so that the Netconf client determines that the global data table does not support the paging attribute.

[0074] Therefore, by applying the data acquisition device provided in this application, the Netconf server receives a first data acquisition request sent by the Netconf client. The first data acquisition request includes a service identifier and a paging attribute. According to the service identifier, the Netconf server determines the service corresponding to the service identifier. Under the service, according to the paging attribute, from the data table of the service, the Netconf server locates the corresponding paging and acquires data from the corresponding paging. The Netconf server sends a first data acquisition response to the Netconf client. The first data acquisition response includes the data acquired from the corresponding paging.

[0075] In this way, through the paging attribute included in the data acquisition request, the Netconf server can acquire data at a specified location and in a specified quantity and feedback it to the Netconf client, so that the Netconf client can quickly acquire the specified data, saving the system memory at both ends and improving the user experience. Moreover, it also solves the problems in the existing method of acquiring data included in a specified page, such as the slow speed of the network device in acquiring data, wasting the system memory of the controller and the network device, and affecting the user experience.

[0076] Based on the same inventive concept, an embodiment of this application also provides a network device, as Figure 4 shown, including a processor 410, a transceiver 420, and a machine-readable storage medium 430. The machine-readable storage medium 430 stores machine-executable instructions that can be executed by the processor 410. The processor 410 is prompted by the machine-executable instructions to execute the data acquisition method provided in the embodiment of this application. The foregoing Figure 3 data acquisition device shown can be implemented by using the hardware structure of the network device as Figure 4 shown.

[0077] The above-mentioned computer-readable storage medium 430 may include a random access memory (English: Random Access Memory, abbreviated as: RAM), and may also include a non-volatile memory (English: Non-volatile Memory, abbreviated as: NVM), such as at least one disk memory. Optionally, the computer-readable storage medium 430 may also be at least one storage device located far from the foregoing processor 410.

[0078] The above-mentioned processor 410 may be a general-purpose processor, including a central processing unit (CPU for short), a network processor (NP for short), etc.; it may also be a digital signal processor (DSP for short), an application-specific integrated circuit (ASIC for short), a field-programmable gate array (FPGA for short), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0079] In the embodiment of the present application, the processor 410 reads machine-executable instructions stored in the machine-readable storage medium 430, and is prompted by the machine-executable instructions to be able to implement the processor 410 itself and call the transceiver 420 to execute the data acquisition method described in the foregoing embodiment of the present application.

[0080] In addition, the embodiment of the present application provides a machine-readable storage medium 430, and the machine-readable storage medium 430 stores machine-executable instructions. When called and executed by the processor 410, the machine-executable instructions prompt the processor 410 itself and call the transceiver 420 to execute the communication method described in the foregoing embodiment of the present application.

[0081] For the implementation process of the functions and roles of each unit in the above-mentioned device, please refer to the implementation process of the corresponding steps in the above method for details, and will not be elaborated here.

[0082] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described above is only illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of the present application. Those of ordinary skill in the art can understand and implement it without creative efforts.

[0083] For the data acquisition device and the machine-readable storage medium embodiment, since the method content involved is basically similar to the foregoing method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0084] The above are only the preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included within the scope of protection of the present application.

Claims

1. A data acquisition method, characterized in that, The method is applied to a Netconf server, and the method includes; Receiving a first data acquisition request sent by a Netconf client, where the first data acquisition request includes a service identifier and a paging attribute; Determining the service corresponding to the service identifier according to the service identifier; Under the service, according to the paging attribute, locate the corresponding page from the data table of the service, and obtain data from the corresponding page; Sending a first data acquisition response to the Netconf client, where the first data acquisition response includes the data obtained from the corresponding page.

2. The method according to claim 1, wherein The paging attribute includes a paging identifier and the number of data to be obtained within the page indicated by the paging identifier; The step of locating the corresponding page from the data table of the service according to the paging attribute and obtaining data from the corresponding page specifically includes: Locating the corresponding page from the data table of the service according to the paging identifier; Using the number of data, starting from the first data of the page, obtaining the same amount of data as the number of data.

3. The method according to claim 1, characterized in that After determining the service corresponding to the service identifier, the method further includes: Under the service, obtaining the data table of the service; If the data table of the service is not a global data table, then according to the paging attribute, locate the corresponding page from the data table of the service, and obtain data from the corresponding page.

4. The method according to claim 3, characterized in that, The method further includes: If the data table of the service is a global data table, then sending a second data acquisition response to the Netconf client, where the second data acquisition response includes an error prompt, so that the Netconf client determines that the global data table does not support the paging attribute.

5. A data acquisition device, characterized in that, The device is applied to a Netconf server, and the device includes; A receiving unit, configured to receive a first data acquisition request sent by a Netconf client, where the first data acquisition request includes a service identifier and a paging attribute; A determining unit, configured to determine the service corresponding to the service identifier according to the service identifier; A first acquisition unit, configured to, under the service, locate the corresponding page from the data table of the service according to the paging attribute, and obtain data from the corresponding page; A sending unit, configured to send a first data acquisition response to the Netconf client, where the first data acquisition response includes the data obtained from the corresponding page.

6. The device according to claim 5, characterized in that, The paging attribute includes a paging identifier and the number of data to be obtained within the page indicated by the paging identifier; The first acquisition unit is specifically configured to locate the corresponding page from the data table of the service according to the paging identifier; Using the number of data, starting from the first data of the page, obtaining the same amount of data as the number of data.

7. The device according to claim 5, characterized in that, The device further includes: a second acquisition unit, configured to obtain the data table of the service under the service; The first acquisition unit is further configured to, if the data table of the service is not a global data table, then locate the corresponding page from the data table of the service according to the paging attribute, and obtain data from the corresponding page.

8. The device according to claim 7, characterized in that, The sending unit is further configured to, if the data table of the service is a global data table, send a second data acquisition response to the Netconf client, where the second data acquisition response includes an error prompt, so that the Netconf client determines that the global data table does not support the paging attribute.

Citation Information

Patent Citations

  • Data acquisition method of network configuration protocol and network configuration server

    CN102368716A

  • Paging processing method and device, electronic equipment and storage medium

    CN114840765A