WO2021103791A1 - 处理数据的方法、装置及系统 - Google Patents

处理数据的方法、装置及系统 Download PDF

Info

Publication number
WO2021103791A1
WO2021103791A1 PCT/CN2020/117247 CN2020117247W WO2021103791A1 WO 2021103791 A1 WO2021103791 A1 WO 2021103791A1 CN 2020117247 W CN2020117247 W CN 2020117247W WO 2021103791 A1 WO2021103791 A1 WO 2021103791A1
Authority
WO
WIPO (PCT)
Prior art keywords
list
list entries
request message
total amount
management device
Prior art date
Application number
PCT/CN2020/117247
Other languages
English (en)
French (fr)
Inventor
王子韬
郑光迎
吴钦
牛野
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP20892274.0A priority Critical patent/EP4050849A4/en
Publication of WO2021103791A1 publication Critical patent/WO2021103791A1/zh
Priority to US17/826,312 priority patent/US20220284020A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/02Standardisation; Integration
    • H04L41/0213Standardised network management protocols, e.g. simple network management protocol [SNMP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2379Updates performed during online database operations; commit processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/02Standardisation; Integration
    • H04L41/0226Mapping or translating multiple network management protocols

Definitions

  • This application relates to the field of communications, and in particular to a method, device and system for processing data.
  • the Restconf protocol or the network configuration protocol (network configuration protocol, Netconf) protocol defines a set of management operations for network devices, which can be servers, switches, routers, and so on. At least one list is saved in the network device, and at least one list entry is saved in each list. The user can use this set of management operations to obtain the list items in a certain list that they need from the network device.
  • the identification information of the list can be input into the management device, and the list includes the list entry that the user needs to obtain.
  • the management device sends a request message to the network device, and the request message includes the identification information.
  • the network device receives the request message, obtains the list entry from the list corresponding to the identification information, and sends the obtained list entry to the management device.
  • the management device receives the list entry sent by the network device.
  • the network device may obtain a large number of list entries, so that the management device receives a large number of list entries at one time, which consumes a large amount of memory of the management device, and easily crashes the management device.
  • This application provides a method, device, and system for processing data to avoid the management equipment from crashing.
  • the technical solution is as follows:
  • the present application provides a method for processing data.
  • the management device generates a request message.
  • the request message includes the number of list entries, identification information, and offset, and the number of list entries is used to indicate management
  • the device requests the number of list entries from the network device.
  • the identification information is used to indicate the list to be requested in the network device.
  • the list to be requested includes the list entry indicated by the number of list entries.
  • the value of the offset is equal to the value of the list item that has been sent to the network device.
  • the management device sends the request message to the network device, and the request message is used to request the network device for the list items in the to-be-requested list identified by the identification information, starting from the offset, and indicating the number of list items , The total number of list entries included in the list to be requested is greater than the number of list entries.
  • the management device receives a response message corresponding to the request message sent by the network device, where the response message includes the list entry requested by the request message.
  • the network device Since the request message includes the number of list entries and the offset, the network device obtains the list entry indicated by the number of list entries in the list to be requested starting from the offset, so that the management device receives the list
  • the number of entries is less than or equal to the number of list entries, which prevents the management device from receiving a large number of list entries at one time and causing a crash.
  • the management device obtains the total number of list entries, and determines the total number of requests based on the total number of list entries and the number of list entries.
  • the total number of requests is used to indicate the number of request messages sent by the management device to the network device. .
  • the management device generates a request message when the number of request messages that have been sent to the network device for requesting list entries in the list to be requested does not reach the total number of requests.
  • the management device If the management device does not determine the total number of requests, the management device continuously sends request messages to the network device. When the management device receives a request message that does not include any list entries in the response message, the management device discovers the slave network device After obtaining the list entries in the to-be-requested list, the last request message sent by the management device does not obtain any list conditions, and the last request message sent by the management device and the response message received the last time will cause a waste of network resources. However, in this implementation manner, since the management device determines the total number of requests, when the number of request messages that have been sent to the network device for requesting list entries in the list to be requested reaches the total number of requests, it indicates that the number of requests has been reached. After obtaining the list entries in the to-be-requested list from the network device, the management device can avoid sending the last sent request message and receiving the last received response message, saving network resources.
  • the management device sends a total amount request message to the network device, where the total amount request message includes the identification information, and the total amount request message is used to request the network device to obtain the total amount of the list entries.
  • the management device receives the total amount response message sent by the network device, and the total amount response message includes the total amount of the list entries.
  • the management device can obtain the total number of list entries, and determine the total number of requests based on the total number of list entries. Based on the total number of requests, it can be determined in time whether the list entries in the list to be requested have been obtained, so as to prevent the management device from obtaining After finishing the list entries in the list to be requested, a request message is sent again, which saves network resources.
  • the management device receives a total amount update message sent by the network device, the total amount update message includes the total amount of the updated list items, and the total amount of the updated list items is based on the list by the network device.
  • the total number of list entries determined when the total number of entries changes.
  • the management device updates the value of the total number of requests according to the total number of updated list entries. In this way, the management device can accurately determine when the list entries are obtained from the list to be requested based on the updated total number of requests.
  • the request message is a request message based on the Netconf protocol for network configuration or a request message based on the Restconf protocol.
  • the present application provides a method for processing data.
  • a network device receives a request message sent by a management device.
  • the request message includes the number of list entries, identification information, and offset, and the number of list entries is Used to instruct the management device to request the number of list entries from the network device, the identification information is used to indicate the list to be requested in the network device, the list to be requested includes the list entry indicated by the number of list entries, and the value of the offset is equal to The product of the number of request messages that have been sent to the network device for requesting list entries in the list to be requested and the number of the list entries.
  • the network device obtains the list entry indicated by the number of list entries in the list identified by the identification information with the offset as a starting position, where the total number of list entries included in the list is greater than the number of list entries.
  • the network device sends a response message corresponding to the request message to the management device, where the response message includes the list entry.
  • the network device Since the request message includes the number of list entries and the offset, the network device obtains the list entry indicated by the number of list entries in the list to be requested, starting with the offset, and this can reduce the number of entries to the management.
  • the number of list items sent by the device prevents the management device from receiving a large number of list items at one time and causing a crash.
  • the network device receives a total amount request message sent by the management device, the total amount request message includes the identification information; the network device obtains the total number of list entries included in the list identified by the identification information; the network device sends The management device sends a total amount response message, the total amount response message includes the total amount of the list item, the total amount response message is used by the management device to determine the total number of requests based on the total amount of the list items, and the total number of requests is used to instruct the management device to send The number of request messages sent by the network device.
  • the management device determines the total number of requests based on the total number of list entries, and based on the total number of requests, it can determine in time whether the list in the list to be requested has been obtained. Entries to avoid the management device from sending a request message once after obtaining the list entries in the list to be requested, thereby saving network resources.
  • the network device determines the total amount of the updated list items when the total amount of the list items changes, and sends a total amount update message to the management device.
  • the total amount update message includes the total amount of the updated list items.
  • the total amount update message is used for the management device to update the value of the total number of requests according to the updated list item total amount. This enables the management device to update the total number of requests based on the updated total number of list entries, so that the management device can accurately determine when the list entries have been obtained from the list to be requested based on the updated total number of requests.
  • this application provides a data processing device for executing the first aspect or the method in any one of the possible implementation manners of the first aspect.
  • the device includes a unit for executing the method of the first aspect or any one of the possible implementation manners of the first aspect.
  • the present application provides a data processing device for executing the second aspect or the method in any one of the possible implementation manners of the second aspect.
  • the device includes a unit for executing the second aspect or any one of the possible implementation manners of the second aspect.
  • the present application provides a device for processing data.
  • the device includes a processor, a memory, and a transceiver.
  • the processor, the memory and the transceiver may be connected through a bus system.
  • the memory is configured to store one or more programs
  • the processor is configured to execute one or more programs in the memory to implement the first aspect or the method in any possible implementation manner of the first aspect.
  • the present application provides a device for processing data, the device including: a processor, a memory, and a transceiver.
  • the processor, the memory and the transceiver may be connected through a bus system.
  • the memory is configured to store one or more programs
  • the processor is configured to execute one or more programs in the memory to implement the second aspect or the method in any possible implementation manner of the second aspect.
  • the present application provides a computer-readable storage medium with program code stored in the computer-readable storage medium, which when run on a computer, causes the computer to execute the first, second, and first aspects above Any possible implementation manner of or a method in any possible implementation manner of the second aspect.
  • the present application provides a computer program product containing program code, which when running on a computer, enables the computer to execute the first aspect, the second aspect, any possible implementation manner of the first aspect, or the second aspect Any of the possible implementations of the method.
  • this application provides a data processing system, including the device described in the third aspect and the device described in the fourth aspect; or, the device described in the fifth aspect and the device described in the sixth aspect .
  • FIG. 1 is a schematic diagram of a system architecture provided by an embodiment of the present application.
  • FIG. 2 is a flowchart of a method for processing data provided by an embodiment of the present application
  • FIG. 3 is a flowchart of another method for processing data provided by an embodiment of the present application.
  • FIG. 4 is a flowchart of another method for processing data provided by an embodiment of the present application.
  • FIG. 5 is a flowchart of another method for processing data provided by an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of a device for processing data provided by an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of another device for processing data provided by an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of another device for processing data provided by an embodiment of the present application.
  • Fig. 9 is a schematic structural diagram of another device for processing data provided by an embodiment of the present application.
  • an embodiment of the present application provides a system for processing data.
  • the system includes: a network device and a management device.
  • the network device may be a device such as a router, a switch, or a server.
  • the network device includes at least one list, each list is used to store at least one list entry, and each list entry includes at least one parameter.
  • the network device is a server
  • the network device includes a song list "album” for storing song information
  • the storage path of the song list "album” in the network device is "jukebox/library/artist/album”
  • Each list item included in the song list "album” can be song information, and the song information can include parameters such as the name of the song, the release time, or the singer.
  • the list entries included in the list in the network device may be routing information or configuration information, etc.
  • the management device can establish a network connection with the network device, and obtain all or part of the list entries in a certain list from the network device through the network connection.
  • the list is called a list to be requested, and the user can input identification information of the list to be requested in the management device.
  • the management device obtains the identification information of the list to be requested, establishes a network connection with the network device, generates a request message including the identification information, and sends the request message to the network device through the network connection.
  • the network device receives the request message, obtains the list entry included in the to-be-requested list corresponding to the identification information, and sends a response message to the management device, where the response message includes the obtained list entry.
  • the identification information of the list to be requested may be the storage path of the list to be requested in the network device, etc.
  • the user can input the identification information "jukebox/library/artist/album” of the song list "album” in the management device.
  • the management device establishes a network connection with the network device, and sends a request message to the network device.
  • the request message includes the identification information "jukebox/library/artist/album” of the song list "album”.
  • the network device obtains a list entry from the song list "album” corresponding to the identification information "jukebox/library/artist/album", and sends a response message including the obtained list entry to the management device.
  • the request message and the response message transmitted between the management device and the network device may be messages based on the network configuration protocol (Netconf) or messages based on the Restconf protocol.
  • the network connection established between the management device and the network device can be a Netconf connection or a Restconf connection.
  • the network device When the communication between the management device and the network device is based on the Netconf protocol, the network device is configured based on the Netconf protocol to configure the ability set of paging to obtain data.
  • the ability set of paging to obtain data based on Netconf protocol configuration can be expressed as:
  • Netconf paging capability urn:ietf:params:netconf:capability:paging:1.0.
  • the network device When the communication between the management device and the network device is based on the Restconf protocol, the network device is configured to obtain the data capability set based on the Restconf protocol by paging.
  • the ability set of paging to obtain data based on the Restconf protocol configuration can be expressed as:
  • the management device when the management device needs to obtain the list entries in the to-be-requested list from the network device, the management device establishes a network connection with the network device to obtain the capability set supported by the network device, and the capability set supported by the network device includes paging to obtain data
  • the management device obtains the list entries in the to-be-requested list from the network device in a way of obtaining data by paging. That is, the management device obtains the list items in the to-be-requested list from the network device multiple times, and generates a request message each time the list item is obtained.
  • the request message includes the number of list items, identification information, and offset.
  • the identification information is the identification information of the list to be requested, and the value of the offset is equal to the product of the number of request messages that have been sent to the network device for requesting list entries in the list to be requested and the number of list entries, and is sent to the network device The request message.
  • the network device receives the request message, obtains the list entry indicated by the target list entry amount in the list corresponding to the identification information with the offset as the starting position, and sends a response message corresponding to the request message to the management device, the response message Including the obtained list entries.
  • the management device Since the management device only obtains the list entries indicated by the number of the list entries each time, it can be ensured that the management device will not consume a large amount of memory of the management device when receiving the response message, and avoid the management device from crashing.
  • the management device obtains the list items included in the list to be requested from the network device in multiple times.
  • an embodiment of the present application provides a method for processing data.
  • the method is applied to the network architecture shown in FIG. 1, and the method includes:
  • Step 201 The management device sends a total amount request message to the network device, where the total amount request message includes identification information of the list to be requested.
  • the total amount request message may also include total amount acquisition instruction information.
  • the management device obtains the identification information of the to-be-requested list, and generates a total amount request message including the total amount acquisition indication information and the identification information of the to-be-requested list.
  • the total amount acquisition instruction information is used to instruct the network device to obtain the to-be-requested list.
  • the management device obtains the identification information of the to-be-requested list input by the user.
  • the management device may display a first input interface to the user, and the user may input identification information of the list to be requested in the first input interface.
  • the management device reads the identification information of the list to be requested from the first input interface, generates a total amount request message including total amount acquisition instruction information and the identification information, establishes a network connection with the network device, and connects to the network through the network connection The device sends the total amount request message.
  • the management device also obtains the first parameter type and the retrieval condition, and the generated total amount request message may further include the first parameter type and the retrieval condition.
  • the user when the user needs a list entry whose first parameter in the to-be-requested list meets the retrieval condition, the user can also input the first parameter type and retrieval condition corresponding to the first parameter in the first input interface.
  • the management device also reads the first parameter type and the retrieval condition from the first input interface.
  • the generated total amount request message may also include the first parameter type and the retrieval condition. The total amount request message is used to request the network device to obtain the total amount of list entries whose first parameter satisfies the retrieval condition in the to-be-requested list.
  • the first parameter type and retrieval condition may not be input to the management device.
  • the total amount request message generated by the management device does not include the first parameter type and the retrieval condition.
  • the management device may also first obtain the first parameter type and the retrieval condition, and send a query request to the network device.
  • the query request includes the first parameter type and the retrieval condition.
  • the network device receives the query request, queries, based on the first parameter type, each list including list entries for which the first parameter satisfies the retrieval condition, and sends identification information of each query list to the management device.
  • the management device receives the identification information of each list, selects the identification information of a list, and then generates a total request message including the identification information of the selected list, the first parameter type, and the retrieval condition.
  • the identification information entered by the user on the first input interface displayed on the management device is "jukebox/library/artist/album”
  • the type of the first parameter entered is " "Production time” and the search criteria entered are "Production time is greater than 1990”.
  • the management device reads the identification information "jukebox/library/artist/album", the first parameter type "production time”, and the retrieval condition "production time greater than 1990” from the first input interface, and generates instructions including total amount acquisition, The total amount request message with the identification information "jukebox/library/artist/album", the first parameter type "production time” and the retrieval condition "the production time is greater than 1990" is sent to the network device.
  • the total amount request message includes an indication element and a condition element
  • the indication element is used to include total amount acquisition instruction information
  • the condition element includes the identification information.
  • the condition element further includes the first parameter type and the retrieval condition.
  • the management device uses the start tag and the end tag to define an element, and the start tag and the end tag include the type of the element.
  • the indicator element can be expressed as ⁇ return-count>true ⁇ /return-count>, return-count represents the type of the indicator element, that is, return-count is used to represent the indicator element, and ⁇ return-count> is the indicator element’s
  • the start tag, ⁇ /return-count> is the end tag of the indicator element, and setting the content of the indicator element to true means that the indicator element includes the total amount acquisition instruction information.
  • condition element can be expressed as ⁇ where>/jukebox/library/artist/album[year>1990] ⁇ /where>, where represents the type of the condition element, that is, use where to represent the condition element, and year to represent the first parameter Type "production time", "year>1990” indicates the search condition "production time is greater than 1990”, ⁇ where> is the start tag of the condition element, ⁇ /where> is the end tag of the condition element, so that the condition The elements include the identification information "jukebox/library/artist/album", the first parameter type "production time” and the search condition "the production time is greater than 1990".
  • the total amount request message may be a remote procedure call (RPC) message based on the Netconf protocol, an RPC message based on the Restconf protocol, or a hypertext transfer protocol (http) based on the Restconf protocol news.
  • RPC remote procedure call
  • http hypertext transfer protocol
  • Step 202 The network device receives the total amount request message, obtains the total amount of the list items included in the list to be requested according to the total amount request message, and sends a total amount response message to the management device, and the total amount response message includes the total amount of the list items.
  • the total amount request message includes total amount obtaining instruction information and identification information of the to-be-requested list.
  • the network device obtains the total amount of list entries included in the to-be-requested list from the to-be-requested list corresponding to the identification information according to the instruction of the total amount acquisition instruction information.
  • the network device obtains the total amount of list entries for which the first parameter corresponding to the first parameter type satisfies the retrieval condition from the to-be-requested list corresponding to the identification information.
  • the network device receives the total amount request message, parses the indicator elements included in the total amount request message to obtain total amount acquisition instruction information, and parses the condition elements included in the total amount request message to obtain the to-be-requested Identification information of the list.
  • condition element further includes the first parameter parameter and the search condition
  • condition element is parsed to obtain the first parameter type and the search condition.
  • the total amount request message received by the network device can be expressed as follows:
  • the total request message includes the indication element ⁇ return-count>true ⁇ /return-count> and the condition element ⁇ where>/jukebox/library/artist/album[year>1990] ⁇ /where>.
  • the network device parses the indicator element, it determines that the total amount request message includes the total amount acquisition instruction information according to the content included in the indicator element as "true”, and obtains the to-be-requested list "album” when parsing the condition element
  • the identification information of is "jukebox/library/artist/album”
  • the first parameter type is "production time”
  • the search condition is "production time is greater than 1990”.
  • the total number of list entries whose production time is greater than 1990 is obtained from the pending request list "album” corresponding to the identification information "jukebox/library/artist/album”.
  • the amount is 60.
  • the total amount response message includes a total amount element, and the total amount element includes the total amount of the list item.
  • the indicator element can be expressed as ⁇ count>60 ⁇ /return-count>, count indicates the type of the total amount element, that is, use count to indicate the total amount element, and ⁇ count> is the starting tag of the total amount element. ⁇ /count> is the ending tag of the total element.
  • Step 203 The management device receives the total amount response message, and determines the number of list items according to the total amount of list items included in the total amount response message, and the number of list items is less than the total amount of list items.
  • the management device displays the total number of list entries, and obtains the number of list entries entered by the user according to the total number of list entries.
  • the management device determines the number of list entries according to the total number of list entries and a preset threshold, and the determined number of list entries is less than or equal to the preset threshold.
  • the management device may display a second input interface, the second input interface includes the total number of list items 60, so that the user can input the number of list items 20 in the second input interface according to the total number of list items 60, and the management device can use the second input interface Get the number of list entries in 20.
  • the preset threshold is 21 and the total number of list entries is 60
  • the number of list entries determined by the management device may be 20.
  • the management device calculates the total number of requests based on the total number of list entries and the number of list entries. For example, according to the total number of list entries 60 and the number of list entries 20, the management device calculates the total number of requests as 3, that is, the management device needs to obtain the list entries included in the list to be requested from the network device three times.
  • the management device also saves the total number of entries in the list.
  • the operations in steps 201 to 203 above are optional operations, that is, the management device does not need to obtain the total number of list items from the network device, so that the management device can directly set the number of list items or directly receive the list items input by the user. Quantity. In this case, the management device cannot determine the total number of requests.
  • Step 204 The management device generates a request message, which includes the number of list entries, the identification information and the offset, and sends the request message to the network device.
  • the management device calculates the offset according to the number of request messages and the number of list entries that have been sent to the network device for requesting list entries in the to-be-requested list.
  • the management device If the management device generates a request message for the first time, the number of request messages is 0, and the offset calculated according to the number of request messages and the number of list entries is 0. If the management device generates a request message for the mth time, the number of request messages is m-1, and the offset calculated based on the number of request messages and the number of list entries is (m-1)*L, where L is the list entry Quantity, m is an integer greater than 1, and * is a multiplication operation.
  • the request message generated by the management device may further include the first parameter type and the retrieval condition.
  • the management device may also obtain the second parameter type and the sorting method.
  • the request message generated by the management device may also include the second parameter type and the sorting method.
  • the management device displays the second input interface
  • the user can input the second parameter type and sorting method in the second input interface.
  • the management device can read the second parameter type and sorting method from the second input interface.
  • the second parameter type is the same or different from the first parameter type.
  • the request message may further include an operation type, and the operation type may be a modification operation defined by the Restconf protocol, or an acquisition operation defined by the Netconf protocol.
  • the modification operation type may be a Patch operation or a Post operation defined by the Restconf protocol, and the acquisition operation may be a get operation defined by the Netconf protocol.
  • the management device increases the number of request messages that have been sent.
  • the request message includes a quantity element, an offset element, and a condition element.
  • the quantity element includes the number of list entries
  • the offset element includes the offset
  • the condition element includes identification information of the list to be requested.
  • the condition element also includes the first parameter type and the retrieval condition.
  • the quantity element can be expressed as ⁇ limit>20 ⁇ /limit>, limit represents the quantity element, and ⁇ limit> is the starting tag of the quantity element. ⁇ /limit> is the ending tag of the number of elements.
  • the offset element can be expressed as ⁇ offset>0 ⁇ /offset>, offset represents the offset element, ⁇ offset> is the start tag of the offset element, and ⁇ /offset> is the end tag of the offset element.
  • the condition element can be expressed as ⁇ where>/jukebox/library/artist/album[year>1990] ⁇ /where>.
  • the request message includes a sorting parameter element and a sorting method element.
  • the sorting parameter element includes a second parameter type
  • the sorting method element includes a sorting method.
  • the sorting method is "ascending order".
  • “Ascending order” means that the list items are sorted in an ascending manner of production time, which is represented by ascending. So the sort parameter element can be expressed as ⁇ sort-target>/jukebox/library/artist/album/year ⁇ /sort-target>, sort-target means the sort parameter element, ⁇ sort-target> is the sort parameter element Start tag, ⁇ /sort-target> is the end tag of the sort parameter element.
  • the sorting method element can be expressed as ⁇ sort-by>ascending ⁇ /sort-by>, sort-by means the sorting method element, ⁇ sort-by> is the starting tag of the sorting method element, ⁇ /sort-by> It is the ending tag of the sorting method element.
  • the request message can be expressed as:
  • the request message may be an RPC message based on the Netconf protocol, an RPC message based on the Restconf protocol, or an http message based on the Restconf protocol.
  • Step 205 The network device receives the request message, and obtains the list entry indicated by the number of list entries with the offset as the starting position in the to-be-requested list identified by the identification information.
  • the network device receives the request message, parses the request message, and obtains the number of list entries, the offset, and the identification information. According to the number of list entries and the offset, the identification information is listed in the to-be-requested list corresponding to the identification information. Get list entries.
  • the list entry is obtained from the to-be-requested list corresponding to the identification information through the operation corresponding to the operation type.
  • the network device obtains the first parameter type corresponding to the first parameter type from the to-be-requested list corresponding to the identification information according to the number of list entries and the offset.
  • the first parameter satisfies the list entry of the search condition.
  • Step 206 The network device sends a response message to the management device, where the response message includes the obtained list entry.
  • the network device sorts each list item according to the sorting method according to the acquired second parameter included in each list entry, and the corresponding ,
  • the response message includes each list entry after sorting.
  • the request message received by the network device can be expressed as:
  • the network device parses the request message, analyzes that the request message includes a quantity element " ⁇ limit>20 ⁇ /limit>", and reads the number of list entries 20 from the quantity element.
  • the offset element " ⁇ offset>0 ⁇ /offset>” is parsed from the request message, and the offset is read as 0 from the offset element.
  • the condition element " ⁇ where>/jukebox/library/artist/album[year>1990] ⁇ /where>” is parsed from the request message, and the identification information of the album to be obtained to be requested is read from the condition element as " /jukebox/library/artist/album", the first parameter type is "production time”, and the retrieval condition is "production time is greater than 1990".
  • the sort parameter element " ⁇ sort-target>/jukeboxlibrary/artist/album/year ⁇ /sort-target>” is parsed from the request message, and the second parameter type read from the sort parameter element is also "production time ".
  • the sorting method element " ⁇ sort-by>ascending ⁇ /sort-by>” is parsed from the request message, and the sorting method read from the sorting method element is "ascending".
  • the network device obtains the 1st to 20th list entries whose production time is greater than 1990 from the list album corresponding to the identification information "/jukebox/library/artist/album", according to the 20
  • the production time included in each list item in the list items is sorted in an incremental manner, and a response message is sent to the management device, and the response message includes the sorted 20 list items.
  • the response message can be expressed as:
  • ⁇ name>yesterday ⁇ name> indicates the element including the song name "yesterday”
  • ⁇ year>1995 ⁇ /year> indicates the element including the production time.
  • the production time 1995 is the production time of the song “yesterday”
  • the title of the song “yesterday” and the release date 1995 are the contents of a list entry.
  • the meanings of other elements in the response message are the same as those mentioned above, so they will not be listed one by one.
  • the network device also detects in real time the total number of list entries included in the list to be requested, and when it detects that the total number of list entries included in the list to be requested has changed, re-acquires the list items to be requested.
  • the total number of list entries included in the list is obtained, and the total number of updated list entries is obtained, and a total number update message is sent to the management device.
  • the total number update message includes the total number of updated list entries.
  • the total number of list entries included in the list to be requested may change.
  • the changed situation may include: the network device adds a new list entry to the to-be-requested list, or the network device deletes part of the list entry from the to-be-requested list.
  • the network device when it sends a response message to the management device, it may obtain the total number of list entries in the to-be-requested list, and include the obtained total number of list entries in the response message.
  • the total response message may be an RPC message based on the Netconf protocol, an RPC message based on the Restconf protocol, or an http message based on the Restconf protocol.
  • Step 207 The management device receives the response message, and obtains a list entry from the response message.
  • the management device may save the obtained list item to the hard disk; or, display the obtained list item, and after the display, delete the list item or save the list item to the hard disk. Then the management device releases the memory space occupied by the list entry.
  • the management device determines whether the number of sent request messages is less than the total number of requests. The number of times of sending request messages is less than the total number of requests, the management device re-executes the operations of steps 203 to 207, and it ends when the number of sent request messages reaches the total number of requests.
  • the management device sends z request messages to the network device at different times, and receives z response messages from the network device at different times.
  • the number of list entries included in each of the first z-1 response messages is equal to the number of list entries, and the number of list entries included in the z-th response message is less than or equal to the number of list entries.
  • the management device selects the identification information of a list, and corresponds to the identification information in z times according to the above steps 204 to 207 Request a list entry in the list.
  • the zth response message received by the management device, even if the number of list entries included in the zth response message is less than the total number of list entries, the zth response message only includes the list entries in the list corresponding to the identification information , Will not include list entries in other lists.
  • the management device After receiving the z-th response message, the management device can save the list target in the z-th response message to the hard disk or delete the list entry in the z-th response message, and then re-select a list identification information, and then execute it again The above process.
  • the management device if the management device receives the total amount update message sent by the network device, the total amount update message includes the total amount of the updated list items, then The total number of list entries and the number of list entries after the update, the total number of requests are recalculated, that is, the value of the total number of requests is updated.
  • each response message sent by the network device includes the total number of list entries
  • the management device compares the total number of list entries in the response message with the total number of saved list entries. If the two are different, it means The total number of list items included in the list to be requested in the network device changes. According to the response message including the changed total number of list items and the number of list items, the total number of requests is recalculated, and the total number of saved list items is updated to this The total number of list entries included in the response message.
  • the management device determines whether the number of list entries included in the response message is less than the number of list entries, and after determining that the number of list entries included in the response message is 0 or If it is less than the number of list items, it means that the list items included in the to-be-requested list have been obtained from the network device or the list items that the first parameter included in the to-be-requested list satisfies the retrieval condition have been obtained from the network device, and the process ends.
  • the management device determines that the number of list items included in the response message is less than the number of list items. In the case of, the management device also sends a request message to the network device once, and receives a response message corresponding to the request message. Only when the number of list entries included in the response message is 0, it is determined that the list entries included in the list to be requested are obtained. In this way, the last request message sent by the management device and the response message received will cause a waste of network resources.
  • the management device can obtain the total number of list entries included in the list to be requested, and determine the total number of requests based on the total number of list entries. Based on the total number of requests, it can be determined in time whether the list entries in the list to be requested have been obtained. , To avoid the management device from sending a request message once after obtaining the list entries in the list to be requested, which saves network resources.
  • the request message generated by the management device includes the number of list entries, the offset, and the identification information of the list to be requested, and the request message is sent to the network device.
  • the network device receives the request message, and obtains the list items from the to-be-requested list identified by the identification information according to the number of list items and the offset in the request message, and the number of obtained list items is less than or equal to the number of list items,
  • Sending a response message including the acquired list entries to the management device ensures that the number of list entries acquired by the management device each time is less than or equal to the number of list entries, and avoids that the management device receives a large number of list entries at one time, which may cause the management device to crash. Since the number of list items obtained each time is less than or equal to the number of list items, the loading speed is also improved.
  • the management device and the network device can communicate based on the Netconf protocol or the Restconf protocol, and in this example, the total amount of request messages is Quantity response message, request message and response message can be based on RPC message defined by Netconf protocol or Restconf protocol.
  • the list to be requested is the above-mentioned song list "album" as an example for description.
  • the method for processing data provided by this example includes:
  • Step 301 The management device sends a total amount request message to the network device.
  • the total amount request message includes total amount acquisition instruction information and identification information of the song list "album".
  • the total amount request message may also include total amount acquisition instruction information.
  • the management device obtains the identification information "jukebox/library/artist/album” of the song list "album”, and generates an RPC message including the identification information "jukebox/library/artist/album” and the total acquisition instruction information , Use the RPC message as the total request message.
  • the management device also obtains the first parameter type "production time” and the retrieval condition “production time greater than 1990", and the generated RPC message also includes the first parameter type "production time” and the retrieval condition “production time greater than 1990” ", the generated RPC is as follows, that is, the total request message generated is as follows:
  • the indication element " ⁇ return-count>TRUE ⁇ /return-count>” is used in the RPC message to include the total amount acquisition indication information, and the condition element is used ⁇ where>/jukebox/library/artist/album[year>1990] ⁇ / where> includes the identification information, the first parameter type "production time” (using "year” to represent “production time”), and the search condition "production time is greater than 1990".
  • Step 302 The network device receives the total amount request message, and obtains the total amount of the list items included in the song list "album" according to the total amount request message. Assuming that the total amount of the list items is 60, the network device sends a total amount response message to the management device. The total amount response message includes the total amount 60 of the list entries.
  • the network device receives the total amount request message, and parses the total amount request message.
  • the indicator element ⁇ return-count>true ⁇ /return-count> is parsed from the total amount request message, and based on the content true included in the indicator element, it is determined that the total amount request message includes the total amount acquisition instruction information.
  • the condition element ⁇ where>/jukebox/library/artist/album[year>1990] ⁇ /where> is parsed from the total request message, and the identification information of the song list "album” is obtained from the condition element as "jukebox” /library/artist/album", the first parameter type is "production time", and the search condition is "production time is greater than 1990".
  • the network device obtains the total number of list entries whose production time is greater than 1990 from the song list "album” corresponding to the identification information "jukebox/library/artist/album” according to the instructions of the total acquisition instruction information.
  • the total number of list entries is 60.
  • An RPC message including a total amount element is generated, the total amount element includes the total amount 60 of the list entry, the RPC message is used as a total amount response message, and the total amount response message is sent to the management device.
  • the total amount element can be expressed as ⁇ count>60 ⁇ /count>
  • the total amount response message can be expressed as:
  • Step 303 The management device receives the total amount response message, and determines the number of list entries 20 according to the total amount 60 of list entries included in the total amount response message.
  • the management device displays the total number of list items 60, so that the user can input the number of list items according to the total number of list items 60. Assuming that the number of input list items is 20, the management device obtains the number of input list items 20.
  • the management device determines that the total number of requests is 3 according to the total number of list entries 60 and the number of list entries 20.
  • Step 304 The management device generates a first request message, the first request message includes the number of list entries 20, the identification information of the song list album, and the offset 0, and sends the first request message to the network device.
  • the first request message is a request message generated by the management device for the first time, and the number of request messages sent at this time is zero.
  • the management device calculates an offset of 0 according to the number of sent request messages 0 and the number of list entries 20. And, the management device obtains that the second parameter type input by the user is "production time” and the sorting method is "ascending order", and generates a first request message.
  • the first request message includes the number of list entries 20 and the identification information of the song list "album”. jukebox/library/artist/album”, calculated offset "0", first parameter type "production time”, search condition "production time greater than 1990”, second parameter type "production time” and sorting method "ascending order" "(Use ascending to indicate).
  • the first request message generated by the management device may be expressed as follows:
  • the management device After sending the first request message, the management device increases the number of sent request messages, and the increased number of sent request messages is 1.
  • Step 305 The network device receives the first request message, obtains 20 list entries from the song list album according to the number of list entries 20 and offset 0, and sends a first response message to the management device, the first response message includes the 20 List entry.
  • the network device receives the first request message, parses the first request message, and in the case that the number of list entries 20 is parsed from the first request message, it is determined that the management device adopts a paging method of obtaining data.
  • the identification information of the song list "album” "/jukebox/library/artist/album” the identification information of the song list "album” "/jukebox/library/artist/album”
  • the first parameter type "production time”
  • the search condition production time is greater than 1990”
  • the network device obtains the 1st to 20th list entries whose production time is greater than 1990 from the song list album corresponding to the identification information "/jukebox/library/artist/album" according to the number of list entries 20 and the offset 0. According to the production time included in each of the 20 list items, the 20 list items are sorted in an incremental manner. Generate an RPC message including the 20 sorted list entries, use the RPC message as a first response message, and send the first response message to the management device.
  • the first response message can be expressed as:
  • Step 306 The management device receives the first response message, and obtains 20 list entries from the first response message.
  • the management device can save the obtained 20 list entries to the hard disk.
  • the management device determines that the number of sent request messages 1 is less than the total number of requests 3, and continues to perform the following operation 307.
  • Step 307 The management device generates a second request message, the second request message includes the number of list entries 20, the identification information of the song list album, and the offset 20, and sends the second request message to the network device.
  • the second request message is the request message generated for the second time by the management device, and the number of times that the request message has been sent at this time is 1.
  • the management device In this step, the management device generates a second request message according to the number of sent request messages 1 and the number of list entries 20, and the calculated offset is 20.
  • the second request message includes the number of list entries 20 and the song list "album”
  • the identification information "jukebox/library/artist/album”, the calculated offset "20", the first parameter type "production time”, the search condition "production time greater than 1990”, the second parameter type "production time” and
  • the sorting method is "ascending".
  • the second request message generated by the management device may be expressed as follows:
  • the management device After sending the second request message, the management device increases the number of sent request messages, and the increased number of generated request messages is 2.
  • Step 308 The network device receives the second request message, obtains 20 list entries from the song list album according to the number of list entries 20 and the offset 20, and sends a second response message to the management device.
  • the second response message includes the 20 list entries. List entries.
  • the network device receives the second request message, parses the second request message, and in the case that the number of list entries 20 is parsed from the second request message, it is determined that the management device adopts a paging method of obtaining data.
  • the identification information of the song list "album” "/jukebox/library/artist/album” the identification information of the song list "album” "/jukebox/library/artist/album”
  • the first parameter type "production time”
  • the search condition production time is greater than 1990”
  • the second parameter "production time” and the sorting method "ascending order the sorting method "ascending order.
  • the network device obtains the 21st to 40th list entries whose production time is greater than 1990 from the song list album corresponding to the identification information "/jukebox/library/artist/album", a total of 20 List entry.
  • the 20 list items are sorted in an incremental manner.
  • Generate an RPC message including the sorted 20 list entries use the RPC message as a second response message, and send the second response message to the management device.
  • the second response message can be expressed as:
  • Step 309 The management device receives the second response message, and obtains 20 list entries from the second response message.
  • the management device can save the 20 obtained list entries to the hard disk, and the management device determines that the number of sent request messages 2 is less than the total number of requests 3, and continues to perform the following 310 operations.
  • Step 310 The management device generates a third request message, the third request message includes the number of list entries 20, the identification information of the song list album, and the offset 40, and sends the third request message to the network device.
  • the third request message is the third request message generated by the management device, and the number of sent request messages at this time is 2.
  • the management device In this step, the management device generates a third request message based on the number of sent request messages 2 and the number of list entries 20, and the calculated offset is 40.
  • the third request message includes the number of list entries 20 and the song list "album”. Identification information "jukebox/library/artist/album”, calculated offset "40", first parameter type "production time”, search condition "production time greater than 1990”, second parameter type "production time”, and The sorting method is "ascending".
  • the third request message generated by the management device may be expressed as follows:
  • the management device After sending the third request message, the management device increases the number of sent request messages, and the increased number of sent request messages is 3.
  • Step 311 The network device receives the third request message, obtains 20 list entries from the list album according to the number of list entries 40 and offset 20, and sends a third response message to the management device.
  • the third response message includes the 20 lists entry.
  • the network device receives the third request message, parses the third request message, and in the case that the number of list entries 20 is parsed from the third request message, it is determined that the management device adopts a paging method of obtaining data.
  • the identification information of the song list "album” "/jukebox/library/artist/album” the first parameter type "production time”
  • the search condition "production time is greater than 1990” the second parameter "production time” and the sorting method "ascending order”.
  • the network device obtains the 41st to 60th list entries from the album of the songs corresponding to the identification information "/jukebox/library/artist/album" with a production time greater than 1990.
  • the total is also 20 list entries.
  • the 20 list items are sorted in an incremental manner.
  • Generate an RPC message including the sorted 20 list entries use the RPC message as a third response message, and send the third response message to the management device.
  • the third response message can be expressed as:
  • Step 312 The management device receives the third response message, and obtains 20 list entries from the third response message.
  • the management device can save the obtained 20 list entries to the hard disk, and the management device determines that the number of sent request messages 3 is equal to the total number of requests 3, and it ends.
  • the number of list entries included in each request message generated by the management device is 20 and an offset calculated based on the number of sent request messages and the number of list entries 20.
  • the network device obtains no more than 20 list entries from the song list based on the offset each time, so that the response message sent to the management device includes no more than 20 list entries, which prevents the management device from receiving a large number of list entries at one time, resulting in The management device crashed.
  • the management device and the network device can communicate using the Restconf protocol, and in this example, the request message generated by the management device can include operations Type, the operation type is a modification operation.
  • the song list is still the above-mentioned list "album" as an example for description.
  • the method for processing data provided by this example includes:
  • Step 401 The management device sends a total amount request message to the network device.
  • the total amount request message includes the modification operation and the identification information of the song list "album”.
  • the total amount request message may also include total amount acquisition instruction information.
  • the management device obtains the identification information "jukebox/library/artist/album" of the song list "album", and generates the information including the modification operation, the identification information "jukebox/library/artist/album” and the total acquisition instruction information The message is used as the total request message.
  • the total amount request message is an http message
  • the modification operation is a Patch operation or a Post operation defined by the Restconf protocol.
  • the modification operation is described by taking the Patch operation as an example.
  • the Patch operation only the Patch operation needs to be replaced with the Post operation to obtain the implementation of the Post operation.
  • the management device also obtains the first parameter type "production time” and the retrieval condition "production time greater than 1990", and the generated total request message also includes the first parameter type "production time” and the retrieval condition "production time greater than 1990". 1990".
  • the total request message generated can be expressed as:
  • the total amount request message includes the modification operation "Patch” agreed by Restconf.
  • the indicator element " ⁇ return-count>TRUE ⁇ /return-count>” is used in the total amount request message, including the total amount acquisition instruction information, and the use condition element ⁇ where>/jukebox/library/artist/album[year>1990] ⁇ /where> includes the first parameter type "production time” (using "year” for "production time"), and the search condition "production time is greater than 1990" ".
  • Step 402 The network device receives the total amount request message, and obtains the total amount of the list items included in the song list "album" through the modification operation. Assuming that the total amount of the list items is 55, the network device sends a total amount response message to the management device. The amount response message includes the total number of list entries 55.
  • the network device receives the total amount request message, and parses the total amount request message.
  • the indicator element ⁇ return-count>true ⁇ /return-count> is parsed from the total amount request message, and it is determined that the total amount request message includes the total amount acquisition instruction information based on the content true included in the indicator element.
  • the network device obtains the instruction information according to the total amount and obtains the list of songs whose production time is greater than 1990 from the song list “album” corresponding to the identification information “jukebox/library/artist/album” through the “Patch” operation.
  • Total number of entries assuming that the total number of list entries obtained is 55.
  • An http message including a total amount element is generated, the total amount element includes the total amount 55 of the list entry, the http message is used as a total amount response message, and the total amount response message is sent to the management device.
  • the total amount element can be expressed as ⁇ count>55 ⁇ /count>
  • the total amount response message can be expressed as:
  • Step 403 The management device receives the total amount response message, and determines the number of list entries 20 according to the total amount 55 of list entries included in the total amount response message.
  • the management device displays the total number of list entries 55, so that the user can input the number of list entries according to the total number of list entries 55. Assuming that the number of entered list entries is 20, the management device obtains the number of entered list entries 20.
  • the management device determines that the total number of requests is 3 according to the total number of list entries 55 and the number of list entries 20.
  • Step 404 The management device generates a first request message, the first request message includes the modification operation, the number of list entries 20, the identification information of the song list album, and the offset 0, and sends the first request message to the network device.
  • the first request message is a request message generated by the management device for the first time, and the number of sent request messages at this time is zero.
  • the management device calculates an offset of 0 according to the number of sent request messages 0 and the number of list entries 20. And, the management device obtains that the second parameter type input by the user is "production time” and the sorting method is "ascending order", and generates a first request message.
  • the first request message includes the modification operation "Patch", the number of list entries is 20, and the song list " "Album” identification information "jukebox/library/artist/album”, calculated offset "0", first parameter type "production time”, search condition "production time greater than 1990", second parameter type "production time” "And the sorting method "ascending".
  • the first request message generated by the management device may be expressed as follows:
  • the management device After sending the first request message, the management device increases the number of sent request messages, and the increased number of sent request messages is 1.
  • Step 405 The network device receives the first request message, and according to the number of list entries 20 and offset 0, through the modification operation, 20 list entries are obtained from the song list album, and the first response message is sent to the management device.
  • the response message includes the 20 list entries.
  • the network device receives the first request message, parses the first request message, and in the case that the number of list entries 20 is parsed from the first request message, it is determined that the management device adopts a paging method of obtaining data.
  • the modification operation "Patch" from the first request message, offset 0, the identification information of the song list "album” "/jukebox/library/artist/album", the first parameter type "production time", search The condition is "production time is greater than 1990", the second parameter is "production time” and the sorting method is "ascending".
  • the network device obtains the first to the 20th song list album corresponding to the identification information "/jukebox/library/artist/album" through the "Patch" operation.
  • List entries According to the production time included in each of the 20 list items, the 20 list items are sorted in an incremental manner. An http message including the 20 sorted list entries is generated, the http message is used as the first response message, and the first response message is sent to the management device.
  • the first response message can be expressed as:
  • Step 406 The management device receives the first response message, and obtains 20 list entries from the first response message.
  • the management device can save the obtained 20 list entries to the hard disk.
  • the management device determines that the number of sent request messages 1 is less than the total number of requests 3, and continues to perform the following operation 407.
  • Step 407 The management device generates a second request message, the second request message includes the modification operation, the number of list entries 20, the identification information of the song list album, and the offset 20, and sends the second request message to the network device.
  • the second request message is a request message generated by the management device for the second time. At this time, the number of sent request messages is 1.
  • the management device In this step, the management device generates a second request message according to the number of sent request messages 1 and the number of list entries 20, and the calculated offset is 20.
  • the second request message includes the modification operation "Patch” and the number of list entries 20. ,
  • the second request message generated by the management device may be expressed as follows:
  • the management device After sending the second request message, the management device increases the number of sent request messages, and the increased number of sent request messages is 2.
  • Step 408 The network device receives the second request message, and according to the number of list entries 20 and the offset 20, obtains 20 list entries from the song list album through the modification operation, and sends a second response message to the management device.
  • the second response message includes the 20 list entries.
  • the network device receives the second request message, parses the second request message, and in the case that the number of list entries 20 is parsed from the second request message, it is determined that the management device adopts a paging method of obtaining data. From the second request message, continue to parse out the modification operation "Patch", offset 20, the identification information of the song list "album” “/jukebox/library/artist/album", the first parameter type "production time", search The condition is "production time is greater than 1990", the second parameter is "production time” and the sorting method is "ascending".
  • the network device obtains the 21st to 40th songs from the album corresponding to the identification information “/jukebox/library/artist/album” through the "Patch" operation.
  • List items get 20 list items.
  • the 20 list items are sorted in an incremental manner. Generate an http message including the 20 sorted list entries, use the http message as a second response message, and send the second response message to the management device.
  • the second response message can be expressed as:
  • Step 409 The management device receives the second response message, and obtains 20 list entries from the second response message.
  • the management device can save the obtained 20 list entries to the hard disk, and the management device determines that the number of sent request messages 2 is less than the total number of requests 3, and continues to perform the following operation 410.
  • Step 410 The management device generates a third request message, the third request message includes the modification operation, the number of list entries 20, the identification information of the song list album, and the offset 40, and sends the third request message to the network device.
  • the third request message is the third request message generated by the management device, and the number of sent request messages at this time is 2.
  • the management device calculates the offset as 40 according to the number of sent request messages 2 and the number of list entries 20, and generates a third request message.
  • the third request message includes the modification operation "Patch", the number of list entries 20, The identification information of the song list "album” “jukebox/library/artist/album”, the calculated offset "40", the first parameter type "production time”, the search condition "the production time is greater than 1990", the second parameter type "Production time” and sorting method "ascending".
  • the third request message generated by the management device may be expressed as follows:
  • the management device After sending the third request message, the management device increases the number of sent request messages, and the increased number of sent request messages is 1.
  • Step 411 The network device receives the third request message, according to the number of list entries 20 and the offset 40, through the modification operation, obtains 20 list entries from the song list album, and sends a third response message to the management device.
  • the third response message includes the 20 list entries.
  • the network device receives the third request message, parses the third request message, and in the case that the number of list entries 20 is parsed from the third request message, it is determined that the management device adopts a paging method of obtaining data.
  • the modification operation "Patch" from the third request message, offset 40, the identification information of the song list "album” "/jukebox/library/artist/album", the first parameter type "production time”, search The condition is "production time is greater than 1990", the second parameter is "production time” and the sorting method is "ascending".
  • the network device obtains the song list album corresponding to the identification information "/jukebox/library/artist/album" through the "Patch" operation, and the production time is greater than the 41st to the 55th in 1990.
  • List items get 15 list items. According to the production time included in each of the 15 list items, the 15 list items are sorted in an incremental manner. Generate an http message including the 15 sorted list entries, use the http message as a third response message, and send the third response message to the management device.
  • the third response message can be expressed as:
  • Step 412 The management device receives the third response message, and obtains 15 list entries from the third response message.
  • the management device can save the acquired 15 list entries to the hard disk, and the management device determines that the number of sent request messages 3 is equal to the total number of requests 3, and the end is ended.
  • each request message generated by the management device includes a modification operation and the number of list entries is 20.
  • the response message sent to the management device includes no more than 20 list entries. This prevents the management device from receiving a large number of list entries at one time, resulting in The management device crashed.
  • the management device and the network device can communicate using the Netconf protocol, and in this example, the request message generated by the management device can include a This type of operation is a get operation.
  • the list to be requested is the above-mentioned song list "album" as an example for description.
  • the method for processing data provided by this example includes:
  • Step 501 The management device sends a total amount request message to the network device, where the total amount request message includes the obtaining operation and identification information of the list "album".
  • the total amount request message may also include total amount acquisition instruction information.
  • the management device obtains the identification information "jukebox/library/artist/album" of the song list "album", and generates the information including the acquisition operation, the identification information "jukebox/library/artist/album” and the total acquisition instruction information The message is used as the total request message.
  • the total amount request message is an RPC message
  • the modification operation is a get operation defined by the Netconf protocol.
  • the management device also obtains the first parameter type "production time” and the retrieval condition "production time greater than 1990", and the generated total request message also includes the first parameter type "production time” and the retrieval condition "production time greater than 1990". 1990".
  • the total request message generated can be expressed as:
  • Step 502 The network device receives the total amount request message, and obtains the total amount of the list items included in the song list album through the obtaining operation. Assuming that the total amount of the list items is 55, the network device sends a total amount response message to the management device, and the total amount responds The message includes a total of 55 list entries.
  • the network device receives the total amount request message, and parses the total amount request message.
  • the total amount obtaining instruction information is parsed from the total amount request message. And from the total request message, it is parsed that the identification information of the acquisition operation "get” and the song list “album” is "jukebox/library/artist/album", the first parameter type is "production time”, and the retrieval condition is "production The time is greater than 1990".
  • the network device obtains the instruction information according to the total amount and obtains the song list "album” corresponding to the identification information "jukebox/library/artist/album” through the “get” operation.
  • Total number of entries assuming that the total number of list entries obtained is 55.
  • An RPC message including a total amount element is generated, the total amount element includes the total amount 55 of the list entry, the RPC message is used as a total amount response message, and the total amount response message is sent to the management device.
  • the total amount element can be expressed as ⁇ count>55 ⁇ /count>
  • the total amount response message can be expressed as:
  • Step 503 The management device receives the total amount response message, and determines the number of list entries 20 according to the total amount 55 of list entries included in the total amount response message.
  • the management device displays the total number of list entries 55, so that the user can input the number of list entries according to the total number of list entries 55. Assuming that the number of entered list entries is 20, the management device obtains the number of entered list entries 20.
  • the management device determines that the total number of requests is 3 according to the total number of list entries 55 and the number of list entries 20.
  • Step 504 The management device generates a first request message, the first request message includes the acquisition operation, the number of list entries 20, the identification information of the song list album, and the offset 0, and sends the first request message to the network device.
  • the first request message is a request message generated by the management device for the first time, and the number of sent request messages at this time is zero.
  • the management device calculates the offset as 0 according to the number of sent request messages 0 and the number of list entries 20. And, the management device obtains that the second parameter type input by the user is "production time” and the sorting method is "ascending order", and generates a first request message.
  • the first request message includes the obtaining operation "get”, the number of list entries 20, and the song list " "Album” identification information "jukebox/library/artist/album”, calculated offset "0", first parameter type "production time”, search condition "production time greater than 1990", second parameter type "production time” "And the sorting method "ascending".
  • the first request message generated by the management device may be expressed as follows:
  • the management device After sending the first request message, the management device increases the number of sent request messages, and the increased number of sent request messages is 1.
  • Step 505 The network device receives the first request message, and according to the number of list entries 20 and the offset 0, obtains 20 list entries from the song list album through the acquisition operation, and sends the first response message to the management device.
  • the first response message includes the 20 list entries.
  • the network device receives the first request message, parses the first request message, and in the case that the number of list entries 20 is parsed from the first request message, it is determined that the management device adopts a paging method of obtaining data.
  • the get operation "get", offset 0, the identification information of the song list "album” "/jukebox/library/artist/album”, the first parameter type "production time”, search The condition is "production time is greater than 1990", the second parameter is "production time” and the sorting method is "ascending".
  • the network device obtains the 1st to 20th list entries from the song list album corresponding to the identification information “/jukebox/library/artist/album” through the “get” operation according to the number of list entries 20 and the offset 0. According to the production time included in each of the 20 list items, the 20 list items are sorted in an incremental manner. Generate an RPC message including the 20 sorted list entries, use the RPC message as a first response message, and send the first response message to the management device.
  • the first response message can be expressed as:
  • Step 506 The management device receives the first response message, and obtains 20 list entries from the first response message.
  • the management device can save the obtained 20 list entries to the hard disk.
  • the management device determines that the number of sent request messages 1 is less than the total number of requests 3, and continues to perform the following operation 507.
  • Step 507 The management device generates a second request message, the second request message includes the acquisition operation, the number of list entries 20, the identification information of the song list album, and the offset 20, and sends the second request message to the network device.
  • the second request message is a request message generated by the management device for the second time. At this time, the number of sent request messages is 1.
  • the management device calculates the offset as 20 according to the number of sent request messages 1 and the number of list entries 20, and generates a second request message.
  • the second request message includes the get operation "get”, the number of list entries 20, The identification information of the song list "album” “jukebox/library/artist/album”, the calculated offset "20", the first parameter type "production time”, the search condition "the production time is greater than 1990", the second parameter type "Production time” and sorting method "ascending”.
  • the second request message generated by the management device may be expressed as follows:
  • the management device After sending the second request message, the management device increases the number of sent request messages, and the increased number of sent request messages is 2.
  • Step 508 The network device receives the second request message, and obtains 20 list entries from the list album through the acquisition operation according to the number of list entries 20 and the offset 20, and sends a second response message to the management device.
  • the response message includes the 20 list entries.
  • the network device receives the second request message, parses the second request message, and in the case that the number of list entries 20 is parsed from the second request message, it is determined that the management device adopts a paging method of obtaining data. From the second request message, continue to parse out the get operation "get", offset 20, the identification information of the song list "album” "/jukebox/library/artist/album", the first parameter type "production time", search The condition is "production time is greater than 1990", the second parameter is "production time” and the sorting method is "ascending".
  • the network device uses the "Patch” operation to obtain the 21st-40th from the album of the song list corresponding to the identification information "/jukebox/library/artist/album" whose production time is greater than 1990 List items, get 20 list items.
  • the 20 list items are sorted in an incremental manner.
  • Generate an RPC message including the sorted 20 list entries use the RPC message as a second response message, and send the second response message to the management device.
  • the second response message can be expressed as:
  • Step 509 The management device receives the second response message, and obtains 20 list entries from the second response message.
  • the management device can save the obtained 20 list entries to the hard disk, and the management device determines that the number of sent request messages 2 is less than the total number of requests 3, and continues to perform the following operation 510.
  • Step 510 The management device generates a third request message, the third request message includes the modification operation, the number of list entries 20, the identification information of the song list album, and the offset 40, and sends the third request message to the network device.
  • the third request message is the third request message generated by the management device, and the number of sent request messages at this time is 2.
  • the management device calculates the offset as 40 according to the number of sent request messages 2 and the number of list entries 20, and generates a third request message.
  • the third request message includes the get operation "get”, the number of list entries 20, The identification information of the song list "album” “jukebox/library/artist/album”, the calculated offset "40", the first parameter type "production time”, the search condition "the production time is greater than 1990", the second parameter type "Production time” and sorting method "ascending”.
  • the third request message generated by the management device may be expressed as follows:
  • the management device After sending the third request message, the management device increases the number of sent request messages, and the increased number of sent request messages is 1.
  • Step 511 The network device receives the third request message, and obtains 20 list entries from the song list album through the acquisition operation according to the number of list entries 20 and the offset 40, and sends a third response message to the management device.
  • the third response message includes the 20 list entries.
  • the network device receives the third request message, parses the third request message, and in the case that the number of list entries 20 is parsed from the third request message, it is determined that the management device adopts a paging method of obtaining data.
  • the get operation "get", offset 40, the identification information of the song list "album” "/jukebox/library/artist/album", the first parameter type "production time”, search The condition is "production time is greater than 1990", the second parameter is "production time” and the sorting method is "ascending".
  • the network device obtains from the album of the song list corresponding to the identification information "/jukebox/library/artist/album" the production time is greater than the 41st to the 55th in 1990 through the "get” operation.
  • List items get 15 list items.
  • the 15 list items are sorted in an incremental manner.
  • Generate an RPC message including the 15 sorted list entries use the RPC message as a third response message, and send the third response message to the management device.
  • the third response message can be expressed as:
  • Step 512 The management device receives the third response message, and obtains 15 list entries from the third response message.
  • the management device can save the acquired 15 list entries to the hard disk, and the management device determines that the number of sent request messages 3 is equal to the total number of requests 3, and the end is ended.
  • each request message generated by the management device includes an acquisition operation and the number of list entries is 20.
  • the response message sent to the management device includes no more than 20 list entries, which prevents the management device from receiving a large number of list entries at one time, resulting in The management device crashed.
  • an embodiment of the present application provides an apparatus 600 for processing data.
  • the apparatus 600 may be deployed on the management device of any of the foregoing embodiments, and includes:
  • the processing unit 601 is configured to generate a request message, the request message including the number of list entries, identification information, and an offset.
  • the number of list entries is used to instruct the device 600 to request the number of list entries from the network device, and the identification information is used for Indicates the list to be requested in the network device, the list to be requested includes the list entry indicated by the number of list entries, and the value of the offset is equal to the value that has been sent to the network device for requesting the list entry in the list to be requested.
  • the sending unit 602 is configured to send the request message to the network device, where the request message is used to request the network device for the list identified by the identification information, starting from the offset, and indicating the number of list entries Entries, where the total number of list entries included in the list is greater than the number of list entries;
  • the receiving unit 603 is configured to receive a response message corresponding to the request message sent by the network device, where the response message includes the list entry requested by the request message.
  • the detailed implementation process of the request message generated by the processing unit 601 may refer to step 204 of the embodiment shown in FIG. 2, step 304, step 307, and step 310 of the embodiment shown in FIG. 3, and steps of the embodiment shown in FIG. 4 404, step 407, step 410, and related content in step 504, step 507, and step 510 of the embodiment shown in FIG. 5.
  • processing unit 601 is configured to:
  • the request message is generated when the number of request messages sent to the network device for requesting list entries in the list to be requested does not reach the total number of requests.
  • the detailed implementation process for the processing unit 601 to obtain the total amount of list entries may refer to steps 201-203 of the embodiment shown in FIG. 2, steps 301-303 of the embodiment shown in FIG. 3, and steps of the embodiment shown in FIG. 4 401-403, related content in steps 501-503 of the embodiment shown in FIG. 5.
  • the sending unit 602 is further configured to send a total amount request message to the network device, where the total amount request message includes the identification information, and the total amount request message is used to request the network device to obtain the total amount of the list item;
  • the receiving unit 603 is further configured to receive a total amount response message sent by the network device, where the total amount response message includes the total amount of the list item.
  • the receiving unit 603 is further configured to receive a total amount update message sent by the network device.
  • the total amount update message includes the total amount of the updated list items, and the total amount of the updated list items is based on the list items by the network device.
  • the total amount of list entries determined when the total amount changes;
  • the processing unit 601 is further configured to update the value of the total number of requests according to the total number of updated list entries.
  • the request message is a network configuration Netconf protocol message or a Restconf protocol message.
  • the number of list entries is used to indicate the number of list entries that the management device requests from the network device
  • the identification information is used to indicate the network
  • the offset value is equal to the product of the number of request messages that have been sent to the network device for requesting list entries in the list to be requested and the number of list entries, so that the sending unit sends After the network device sends the request message, the network device is made to obtain the list entry in the list to be requested starting from the offset and indicated by the number of list entries, so that the number of list entries received by the receiving unit is less than or It is equal to the number of list items, which prevents the management device from receiving a large number of list items at one time and causing a crash.
  • an embodiment of the present application provides an apparatus 700 for processing data.
  • the apparatus 700 may be deployed on the network equipment of any of the foregoing embodiments, and includes:
  • the receiving unit 701 is configured to receive a request message sent by the management device.
  • the request message includes the number of list entries, identification information, and offset.
  • the number of list entries is used to instruct the management device to request the number of list entries from the apparatus 700.
  • the identification information is used to indicate the list to be requested in the device 700.
  • the list to be requested includes the list entries indicated by the number of the list entries.
  • the value of the offset is equal to the value of the offset that has been sent to the device 700 for requesting the waiting list.
  • the processing unit 702 is configured to obtain the list items in the list identified by the identification information that start at the offset and indicate the number of list items, wherein the total number of list items included in the list is greater than the list items Quantity
  • the sending unit 703 is configured to send a response message corresponding to the request message to the management device, where the response message includes the list entry.
  • the detailed implementation process for the processing unit 701 to obtain the list entry may refer to step 205 of the embodiment shown in FIG. 2, step 305, step 308, and step 311 of the embodiment shown in FIG. 3, and steps of the embodiment shown in FIG. 4 405, step 408, step 411, and related content in step 505, step 508, and step 511 of the embodiment shown in FIG. 5.
  • the receiving unit 701 is further configured to receive a total amount request message sent by the management device, where the total amount request message includes the identification information;
  • the processing unit 702 is further configured to obtain the total number of list entries included in the list corresponding to the identification information;
  • the sending unit 703 is further configured to send a total amount response message to the management device, the total amount response message includes the total amount of the list item, and the total amount response message is used by the management device to determine the total number of requests based on the total amount of the list item. The total number of times is used to indicate the number of request messages sent by the management device to the apparatus 700.
  • step 202 of the embodiment shown in FIG. 2 step 302 of the embodiment shown in FIG. 3, step 402 of the embodiment shown in FIG. 4, and step 402 of the embodiment shown in FIG.
  • the related content in step 502 of the embodiment is shown.
  • processing unit 702 is further configured to determine the total amount of updated list items when the total amount of the list items changes;
  • the sending unit 703 is further configured to send a total amount update message to the management device, where the total amount update message includes the total amount of the updated list items, and the total amount update message is used for the management device to update the request total amount according to the updated total amount of the list items. The value of the number of times.
  • the processing unit since the request message received by the receiving unit includes the number of list entries, identification information, and offset, the processing unit obtains the list of items identified by the identification information and starts with the offset. List entries indicated by the number of list entries, so that the response message of the sending unit includes that the number of list entries is less than the number of list entries. In this way, the number of list entries sent to the management device can be reduced, and it is avoided that the management device receives a large number of list entries at one time and causes a crash.
  • an embodiment of the present application provides a schematic diagram of an apparatus 800 for processing data.
  • the apparatus 800 may be the management device in any of the foregoing embodiments.
  • the device 800 includes at least one processor 801, a bus system 802, a memory 803, and at least one transceiver 804.
  • the device 800 is a device with a hardware structure, and can be used to implement the functional modules in the device 600 described in FIG. 6.
  • the processing unit 601 in the device 600 shown in FIG. 6 can be implemented by calling the code in the memory 603 by the at least one processor 601.
  • the receiving unit 603 can be implemented by the transceiver 604.
  • the device 800 can also be used to implement the function of the collection and analysis device in any of the foregoing embodiments.
  • processor 801 may be a general-purpose central processing unit (central processing unit, CPU), network processor (network processor, NP), microprocessor, application-specific integrated circuit (ASIC) , Or one or more integrated circuits used to control the execution of the program of this application.
  • CPU central processing unit
  • NP network processor
  • ASIC application-specific integrated circuit
  • the above-mentioned bus system 802 may include a path for transferring information between the above-mentioned components.
  • the above-mentioned transceiver 804 is used to communicate with other devices or a communication network.
  • the above-mentioned memory 803 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory (RAM), or other types that can store information and instructions.
  • the type of dynamic storage device can also be electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM), or other optical disk storage, optical discs Storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program codes in the form of instructions or data structures and can be used by Any other medium accessed by the computer, but not limited to this.
  • the memory can exist independently and is connected to the processor through a bus.
  • the memory can also be integrated with the processor.
  • the memory 803 is used to store application program code for executing the solution of the present application, and the processor 501 controls the execution.
  • the processor 801 is configured to execute the application program code stored in the memory 803, so as to realize the functions in the method of the present patent.
  • the processor 801 may include one or more CPUs, such as CPU0 and CPU1 in FIG. 8.
  • the apparatus 800 may include multiple processors, such as the processor 801 and the processor 807 in FIG. 8. Each of these processors can be a single-CPU (single-CPU) processor or a multi-core (multi-CPU) processor.
  • the processor here may refer to one or more devices, circuits, and/or processing cores for processing data (for example, computer program instructions).
  • an embodiment of the present application provides a schematic diagram of an apparatus 900 for processing data.
  • the apparatus 900 may be the network device in any of the foregoing embodiments, for example, may be the head node in the embodiment shown in FIG. 9.
  • the device 900 includes at least one processor 901, a bus system 902, a memory 903, and at least one transceiver 904.
  • the device 900 is a device with a hardware structure, and can be used to implement the functional modules in the device 700 described in FIG. 7.
  • the processing unit 702 in the device 700 shown in FIG. 7 can be implemented by calling the code in the memory 703 by the at least one processor 701.
  • the sending unit 703 can be implemented by the transceiver 704.
  • the device 900 can also be used to implement the function of the collection and analysis device in any of the foregoing embodiments.
  • the aforementioned processor 901 may be a general-purpose central processing unit (central processing unit, CPU), network processor (network processor, NP), microprocessor, application-specific integrated circuit (ASIC) , Or one or more integrated circuits used to control the execution of the program of this application.
  • CPU central processing unit
  • NP network processor
  • ASIC application-specific integrated circuit
  • the above-mentioned bus system 902 may include a path for transferring information between the above-mentioned components.
  • the aforementioned transceiver 904 is used to communicate with other devices or a communication network.
  • the aforementioned memory 903 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM), or other types that can store information and instructions.
  • the type of dynamic storage device can also be electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM), or other optical disk storage, optical discs Storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program codes in the form of instructions or data structures and can be used by Any other medium accessed by the computer, but not limited to this.
  • the memory can exist independently and is connected to the processor through a bus.
  • the memory can also be integrated with the processor.
  • the memory 903 is used to store application program codes for executing the solutions of the present application, and the processor 901 controls the execution.
  • the processor 901 is configured to execute the application program code stored in the memory 903, so as to realize the functions in the method of the present patent.
  • the processor 901 may include one or more CPUs, such as CPU0 and CPU1 in FIG. 9.
  • the apparatus 900 may include multiple processors, such as the processor 901 and the processor 907 in FIG. 9. Each of these processors can be a single-CPU (single-CPU) processor or a multi-core (multi-CPU) processor.
  • the processor here may refer to one or more devices, circuits, and/or processing cores for processing data (for example, computer program instructions).

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Fuzzy Systems (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Probability & Statistics with Applications (AREA)
  • Mathematical Physics (AREA)
  • Computer And Data Communications (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本申请公开了一种处理数据的方法、装置及系统,属于通信领域。所述方法包括:管理设备生成请求消息,所述请求消息包括列表条目数量、标识信息和偏移量;所述管理设备向所述网络设备发送所述请求消息,所述请求消息用于向所述网络设备请求所述标识信息标识的所述列表中的、以所述偏移量为起始位置的、所述列表条目数量指示的列表条目,其中,所述列表包括的列表条目总量大于所述列表条目数量;所述管理设备接收所述网络设备发送的所述请求消息对应的响应消息,所述响应消息包括所述请求消息请求的列表条目。本申请能够避免管理设备崩溃。

Description

处理数据的方法、装置及系统
本申请要求于2019年11月29日提交的申请号为201911204433.8、发明名称为“处理数据的方法、装置及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信领域,特别涉及一种处理数据的方法、装置及系统。
背景技术
Restconf协议或者网络配置协议(network configuration protocol,Netconf)协议定义了一套网络设备的管理操作,该网络设备可以为服务器、交换机或路径器等。网络设备中保存到至少一个列表,每个列表保存有至少一个列表条目。用户可以使用该套管理操作,从网络设备中获取所需要的某个列表中的列表条目。
例如,用户需要从网络设备中获取某个列表的列表条目时,可以在管理设备中输入列表的标识信息,该列表包括用户需要获取的列表条目。管理设备向网络设备发送请求消息,该请求消息包括该标识信息。网络设备接收该请求消息,从该标识信息对应的列表中获取列表条目,向管理设备发送获取的列表条目。管理设备接收网络设备发送的列表条目。
在实现本申请的过程中,发明人发现现有技术至少存在以下问题:
网络设备可能获取到大量的列表条目,这样管理设备一次接收到大量的列表条目,消耗了管理设备的大量内存,很容易使管理设备崩溃。
发明内容
本申请提供了一种处理数据的方法、装置及系统,以避免管理设备崩溃。所述技术方案如下:
第一方面,本申请提供了一种处理数据的方法,在所述方法中:管理设备生成请求消息,该请求消息包括列表条目数量、标识信息和偏移量,该列表条目数量用于指示管理设备向网络设备请求列表条目的数量,该标识信息用于指示网络设备中的待请求的列表,待请求的列表包括该列表条目数量指示的列表条目,该偏移量的值等于已经向网络设备发送的、用于请求待请求的列表中的列表条目的请求消息的数量与该列表条目数量的乘积。管理设备向网络设备发送该请求消息,该请求消息用于向网络设备请求该标识信息标识的待请求的列表中的、以该偏移量为起始位置的、该列表条目数量指示的列表条目,待请求的列表包括的列表条目总量大于所述列表条目数量。管理设备接收网络设备发送的该请求消息对应的响应消息,该响应消息包括该请求消息请求的列表条目。
由于该请求消息包括列表条目数量和偏移量,使得网络设备获取待请求的列表中的、以该偏移量为起始位置的、该列表条目数量指示的列表条目,这样管理设备接收到列表条目的数量小于或等于该列表条目数量,避免了管理设备一次接收到大量的列表条目,出现崩溃现象。
在一种可能的实现方式中,管理设备获取列表条目总量,根据该列表条目总量和该列表条目数量确定请求总次数,该请求总次数用于指示管理设备向网络设备发送请求消息的数量。管理设备在已向网络设备发送的、用于请求待请求的列表中的列表条目的请求消息的数量未达到该请求总次数时,生成请求消息。
如果管理设备没有确定该请求总次数,则管理设备不断地向网络设备发送请求消息, 当管理设备接收到某个请求消息对应的响应消息中不包括任何列表条目时,管理设备才发现从网络设备中获取完待请求的列表中的列表条目,如此管理设备最后一次发送的请求消息没有获取到任何列表条件,管理设备最后一次发送的请求消息和最后一次接收的响应消息会产生网络资源的浪费。然而,在该实现方式中,由于管理设备确定请求总次数,这样在已向网络设备发送的、用于请求待请求的列表中的列表条目的请求消息的数量达到该请求总次数时,表明已从网络设备中获取完待请求列表中的列表条目,从而管理设备可以避免发送上述最后一次发送的请求消息和接收上述最后一次接收的响应消息,节省了网络资源。
在另一种可能的实现方式中,管理设备向网络设备发送总量请求消息,该总量请求消息包括该标识信息,该总量请求消息用于请求网络设备获取该列表条目总量。管理设备接收网络设备发送的总量响应消息,该总量响应消息包括该列表条目总量。如此管理设备能够获取到列表条目总量,从而基于该列表条目总量确定请求总次数,基于该请求总次数可以及时确定是否已获取完待请求的列表中的列表条目,从而避免管理设备在获取完待请求的列表中的列表条目后还发送一次请求消息,节省网络资源。
在另一种可能的实现方式中,管理设备接收网络设备发送的总量更新消息,该总量更新消息包括更新后的列表条目总量,该更新后的列表条目总量是网络设备基于该列表条目总量变化时确定的列表条目总量。管理设备根据更新后的列表条目总量更新该请求总次数的值。如此管理设备能够基于该更新后的请求总次数能够准确地判断出何时从待请求的列表中获取完列表条目。
在另一种可能的实现方式中,该请求消息是基于网络配置Netconf协议的请求消息或基于Restconf协议的请求消息。
第二方面,本申请提供了一种处理数据的方法,在所述方法中:网络设备接收管理设备发送的请求消息,该请求消息包括列表条目数量、标识信息和偏移量,该列表条目数量用于指示管理设备向网络设备请求列表条目的数量,该标识信息用于指示网络设备中的待请求的列表,待请求的列表包括该列表条目数量指示的列表条目,该偏移量的值等于已经向网络设备发送的、用于请求待请求的列表中的列表条目的请求消息的数量与该列表条目数量的乘积。网络设备获取该标识信息标识的列表中的、以该偏移量为起始位置的、该列表条目数量指示的列表条目,其中,该列表包括的列表条目总量大于该列表条目数量。网络设备向管理设备发送该请求消息对应的响应消息,该响应消息包括该列表条目。
由于该请求消息包括列表条目数量和偏移量,这样网络设备获取待请求的列表中的、以该偏移量为起始位置的、该列表条目数量指示的列表条目,如此可以减小向管理设备发送的列表条目的数量,避免了管理设备一次接收到大量的列表条目,出现崩溃现象。
在一种可能的实现方式中,网络设备接收管理设备发送的总量请求消息,该总量请求消息包括该标识信息;网络设备获取该标识信息标识的列表包括的列表条目总量;网络设备向管理设备发送总量响应消息,该总量响应消息包括该列表条目总量,该总量响应消息 用于管理设备基于该列表条目总量确定请求总次数,该请求总次数用于指示管理设备向网络设备发送请求消息的数量。如此可以向管理设备发送待请求的列表包括的列表条目总量,使得管理设备基于该列表条目总量确定请求总次数,基于该请求总次数可以及时确定是否已获取完待请求的列表中的列表条目,以避免管理设备在获取完待请求的列表中的列表条目后还发送一次请求消息,从而节省了网络资源。
在另一种可能的实现方式中,网络设备在该列表条目总量变化时确定更新后的列表条目总量,向管理设备发送总量更新消息,该总量更新消息包括更新后的列表条目总量,该总量更新消息用于管理设备根据更新后的列表条目总量更新该请求总次数的值。这样使得管理设备根据更新后的列表条目总量更新请求总次数,如此管理设备基于该更新后的请求总次数能够准确地判断出何时从待请求的列表中获取完列表条目。
第三方面,本申请提供了一种处理数据的装置,用于执行第一方面或第一方面的任意一种可能实现方式中的方法。具体地,所述装置包括用于执行第一方面或第一方面的任意一种可能实现方式的方法的单元。
第四方面,本申请提供了一种处理数据的装置,用于执行第二方面或第二方面的任意一种可能实现方式中的方法。具体地,所述装置包括用于执行第二方面或第二方面的任意一种可能实现方式的方法的单元。
第五方面,本申请提供了一种处理数据的装置,所述装置包括:处理器、存储器和收发器。其中,所述处理器、所述存储器和所述收发器之间可以通过总线系统相连。所述存储器用于存储一个或多个程序,所述处理器用于执行所述存储器中的一个或多个程序,完成第一方面或第一方面的任意可能实现方式中的方法。
第六方面,本申请提供了一种处理数据的装置,所述装置包括:处理器、存储器和收发器。其中,所述处理器、所述存储器和所述收发器之间可以通过总线系统相连。所述存储器用于存储一个或多个程序,所述处理器用于执行所述存储器中的一个或多个程序,完成第二方面或第二方面的任意可能实现方式中的方法。
第七方面,本申请提供了一种计算机可读存储介质,计算机可读存储介质中存储有程序代码,当其在计算机上运行时,使得计算机执行上述第一方面、第二方面、第一方面的任意可能实现方式或第二方面的任意可能实现方式中的方法。
第八方面,本申请提供了一种包含程序代码的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面、第二方面、第一方面的任意可能实现方式或第二方面的任意可能实现方式中的方法。
第九方面,本申请提供了一种处理数据的系统,包括第三方面所述的装置和第四方面所述的装置;或者,包括第五方面所述的装置和第六方面所述的装置。
附图说明
图1是本申请实施例提供的一种系统架构示意图;
图2是本申请实施例提供的一种处理数据的方法流程图;
图3是本申请实施例提供的另一种处理数据的方法流程图;
图4是本申请实施例提供的另一种处理数据的方法流程图;
图5是本申请实施例提供的另一种处理数据的方法流程图;
图6是本申请实施例提供的一种处理数据的装置结构示意图;
图7是本申请实施例提供的另一种处理数据的装置结构示意图;
图8是本申请实施例提供的另一种处理数据的装置结构示意图;
图9是本申请实施例提供的另一种处理数据的装置结构示意图。
具体实施方式
下面将结合附图对本申请实施方式作进一步地详细描述。
参见图1,本申请实施例提供了一种处理数据的系统,该系统包括:网络设备和管理设备。
网络设备可以为路由器、交换机或服务器等设备,网络设备中包括至少一个列表(list),每个列表用于保存至少一个列表条目(list entry),每个列表条目包括至少一个参数。
例如,假设网络设备为服务器,以及假设该网络设备包括一个用于保存歌曲信息的歌曲列表“album”,该歌曲列表“album”在网络设备中的存储路径为“jukebox/library/artist/album”,该歌曲列表“album”包括的每个列表条目可以为歌曲信息,该歌曲信息可以包括歌曲的名称、出品时间或歌手等参数。
再如,假设网络设备为路由器或交换机,该网络设备中的列表包括的列表条目可以是路由信息或配置信息等。
管理设备可以建立与网络设备之间的网络连接,通过该网络连接从网络设备中获取某个列表中的全部或部分列表条目。
可选的,当用户需要请求某个列表包括的列表条目时,为了便于说明,称该列表为待请求列表,用户可以在管理设备中输入待请求列表的标识信息。管理设备获取待请求列表的标识信息,建立与网络设备之间的网络连接,生成包括该标识信息的请求消息,通过该网络连接向网络设备发送该请求消息。网络设备接收该请求消息,获取该标识信息对应的待请求列表包括的列表条目,向管理设备发送响应消息,该响应消息包括获取的列表条目。
可选的,待请求列表的标识信息可以是待请求列表在网络设备中的存储路径等。
例如,假设用户需要歌曲列表“album”中的列表条目,用户可以在管理设备中输入该歌曲列表“album”的标识信息“jukebox/library/artist/album”。管理设备建立与网络设备之间的网络连接,向网络设备发送请求消息,该请求消息包括该歌曲列表“album”的标识信息“jukebox/library/artist/album”。网络设备从该标识信息“jukebox/library/artist/album”对应的歌曲列表“album”中获取列表条目,向管理设备发送包括获取的列表条目的响应消息。
可选的,管理设备与网络设备之间传输的请求消息和响应消息可以是基于网络配置协议(network configuration protocol,Netconf)的消息或基于Restconf协议的消息。管理设备与网络设备之间建立的网络连接可以是Netconf连接或Restconf连接。
需要说明的是:一个列表中保存的列表条目可能较多,这样管理设备在使用Netconf 协议或Restconf协议从网络设备中获取待请求列表中的列表条目时,网络设备会向管理设备发送待请求列表中大量的列表条目。这样管理设备会接收到大量的列表条目,消耗掉管理设备的大量内存,导致管理设备崩溃。为了解决该技术问题,可以在网络设备中定义一个分页获取数据的能力集,该能力集支持分页获取数据方式,所谓分页获取数据方式是指允许管理设备分多次从网络设备中获取列表中的列表条目。这样管理设备每次获取的列表条目不会太多,从而不会消耗大量的内存空间,避免了管理设备崩溃。
当管理设备与网络设备之间基于Netconf协议通信时,在网络设备中基于Netconf协议配置分页获取数据的能力集。基于Netconf协议配置的分页获取数据的能力集可以表示为:
Netconf paging capability:urn:ietf:params:netconf:capability:paging:1.0。
当管理设备与网络设备之间基于Restconf协议通信时,在网络设备中基于Restconf协议配置分页获取数据能力集。基于Restconf协议配置的分页获取数据的能力集可以表示为:
Restconf paging capability:urn:ietf:params:restconf:capability:paging:1.0。
这样在管理设备需要从网络设备中获取待请求列表中的列表条目时,管理设备建立与网络设备之间的网络连接,获取网络设备支持的能力集,在网络设备支持的能力集包括分页获取数据的能力集的情况下,管理设备采用分页获取数据方式从网络设备中获取待请求列表中的列表条目。也就是说,管理设备分多次从网络设备中获取待请求列表中的列表条目,在每次获取列表条目时,生成请求消息,该请求消息包括列表条目数量、标识信息和偏移量,该标识信息为待请求列表的标识信息,该偏移量的值等于已经向网络设备发送的、用于请求待请求列表中的列表条目的请求消息的数量与列表条目数量的乘积,向网络设备发送该请求消息。
网络设备接收该请求消息,在该标识信息对应的列表中以该偏移量为起始位置获取该目标列表条目量指示的列表条目,向管理设备发送该请求消息对应的响应消息,该响应消息包括获取的列表条目。
由于管理设备每次只获取该列表条目数量指示的列表条目,这样可以保证管理设备在接收到响应消息时,不会消耗掉管理设备的大量内存,避免管理设备崩溃。
接下来,将在发下图2所示的实施例中详细说明管理设备如何分多次从网络设备中获取待请求列表包括的列表条目的过程。
参见图2,本申请实施例提供了一种处理数据的方法,该方法应用于图1所示的网络架构,该方法包括:
步骤201:管理设备向网络设备发送总量请求消息,该总量请求消息包括待请求列表的标识信息。
该总量请求消息还可以包括总量获取指示信息。
在本步骤中,管理设备获取待请求列表的标识信息,生成包括总量获取指示信息和待请求列表的标识信息的总量请求消息,该总量获取指示信息用于指示网络设备获取待请求列表包括的列表条目总量。
可选的,管理设备获取用户输入的待请求列表的标识信息。
管理设备可以向用户显示第一输入界面,用户可以在第一输入界面中输入待请求列表的标识信息。管理设备从第一输入界面中读取待请求列表的标识信息,生成包括总量获取指示信息和该标识信息的总量请求消息,建立与网络设备之间的网络连接,通过该网络连 接向网络设备发送该总量请求消息。
可选的,管理设备还获取第一参数类型和检索条件,生成的总量请求消息还可以包括第一参数类型和检索条件。
可选的,用户需要待请求列表中的第一参数满足该检索条件的列表条目时,用户还可以在第一输入界面中输入第一参数对应的第一参数类型和检索条件。管理设备还从第一输入界面中读取第一参数类型和检索条件,相应的,生成的总量请求消息还可以包括第一参数类型和检索条件。该总量请求消息用于请求网络设备在待请求列表中获取第一参数满足该检索条件的列表条目总量。
可选的,在用户需要整个待请求列表中的列表条目时,可以不向管理设备输入第一参数类型和检索条件。此种情况下,管理设备生成的总量请求消息不包括第一参数类型和检索条件。
可选的,在执行本步骤之前,管理设备也可以先获取第一参数类型和检索条件,向网络设备发送查询请求,该查询请求包括第一参数类型和检索条件。网络设备接收该查询请求,基于第一参数类型查询包括第一参数满足该检索条件的列表条目的各列表,向管理设备发送查询的各列表的标识信息。管理设备接收该各列表的标识信息,选择一个列表的标识信息,然后生成包括选择的列表的标识信息、第一参数类型和检索条件的总量请求消息。
例如,假设用户需要从歌曲列表“album”中获取列表条目,则用户在管理设备显示的第一输入界面输入的标识信息为“jukebox/library/artist/album”,输入的第一参数类型为“出品时间”以及输入的检索条件为“出品时间大于1990年”。管理设备从第一输入界面中读取该标识信息“jukebox/library/artist/album”、第一参数类型“出品时间”和检索条件“出品时间大于1990年”,生成包括总量获取指示信息、该标识信息“jukebox/library/artist/album”、第一参数类型“出品时间”和检索条件“出品时间大于1990年”的总量请求消息,向网络设备发送该总量请求消息。
可选的,总量请求消息包括指示元素和条件元素,使用该指示元素包括总量获取指示信息,该条件元素包括该标识信息。在该总量请求消息还包括第一参数类型和检索条件的情况下,该条件元素还包括第一参数类型和检索条件。
在总量请求消息中,管理设备使用起始标签和结束标签定义一个元素,起始标签和结束标签包括该元素的类型。例如该指示元素可以表示为<return-count>true</return-count>,return-count表示该指示元素的类型,即使用return-count表示该指示元素,<return-count>为该指示元素的起始标签,</return-count>为该指示元素的结束标签,将该指示元素的内容设置为true表示该指示元素包括总量获取指示信息。
再如该条件元素可以表示为<where>/jukebox/library/artist/album[year>1990]</where>,where表示该条件元素的类型,即使用where表示该条件元素,year表示第一参数类型“出品时间”,“year>1990”表示检索条件“出品时间大于1990年”,<where>为该条件元素的起始标签,</where>为该条件元素的结束标签,如此使得该条件元素包括该标识信息“jukebox/library/artist/album”、第一参数类型“出品时间”和检索条件“出品时间大于1990年”。
所以该总量请求消息可以表示为:
<return-count>true</return-count>
<where>/jukebox/library/artist/album[year>1990]</where>。
可选的,该总量请求消息可以是基于Netconf协议的远程过程调用(remote procedure  call,RPC)消息、基于Restconf协议的RPC消息或基于Restconf协议的超文本传输协议(hyper text transfer protocol,http)消息。
步骤202:网络设备接收该总量请求消息,根据该总量请求消息获取待请求列表包括的列表条目总量,向管理设备发送总量响应消息,该总量响应消息包括该列表条目总量。
在本步骤中,该总量请求消息包括总量获取指示信息和待请求列表的标识信息。网络设备根据该总量获取指示信息的指示,从该标识信息对应的待请求列表中获取待请求列表包括的列表条目总量。
在该总量请求消息还包括第一参数类型和检索条件,则网络设备从该标识信息对应的待请求列表中获取第一参数类型对应的第一参数满足该检索条件的列表条目总量。
可选的,在本步骤中,网络设备接收该总量请求消息,解析该总量请求消息包括的指示元素,得到总量获取指示信息,解析该总量请求消息包括的条件元素,得到待请求列表的标识信息。
可选的,从该条件元素中还包括第一参数参数和检索条件时,解析该条件元素还得到第一参数类型和检索条件。
例如,网络设备接收的总量请求消息可以表示如下:
<return-count>true</return-count>
<where>/jukebox/library/artist/album[year>1990]</where>。
该总量请求消息中包括指示元素<return-count>true</return-count>,以及条件元素<where>/jukebox/library/artist/album[year>1990]</where>。
网络设备在解析到该指示元素时,根据该指示元素包括的内容为“true”,确定该总量请求消息包括总量获取指示信息,以及在解析该条件元素时,得到待请求列表“album”的标识信息为“jukebox/library/artist/album”、第一参数类型为“出品时间”、检索条件为“出品时间大于1990年”。根据该总量获取指示信息的指示,从该标识信息“jukebox/library/artist/album”对应的待请求列表“album”中获取出品时间大于1990年的列表条目总量,假设获取的列表条目总量为60。
可选的,该总量响应消息中包括总量元素,该总量元素包括该列表条目总量。例如,该指示元素可以表示为<count>60</return-count>,count表示该总量元素的类型,即使用count表示该总量元素,<count>为该总量元素的起始标签,</count>为该总量元素的结束标签。
步骤203:管理设备接收该总量响应消息,根据该总量响应消息包括的列表条目总量确定列表条目数量,列表条目数量小于该列表条目总量。
在本步骤中,管理设备显示列表条目总量,获取用户根据该列表条目总量输入的列表条目数量。或者,管理设备根据该列表条目总量和预设阈值确定列表条目数量,确定的列表条目数量小于或等于该预设阈值。
例如,管理设备可以显示第二输入界面,第二输入界面包括列表条目总量60,这样用户可以根据列表条目总量60在第二输入界面中输入列表条目数量20,管理设备从第二输入界面中获取列表条目数量20。或者,假设预设阈值为21,该列表条目总量为60,则管理设备确定的列表条目数量可以为20。
可选的,管理设备根据该列表条目总量和列表条目数量计算请求总次数。例如,管理设备根据该列表条目总量60和列表条目数量20,计算请求总次数为3,即管理设备需要 分三次从网络设备中获取待请求列表包括的列表条目。
可选的,管理设备还保存该列表条目总量。
可选的,上述步骤201至203的操作是可选的操作,即管理设备也可以不用从网络设备中获取列表条目总量,这样管理设备可以直接设置列表条目数量或直接接收用户输入的列表条目数量。在此种情况下,管理设备就无法确定请求总次数。
步骤204:管理设备生成请求消息,该请求消息包括列表条目数量、该标识信息和偏移量,向网络设备发送请求消息。
在本步骤中,管理设备根据已向网络设备发送的、用于请求待请求列表中的列表条目的请求消息的数量和列表条目数量,计算该偏移量。
如果管理设备第一次生成请求消息,则该请求消息的数量为0,根据该请求消息的数量和列表条目数量计算的偏移量为0。如果管理设备第m次生成请求消息,则该请求消息的数量为m-1,则根据该请求消息的数量和列表条目数量计算的偏移量为(m-1)*L,L为列表条目数量,m为大于1的整数,*为乘法运算。
可选的,管理设备生成的请求消息还可以包括第一参数类型和检索条件。
可选的,管理设备还可以获取第二参数类型和排序方式,相应的,管理设备设备生成的请求消息中还可以包括第二参数类型和排序方式。
可选的,管理设备在显示第二输入界面后,用户可以在第二输入界面中输入第二参数类型和排序方式。这样管理设备可以从第二输入界面中读取第二参数类型和排序方式。
可选的,第二参数类型与第一参数类型相同或不同。
可选的,该请求消息还可以包括一种操作类型,该操作类型可以是Restconf协议定义的修改操作,或者是Netconf协议定义的获取操作。该修改操作类型可以为Restconf协议定义的Patch操作或Post操作,该获取操作可以为Netconf协议定义的get操作。
可选的,在生成请求消息之后,管理设备增加已发送的请求消息的数量。
可选的,请求消息中包括数量元素、偏移元素和条件元素,该数量元素包括列表条目数量,该偏移元素包括该偏移量,该条件元素包括待请求列表的标识信息。在该请求消息还包括第一参数类型和检索条件的情况下,该条件元素还包括第一参数类型和检索条件。
例如,假设列表条目数量为20,计算的偏移量为0,该数量元素可以表示为<limit>20</limit>,limit表示该数量元素,<limit>为该数量元素的起始标签,</limit>为该数量元素的结束标签。该偏移元素可以表示为<offset>0</offset>,offset表示该偏移元素,<offset>为该偏移元素的起始标签,</offset>为该偏移元素的结束标签。该条件元素可以表示为<where>/jukebox/library/artist/album[year>1990]</where>。
可选的,请求消息中包括排序参数元素和排序方式元素。该排序参数元素包括第二参数类型,该排序方式元素包括排序方式。
例如,假设第二参数类型也为出品时间,使用year来表示,以及假设排序方式为“升序”,“升序”表示按出品时间递增方式对列表条目进行排序,使用ascending来表示。所以该排序参数元素可以表示为<sort-target>/jukebox/library/artist/album/year</sort-target>,sort-target表示该排序参数元素,<sort-target>为该排序参数元素的起始标签,</sort-target>为该排序参数元素的结束标签。该排序方式元素可以表示为<sort-by>ascending</sort-by>,sort-by表示该排序方式元素,<sort-by>为该排序方式元素的起始标签,</sort-by>为该排序方式元素的结束标签。
因此,该请求消息可以表示为:
<limit>20</limit>
<offset>0</offset>
<where>/jukebox/library/artist/album[year>1990]</where>
<sort-target>/jukebox/library/artist/album/year</sort-target>
<sort-by>ascending</sort-by>。
可选的,该请求消息可以是基于Netconf协议的RPC消息、基于Restconf协议的RPC消息或基于Restconf协议的http消息。
步骤205:网络设备接收该请求消息,获取该标识信息标识的待请求列表中的、以该偏移量为起始位置的、该列表条目数量指示的列表条目。
在本步骤中,网络设备接收该请求消息,解析该请求消息,得到列表条目数量、偏移量和标识信息,根据该列表条目数量和该偏移量,在该标识信息对应的待请求列表中获取列表条目。
可选的,在该请求消息还包括操作类型时,根据该列表条目数量和该偏移量,通过该操作类型对应的操作,在该标识信息对应的待请求列表中获取列表条目。
可选的,在该请求消息还包括第一参数类型和检索条件的情况下,网络设备根据该列表条目数量和该偏移量从该标识信息对应的待请求列表中获取第一参数类型对应的第一参数满足该检索条件的列表条目。
步骤206:网络设备向管理设备发送响应消息,该响应消息包括获取的列表条目。
可选的,在该请求消息还包括第二参数类型和排序方式的情况下,网络设备根据获取的每个列表条目包括的第二参数,按照该排序方式对每个列表条目进行排序,相应的,该响应消息包括排序后的每个列表条目。
例如,网络设备接收的请求消息可以表示为:
<limit>20</limit>
<offset>0</offset>
<where>/jukebox/library/artist/album[year>1990]</where>
<sort-target>/jukebox/library/artist/album/year</sort-target>
<sort-by>ascending</sort-by>。
网络设备解析该请求消息,解析出该请求消息包括数量元素“<limit>20</limit>”,从该数量元素读取列表条目数量20。从该请求消息中解析出偏移元素“<offset>0</offset>”,从该偏移元素中读取偏移量为0。从该请求消息中解析出条件元素“<where>/jukebox/library/artist/album[year>1990]</where>”,从该条件元素中读取待获取待请求列表album的标识信息为“/jukebox/library/artist/album”,第一参数类型为“出品时间”,检索条件为“出品时间大于1990”。从该请求消息中解析出排序参数元素“<sort-target>/jukeboxlibrary/artist/album/year</sort-target>”,从该排序参数元素中读取的第二参数类型也为“出品时间”。从该请求消息中解析出排序方式元素“<sort-by>ascending</sort-by>”,从该排序方式元素中读取的排序方式为“升序”。
网络设备根据列表条目数量20和偏移量0,从标识信息“/jukebox/library/artist/album”对应的列表album中获取出品时间大于1990年的第1至20个列表条目,根据该20个列表条目中的每个列表条目包括的出品时间,按递增的方式进行排序,向管理设备发送响应 消息,该响应消息包括排序后的20个列表条目。
该响应消息可以表示为:
Figure PCTCN2020117247-appb-000001
在上述响应消息中,<name>yesterday<name>表示包括歌曲名称“yesterday”的元素,<year>1995</year>表示包括出品时间的元素,该出品时间1995为歌曲“yesterday”的出品时间,歌曲名称“yesterday”和出品时间1995为一个列表条目中的内容。对于该响应消息中的其他元素的含义与上述含义相同,就不再一一列举。
可选的,在管理设备请求列表条目的过程中,网络设备还实时检测待请求列表包括的列表条目总量,在检测出待请求列表中包括的列表条目总量发生变化时,重新获取待请求列表包括的列表条目总量,得到更新后的列表条目总量,向管理设备发送总量更新消息,该总量更新消息包括更新后的列表条目总量。
在管理设备请求列表条目的过程中,待请求列表中包括的列表条目总量可能发生变化。发生变化的情况可以包括:网络设备在待请求列表中增加了新的列表条目,或者,网络设备在待请求列表中删除了部分列表条目。
可选的,网络设备在向管理设备发送响应消息时,可以获取待请求列表中的列表条目总量,并在该响应消息中包括获取的列表条目总量。
可选的,该总量响应消息可以是基于Netconf协议的RPC消息、基于Restconf协议的RPC消息或基于Restconf协议的http消息。
步骤207:管理设备接收该响应消息,从该响应消息中获取列表条目。
管理设备可以将获取的该列表条目保存到硬盘中;或者,显示获取的该列表条目,在显示后可以删除该列表条目或将该列表条目保存到硬盘中。然后管理设备释放该列表条目占用的内存空间。
可选的,在管理设备已计算出请求总次数的情况下,在删除该列表条目或将该列表条目保存到硬盘后,管理设备判断已发送请求消息的数量是否小于该请求总次数,如果已发送请求消息的次数小于该请求总次数,则管理设备重新执行步骤203至207的操作,直到已发送请求消息的数量达到该请求总次数时,则结束。
可选的,假设该请求总次数为z,即管理设备在不同时间向网络设备发送z个请求消息,以及在不同时间接收网络设备发送的z个响应消息。其中前z-1个响应消息中的每个响应消息包括的列表条目的数目等于该列表条目数量,第z个响应消息包括的列表条目的数目小于或等于该列表条目数量。
可选的,在网络设备中,存在多个列表包括第一参数满足该检索条件的列表条目时,管理设备选择一个列表的标识信息,按上述204至207的步骤分z次从该标识信息对应的列表中请求列表条目。其中,对于管理设备接收的第z个响应消息,即使第z个响应消息包括的列表条目的数目小于该列表条目总量,第z个响应消息也只包括该标识信息对应的列表中的列表条目,不会包括其他列表中的列表条目。管理设备在接收到第z个响应消息后,在将第z个响应消息中的列表目标保存到硬盘或删除第z个响应消息中的列表条目后,可以重新选择一个列表标识信息,然后重新执行上述流程。
可选的,在管理设备分多次请求待请求列表中的列表条目的过程,如果管理设备接收网络设备发送的总量更新消息,该总量更新消息包括更新后的列表条目总量,则根据该更新后的列表条目总量和列表条目数量,重新计算请求总次数,即更新该请求总次数的值。
可选的,如果网络设备每次发送的响应消息中均包括列表条目总量,则管理设备比较该响应消息中的列表条目总量与保存的列表条目总量,如果比较出两者不同,表示网络设备中的待请求列表包括的列表条目总量发生变化,根据该响应消息包括变化后的列表条目总量和列表条目数量,重新计算请求总次数,以及将保存的列表条目总量更新为该响应消息包括的列表条目总量。
可选的,在管理设备没有计算出请求总次数的情况下,管理设备判断该响应消息中包括的列表条目数目是否小于列表条目数量,在判断出该响应消息中包括的列表条目数目为0或小于该列表条目数量的情况下,说明已从网络设备中获取完待请求列表包括的列表条目或已从网络设备中获取完待请求列表包括的第一参数满足检索条件的列表条目,则结束。
在管理设备没有计算出请求总次数的情况下,管理设备为了能够准确地确定获取完待请求列表包括的列表条目,管理设备即使在判断出该响应消息中包括的列表条目数目小于该列表条目数量的情况下,管理设备还向网络设备发送一次请求消息,接收该请求消息对应的响应消息,在该响应消息包括的列表条目的数目为0,才确定获取完待请求列表包括的列表条目。这样管理设备最后一次发送的请求消息和接收的响应消息会产生网络资源浪费。
为了避免该资源浪费,管理设备可以获取待请求列表包括的列表条目总量,基于该列表条目总量确定请求总次数,基于该请求总次数可以及时确定是否已获取完待请求列表中的列表条目,以避免管理设备在获取完待请求的列表中的列表条目后还发送一次请求消息,省了网络资源。
在本申请实施例中,管理设备生成的请求消息中包括列表条目数量、偏移量和待请求列表的标识信息,向网络设备发送该请求消息。网络设备接收该请求消息,根据该请求消息中的列表条目数量和偏移量,从该标识信息标识的待请求列表中获取列表条目,且获取的列表条目的数量小于或等于该列表条目数量,向管理设备发送包括获取的列表条目的响应消息,如此保证管理设备每次获取的列表条目的数量均小于或等于该列表条目数量,避免管理设备一次接收到大量的列表条目,导致管理设备崩溃。由于每次获取的列表条目数量小于或等于该列表条目数量,也提高了加载速度。
对于图2所示的实施例,本申请列举了一种实例进行详细说明,在该实例中管理设备与网络设备可以基于Netconf协议或Restconf协议进行通信,且在该实例中总量请求消息,总量响应消息,请求消息和响应消息可以基于Netconf协议或Restconf协议定义的RPC消 息。在该实例中,以待请求列表为上述歌曲列表“album”为例进行说明,参见图3,该实例提供的处理数据的方法,包括:
步骤301:管理设备向网络设备发送总量请求消息,该总量请求消息包括总量获取指示信息和歌曲列表“album”的标识信息。
该总量请求消息还可以包括总量获取指示信息。在本步骤中,管理设备获取歌曲列表“album”的标识信息“jukebox/library/artist/album”,生成包括该标识信息“jukebox/library/artist/album”和该总量获取指示信息的RPC消息,将该RPC消息作为总量请求消息。
可选的,管理设备还获取第一参数类型“出品时间”和检索条件“出品时间大于1990年”,生成的RPC消息还包括第一参数类型“出品时间”和检索条件“出品时间大于1990年”,生成的RPC如下,即生成的总量请求消息如下:
Figure PCTCN2020117247-appb-000002
在该RPC消息中使用指示元素“<return-count>TRUE</return-count>”包括总量获取指示信息,使用条件元素<where>/jukebox/library/artist/album[year>1990]</where>包括该标识信息、第一参数类型“出品时间”(使用“year”表示“出品时间”),以及检索条件“出品时间大于1990年”。
步骤302:网络设备接收该总量请求消息,根据该总量请求消息获取歌曲列表“album”包括的列表条目总量,假设该列表条目总量为60,向管理设备发送总量响应消息,该总量响应消息包括列表条目总量60。
在本步骤中,网络设备接收该总量请求消息,解析该总量请求消息。从该总量请求消息中解析出指示元素<return-count>true</return-count>,基于该指示元素包括的内容true确定该总量请求消息包括总量获取指示信息。以及从该总量请求消息中解析出条件元素<where>/jukebox/library/artist/album[year>1990]</where>,从该条件元素中获取歌曲列表“album”的标识信息为“jukebox/library/artist/album”、第一参数类型为“出品时间”、检索条件为“出品时间大于1990年”。
然后,网络设备根据该总量获取指示信息的指示,从该标识信息“jukebox/library/artist/album”对应的歌曲列表“album”中获取出品时间大于1990年的列表条目总量,假设获取的列表条目总量为60。生成包括总量元素的RPC消息,该总量元素包括该列表条目总量60,将该RPC消息作为总量响应消息,向管理设备发送该总量响应消息。
其中,该总量元素可以表示为<count>60</count>,该总量响应消息可以表示为:
Figure PCTCN2020117247-appb-000003
Figure PCTCN2020117247-appb-000004
步骤303:管理设备接收该总量响应消息,根据该总量响应消息包括的列表条目总量60确定列表条目数量20。
在本步骤中,管理设备显示该列表条目总量60,这样用户可以根据列表条目总量60输入列表条目数量,假设输入的列表条目数量为20,管理设备获取输入的列表条目数量20。
可选的,管理设备根据该列表条目总量60和列表条目数量20,确定请求总次数为3。
步骤304:管理设备生成第一请求消息,第一请求消息包括列表条目数量20、歌曲列表album的标识信息和偏移量0,向网络设备发送第一请求消息。
第一请求消息是管理设备第一次生成的请求消息,此时已发送的请求消息的数量为0。
在本步骤中,管理设备根据已发送请求消息的数量0和列表条目数量20,计算的偏移量为0。以及,管理设备获取用户输入的第二参数类型为“出品时间”以及排序方式为“升序”,生成第一请求消息,第一请求消息包括列表条目数量20、歌曲列表“album”的标识信息“jukebox/library/artist/album”、计算的偏移量“0”,第一参数类型“出品时间”、检索条件“出品时间大于1990年”、第二参数类型“出品时间”以及排序方式“升序”(使用ascending表示)。
其中,管理设备生成的第一请求消息可以表示如下:
Figure PCTCN2020117247-appb-000005
在发送第一请求消息后,管理设备增加已发送请求消息的数量,增加后的已发送请求消息的数量为1。
步骤305:网络设备接收第一请求消息,根据该列表条目数量20和偏移量0从歌曲列表album中获取20个列表条目,向管理设备发送第一响应消息,第一响应消息包括该20个列表条目。
在本步骤中,网络设备接收第一请求消息,解析第一请求消息,在从第一请求消息中解析出列表条目数量20的情况下,确定管理设备采用分页获取数据方式。继续从第一请求消息中,解析出偏移量0,歌曲列表“album”的标识信息“/jukebox/library/artist/album”,第一参数类型“出品时间”,检索条件“出品时间大于1990”,第二参数“出品时间”以及排序方式“升序”。
网络设备根据列表条目数量20和偏移量0,从标识信息“/jukebox/library/artist/album”对应的歌曲列表album中获取出品时间大于1990年的第1至20个列表条目。根据该20个列表条目中的每个列表条目包括的出品时间,按递增的方式对该20个列表条目进行排序。生成包括排序后的20个列表条目的RPC消息,将该RPC消息作为第一响应消息,向管理设备发送第一响应消息。
其中,第一响应消息可以表示为:
Figure PCTCN2020117247-appb-000006
步骤306:管理设备接收第一响应消息,从第一响应消息中获取20个列表条目。
管理设备可以将获取的20个列表条目保存到硬盘中,管理设备判断出已发送请求消息的数量1小于该请求总次数3,继续执行如下307的操作。
步骤307:管理设备生成第二请求消息,第二请求消息包括列表条目数量20、歌曲列表album的标识信息和偏移量20,向网络设备发送第二请求消息。
第二请求消息是管理设备第二次生成的请求消息,此时已发送请求消息的次数为1。
在本步骤中,管理设备根据已发送请求消息的数量1和列表条目数量20,计算的偏移量为20,生成第二请求消息,第二请求消息包括列表条目数量20、歌曲列表“album”的标识信息“jukebox/library/artist/album”、计算的偏移量“20”,第一参数类型“出品时间”、检索条件“出品时间大于1990年”、第二参数类型“出品时间”以及排序方式“升序”。
其中,管理设备生成的第二请求消息可以表示如下:
Figure PCTCN2020117247-appb-000007
Figure PCTCN2020117247-appb-000008
在发送第二请求消息后,管理设备增加已发送请求消息的数量,增加后的已生成请求消息的次数为2。
步骤308:网络设备接收第二请求消息,根据该列表条目数量20和该偏移量20从歌曲列表album中获取20个列表条目,向管理设备发送第二响应消息,第二响应消息包括该20个列表条目。
在本步骤中,网络设备接收第二请求消息,解析第二请求消息,在从第二请求消息中解析出列表条目数量20的情况下,确定管理设备采用分页获取数据方式。继续从第二请求消息中,解析出偏移量20,歌曲列表“album”的标识信息“/jukebox/library/artist/album”,第一参数类型“出品时间”,检索条件“出品时间大于1990”,第二参数“出品时间”以及排序方式“升序”。
网络设备根据列表条目数量20和偏移量20,从标识信息“/jukebox/library/artist/album”对应的歌曲列表album中获取出品时间大于1990年的第21至40个列表条目,总共20个列表条目。根据该20个列表条目中的每个列表条目包括的出品时间,按递增的方式对该20个列表条目进行排序。生成包括排序后的20个列表条目的RPC消息,将该RPC消息作为第二响应消息,向管理设备发送第二响应消息。
其中,第二响应消息可以表示为:
Figure PCTCN2020117247-appb-000009
步骤309:管理设备接收第二响应消息,从第二响应消息中获取20个列表条目。
管理设备可以将获取的20个列表条目保存到硬盘中,管理设备判断出已发送请求消息的数量2小于该请求总次数3,继续执行如下310的操作。
步骤310:管理设备生成第三请求消息,第三请求消息包括列表条目数量20、歌曲列表album的标识信息和偏移量40,向网络设备发送第三请求消息。
第三请求消息是管理设备第三次生成的请求消息,此时已发送请求消息的数量为2。
在本步骤中,管理设备根据已发送请求消息的数量2和列表条目数量20,计算的偏移量为40,生成第三请求消息,第三请求消息包括列表条目数量20、歌曲列表“album”的标识信息“jukebox/library/artist/album”、计算的偏移量“40”,第一参数类型“出品时间”、检索条件“出品时间大于1990年”、第二参数类型“出品时间”以及排序方式“升序”。
其中,管理设备生成的第三请求消息可以表示如下:
Figure PCTCN2020117247-appb-000010
Figure PCTCN2020117247-appb-000011
在发送第三请求消息后,管理设备增加已发送请求消息的数量,增加后的已发送请求消息的数量为3。
步骤311:网络设备接收第三请求消息,根据该列表条目数量40和偏移量20从列表album中获取20个列表条目,向管理设备发送第三响应消息,第三响应消息包括该20个列表条目。
在本步骤中,网络设备接收第三请求消息,解析第三请求消息,在从第三请求消息中解析出列表条目数量20的情况下,确定管理设备采用分页获取数据方式。继续从第三请求消息中,解析出偏移量40,歌曲列表“album”的标识信息“/jukebox/library/artist/album”,第一参数类型“出品时间”,检索条件“出品时间大于1990”,第二参数“出品时间”以及排序方式“升序”。
网络设备根据列表条目数量20和偏移量40,从标识信息“/jukebox/library/artist/album”对应的歌曲列表album中获取出品时间大于1990年的第41至60个列表条目,总共也为20个列表条目。根据该20个列表条目中的每个列表条目包括的出品时间,按递增的方式对该20个列表条目进行排序。生成包括排序后的20个列表条目的RPC消息,将该RPC消息作为第三响应消息,向管理设备发送第三响应消息。
其中,第三响应消息可以表示为:
Figure PCTCN2020117247-appb-000012
步骤312:管理设备接收第三响应消息,从第三响应消息中获取20个列表条目。
管理设备可以将获取的20个列表条目保存到硬盘中,管理设备判断出已发送请求消息的数量3等于该请求总次数3,结束。
在本申请实施例中,管理设备生成的每个请求消息中包括的列表条目数量为20以及基于已发送的请求消息的数量和该列表条目数量20计算的偏移量。网络设备每次从歌曲列表中基于该偏移量获取列表条目不超过20条,这样向管理设备发送的响应消息包括不超过20条列表条目,如此避免管理设备一次接收到大量的列表条目,导致管理设备崩溃。
对于图2所示的实施例,本申请列举了一种实例进行详细说明,在该实例中管理设备与网络设备可以使用Restconf协议进行通信,且在该实例中管理设备生成的请求消息可以包括操作类型,该操作类型为修改操作。在该实例中,仍以歌曲列表为上述列表“album”为例进行说明,参见图4,该实例提供的处理数据的方法,包括:
步骤401:管理设备向网络设备发送总量请求消息,该总量请求消息包括修改操作和歌曲列表“album”的标识信息。
该总量请求消息还可以包括总量获取指示信息。在本步骤中,管理设备获取歌曲列表“album”的标识信息“jukebox/library/artist/album”,生成包括修改操作、该标识信息“jukebox/library/artist/album”和该总量获取指示信息的消息,将该消息作为总量请求消息。
可选的,该总量请求消息为http消息,该修改操作是Restconf协议定义的Patch操作或Post操作。在本申请实施例中,该修改操作以Patch操作为例进行说明,对于Post操作的实现方式,只需要将Patch操作替换Post操作,便可得到Post操作的实现方式。
可选的,管理设备还获取第一参数类型“出品时间”和检索条件“出品时间大于1990年”,生成的总量请求消息还包括第一参数类型“出品时间”和检索条件“出品时间大于1990年”。生成的总量请求消息,可以表示为:
Figure PCTCN2020117247-appb-000013
该总量请求消息包括Restconf协议定的修改操作“Patch”,在该总量请求消息中使用指示元素“<return-count>TRUE</return-count>”包括总量获取指示信息,使用条件元素<where>/jukebox/library/artist/album[year>1990]</where>包括第一参数类型“出品时间”(使用“year”表示“出品时间”),以及检索条件“出品时间大于1990年”。
步骤402:网络设备接收该总量请求消息,通过该修改操作,获取歌曲列表“album”包括的列表条目总量,假设该列表条目总量为55,向管理设备发送总量响应消息,该总量响应消息包括列表条目总量55。
在本步骤中,网络设备接收该总量请求消息,解析该总量请求消息。从该总量请求消 息中解析出指示元素<return-count>true</return-count>,基于该指示元素包括的内容true确定该总量请求消息包括总量获取指示信息。以及从该总量请求消息中解析出修改操作“Patch”,以及条件元素<where>/jukebox/library/artist/album[year>1990]</where>,从该条件元素中获取歌曲列表“album”的标识信息为“jukebox/library/artist/album”、第一参数类型为“出品时间”、检索条件为“出品时间大于1990年”。
然后,网络设备根据该总量获取指示信息的指示,通过该“Patch”操作,从该标识信息“jukebox/library/artist/album”对应的歌曲列表“album”中获取出品时间大于1990年的列表条目总量,假设获取的列表条目总量为55。生成包括总量元素的http消息,该总量元素包括该列表条目总量55,将该http消息作为总量响应消息,向管理设备发送该总量响应消息。
其中,该总量元素可以表示为<count>55</count>,该总量响应消息可以表示为:
HTTP/1.1 200 OK
Date:Thu,26 Jan 2017 20:56:30 GMT
Server:example-server
Last-Modified:Thu,26 Jan 2017 20:56:30 GMT
Content-Type:application/yang-data+xml
<count>55</count>。
步骤403:管理设备接收该总量响应消息,根据该总量响应消息包括的列表条目总量55确定列表条目数量20。
在本步骤中,管理设备显示该列表条目总量55,这样用户可以根据列表条目总量55输入列表条目数量,假设输入的列表条目数量为20,管理设备获取输入的列表条目数量20。
可选的,管理设备根据该列表条目总量55和列表条目数量20,确定请求总次数为3。
步骤404:管理设备生成第一请求消息,第一请求消息包括修改操作、列表条目数量20、歌曲列表album的标识信息和偏移量0,向网络设备发送第一请求消息。
第一请求消息是管理设备第一次生成的请求消息,此时已发送请求消息的数量为0。
在本步骤中,管理设备根据已发送请求消息的数量0和列表条目数量20,计算的偏移量为0。以及,管理设备获取用户输入的第二参数类型为“出品时间”以及排序方式为“升序”,生成第一请求消息,第一请求消息包括修改操作“Patch”、列表条目数量20、歌曲列表“album”的标识信息“jukebox/library/artist/album”、计算的偏移量“0”、第一参数类型“出品时间”、检索条件“出品时间大于1990年”、第二参数类型“出品时间”以及排序方式“升序”。
其中,管理设备生成的第一请求消息可以表示如下:
Figure PCTCN2020117247-appb-000014
Figure PCTCN2020117247-appb-000015
在发送第一请求消息后,管理设备增加已发送请求消息的数量,增加后的已发送请求消息的数量为1。
步骤405:网络设备接收第一请求消息,根据该列表条目数量20和偏移量0,通过该修改操作,从歌曲列表album中获取20个列表条目,向管理设备发送第一响应消息,第一响应消息包括该20个列表条目。
在本步骤中,网络设备接收第一请求消息,解析第一请求消息,在从第一请求消息中解析出列表条目数量20的情况下,确定管理设备采用分页获取数据方式。继续从第一请求消息中,解析出修改操作“Patch”,偏移量0,歌曲列表“album”的标识信息“/jukebox/library/artist/album”,第一参数类型“出品时间”,检索条件“出品时间大于1990”,第二参数“出品时间”以及排序方式“升序”。
网络设备根据列表条目数量20和偏移量0,通过“Patch”操作,从该标识信息“/jukebox/library/artist/album”对应的歌曲列表album中获取出品时间大于1990年的第1至20个列表条目。根据该20个列表条目中的每个列表条目包括的出品时间,按递增的方式对该20个列表条目进行排序。生成包括排序后的20个列表条目的http消息,将该http消息作为第一响应消息,向管理设备发送第一响应消息。
其中,第一响应消息可以表示为:
Figure PCTCN2020117247-appb-000016
步骤406:管理设备接收第一响应消息,从第一响应消息中获取20个列表条目。
管理设备可以将获取的20个列表条目保存到硬盘中,管理设备判断出已发送请求消息的数量1小于该请求总次数3,继续执行如下407的操作。
步骤407:管理设备生成第二请求消息,第二请求消息包括修改操作、列表条目数量20、歌曲列表album的标识信息和偏移量20,向网络设备发送第二请求消息。
第二请求消息是管理设备第二次生成的请求消息,此时已发送请求消息的数量为1。
在本步骤中,管理设备根据已发送请求消息的数量1和列表条目数量20,计算的偏移量为20,生成第二请求消息,第二请求消息包括修改操作“Patch”、列表条目数量20、歌曲列表“album”的标识信息“jukebox/library/artist/album”、计算的偏移量“20”、第一参数类型“出品时间”、检索条件“出品时间大于1990年”、第二参数类型“出品时间”以及排序方式“升序”。
其中,管理设备生成的第二请求消息可以表示如下:
Figure PCTCN2020117247-appb-000017
在发送第二请求消息后,管理设备增加已发送请求消息的数量,增加后的已发送请求消息的数量为2。
步骤408:网络设备接收第二请求消息,根据该列表条目数量20和该偏移量20,通过该修改操作,从该歌曲列表album中获取20个列表条目,向管理设备发送第二响应消息,第二响应消息包括该20个列表条目。
在本步骤中,网络设备接收第二请求消息,解析第二请求消息,在从第二请求消息中解析出列表条目数量20的情况下,确定管理设备采用分页获取数据方式。继续从第二请求消息中,解析出修改操作“Patch”,偏移量20,歌曲列表“album”的标识信息“/jukebox/library/artist/album”,第一参数类型“出品时间”,检索条件“出品时间大于1990”,第二参数“出品时间”以及排序方式“升序”。
网络设备根据列表条目数量20和偏移量20,通过“Patch”操作,从该标识信息“/jukebox/library/artist/album”对应的歌曲列表album中获取出品时间大于1990年的第21至40个列表条目,得到20个列表条目。根据该20个列表条目中的每个列表条目包括的出品时间,按递增的方式对该20个列表条目进行排序。生成包括排序后的20个列表条目的http消息,将该http消息作为第二响应消息,向管理设备发送第二响应消息。
其中,第二响应消息可以表示为:
Figure PCTCN2020117247-appb-000018
Figure PCTCN2020117247-appb-000019
步骤409:管理设备接收第二响应消息,从第二响应消息中获取20个列表条目。
管理设备可以将获取的20个列表条目保存到硬盘中,管理设备判断出已发送请求消息的数量2小于该请求总次数3,继续执行如下410的操作。
步骤410:管理设备生成第三请求消息,第三请求消息包括修改操作、列表条目数量20、歌曲列表album的标识信息和偏移量40,向网络设备发送第三请求消息。
第三请求消息是管理设备第三次生成的请求消息,此时已发送请求消息的数量为2。
在本步骤中,管理设备根据已发送请求消息的数量2和列表条目数量20,计算偏移量为40,生成第三请求消息,第三请求消息包括修改操作“Patch”、列表条目数量20、歌曲列表“album”的标识信息“jukebox/library/artist/album”、计算的偏移量“40”、第一参数类型“出品时间”、检索条件“出品时间大于1990年”、第二参数类型“出品时间”以及排序方式“升序”。
其中,管理设备生成的第三请求消息可以表示如下:
Figure PCTCN2020117247-appb-000020
在发送第三请求消息后,管理设备增加已发送请求消息的数量,增加后的已发送请求消息的数量为1。
步骤411:网络设备接收第三请求消息,根据该列表条目数量20和该偏移量40,通过该修改操作,从该歌曲列表album中获取20个列表条目,向管理设备发送第三响应消息,第三响应消息包括该20个列表条目。
在本步骤中,网络设备接收第三请求消息,解析第三请求消息,在从第三请求消息中解析出列表条目数量20的情况下,确定管理设备采用分页获取数据方式。继续从第三请 求消息中,解析出修改操作“Patch”,偏移量40,歌曲列表“album”的标识信息“/jukebox/library/artist/album”,第一参数类型“出品时间”,检索条件“出品时间大于1990”,第二参数“出品时间”以及排序方式“升序”。
网络设备根据列表条目数量20和偏移量40,通过“Patch”操作,从该标识信息“/jukebox/library/artist/album”对应的歌曲列表album中获取出品时间大于1990年的第41至55个列表条目,得到15个列表条目。根据该15个列表条目中的每个列表条目包括的出品时间,按递增的方式对该15个列表条目进行排序。生成包括排序后的15个列表条目的http消息,将该http消息作为第三响应消息,向管理设备发送第三响应消息。
其中,第三响应消息可以表示为:
Figure PCTCN2020117247-appb-000021
步骤412:管理设备接收第三响应消息,从第三响应消息中获取15个列表条目。
管理设备可以将获取的15个列表条目保存到硬盘中,管理设备判断出已发送请求消息的数量3等于该请求总次数3,结束。
在本申请实施例中,管理设备生成的每个请求消息中包括修改操作和列表条目数量为20。网络设备每次通过该修改操作,从歌曲列表中获取列表条目不超过20条,这样向管理设备发送的响应消息包括不超过20条列表条目,如此避免管理设备一次接收到大量的列表条目,导致管理设备崩溃。
对于图2所示的实施例,本申请列举了一种实例进行详细说明,在该实例中管理设备与网络设备可以使用Netconf协议进行通信,且在该实例中管理设备生成的请求消息可以包括一种操作类型,该操作类型为获取操作。在该实例中,以待请求列表为上述歌曲列表“album”为例进行说明,参见图5,该实例提供的处理数据的方法,包括:
步骤501:管理设备向网络设备发送总量请求消息,该总量请求消息包括获取操作和列表“album”的标识信息。
该总量请求消息还可以包括总量获取指示信息。在本步骤中,管理设备获取歌曲列表“album”的标识信息“jukebox/library/artist/album”,生成包括获取操作、该标识信息“jukebox/library/artist/album”和该总量获取指示信息的消息,将该消息作为总量请求消息。
可选的,该总量请求消息为RPC消息,该修改操作是Netconf协议定义的get操作。
可选的,管理设备还获取第一参数类型“出品时间”和检索条件“出品时间大于1990年”,生成的总量请求消息还包括第一参数类型“出品时间”和检索条件“出品时间大于1990年”。生成的总量请求消息,可以表示为:
Figure PCTCN2020117247-appb-000022
步骤502:网络设备接收该总量请求消息,通过该获取操作,获取歌曲列表album包括的列表条目总量,假设该列表条目总量为55,向管理设备发送总量响应消息,该总量响应消息包括列表条目总量55。
在本步骤中,网络设备接收该总量请求消息,解析该总量请求消息。从该总量请求消息中解析出总量获取指示信息。以及从该总量请求消息中解析出获取操作“get”、歌曲列表“album”的标识信息为“jukebox/library/artist/album”、第一参数类型为“出品时间”、检索条件为“出品时间大于1990年”。
然后,网络设备根据该总量获取指示信息的指示,通过该“get”操,获取该标识信息“jukebox/library/artist/album”对应的歌曲列表“album”包括的出品时间大于1990年的列表条目总量,假设获取的列表条目总量为55。生成包括总量元素的RPC消息,该总量元素包括该列表条目总量55,将该RPC消息作为总量响应消息,向管理设备发送该总量响应消息。
其中,该总量元素可以表示为<count>55</count>,该总量响应消息可以表示为:
Figure PCTCN2020117247-appb-000023
步骤503:管理设备接收该总量响应消息,根据该总量响应消息包括的列表条目总量55确定列表条目数量20。
在本步骤中,管理设备显示该列表条目总量55,这样用户可以根据列表条目总量55输入列表条目数量,假设输入的列表条目数量为20,管理设备获取输入的列表条目数量20。
可选的,管理设备根据该列表条目总量55和列表条目数量20,确定请求总次数为3。
步骤504:管理设备生成第一请求消息,第一请求消息包括获取操作、列表条目数量20、歌曲列表album的标识信息和偏移量0,向网络设备发送第一请求消息。
第一请求消息是管理设备第一次生成的请求消息,此时已发送请求消息的数量为0。
在本步骤中,管理设备根据已发送请求消息的数量0和列表条目数量20,计算偏移量为0。以及,管理设备获取用户输入的第二参数类型为“出品时间”以及排序方式为“升序”,生成第一请求消息,第一请求消息包括获取操作“get”、列表条目数量20、歌曲列表“album”的标识信息“jukebox/library/artist/album”、计算的偏移量“0”、第一参数类型“出品时间”、检索条件“出品时间大于1990年”、第二参数类型“出品时间”以及排序方式“升序”。
其中,管理设备生成的第一请求消息可以表示如下:
Figure PCTCN2020117247-appb-000024
在发送第一请求消息后,管理设备增加已发送请求消息的数量,增加后的已发送请求消息的次数为1。
步骤505:网络设备接收第一请求消息,根据该列表条目数量20和该偏移量0,通过该获取操作,从该歌曲列表album中获取20个列表条目,向管理设备发送第一响应消息,第一响应消息包括该20个列表条目。
在本步骤中,网络设备接收第一请求消息,解析第一请求消息,在从第一请求消息中解析出列表条目数量20的情况下,确定管理设备采用分页获取数据方式。继续从第一请求消息中,解析出获取操作“get”,偏移量0,歌曲列表“album”的标识信息“/jukebox/library/artist/album”,第一参数类型“出品时间”,检索条件“出品时间大于1990”,第二参数“出品时间”以及排序方式“升序”。
网络设备根据列表条目数量20和偏移量0,通过“get”操作,从该标识信息“/jukebox/library/artist/album”对应的歌曲列表album执行获取第1至20个列表条目。根据该20个列表条目中的每个列表条目包括的出品时间,按递增的方式对该20个列表条目进行排序。生成包括排序后的20个列表条目的RPC消息,将该RPC消息作为第一响应消息,向管理设备发送第一响应消息。
其中,第一响应消息可以表示为:
Figure PCTCN2020117247-appb-000025
Figure PCTCN2020117247-appb-000026
步骤506:管理设备接收第一响应消息,从第一响应消息中获取20个列表条目。
管理设备可以将获取的20个列表条目保存到硬盘中,管理设备判断出已发送请求消息的数量1小于该请求总次数3,继续执行如下507的操作。
步骤507:管理设备生成第二请求消息,第二请求消息包括获取操作、列表条目数量20、歌曲列表album的标识信息和偏移量20,向网络设备发送第二请求消息。
第二请求消息是管理设备第二次生成的请求消息,此时已发送请求消息的数量为1。
在本步骤中,管理设备根据已发送请求消息的数量1和列表条目数量20,计算偏移量为20,生成第二请求消息,第二请求消息包括获取操作“get”、列表条目数量20、歌曲列表“album”的标识信息“jukebox/library/artist/album”、计算的偏移量“20”、第一参数类型“出品时间”、检索条件“出品时间大于1990年”、第二参数类型“出品时间”以及排序方式“升序”。
其中,管理设备生成的第二请求消息可以表示如下:
Figure PCTCN2020117247-appb-000027
在发送第二请求消息后,管理设备增加已发送请求消息的数量,增加后的已发送请求消息的数量为2。
步骤508:网络设备接收第二请求消息,根据该列表条目数量20和该偏移量20,通过该获取操作,从该列表album获取20个列表条目,向管理设备发送第二响应消息,第二响应消息包括该20个列表条目。
在本步骤中,网络设备接收第二请求消息,解析第二请求消息,在从第二请求消息中解析出列表条目数量20的情况下,确定管理设备采用分页获取数据方式。继续从第二请求消息中,解析出获取操作“get”,偏移量20,歌曲列表“album”的标识信息“/jukebox/library/artist/album”,第一参数类型“出品时间”,检索条件“出品时间大于1990”,第二参数 “出品时间”以及排序方式“升序”。
网络设备根据列表条目数量20和偏移量20,通过“Patch”操作,从该标识信息“/jukebox/library/artist/album”对应的歌曲列表album中出品时间大于1990年的获取第21至40个列表条目,得到20个列表条目。根据该20个列表条目中的每个列表条目包括的出品时间,按递增的方式对该20个列表条目进行排序。生成包括排序后的20个列表条目的RPC消息,将该RPC消息作为第二响应消息,向管理设备发送第二响应消息。
其中,第二响应消息可以表示为:
Figure PCTCN2020117247-appb-000028
步骤509:管理设备接收第二响应消息,从第二响应消息中获取20个列表条目。
管理设备可以将获取的20个列表条目保存到硬盘中,管理设备判断出已发送请求消息的数量2小于该请求总次数3,继续执行如下510的操作。
步骤510:管理设备生成第三请求消息,第三请求消息包括修改操作、列表条目数量20、歌曲列表album的标识信息和偏移量40,向网络设备发送第三请求消息。
第三请求消息是管理设备第三次生成的请求消息,此时已发送请求消息的数量为2。
在本步骤中,管理设备根据已发送请求消息的数量2和列表条目数量20,计算偏移量为40,生成第三请求消息,第三请求消息包括获取操作“get”、列表条目数量20、歌曲列表“album”的标识信息“jukebox/library/artist/album”、计算的偏移量“40”、第一参数类型“出品时间”、检索条件“出品时间大于1990年”、第二参数类型“出品时间”以及排序方式“升序”。
其中,管理设备生成的第三请求消息可以表示如下:
Figure PCTCN2020117247-appb-000029
Figure PCTCN2020117247-appb-000030
在发送第三请求消息后,管理设备增加已发送请求消息的数量,增加后的已发送请求消息的数量为1。
步骤511:网络设备接收第三请求消息,根据该列表条目数量20和该偏移量40,通过该获取操作,从该歌曲列表album中获取20个列表条目,向管理设备发送第三响应消息,第三响应消息包括该20个列表条目。
在本步骤中,网络设备接收第三请求消息,解析第三请求消息,在从第三请求消息中解析出列表条目数量20的情况下,确定管理设备采用分页获取数据方式。继续从第三请求消息中,解析出获取操作“get”,偏移量40,歌曲列表“album”的标识信息“/jukebox/library/artist/album”,第一参数类型“出品时间”,检索条件“出品时间大于1990”,第二参数“出品时间”以及排序方式“升序”。
网络设备根据列表条目数量20和偏移量40,通过“get”操作,从该标识信息“/jukebox/library/artist/album”对应的歌曲列表album中获取出品时间大于1990年的第41至55个列表条目,得到15个列表条目。根据该15个列表条目中的每个列表条目包括的出品时间,按递增的方式对该15个列表条目进行排序。生成包括排序后的15个列表条目的RPC消息,将该RPC消息作为第三响应消息,向管理设备发送第三响应消息。
其中,第三响应消息可以表示为:
Figure PCTCN2020117247-appb-000031
步骤512:管理设备接收第三响应消息,从第三响应消息中获取15个列表条目。
管理设备可以将获取的15个列表条目保存到硬盘中,管理设备判断出已发送请求消息的数量3等于该请求总次数3,结束。
在本申请实施例中,管理设备生成的每个请求消息中包括获取操作和列表条目数量为20。网络设备每次通过该获取操作,从歌曲列表中获取列表条目不超过20条,这样向管理设备发送的响应消息包括不超过20条列表条目,如此避免管理设备一次接收到大量的列表条目,导致管理设备崩溃。
参见图6,本申请实施例提供了一种处理数据的装置600,所述装置600可以部署在上述任意实施例的管理设备上,包括:
处理单元601,用于生成请求消息,该请求消息包括列表条目数量、标识信息和偏移量,该列表条目数量用于指示所述装置600向网络设备请求列表条目的数量,该标识信息用于指示网络设备中的待请求的列表,待请求的列表包括该列表条目数量指示的列表条目,该偏移量的值等于已经向网络设备发送的、用于请求待请求的列表中的列表条目的请求消息的数量与该列表条目数量的乘积;
发送单元602,用于向网络设备发送该请求消息,该请求消息用于向网络设备请求该标识信息标识的列表中的、以该偏移量为起始位置的、该列表条目数量指示的列表条目,其中,该列表包括的列表条目总量大于该列表条目数量;
接收单元603,用于接收网络设备发送的该请求消息对应的响应消息,该响应消息包括该请求消息请求的列表条目。
可选的,处理单元601生成请求消息的详细实现过程可以参见图2所示实施例的步骤204,图3所示实施例的步骤304、步骤307、步骤310,图4所示实施例的步骤404、步骤407、步骤410,图5所示实施例的步骤504、步骤507、步骤510中的相关内容。
可选的,处理单元601,用于:
获取列表条目总量,根据该列表条目总量和该列表条目数量确定请求总次数,该请求总次数用于指示所述装置600向网络设备发送请求消息的数量;
在已向网络设备发送的、用于请求待请求的列表中的列表条目的请求消息的数量未达到该请求总次数时,生成该请求消息。
可选的,处理单元601获取列表条目总量的详细实现过程可以参见图2所示实施例的步骤201-203,图3所示实施例的步骤301-303,图4所示实施例的步骤401-403,图5所示实施例的步骤501-503中的相关内容。
可选的,发送单元602,还用于向网络设备发送总量请求消息,该总量请求消息包括该标识信息,该总量请求消息用于请求网络设备获取该列表条目总量;
接收单元603,还用于接收网络设备发送的总量响应消息,该总量响应消息包括该列表条目总量。
可选的,接收单元603,还用于接收网络设备发送的总量更新消息,该总量更新消息包括更新后的列表条目总量,该更新后的列表条目总量是网络设备基于该列表条目总量变化时确定的列表条目总量;
处理单元601,还用于根据更新后的列表条目总量更新该请求总次数的值。
可选的,该请求消息是网络配置Netconf协议的消息或Restconf协议的消息。
在本申请实施例中,由于处理单元生成的请求消息列表条目数量、标识信息和偏移量,该列表条目数量用于指示管理设备向网络设备请求列表条目的数量,该标识信息用于指示网络设备中的待请求的列表,该偏移量的值等于已经向网络设备发送的、用于请求待请求的列表中的列表条目的请求消息的数量与该列表条目数量的乘积,这样发送单元向网络设备发送该请求消息后,使得网络设备获取待请求的列表中的、以该偏移量为起始位置的、该列表条目数量指示的列表条目,这样接收单元接收到列表条目的数量小于或等于该列表条目数量,避免了管理设备一次接收到大量的列表条目,出现崩溃现象。
参见图7,本申请实施例提供了一种处理数据的装置700,所述装置700可以部署在上述任意实施例的网络设备上,包括:
接收单元701,用于接收管理设备发送的请求消息,该请求消息包括列表条目数量、标识信息和偏移量,该列表条目数量用于指示管理设备向所述装置700请求列表条目的数量,该标识信息用于指示所述装置700中的待请求的列表,待请求的列表包括该列表条目数量指示的列表条目,该偏移量的值等于已经向所述装置700发送的、用于请求待请求的列表中的列表条目的请求消息的数量与该列表条目数量的乘积;
处理单元702,用于获取该标识信息标识的列表中的、以该偏移量为起始位置的、该列表条目数量指示的列表条目,其中,该列表包括的列表条目总量大于该列表条目数量;
发送单元703,用于向管理设备发送该请求消息对应的响应消息,该响应消息包括该列表条目。
可选的,处理单元701获取列表条目的详细实现过程可以参见图2所示实施例的步骤205,图3所示实施例的步骤305、步骤308、步骤311,图4所示实施例的步骤405、步骤408、步骤411,图5所示实施例的步骤505、步骤508、步骤511中的相关内容。
可选的,接收单元701,还用于接收管理设备发送的总量请求消息,该总量请求消息包括所述标识信息;
处理单元702,还用于获取该标识信息对应的该列表包括的列表条目总量;
发送单元703,还用于向管理设备发送总量响应消息,该总量响应消息包括该列表条目总量,该总量响应消息用于管理设备基于该列表条目总量确定请求总次数,该请求总次数用于指示管理设备向所述装置700发送请求消息的数量。
可选的,处理单元701列表条目总量的详细实现过程可以参见图2所示实施例的步骤202,图3所示实施例的步骤302,图4所示实施例的步骤402,图5所示实施例的步骤502中的相关内容。
可选的,处理单元702,还用于在该列表条目总量变化时确定更新后的列表条目总量;
发送单元703,还用于向管理设备发送总量更新消息,该总量更新消息包括更新后的列表条目总量,该总量更新消息用于管理设备根据更新后的列表条目总量更新请求总次数的值。
在本申请实施例中,由于接收单元接收的请求消息包括列表条目数量、标识信息和偏移量,处理单元获取该标识信息标识的列表中的、以该偏移量为起始位置的、该列表条目数量指示的列表条目,这样发送单元的响应消息包括该列表条目的数目小于该列表条目数量。如此可以减小向管理设备发送的列表条目的数量,避免了管理设备一次接收到大量的列表条目,出现崩溃现象。
参见图8,本申请实施例提供了一种处理数据的装置800示意图。该装置800可以是上述任一实施例中的管理设备。该装置800包括至少一个处理器801,总线系统802,存储器803以及至少一个收发器804。
该装置800是一种硬件结构的装置,可以用于实现图6所述的装置600中的功能模块。例如,本领域技术人员可以想到图6所示的装置600中的处理单元601可以通过该至少一个处理器601调用存储器603中的代码来实现,图6所示的装置600中的发送单元602和接收单元603可以通过该收发器604来实现。
可选的,该装置800还可用于实现上述任一实施例中采集分析设备的功能。
可选的,上述处理器801可以是一个通用中央处理器(central processing unit,CPU),网络处理器(network processor,NP),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本申请方案程序执行的集成电路。
上述总线系统802可包括一通路,在上述组件之间传送信息。
上述收发器804,用于与其他设备或通信网络通信。
上述存储器803可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compact disc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过总线与处理器相连接。存储器也可以和处理器集成在一起。
其中,存储器803用于存储执行本申请方案的应用程序代码,并由处理器501来控制执行。处理器801用于执行存储器803中存储的应用程序代码,从而实现本专利方法中的功能。
在具体实现中,作为一种实施例,处理器801可以包括一个或多个CPU,例如图8中的CPU0和CPU1。
在具体实现中,作为一种实施例,该装置800可以包括多个处理器,例如图8中的处理器801和处理器807。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。
参见图9,本申请实施例提供了一种处理数据的装置900示意图。该装置900可以是上述任一实施例中的网络设备,例如可以是如图9所示实施例中的头节点。该装置900包括至少一个处理器901,总线系统902,存储器903以及至少一个收发器904。
该装置900是一种硬件结构的装置,可以用于实现图7所述的装置700中的功能模块。例如,本领域技术人员可以想到图7所示的装置700中的处理单元702可以通过该至少一个处理器701调用存储器703中的代码来实现,图7所示的装置700中的接收单元701和发送单元703可以通过该收发器704来实现。
可选的,该装置900还可用于实现上述任一实施例中采集分析设备的功能。
可选的,上述处理器901可以是一个通用中央处理器(central processing unit,CPU),网络处理器(network processor,NP),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本申请方案程序执行的集成电路。
上述总线系统902可包括一通路,在上述组件之间传送信息。
上述收发器904,用于与其他设备或通信网络通信。
上述存储器903可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者 可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compact disc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过总线与处理器相连接。存储器也可以和处理器集成在一起。
其中,存储器903用于存储执行本申请方案的应用程序代码,并由处理器901来控制执行。处理器901用于执行存储器903中存储的应用程序代码,从而实现本专利方法中的功能。
在具体实现中,作为一种实施例,处理器901可以包括一个或多个CPU,例如图9中的CPU0和CPU1。
在具体实现中,作为一种实施例,该装置900可以包括多个处理器,例如图9中的处理器901和处理器907。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (17)

  1. 一种处理数据的方法,其特征在于,所述方法包括:
    管理设备生成请求消息,所述请求消息包括列表条目数量、标识信息和偏移量,所述列表条目数量用于指示所述管理设备向网络设备请求列表条目的数量,所述标识信息用于指示所述网络设备中的待请求的列表,所述待请求的列表包括所述列表条目数量指示的列表条目,所述偏移量的值等于已经向所述网络设备发送的、用于请求所述待请求的列表中的列表条目的请求消息的数量与所述列表条目数量的乘积;
    所述管理设备向所述网络设备发送所述请求消息,所述请求消息用于向所述网络设备请求所述标识信息标识的所述列表中的、以所述偏移量为起始位置的、所述列表条目数量指示的列表条目,其中,所述列表包括的列表条目总量大于所述列表条目数量;
    所述管理设备接收所述网络设备发送的所述请求消息对应的响应消息,所述响应消息包括所述请求消息请求的列表条目。
  2. 如权利要求1所述的方法,其特征在于,所述管理设备生成请求消息之前,还包括:
    所述管理设备获取所述列表条目总量,根据所述列表条目总量和所述列表条目数量确定请求总次数,所述请求总次数用于指示所述管理设备向所述网络设备发送请求消息的数量;
    所述管理设备生成请求消息,包括:
    所述管理设备在已向所述网络设备发送的、用于请求所述待请求的列表中的列表条目的请求消息的数量未达到所述请求总次数时,生成所述请求消息。
  3. 如权利要求2所述的方法,其特征在于,所述管理设备获取所述列表条目总量,包括:
    所述管理设备向所述网络设备发送总量请求消息,所述总量请求消息包括所述标识信息,所述总量请求消息用于请求所述网络设备获取所述列表条目总量;
    所述管理设备接收所述网络设备发送的总量响应消息,所述总量响应消息包括所述列表条目总量。
  4. 如权利要求2所述的方法,其特征在于,还包括:
    所述管理设备接收所述网络设备发送的总量更新消息,所述总量更新消息包括更新后的列表条目总量,所述更新后的列表条目总量是所述网络设备基于所述列表条目总量变化时确定的列表条目总量;
    所述管理设备根据更新后的列表条目总量更新所述请求总次数的值。
  5. 如权利要求1至4任一项所述的方法,其特征在于,所述请求消息是基于网络配置Netconf协议的请求消息或基于Restconf协议的请求消息。
  6. 一种处理数据的方法,其特征在于,所述方法包括:
    网络设备接收管理设备发送的请求消息,所述请求消息包括列表条目数量、标识信息 和偏移量,所述列表条目数量用于指示所述管理设备向所述网络设备请求列表条目的数量,所述标识信息用于指示所述网络设备中的待请求的列表,所述待请求的列表包括所述列表条目数量指示的列表条目,所述偏移量的值等于已经向所述网络设备发送的、用于请求所述待请求的列表中的列表条目的请求消息的数量与所述列表条目数量的乘积;
    所述网络设备获取所述标识信息标识的所述列表中的、以所述偏移量为起始位置的、所述列表条目数量指示的列表条目,其中,所述列表包括的列表条目总量大于所述列表条目数量;
    所述网络设备向所述管理设备发送所述请求消息对应的响应消息,所述响应消息包括所述列表条目。
  7. 如权利要求6所述的方法,其物征在于,所述网络设备接收管理设备发送的请求消息之前,还包括:
    所述网络设备接收所述管理设备发送的总量请求消息,所述总量请求消息包括所述标识信息;
    所述网络设备获取所述标识信息标识的所述列表包括的列表条目总量;
    所述网络设备向所述管理设备发送总量响应消息,所述总量响应消息包括所述列表条目总量,所述总量响应消息用于所述管理设备基于所述列表条目总量确定请求总次数,所述请求总次数用于指示所述管理设备向所述网络设备发送请求消息的数量。
  8. 如权利要求7所述的方法,其特征在于,所述方法还包括:
    所述网络设备在所述列表条目总量变化时确定更新后的列表条目总量,向所述管理设备发送总量更新消息,所述总量更新消息包括所述更新后的列表条目总量,所述总量更新消息用于所述管理设备根据所述更新后的列表条目总量更新所述请求总次数的值。
  9. 一种处理数据的装置,其特征在于,所述装置包括:
    处理单元,用于生成请求消息,所述请求消息包括列表条目数量、标识信息和偏移量,所述列表条目数量用于指示所述装置向网络设备请求列表条目的数量,所述标识信息用于指示所述网络设备中的待请求的列表,所述待请求的列表包括所述列表条目数量指示的列表条目,所述偏移量的值等于已经向所述网络设备发送的、用于请求所述待请求的列表中的列表条目的请求消息的数量与所述列表条目数量的乘积;
    发送单元,用于向所述网络设备发送所述请求消息,所述请求消息用于向所述网络设备请求所述标识信息标识的所述列表中的、以所述偏移量为起始位置的、所述列表条目数量指示的列表条目,其中,所述列表包括的列表条目总量大于所述列表条目数量;
    接收单元,用于接收所述网络设备发送的所述请求消息对应的响应消息,所述响应消息包括所述请求消息请求的列表条目。
  10. 如权利要求9所述的装置,其特征在于,所述处理单元,用于:
    获取所述列表条目总量,根据所述列表条目总量和所述列表条目数量确定请求总次数,所述请求总次数用于指示所述管理设备向所述装置发送请求消息的数量;
    在已向所述网络设备发送的、用于请求所述待请求的列表中的列表条目的请求消息的 数量未达到所述请求总次数时,生成所述请求消息。
  11. 如权利要求10所述的装置,其特征在于,所述发送单元,还用于向所述网络设备发送总量请求消息,所述总量请求消息包括所述标识信息,所述总量请求消息用于请求所述网络设备获取所述列表条目总量;
    所述接收单元,还用于接收所述网络设备发送的总量响应消息,所述总量响应消息包括所述列表条目总量。
  12. 如权利要求10所述的装置,其特征在于,
    所述接收单元,还用于接收所述网络设备发送的总量更新消息,所述总量更新消息包括更新后的列表条目总量,所述更新后的列表条目总量是所述网络设备基于所述列表条目总量变化时确定的列表条目总量;
    所述处理单元,还用于根据更新后的列表条目总量更新所述请求总次数的值。
  13. 如权利要求9至12任一项所述的装置,其特征在于,所述请求消息是基于网络配置Netconf协议的请求消息或基于Restconf协议的请求消息。
  14. 一种处理数据的装置,其特征在于,所述装置包括:
    接收单元,用于接收管理设备发送的请求消息,所述请求消息包括列表条目数量、标识信息和偏移量,所述列表条目数量用于指示所述管理设备向所述装置请求列表条目的数量,所述标识信息用于指示所述装置中的待请求的列表,所述待请求的列表包括所述列表条目数量指示的列表条目,所述偏移量的值等于已经向所述装置发送的、用于请求所述待请求的列表中的列表条目的请求消息的数量与所述列表条目数量的乘积;
    处理单元,用于获取所述标识信息标识的所述列表中的、以所述偏移量为起始位置的、所述列表条目数量指示的列表条目,其中,所述列表包括的列表条目总量大于所述列表条目数量;
    发送单元,用于向所述管理设备发送所述请求消息对应的响应消息,所述响应消息包括所述列表条目。
  15. 如权利要求14所述的装置,其物征在于,
    所述接收单元,还用于接收所述管理设备发送的总量请求消息,所述总量请求消息包括所述标识信息;
    所述处理单元,还用于获取所述标识信息标识的所述列表包括的列表条目总量;
    所述发送单元,还用于向所述管理设备发送总量响应消息,所述总量响应消息包括所述列表条目总量,所述总量响应消息用于所述管理设备基于所述列表条目总量确定请求总次数,所述请求总次数用于指示所述管理设备向所述装置发送请求消息的数量。
  16. 如权利要求15所述的装置,其特征在于,所述处理单元,还用于在所述列表条目总量变化时确定更新后的列表条目总量;
    所述发送单元,还用于向所述管理设备发送总量更新消息,所述总量更新消息包括所 述更新后的列表条目总量,所述总量更新消息用于所述管理设备根据所述更新后的列表条目总量更新所述请求总次数的值。
  17. 一种处理数据的系统,其特征在于,所述系统包括:如权利要求9至13任一项所述的装置和如权利要求14至16任一项所述的装置。
PCT/CN2020/117247 2019-11-29 2020-09-23 处理数据的方法、装置及系统 WO2021103791A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP20892274.0A EP4050849A4 (en) 2019-11-29 2020-09-23 DATA PROCESSING METHOD, APPARATUS AND SYSTEM
US17/826,312 US20220284020A1 (en) 2019-11-29 2022-05-27 Data processing method, apparatus, and system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911204433.8 2019-11-29
CN201911204433.8A CN112887113A (zh) 2019-11-29 2019-11-29 处理数据的方法、装置及系统

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/826,312 Continuation US20220284020A1 (en) 2019-11-29 2022-05-27 Data processing method, apparatus, and system

Publications (1)

Publication Number Publication Date
WO2021103791A1 true WO2021103791A1 (zh) 2021-06-03

Family

ID=76038899

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/117247 WO2021103791A1 (zh) 2019-11-29 2020-09-23 处理数据的方法、装置及系统

Country Status (4)

Country Link
US (1) US20220284020A1 (zh)
EP (1) EP4050849A4 (zh)
CN (1) CN112887113A (zh)
WO (1) WO2021103791A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11669527B1 (en) * 2021-11-23 2023-06-06 Sap Se Optimized policy data structure for distributed authorization systems
CN115098215B (zh) * 2022-07-19 2024-06-04 重庆紫光华山智安科技有限公司 基于多服务的数据分页方法、系统、电子设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102355374A (zh) * 2011-10-28 2012-02-15 杭州华三通信技术有限公司 一种数据获取方法和设备
CN102368716A (zh) * 2011-11-29 2012-03-07 迈普通信技术股份有限公司 一种网络配置协议的数据获取方法及网络配置服务器
CN102891768A (zh) * 2012-10-11 2013-01-23 华为技术有限公司 网络管理的方法和网元
US20140365621A1 (en) * 2013-06-06 2014-12-11 Alcatel-Lucent Canada, Inc. Netconf snmp gateway
CN105827424A (zh) * 2015-01-07 2016-08-03 中兴通讯股份有限公司 数据获取方法及装置

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5204954A (en) * 1987-11-18 1993-04-20 International Business Machines Corporation Remote storage management mechanism and method
CN104184645B (zh) * 2013-05-27 2018-05-04 华为技术有限公司 一种生成操作请求的方法、设备及系统
US9537753B2 (en) * 2014-03-03 2017-01-03 Cisco Technology, Inc. Opaque profile identifiers for path computation element protocol
CN105119763B (zh) * 2015-09-24 2018-12-28 烽火通信科技股份有限公司 基于RIA的Web网管客户端的大数据快速导出方法及系统
CN106612196B (zh) * 2015-10-23 2019-02-01 华为技术有限公司 获取资源的方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102355374A (zh) * 2011-10-28 2012-02-15 杭州华三通信技术有限公司 一种数据获取方法和设备
CN102368716A (zh) * 2011-11-29 2012-03-07 迈普通信技术股份有限公司 一种网络配置协议的数据获取方法及网络配置服务器
CN102891768A (zh) * 2012-10-11 2013-01-23 华为技术有限公司 网络管理的方法和网元
US20140365621A1 (en) * 2013-06-06 2014-12-11 Alcatel-Lucent Canada, Inc. Netconf snmp gateway
CN105827424A (zh) * 2015-01-07 2016-08-03 中兴通讯股份有限公司 数据获取方法及装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4050849A1

Also Published As

Publication number Publication date
US20220284020A1 (en) 2022-09-08
CN112887113A (zh) 2021-06-01
EP4050849A1 (en) 2022-08-31
EP4050849A4 (en) 2022-12-21

Similar Documents

Publication Publication Date Title
JP5007339B2 (ja) ウェブシンジケーションを介した双方向マルチマスタ同期
US7484219B2 (en) Synchronizing centralized data store from distributed independent data stores using fixed application programming interfaces
WO2015014145A1 (zh) 加快子资源加载速度的方法和装置
WO2021103791A1 (zh) 处理数据的方法、装置及系统
US10235384B2 (en) Servicing database operations using a messaging server
US20070250611A1 (en) Method of and System for Providing Performance Information in a UDDI System
CN111143382B (zh) 数据处理方法、系统和计算机可读存储介质
JP2009524889A (ja) 複数クライアントの検索方法およびシステム
US9148329B1 (en) Resource constraints for request processing
JP2009538475A (ja) 構造化ウェブサイトコンテンツの同期技術
WO2017202255A1 (zh) 页面展示方法、装置和客户端设备
WO2014161261A1 (zh) 数据的存储方法及装置
CN111782692A (zh) 一种频率控制方法及装置
CN111597259B (zh) 数据存储系统、方法、装置、电子设备及存储介质
CN108111598B (zh) 云盘数据的下发方法、装置及存储介质
CN101483668A (zh) 热点数据的网络存储和访问方法、设备及系统
JP2002183019A (ja) キャッシュ装置
JPH1031615A (ja) 分散ハイパーメディアシステム
CN109165259B (zh) 基于网络附属存储的索引表更新方法、处理器及存储装置
CN110955460A (zh) 一种服务进程启动方法、装置、电子设备和存储介质
EP3391217B1 (en) Long-running storage manageability operation management
JP6607044B2 (ja) サーバー装置、分散ファイルシステム、分散ファイルシステム制御方法、および、プログラム
JP2020134961A (ja) データベース管理システム、端末装置及び方法
JP2012146076A (ja) キャッシュサーバ、キャッシュ管理方法およびキャッシュ管理プログラム
WO2021036989A1 (zh) 一种数据访问的方法、装置及系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20892274

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020892274

Country of ref document: EP

Effective date: 20220523

NENP Non-entry into the national phase

Ref country code: DE