WO2017000540A1 - 数据查询方法及装置 - Google Patents

数据查询方法及装置 Download PDF

Info

Publication number
WO2017000540A1
WO2017000540A1 PCT/CN2016/070432 CN2016070432W WO2017000540A1 WO 2017000540 A1 WO2017000540 A1 WO 2017000540A1 CN 2016070432 W CN2016070432 W CN 2016070432W WO 2017000540 A1 WO2017000540 A1 WO 2017000540A1
Authority
WO
WIPO (PCT)
Prior art keywords
data query
terminal
query request
character
unique identifier
Prior art date
Application number
PCT/CN2016/070432
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 中兴通讯股份有限公司
Publication of WO2017000540A1 publication Critical patent/WO2017000540A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • 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/2455Query execution
    • 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
    • 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

Definitions

  • the present invention relates to the field of communications, and in particular to a data query method and apparatus.
  • a packet transport network (PTN) device user access device access mode includes: a network management platform mode, a CLI control mode, and an SNMP WEB access. All three access terminals can query data to the device to implement management of devices and networks. Different types of terminals can be accessed at the same time, and terminals of the same type can also access multiple at the same time. For example, there are two network management terminals, and two CLI terminals are simultaneously connected to the same PTN device, and all of them are performing query data operations. The device needs to ensure that the data queried and replied does not conflict.
  • PTN packet transport network
  • a query request for a plurality of access terminals generates a series of sequential nodes, and then performs queries in sequence according to the nodes.
  • This type of query is blocking.
  • one query request is in execution, another query is in a wait state.
  • subsequent queries are blocked.
  • This method has a great impact on the timeliness and effectiveness of the query data, as well as the user experience.
  • the present invention provides a data query method and apparatus to solve at least the problem that multiple terminals cannot query data of one device at the same time in the related art.
  • a data query method including: receiving a first data query request sent by a terminal; acquiring a unique identifier of the first data query request, wherein the unique identifier carries the information of the terminal; Generating a second data query request with the first data query request; executing the query according to the second data query request to obtain the query result; and transmitting the query result to the terminal.
  • obtaining the unique identifier of the first data query request includes: determining a type of the terminal; determining an ID of the terminal; determining an ID of the object requested by the first data query request; and determining, according to the type of the terminal, the ID of the terminal, and the request query The ID of the object generates a unique identifier for the first data query request.
  • generating the unique identifier of the first data query request according to the type of the terminal, the ID of the terminal, and the ID of the object that is requested to be queried includes: acquiring the first character, where the first character is the first data query request at the adaptation layer Mapping the type of the terminal; acquiring the second character, wherein the second character is the ID of the terminal mapped by the first data query request at the adaptation layer; acquiring the third character, wherein the third character is the first data query request The ID of the object of the request query for the layer mapping; And the first character, the second character, and the third character generate a character string according to a preset rule, and use the character string as a unique identifier of the first data query request.
  • the method before performing the query according to the second data query request, the method further includes: buffering the first data query request by using the unique identifier as a keyword, and after sending the query result to the terminal, the method further includes: deleting the cache The first data query request.
  • the method further includes: starting a timer, wherein the timer is used to specify a response waiting time of the second data query request, and waiting for a response to the second data query request The time is recorded, wherein if the query result is not obtained within the response waiting time, the cached first data query request is deleted, and when the query result is sent to the terminal, the method further includes: stopping the timer.
  • performing the query according to the second data query request, to obtain the query result including: obtaining a response message of the second data query request; parsing the response message to obtain a unique identifier carried in the response message; Identifying the corresponding first data query request; and encapsulating the first data query request and the response message to obtain a query result, wherein the query result is sent to the terminal according to the unique identifier.
  • a data query apparatus including: a receiving unit, configured to receive a first data query request sent by a terminal; and an obtaining unit configured to obtain a unique identifier of the first data query request, where Uniquely identifying the information carrying the terminal; the generating unit is configured to generate a second data query request according to the unique identifier and the first data query request; the query unit is configured to execute the query according to the second data query request to obtain the query result; and send Unit, set to send the query results to the terminal.
  • the obtaining unit includes: a first determining module, configured to determine a type of the terminal; a second determining module, configured to determine an ID of the terminal; and a third determining module, configured to determine an object of the first data query request request query And a generating module configured to generate a unique identifier of the first data query request according to the type of the terminal, the ID of the terminal, and the ID of the object requesting the query.
  • the generating module includes: a first acquiring submodule, configured to acquire the first character, where the first character is a type of the terminal that the first data query requests to be mapped in the adaptation layer; and the second acquiring submodule is set to Obtaining a second character, where the second character is an ID of the terminal mapped by the first data query request at the adaptation layer; and the third obtaining submodule is configured to obtain a third character, wherein the third character is the first data query request The ID of the object of the request query mapped in the adaptation layer; and the generating submodule, set to generate a string according to a preset rule for the first character, the second character, and the third character, and use the string as the first data query request Unique identifier.
  • the apparatus further includes: a cache unit configured to cache the first data query request with the unique identifier as a key; and a deleting unit configured to delete the cached first data query request.
  • the first data query request sent by the terminal is received; the unique identifier of the first data query request is obtained, wherein the unique identifier carries the information of the terminal; and the second data query request is generated according to the unique identifier and the first data query request; Performing a query according to the second data query request to obtain the query result; and sending the query result to the terminal, solving the problem that the multi-terminal cannot query the data of one device at the same time in the related technology, and then obtaining the first data query request
  • the unique identifier generates a second data query request according to the unique identifier and the first data query request, and performs a query according to the second data query request to obtain the query result, thereby achieving the effect that the multi-terminal can query the data of one device at the same time.
  • FIG. 1 is a flow chart of a data query method according to a first embodiment of the present invention
  • FIG. 2 is a schematic diagram of a query architecture of a data query method according to a first embodiment of the present invention
  • FIG. 3 is a schematic diagram showing the structure of a unique identifier of a data query method according to a first embodiment of the present invention
  • FIG. 4 is a schematic diagram of establishing a management information model in a data query method according to a first embodiment of the present invention
  • FIG. 5 is a flowchart of data query for a network management terminal in a data query method according to a second embodiment of the present invention.
  • FIG. 6 is a flowchart of data query for a CLI terminal in a data query method according to a second embodiment of the present invention.
  • FIG. 7 is a flowchart of performing a query process when a query response is received in a data query method according to a second embodiment of the present invention.
  • FIG. 8 is a flowchart of performing a query process when a query response is not received in a data query method according to a second embodiment of the present invention.
  • FIG. 9 is a block diagram showing the structure of a data querying apparatus according to an embodiment of the present invention.
  • FIG. 1 is a flowchart of a data query method according to a first embodiment of the present invention. As shown in FIG. 1, the process includes the following steps:
  • Step S102 Receive a first data query request sent by the terminal.
  • the originating end of the first data query request may be a network management terminal, a Command-Line Interface (CLI) terminal, or a Simple Network Management Protocol (SNMP) WEB;
  • the receiving end of the data query request is a PTN device.
  • Step S104 Acquire a unique identifier of the first data query request, where the information that carries the terminal is uniquely identified.
  • the unique identifier carries information about the terminal for uniquely identifying the first data query request. Receive more at the same time When the first number of queries sent by the terminal is requested, the unique identifier of each first data query request is different for the device receiving the request. Therefore, according to the unique identifier, the device receiving the request can distinguish between different first data query requests.
  • Step S106 Generate a second data query request according to the unique identifier and the first data query request.
  • the second data query request carries the specific identification information and the specific request information of the first data query request. That is, the second data query request includes information of the terminal that transmitted the first data query request and information of the query command.
  • Step S108 executing a query according to the second data query request to obtain a query result.
  • the query is executed according to the second data query request, and the obtained query result carries the unique identifier, that is, the information of the terminal that sends the first data query request. Therefore, when a plurality of terminals perform data query on a device at the same time, the device can determine the correspondence between the query result and the terminal according to the data query method of the embodiment, and simultaneously send the plurality of query results to the corresponding terminal. .
  • Step S110 the query result is sent to the terminal.
  • the first data query request sent by the terminal is received; the unique identifier of the first data query request is obtained, wherein the information carrying the terminal is uniquely identified; and the second data query is generated according to the unique identifier and the first data query request.
  • the request is performed according to the second data query request to obtain the query result; and the query result is sent to the terminal, which solves the problem that the multi-terminal cannot query the data of one device at the same time in the related technology, and then obtains the first data query request.
  • the unique identifier generates a second data query request according to the unique identifier and the first data query request, and performs a query according to the second data query request to obtain the query result, thereby achieving the effect that the multi-terminal can query the data of one device at the same time.
  • obtaining the unique identifier of the first data query request includes: determining a type of the terminal; determining an ID of the terminal; determining an ID of the object requested by the first data query request; and The type, the ID of the terminal, and the ID of the object requesting the query generate a unique identifier for the first data query request.
  • the type of the terminal and the ID of the terminal are used to identify the information of the terminal that sent the first data query request.
  • Each terminal can be uniquely identified by type and ID.
  • a query command object is created in the management information model, and each query command corresponds to an object ID, that is, an ID of an object requested by the first data query request.
  • the combination of the type of the terminal, the ID of the terminal, and the ID of the object requesting the query may uniquely identify the first data query request.
  • generating the unique identifier of the first data query request according to the type of the terminal, the ID of the terminal, and the ID of the object requesting the query comprises: acquiring the first character, wherein the first character is the first data query request in the adaptation layer mapping The type of the terminal; the second character is obtained, wherein the second character is the ID of the terminal mapped by the adaptation layer in the first data query; the third character is obtained, wherein the third character is the first data query request in the adaptation The ID of the object of the layer query requesting the query; and the first character, the second character, and the third character generate a character string according to a preset rule, and use the character string as the unique identifier of the first data query request.
  • Each terminal is defined by a terminal type (LINK_TYPE) and a terminal ID (LINK_ID).
  • the device receives the first data query request (message) and maps the terminal type and the terminal ID in the adaptation layer.
  • Create a query command object in the management information model each The query command corresponds to an object ID (OBJECT_ID).
  • the mapping command object ID of the first data query request at the adaptation layer may be obtained.
  • the ID of the current query (QUERY_ID, that is, the unique identifier described above) is generated according to LINK_TYPE, LINK_ID, OBJECT_ID, and this ID is unique to the device that receives the first data query request.
  • it is pre-defined as a fixed-length string, which is filled with LINK_TYPE, LINK_ID, and OBJECT_ID from high to low.
  • the method before performing the query according to the second data query request, the method further includes: buffering the first data query request by using the unique identifier as a keyword, and after sending the query result to the terminal, the method further includes: deleting the cache The first data query request.
  • the first data query request is saved with the unique identifier as a keyword for use in response.
  • the cached first data query request (message) can be deleted to release the memory.
  • the method further includes: starting a timer, wherein the timer is used to specify a response waiting for the second data query request Time, and record the time waiting to answer the second data query request, wherein if the query result is not obtained within the response waiting time, the cached first data query request is deleted, and the query result is sent to the terminal.
  • the method further includes: stopping the timer.
  • the response waiting time (timeout time) is preset. If a response is received within the response waiting time, the subsequent process is executed, and the timer is stopped while the query result is sent to the terminal; if not within the response waiting time When the result of the query is obtained, the cached first data query request is deleted to release the memory.
  • performing the query according to the second data query request to obtain the query result includes: obtaining a response message of the second data query request; parsing the response message to obtain a unique identifier carried in the response message; and obtaining the unique identifier Corresponding first data query request; and encapsulating the first data query request and the response message to obtain a query result, wherein the query result is sent to the terminal according to the unique identifier.
  • the response message After performing the query according to the second data query request and obtaining the response message, in order to know which terminal the response message corresponds to, that is, to identify which terminal the response message is sent to, the response message may be parsed to Get the unique identifier carried in the response packet. According to the unique identifier, the information of the terminal and the first data query request corresponding to the unique identifier (searched in the cache) can be obtained. After the first data query request and the response message are encapsulated, they may be sent to the identified terminal.
  • FIG. 2 is a schematic diagram of a query architecture of a data query method according to a first embodiment of the present invention.
  • the CLI terminal, the network management terminal, and the SNMP WEB terminal simultaneously send a data query request to the device (the PTN device) (that is, the first data query request in the embodiment shown in FIG. 1), and the adaptation layer of the device first
  • the data query request is processed, and subsequent command processing is performed.
  • Subsequent command processing includes sending a processed data query request (ie, a second data query request in the embodiment shown in FIG. 1) to the service module, starting a timer, and the like.
  • FIG. 3 is a block diagram showing the construction of a unique identifier of a data query method according to a first embodiment of the present invention.
  • the unique identifier is LINK_TYPE (terminal type, data volume is 8 bits), LINK_ID (terminal ID, data volume is 8 ratio) Special) and OBJECT_ID (object ID, data amount is 16 bits).
  • the method defines a string that is uniquely identified as a fixed length, and is filled with LINK_TYPE, LINK_ID, and OBJECT_ID from high to low.
  • FIG. 4 is a schematic diagram of establishing a management information model in a data query method according to a first embodiment of the present invention.
  • the board location attribute including the rack number, slot number, etc., represented by ATTRIBUTE_ID
  • FIG. 5 is a flowchart of data query for a network management terminal in a data query method according to a second embodiment of the present invention. As shown in FIG. 5, the method includes:
  • Step S502 Receive a command of the network management terminal to query the running status of the board.
  • the first data query request in the embodiment shown in FIG. 1 may be the command.
  • the terminal type (LINK_TYPE) and the terminal ID (LINK_ID) are mapped in the adapter, and the object ID (OBJECT_ID) of the command for querying the running state of the board is displayed.
  • QUERY_ID is the unique identifier in the embodiment shown in FIG.
  • Step S508 buffering the query request message.
  • the query request message is the message corresponding to the command for querying the running status of the board in step S502.
  • the query request message is stored in the MAP mapping table with the QUERY_ID (0x0504650A) as a key.
  • step S510 the query request is delivered to the service module.
  • the query request carries a QUERY_ID, which is the second data query request in the embodiment shown in FIG.
  • step S512 a timer is started.
  • a timeout of 60 seconds For example, define a timeout of 60 seconds. If a query response is obtained within this time, the steps in the embodiment shown in Fig. 7 are performed, and if the query response is not obtained, the steps in the embodiment shown in Fig. 8 are performed.
  • FIG. 6 is a flowchart of data query for a CLI terminal in a data query method according to a second embodiment of the present invention. As shown in FIG. 6, the method includes:
  • Step S602 Receive a command of the CLI terminal to query the running status of the board.
  • the first data query request in the embodiment shown in FIG. 1 may be the command.
  • the terminal type (LINK_TYPE) and the terminal ID (LINK_ID) are mapped in the adapter, and the object ID (OBJECT_ID) of the command for querying the running state of the board is displayed.
  • QUERY_ID is the unique identifier in the embodiment shown in FIG.
  • Step S608 buffering the query request message.
  • the query request message is a message corresponding to the command for querying the running status of the board in step S602.
  • the query request message is stored in the MAP mapping table with the QUERY_ID (0x0102650A) as a key.
  • Step S610 the query request is delivered to the service module.
  • the query request carries a QUERY_ID, which is the second data query request in the embodiment shown in FIG.
  • step S612 a timer is started.
  • the timeout period is defined as 60 seconds. If a query response is obtained within this time, the steps in the embodiment shown in Fig. 7 are performed, and if the query response is not obtained, the steps in the embodiment shown in Fig. 8 are performed.
  • the foregoing process of FIG. 5 and FIG. 6 can be performed simultaneously, that is, the method can enable the network management terminal and the CLI terminal to simultaneously query the running status of the board.
  • FIG. 7 is a flowchart of performing a query process when a query response is received in a data query method according to a second embodiment of the present invention. As shown in FIG. 7, the method includes:
  • Step S702 receiving a query response of the service module.
  • step S704 the QUERY_ID is taken out.
  • Step S706 the query request message is taken out from the cache according to the QUERY_ID.
  • Step S708 packing and reporting the response message.
  • Step S710 stopping the timer and deleting the cached query request message.
  • the query request message is found from the MAP table. It is encapsulated with the response packet and sent to the CLI terminal. At the same time, the timer is stopped, and the cached query request message is deleted from the MAP table. The query ends.
  • the query request message is found from the MAP table. It is encapsulated with the response packet and sent to the network management terminal. At the same time, the timer is stopped, and the cached query request message is deleted from the MAP table. The query ends.
  • FIG. 8 is a flowchart of performing a query process when a query response is not received in the data query method according to the second embodiment of the present invention. As shown in Figure 8, the method includes:
  • Step S802 the query response of the service module is not received after the timeout.
  • Step S804 deleting the cached query request message.
  • the cached query request message is deleted from the MAP table, and the query is ended.
  • the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation.
  • the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present invention.
  • a data query device is provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and has not been described again.
  • the term “module” may implement a combination of software and/or hardware of a predetermined function.
  • the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
  • FIG. 9 is a structural block diagram of a data query apparatus according to an embodiment of the present invention. As shown in FIG. 9, the apparatus includes: a receiving unit 20, an obtaining unit 40, a generating unit 60, a query unit 80, and a transmitting unit 100.
  • the receiving unit 20 is configured to receive a first data query request sent by the terminal.
  • the obtaining unit 40 is configured to obtain a unique identifier of the first data query request, where the information that carries the terminal is uniquely identified.
  • the generating unit 60 is configured to generate a second data query request according to the unique identifier and the first data query request.
  • the query unit 80 is configured to execute the query according to the second data query request to obtain the query result.
  • the sending unit 100 is configured to send the query result to the terminal.
  • the obtaining unit 40 includes: a first determining module, configured to determine a type of the terminal; a second determining module, configured to determine an ID of the terminal; and a third determining module, configured to determine an object of the first data query request request query ID; And a generating module, configured to generate a unique identifier of the first data query request according to the type of the terminal, the ID of the terminal, and the ID of the object requesting the query.
  • the generating module includes: a first acquiring sub-module, configured to acquire a first character, where the first character is a type of a terminal that is mapped by the first data query request at the adaptation layer; and the second acquiring sub-module is configured In order to obtain the second character, where the second character is the first data query requesting the ID of the terminal mapped in the adaptation layer; the third obtaining submodule is configured to obtain the third character, wherein the third character is the first data query Requesting an ID of the object of the request query mapped in the adaptation layer; and generating a submodule, setting the first character, the second character, and the third character to generate a character string according to a preset rule, and using the string as the first data query The unique identifier of the request.
  • the apparatus further includes: a cache unit configured to cache the first data query request with the unique identifier as a key; and a deleting unit configured to delete the cached first data query request.
  • the receiving unit 20 receives the first data query request sent by the terminal, the obtaining unit 40 obtains the unique identifier of the first data query request, and the generating unit 60 generates the second data query request according to the unique identifier and the first data query request.
  • the query unit 80 performs a query according to the second data query request to obtain the query result, and the sending unit 100 sends the query result to the terminal, which solves the problem that the multi-terminal cannot query the data of one device at the same time in the related art, and then obtains the problem.
  • the unit 40 obtains the unique identifier of the first data query request, and the generating unit 60 generates a second data query request according to the unique identifier and the first data query request, and then the query unit 80 executes the query according to the second data query request to obtain the query result.
  • Multi-terminal can query the effect of data on one device at the same time.
  • each of the above modules may be implemented by software or hardware.
  • the foregoing may be implemented by, but not limited to, the foregoing modules are all located in the same processor; or, the modules are located in multiple In the processor.
  • modules or steps of the present invention described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
  • the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module.
  • the invention is not limited to any specific combination of hardware and software.
  • the data query method and apparatus provided by the embodiments of the present invention have the following beneficial effects: the problem that the multi-terminal cannot query data of one device at the same time in the related art is solved, and the unique request for obtaining the first data query is obtained.
  • the identifier generates a second data query request according to the unique identifier and the first data query request, and performs a query according to the second data query request to obtain the query result, so that the multi-terminal can simultaneously query the data of one device.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Fuzzy Systems (AREA)
  • Mathematical Physics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种数据查询方法及装置。该方法包括:接收终端发送的第一数据查询请求(S102);获取第一数据查询请求的唯一标识(S104),其中,唯一标识携带有终端的信息;根据唯一标识和第一数据查询请求生成第二数据查询请求(S106);按照第二数据查询请求执行查询,以获取查询结果(S108);以及将查询结果发送至终端(S110)。解决了相关技术中多终端不能同时对一台设备查询数据的问题。

Description

数据查询方法及装置 技术领域
本发明涉及通信领域,具体而言,涉及一种数据查询方法及装置。
背景技术
在对网络设备进行数据查询时,有些可支持多个终端对其进行数据查询。例如,分组传送网(Packet Transport Network,简称为PTN)设备使用者接入设备的接入方式有:网络管理平台方式、CLI控制方式、SNMP WEB接入。这三种接入终端都可以到设备查询数据,从而实现对设备和网络的管理。不同类型的终端可以同时接入,同类型的终端也可以同时接入多个。比如现在有两个网管终端,两个CLI终端同时接入到同一台PTN设备中,且都在执行查询数据操作。设备需要保证查询、应答的数据不冲突。
相关技术中,对多个接入终端的查询请求会生成一系列顺序节点,然后按照节点依次执行查询。这种查询方式是阻塞式的,当一个查询请求在执行中,另一个查询就处于等待状态。特别是当某个查询需要较长周期时,后面的查询都会被阻塞。这种方式对查询数据的及时性及有效性,以及用户体验都有较大影响。
针对相关技术中多终端不能同时对一台设备查询数据的问题,目前尚未提出有效的解决方案。
发明内容
本发明提供了一种数据查询方法及装置,以至少解决相关技术中多终端不能同时对一台设备查询数据的问题。
根据本发明的一个方面,提供了一种数据查询方法,包括:接收终端发送的第一数据查询请求;获取第一数据查询请求的唯一标识,其中,唯一标识携带有终端的信息;根据唯一标识和第一数据查询请求生成第二数据查询请求;按照第二数据查询请求执行查询,以获取查询结果;以及将查询结果发送至终端。
可选地,获取第一数据查询请求的唯一标识包括:确定终端的类型;确定终端的ID;确定第一数据查询请求请求查询的对象的ID;以及根据终端的类型、终端的ID以及请求查询的对象的ID生成第一数据查询请求的唯一标识。
可选地,根据终端的类型、终端的ID以及请求查询的对象的ID生成第一数据查询请求的唯一标识包括:获取第一字符,其中,第一字符为第一数据查询请求在适配层映射的终端的类型;获取第二字符,其中,第二字符为第一数据查询请求在适配层映射的终端的ID;获取第三字符,其中,第三字符为第一数据查询请求在适配层映射的请求查询的对象的ID;以 及第一字符、第二字符和第三字符按照预设规则生成一个字符串,并将字符串作为第一数据查询请求的唯一标识。
可选地,在按照第二数据查询请求执行查询之前,该方法还包括:以唯一标识为关键字,缓存第一数据查询请求,在将查询结果发送至终端之后,该方法还包括:删除缓存的第一数据查询请求。
可选地,在按照第二数据查询请求执行查询的同时,该方法还包括:启动定时器,其中,定时器用于指定第二数据查询请求的应答等待时间,并对等待应答第二数据查询请求的时间进行记录,其中,如果在应答等待时间之内未获取到查询结果,则删除缓存的第一数据查询请求,在将查询结果发送至终端的同时,该方法还包括:停止定时器。
可选地,按照第二数据查询请求执行查询,以获取查询结果包括:获取第二数据查询请求的应答报文;对应答报文进行解析,以获取应答报文中携带的唯一标识;获取唯一标识对应的第一数据查询请求;以及将第一数据查询请求和应答报文进行封装,以得到查询结果,其中,按照唯一标识将查询结果发送至终端。
根据本发明的另一方面,提供了一种数据查询装置,包括:接收单元,设置为接收终端发送的第一数据查询请求;获取单元,设置为获取第一数据查询请求的唯一标识,其中,唯一标识携带有终端的信息;生成单元,设置为根据唯一标识和第一数据查询请求生成第二数据查询请求;查询单元,设置为按照第二数据查询请求执行查询,以获取查询结果;以及发送单元,设置为将查询结果发送至终端。
可选地,获取单元包括:第一确定模块,设置为确定终端的类型;第二确定模块,设置为确定终端的ID;第三确定模块,设置为确定第一数据查询请求请求查询的对象的ID;以及生成模块,设置为根据终端的类型、终端的ID以及请求查询的对象的ID生成第一数据查询请求的唯一标识。
可选地,生成模块包括:第一获取子模块,设置为获取第一字符,其中,第一字符为第一数据查询请求在适配层映射的终端的类型;第二获取子模块,设置为获取第二字符,其中,第二字符为第一数据查询请求在适配层映射的终端的ID;第三获取子模块,设置为获取第三字符,其中,第三字符为第一数据查询请求在适配层映射的请求查询的对象的ID;以及生成子模块,设置为第一字符、第二字符和第三字符按照预设规则生成一个字符串,并将字符串作为第一数据查询请求的唯一标识。
可选地,该装置还包括:缓存单元,设置为以唯一标识为关键字,缓存第一数据查询请求;以及删除单元,设置为删除缓存的第一数据查询请求。
通过本发明,接收终端发送的第一数据查询请求;获取第一数据查询请求的唯一标识,其中,唯一标识携带有终端的信息;根据唯一标识和第一数据查询请求生成第二数据查询请求;按照第二数据查询请求执行查询,以获取查询结果;以及将查询结果发送至终端,解决了相关技术中多终端不能同时对一台设备查询数据的问题,进而通过获取第一数据查询请求 的唯一标识,根据唯一标识和第一数据查询请求生成第二数据查询请求,并按照第二数据查询请求执行查询,以获取查询结果,达到了多终端可同时对一台设备查询数据的效果。
附图说明
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:
图1是根据本发明第一实施例的数据查询方法的流程图;
图2是根据本发明第一实施例的数据查询方法的查询架构的示意图;
图3是根据本发明第一实施例的数据查询方法的唯一标识的构成示意图;
图4是根据本发明第一实施例的数据查询方法中建立管理信息模型的示意图;
图5是根据本发明第二实施例的数据查询方法中用于网管终端进行数据查询的流程图;
图6是根据本发明第二实施例的数据查询方法中用于CLI终端进行数据查询的流程图;
图7是根据本发明第二实施例的数据查询方法中收到查询应答时执行查询处理的流程图;
图8是根据本发明第二实施例的数据查询方法中未收到查询应答时执行查询处理的流程图;以及
图9是根据本发明实施例的数据查询装置的结构框图。
具体实施方式
下文中将参考附图并结合实施例来详细说明本发明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。
在本实施例中提供了一种数据查询方法,图1是根据本发明第一实施例的数据查询方法的流程图,如图1所示,该流程包括如下步骤:
步骤S102,接收终端发送的第一数据查询请求。
例如,第一数据查询请求的发起端可以为网络管理终端、命令行界面(Command-Line Interface,简称为CLI)终端,或者简单网络管理协议(Simple Network Management Protocol,简称为SNMP)WEB;第一数据查询请求的接收端为PTN设备。
步骤S104,获取第一数据查询请求的唯一标识,其中,唯一标识携带有终端的信息。
唯一标识携带有终端的信息,用于对第一数据查询请求进行唯一标识。在同时接收到多 个终端发送的第一数查询据请求时,每个第一数据查询请求的唯一标识对于接收该请求的设备来说是不同的。因此根据该唯一标识,接收该请求的设备可以对不同的第一数据查询请求进行区分。
步骤S106,根据唯一标识和第一数据查询请求生成第二数据查询请求。
第二数据查询请求同时携带了唯一标识信息和第一数据查询请求的具体请求信息。也即,第二数据查询请求包含发送第一数据查询请求的终端的信息和查询命令的信息。
步骤S108,按照第二数据查询请求执行查询,以获取查询结果。
根据第二数据查询请求执行查询,获取的查询结果中携带了唯一标识,也即携带了发送第一数据查询请求的终端的信息。因此,在多个终端同时对某设备执行数据查询时,该设备可以根据本实施例的数据查询方法确定查询结果与终端的对应关系,进而同时将多个查询结果分别发送给其所对应的终端。
步骤S110,将查询结果发送至终端。
根据该实施例,通过接收终端发送的第一数据查询请求;获取第一数据查询请求的唯一标识,其中,唯一标识携带有终端的信息;根据唯一标识和第一数据查询请求生成第二数据查询请求;按照第二数据查询请求执行查询,以获取查询结果;以及将查询结果发送至终端,解决了相关技术中多终端不能同时对一台设备查询数据的问题,进而通过获取第一数据查询请求的唯一标识,根据唯一标识和第一数据查询请求生成第二数据查询请求,并按照第二数据查询请求执行查询,以获取查询结果,达到了多终端可同时对一台设备查询数据的效果。
为了简化生成上述唯一标识的过程,优选地,获取第一数据查询请求的唯一标识包括:确定终端的类型;确定终端的ID;确定第一数据查询请求请求查询的对象的ID;以及根据终端的类型、终端的ID以及请求查询的对象的ID生成第一数据查询请求的唯一标识。
终端的类型和终端的ID用于标识发送第一数据查询请求的终端的信息。每个终端都可以用类型和ID所唯一标识。在管理信息模型中建立查询命令对象,每条查询命令对应一个对象ID,也即第一数据查询请求请求查询的对象的ID。终端的类型、终端的ID以及请求查询的对象的ID三者相结合,可以对第一数据查询请求进行唯一的标识。
优选地,根据终端的类型、终端的ID以及请求查询的对象的ID生成第一数据查询请求的唯一标识包括:获取第一字符,其中,第一字符为第一数据查询请求在适配层映射的终端的类型;获取第二字符,其中,第二字符为第一数据查询请求在适配层映射的终端的ID;获取第三字符,其中,第三字符为第一数据查询请求在适配层映射的请求查询的对象的ID;以及第一字符、第二字符和第三字符按照预设规则生成一个字符串,并将字符串作为第一数据查询请求的唯一标识。
以终端类型(LINK_TYPE)和终端ID(LINK_ID)定义每个终端。设备收到第一数据查询请求(报文)在适配层映射终端类型和终端ID。在管理信息模型中建立查询命令对象,每 条查询命令对应一个对象ID(OBJECT_ID)。可获取第一数据查询请求在适配层的映射命令对象ID。根据LINK_TYPE、LINK_ID、OBJECT_ID生成本次查询的ID(QUERY_ID,也即上述的唯一标识),此ID对于接收第一数据查询请求的设备来说是唯一的。
例如,预先定义为一个固定长度的字符串,从高位到低位分别填充为LINK_TYPE,LINK_ID以及OBJECT_ID。
可选地,在按照第二数据查询请求执行查询之前,该方法还包括:以唯一标识为关键字,缓存第一数据查询请求,在将查询结果发送至终端之后,该方法还包括:删除缓存的第一数据查询请求。
以唯一标识作为关键字保存第一数据查询请求,以备应答时使用。在最终获取到查询结果之后,可以将缓存的第一数据查询请求(报文)删除,以释放内存。
为了提高数据查询的有效性和执行效率,可选地,在按照第二数据查询请求执行查询的同时,该方法还包括:启动定时器,其中,定时器用于指定第二数据查询请求的应答等待时间,并对等待应答第二数据查询请求的时间进行记录,其中,如果在应答等待时间之内未获取到查询结果,则删除缓存的第一数据查询请求,在将查询结果发送至终端的同时,该方法还包括:停止定时器。
预先设定应答等待时间(超时时间),如果在应答等待时间内接收到了应答,则执行后续的过程,并在将查询结果发送至终端的同时,停止计时器;如果在应答等待时间之内未获取到查询结果,则删除缓存的第一数据查询请求,以释放内存。
优选地,按照第二数据查询请求执行查询,以获取查询结果包括:获取第二数据查询请求的应答报文;对应答报文进行解析,以获取应答报文中携带的唯一标识;获取唯一标识对应的第一数据查询请求;以及将第一数据查询请求和应答报文进行封装,以得到查询结果,其中,按照唯一标识将查询结果发送至终端。
在根据第二数据查询请求执行查询并获取到应答报文之后,为了获知该应答报文对应于哪个终端,也即识别该应答报文该发送至哪个终端,可以对应答报文进行解析,以获取应答报文中携带的唯一标识。根据该唯一标识,可以获知终端的信息,以及该唯一标识对应的第一数据查询请求(在缓存中查找)。将第一数据查询请求和应答报文进行封装之后,可将其发送至上述识别出的终端。
图2是根据本发明第一实施例的数据查询方法的查询架构的示意图。如图2所示,CLI终端、网管终端和SNMP WEB终端同时向设备(PTN设备)发出数据查询请求(即图1所示实施例中的第一数据查询请求),设备的适配层首先对该数据查询请求进行处理,之后执行后续的命令处理。后续的命令处理包括向业务模块发送经过处理的数据查询请求(即图1所示实施例中的第二数据查询请求)、启动定时器等。
图3是根据本发明第一实施例的数据查询方法的唯一标识的构成示意图。如图3所示,唯一标识由LINK_TYPE(终端类型,数据量为8比特)、LINK_ID(终端ID,数据量为8比 特)和OBJECT_ID(对象ID,数据量为16比特)组成。该方法中定义唯一标识为一个固定长度的字符串,从高位到低位分别填充为LINK_TYPE、LINK_ID和OBJECT_ID。
图4是根据本发明第一实施例的数据查询方法中建立管理信息模型的示意图。如图4所示,在管理信息模型中建立查询命令对象,每个命令对象对应一个对象ID(OBJECT_ID),查询单板运行状态即可获取该对象ID,例如,OBJECT_ID=25866。另外,为了提高数据查询的准确性,也可以获取单板位置属性(包括机架号、槽位号等,用ATTRIBUTE_ID表示),例如,ATTRIBUTE_ID=88。
下面提供了根据本发明第二实施例的数据查询方法。该实施例可以作为图1所示实施例的一种优选的实施方式。在该实施例中,提供了网管终端和CLI终端同时到设备查询单板运行状态的多终端数据查询方法。图5是根据本发明第二实施例的数据查询方法中用于网管终端进行数据查询的流程图。如图5所示,该方法包括:
步骤S502,接收到网管终端的查询单板运行状态的命令。
图1所示实施例中的第一数据查询请求可以为该命令。
步骤S504,获取映射:LINK_TYPE=5,LINK_ID=4,OBJECT_ID=25866。
根据上述命令在适配器映射终端类型(LINK_TYPE)和终端ID(LINK_ID),以及查询单板运行状态的命令的对象ID(OBJECT_ID)。其中,映射的终端类型以及终端ID分别为:LINK_TYPE=5,LINK_ID=4;查询单板状态命令映射的对象ID为OBJECT_ID=25866。
步骤S506,计算QUERY_ID=0x0504650A。
QUERY_ID即图1所示实施例中的唯一标识。
步骤S508,缓存查询请求报文。
该查询请求报文即步骤S502中查询单板运行状态的命令所对应的报文。将查询请求报文以QUERY_ID(0x0504650A)为关键字,存储到MAP映射表中。
步骤S510,将查询请求下发至业务模块。
将查询请求发送到业务模块执行查询。该查询请求携带有QUERY_ID,该查询请求也即图1所示实施例中的第二数据查询请求。
步骤S512,启动定时器。
例如,定义超时时间为60秒。如果在该时间内得到了查询应答,则执行图7所示实施例中的步骤,如果未得到查询应答,则执行图8所示实施例中的步骤。
图6是根据本发明第二实施例的数据查询方法中用于CLI终端进行数据查询的流程图。如图6所示,该方法包括:
步骤S602,接收到CLI终端的查询单板运行状态的命令。
图1所示实施例中的第一数据查询请求可为该命令。
步骤S604,获取映射:LINK_TYPE=1,LINK_ID=2,OBJECT_ID=25866。
根据上述命令在适配器映射终端类型(LINK_TYPE)和终端ID(LINK_ID),以及查询单板运行状态的命令的对象ID(OBJECT_ID)。其中,映射的终端类型以及终端ID分别为:LINK_TYPE=1,LINK_ID=2;查询单板状态命令映射的对象ID为OBJECT_ID=25866。
步骤S606,计算QUERY_ID=0x0102650A。
QUERY_ID即图1所示实施例中的唯一标识。
步骤S608,缓存查询请求报文。
该查询请求报文即步骤S602中查询单板运行状态的命令所对应的报文。将查询请求报文以QUERY_ID(0x0102650A)为关键字,存储到MAP映射表中。
步骤S610,将查询请求下发业务模块。
将查询请求发送到业务模块执行查询。该查询请求携带有QUERY_ID,该查询请求也即图1所示实施例中的第二数据查询请求。
步骤S612,启动定时器。
同上述步骤S512,定义超时时间为60秒。如果在该时间内得到了查询应答,则执行图7所示实施例中的步骤,如果未得到查询应答,则执行图8所示实施例中的步骤。
需要说明的是,根据本发明实施例的数据查询方法中,上述图5和图6执行流程可同时进行,也即该方法可使网管终端和CLI终端同时到设备查询单板运行状态。
图7是根据本发明第二实施例的数据查询方法中收到查询应答时执行查询处理的流程图。如图7所示,该方法包括:
步骤S702,收到业务模块的查询应答。
步骤S704,取出QUERY_ID。
从查询应答中提取QUERY_ID。
步骤S706,根据QUERY_ID从缓存中取出查询请求报文。
步骤S708,打包上报应答报文。
将查询请求报文与查询应答报文进行封装,得到查询结果,并将其发送至网管终端或者CLI终端(如果两个终端发送的请求均得到了应答,则将两个查询结果分别发送至其对应的终端;如果只有一个终端发送的请求得到了应答,则只向该终端发送查询结果)。
步骤S710,停止定时器,删除缓存的查询请求报文。
具体地,如果收到QUERY_ID=0x0102650A的应答报文,则从MAP表中找到查询请求报文。将其与应答报文封装后发送到CLI终端。同时停止定时器,并将缓存的查询请求报文从MAP表中删除。查询结束。
如果收到QUERY_ID=0x0504650A的应答报文,则从MAP表中找到查询请求报文。将其与应答报文封装后发送到到网管终端。同时停止定时器,并将缓存的查询请求报文从MAP表中删除。查询结束。
图8是根据本发明第二实施例的数据查询方法中未收到查询应答时执行查询处理的流程图。如图8所示,该方法包括:
步骤S802,超时未收到业务模块的查询应答。
步骤S804,删除缓存的查询请求报文。
如果超时未收到业务模块的查询应答,则将缓存的查询请求报文从MAP表中删除,并结束查询。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。
在本实施例中还提供了一种数据查询装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
图9是根据本发明实施例的数据查询装置的结构框图,如图9所示,该装置包括:接收单元20、获取单元40、生成单元60、查询单元80和发送单元100。
接收单元20,设置为接收终端发送的第一数据查询请求。
获取单元40,设置为获取第一数据查询请求的唯一标识,其中,唯一标识携带有终端的信息。
生成单元60,设置为根据唯一标识和第一数据查询请求生成第二数据查询请求。
查询单元80,设置为按照第二数据查询请求执行查询,以获取查询结果。
发送单元100,设置为将查询结果发送至终端。
进一步地,获取单元40包括:第一确定模块,设置为确定终端的类型;第二确定模块,设置为确定终端的ID;第三确定模块,设置为确定第一数据查询请求请求查询的对象的ID; 以及生成模块,设置为根据终端的类型、终端的ID以及请求查询的对象的ID生成第一数据查询请求的唯一标识。
可选地,上述生成模块包括:第一获取子模块,设置为获取第一字符,其中,第一字符为第一数据查询请求在适配层映射的终端的类型;第二获取子模块,设置为获取第二字符,其中,第二字符为第一数据查询请求在适配层映射的终端的ID;第三获取子模块,设置为获取第三字符,其中,第三字符为第一数据查询请求在适配层映射的请求查询的对象的ID;以及生成子模块,设置为第一字符、第二字符和第三字符按照预设规则生成一个字符串,并将字符串作为第一数据查询请求的唯一标识。
可选地,该装置还包括:缓存单元,设置为以唯一标识为关键字,缓存第一数据查询请求;以及删除单元,设置为删除缓存的第一数据查询请求。
根据该实施例,通过接收单元20接收终端发送的第一数据查询请求,获取单元40获取第一数据查询请求的唯一标识,生成单元60根据唯一标识和第一数据查询请求生成第二数据查询请求,查询单元80按照第二数据查询请求执行查询,以获取查询结果,以及发送单元100将查询结果发送至终端,解决了相关技术中多终端不能同时对一台设备查询数据的问题,进而通过获取单元40获取第一数据查询请求的唯一标识,生成单元60根据唯一标识和第一数据查询请求生成第二数据查询请求,然后查询单元80按照第二数据查询请求执行查询,以获取查询结果,达到了多终端可同时对一台设备查询数据的效果。
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述模块分别位于多个处理器中。
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。
工业实用性
如上所述,本发明实施例提供的一种数据查询方法及装置具有以下有益效果:解决了相关技术中多终端不能同时对一台设备查询数据的问题,进而通过获取第一数据查询请求的唯一标识,根据唯一标识和第一数据查询请求生成第二数据查询请求,并按照第二数据查询请求执行查询,以获取查询结果,达到了多终端可同时对一台设备查询数据的效果。

Claims (10)

  1. 一种数据查询方法,包括:
    接收终端发送的第一数据查询请求;
    获取所述第一数据查询请求的唯一标识,其中,所述唯一标识携带有所述终端的信息;
    根据所述唯一标识和所述第一数据查询请求生成第二数据查询请求;
    按照所述第二数据查询请求执行查询,以获取查询结果;以及
    将所述查询结果发送至所述终端。
  2. 根据权利要求1所述的方法,其中,获取所述第一数据查询请求的唯一标识包括:
    确定所述终端的类型;
    确定所述终端的ID;
    确定所述第一数据查询请求请求查询的对象的ID;以及
    根据所述终端的类型、所述终端的ID以及所述请求查询的对象的ID生成所述第一数据查询请求的唯一标识。
  3. 根据权利要求2所述的方法,其中,根据所述终端的类型、所述终端的ID以及所述请求查询的对象的ID生成所述第一数据查询请求的唯一标识包括:
    获取第一字符,其中,所述第一字符为所述第一数据查询请求在适配层映射的所述终端的类型;
    获取第二字符,其中,所述第二字符为所述第一数据查询请求在所述适配层映射的终端的ID;
    获取第三字符,其中,所述第三字符为所述第一数据查询请求在所述适配层映射的请求查询的对象的ID;以及
    所述第一字符、所述第二字符和所述第三字符按照预设规则生成一个字符串,并将所述字符串作为所述第一数据查询请求的唯一标识。
  4. 根据权利要求1所述的方法,其中,
    在按照所述第二数据查询请求执行查询之前,所述方法还包括:以所述唯一标识为关键字,缓存所述第一数据查询请求,
    在将所述查询结果发送至所述终端之后,所述方法还包括:删除缓存的第一数据查询请求。
  5. 根据权利要求4所述的方法,其中,
    在按照所述第二数据查询请求执行查询的同时,所述方法还包括:启动定时器,其中,所述定时器用于指定所述第二数据查询请求的应答等待时间,并对等待应答所述第二数据查询请求的时间进行记录,
    其中,如果在所述应答等待时间之内未获取到所述查询结果,则删除所述缓存的第一数据查询请求,
    在将所述查询结果发送至所述终端的同时,所述方法还包括:停止所述定时器。
  6. 根据权利要求4所述的方法,其中,按照所述第二数据查询请求执行查询,以获取查询结果包括:
    获取所述第二数据查询请求的应答报文;
    对所述应答报文进行解析,以获取所述应答报文中携带的所述唯一标识;
    获取所述唯一标识对应的第一数据查询请求;以及
    将所述第一数据查询请求和所述应答报文进行封装,以得到所述查询结果,
    其中,按照所述唯一标识将所述查询结果发送至所述终端。
  7. 一种数据查询装置,包括:
    接收单元,设置为接收终端发送的第一数据查询请求;
    获取单元,设置为获取所述第一数据查询请求的唯一标识,其中,所述唯一标识携带有所述终端的信息;
    生成单元,设置为根据所述唯一标识和所述第一数据查询请求生成第二数据查询请求;
    查询单元,设置为按照所述第二数据查询请求执行查询,以获取查询结果;以及
    发送单元,设置为将所述查询结果发送至所述终端。
  8. 根据权利要求7所述的装置,其中,所述获取单元包括:
    第一确定模块,设置为确定所述终端的类型;
    第二确定模块,设置为确定所述终端的ID;
    第三确定模块,设置为确定所述第一数据查询请求请求查询的对象的ID;以及
    生成模块,设置为根据所述终端的类型、所述终端的ID以及所述请求查询的对象的ID生成所述第一数据查询请求的唯一标识。
  9. 根据权利要求8所述的装置,其中,所述生成模块包括:
    第一获取子模块,设置为获取第一字符,其中,所述第一字符为所述第一数据查询请求在适配层映射的所述终端的类型;
    第二获取子模块,设置为获取第二字符,其中,所述第二字符为所述第一数据查询请求在所述适配层映射的终端的ID;
    第三获取子模块,设置为获取第三字符,其中,所述第三字符为所述第一数据查询请求在所述适配层映射的请求查询的对象的ID;以及
    生成子模块,设置为所述第一字符、所述第二字符和所述第三字符按照预设规则生成一个字符串,并将所述字符串作为所述第一数据查询请求的唯一标识。
  10. 根据权利要求7所述的装置,其中,所述装置还包括:
    缓存单元,设置为以所述唯一标识为关键字,缓存所述第一数据查询请求;以及
    删除单元,设置为删除缓存的第一数据查询请求。
PCT/CN2016/070432 2015-07-01 2016-01-07 数据查询方法及装置 WO2017000540A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510379816.4A CN106326296A (zh) 2015-07-01 2015-07-01 数据查询方法及装置
CN201510379816.4 2015-07-01

Publications (1)

Publication Number Publication Date
WO2017000540A1 true WO2017000540A1 (zh) 2017-01-05

Family

ID=57607913

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/070432 WO2017000540A1 (zh) 2015-07-01 2016-01-07 数据查询方法及装置

Country Status (2)

Country Link
CN (1) CN106326296A (zh)
WO (1) WO2017000540A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111488515A (zh) * 2019-01-25 2020-08-04 华为技术有限公司 信息查询方法、装置、设备及存储介质

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107273545A (zh) * 2017-07-11 2017-10-20 王焱华 一种大数据查询方法
CN108093026B (zh) * 2017-11-17 2020-04-07 阿里巴巴集团控股有限公司 多租户请求的处理方法及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100042414A1 (en) * 2008-08-18 2010-02-18 At&T Intellectual Property I, L.P. System and method for improving name dialer performance
CN101730069A (zh) * 2008-10-31 2010-06-09 中国移动通信集团天津有限公司 一种hlr用户数据查询的方法、系统和装置
CN103685267A (zh) * 2013-12-10 2014-03-26 小米科技有限责任公司 数据访问方法及装置
CN104243565A (zh) * 2014-09-04 2014-12-24 华为软件技术有限公司 获取配置数据的方法和装置

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7127463B2 (en) * 2002-04-18 2006-10-24 International Business Machines Corporation Optimization of database network traffic based upon data-use analysis
CN1941787A (zh) * 2005-09-30 2007-04-04 乐金电子(昆山)电脑有限公司 A/v网络中设备标识符的设定方法
CN101082924A (zh) * 2007-06-04 2007-12-05 徐恩麒 酒店互动系统
CN104283843B (zh) * 2013-07-02 2018-12-07 腾讯科技(深圳)有限公司 一种用户登陆的方法、装置及系统
CN103914520B (zh) * 2014-03-18 2022-01-25 小米科技有限责任公司 数据查询方法、终端设备和服务器

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100042414A1 (en) * 2008-08-18 2010-02-18 At&T Intellectual Property I, L.P. System and method for improving name dialer performance
CN101730069A (zh) * 2008-10-31 2010-06-09 中国移动通信集团天津有限公司 一种hlr用户数据查询的方法、系统和装置
CN103685267A (zh) * 2013-12-10 2014-03-26 小米科技有限责任公司 数据访问方法及装置
CN104243565A (zh) * 2014-09-04 2014-12-24 华为软件技术有限公司 获取配置数据的方法和装置

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111488515A (zh) * 2019-01-25 2020-08-04 华为技术有限公司 信息查询方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN106326296A (zh) 2017-01-11

Similar Documents

Publication Publication Date Title
WO2017114205A1 (zh) 短链接处理方法、装置及服务器
WO2017114206A1 (zh) 短链接处理方法、装置及短链接服务器
CN104184832B (zh) 网络应用中的数据提交方法及装置
CN107231402A (zh) Http请求处理方法、装置及系统
WO2020173080A1 (zh) 调用链信息查询方法以及设备
CN110049503B (zh) 一种获取数据的方法和设备
US9319449B2 (en) Method, apparatus, and computer program product for processing data requests
CN108093026B (zh) 多租户请求的处理方法及装置
RU2642833C2 (ru) Способ и устройство для обеспечения медиаресурса
WO2014161261A1 (zh) 数据的存储方法及装置
WO2016110078A1 (zh) 数据获取方法及装置、存储介质
WO2017000540A1 (zh) 数据查询方法及装置
CN112445700A (zh) 测试方法和装置
CN105450585A (zh) 一种信息传输方法及装置
US20170155712A1 (en) Method and device for updating cache data
CN108154024B (zh) 一种数据检索方法、装置及电子设备
CN103294683B (zh) 一种视频文件字幕自动匹配系统及方法
WO2020224241A1 (zh) 一种云通信方法及装置、用户设备、网络设备
CN109660589B (zh) 请求处理方法及装置、电子设备
US20190124162A1 (en) Automatic server cluster discovery
JP6233846B2 (ja) 可変長ノンスの生成
CN112306791B (zh) 一种性能监控的方法和装置
CN109361716B (zh) 一种ip地址的获取方法、装置、终端设备和存储介质
WO2015192497A1 (zh) 通信链路的发送方法、装置及终端
CN113242307B (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: 16816906

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16816906

Country of ref document: EP

Kind code of ref document: A1