CN113836405B - Information query method, device and computer readable storage medium - Google Patents

Information query method, device and computer readable storage medium Download PDF

Info

Publication number
CN113836405B
CN113836405B CN202111057516.6A CN202111057516A CN113836405B CN 113836405 B CN113836405 B CN 113836405B CN 202111057516 A CN202111057516 A CN 202111057516A CN 113836405 B CN113836405 B CN 113836405B
Authority
CN
China
Prior art keywords
information
preset
interface
searched
target
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202111057516.6A
Other languages
Chinese (zh)
Other versions
CN113836405A (en
Inventor
陈贻斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen TCL New Technology Co Ltd
Original Assignee
Shenzhen TCL New Technology Co Ltd
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 Shenzhen TCL New Technology Co Ltd filed Critical Shenzhen TCL New Technology Co Ltd
Priority to CN202111057516.6A priority Critical patent/CN113836405B/en
Publication of CN113836405A publication Critical patent/CN113836405A/en
Application granted granted Critical
Publication of CN113836405B publication Critical patent/CN113836405B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation
    • 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/2457Query processing with adaptation to user needs
    • 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/25Integrating or interfacing systems involving database management systems

Abstract

The embodiment of the application discloses an information query method, an information query device and a computer-readable storage medium; the embodiment of the application can receive the information inquiry request, wherein the information inquiry request carries the information identifier to be searched; detecting whether a preset information base contains target information corresponding to an information identifier to be searched; if the fact that the preset information base does not contain corresponding target information is detected, the calling times of an information inquiry interface in the preset duration are obtained, and the information inquiry interface is an inquiry interface of other service information bases; and if the calling times of the information query interface are detected to be smaller than the preset times threshold, querying the information identifier to be searched through the information query interface to obtain queried target information. Therefore, target information can be obtained from other service providers through a preset information base or through an information query interface, so that query service for providing full-ecological service data information is realized, the success rate of information query of users is improved, and the user experience is enhanced.

Description

Information query method, device and computer readable storage medium
Technical Field
The present disclosure relates to the field of information technologies, and in particular, to an information query method, an information query device, and a computer readable storage medium.
Background
With the development of internet technology, data information services provide great convenience to users. For example, a user can search related data information through a data information query service provided by a certain platform or service provider, so that subsequent use or reading is facilitated, and the user experience is improved.
However, the platform or service provider of the existing data query service is generally focused on the field of service data information of the platform or service provider, which results in failure of the user in querying part of service data, such as querying service data of other platforms, and reduces success rate of querying information of the user.
Disclosure of Invention
The embodiment of the application provides an information query method, an information query device and a computer readable storage medium. The query service of the full ecological business data can be provided, and the success rate of the user for querying information is improved.
The embodiment of the application provides an information query method, which comprises the following steps:
receiving an information inquiry request, wherein the information inquiry request carries an information identifier to be searched;
detecting whether a preset information base contains target information corresponding to the information identifier to be searched;
if the fact that the preset information base does not contain corresponding target information is detected, acquiring the calling times of an information inquiry interface in a preset duration, wherein the information inquiry interface is an inquiry interface of other service information bases;
And if the calling times of the information query interface are detected to be smaller than the preset times threshold, querying the information identifier to be searched through the information query interface to obtain queried target information.
Accordingly, an embodiment of the present application provides an information query apparatus, including:
the receiving unit is used for receiving an information inquiry request, wherein the information inquiry request carries an information identifier to be searched;
the detection unit is used for detecting whether the preset information base contains target information corresponding to the information identifier to be searched;
the acquisition unit is used for acquiring the calling times of the information inquiry interface in the preset duration if the preset information base does not contain corresponding target information, wherein the information inquiry interface is an interface for acquiring information from other service information bases;
and the query unit is used for querying the information identifier to be searched through the information query interface to obtain queried target information if the calling times of the information query interface are detected to be smaller than a preset times threshold value.
In some embodiments, the query unit is further configured to:
acquiring a first interface task sub-queue corresponding to the information query interface in a preset time period, wherein the preset time period is a unit time period in the preset time period;
When the number of information tasks in the first interface task sub-queue reaches a preset task amount threshold of the information query interface, adding the information mark to be searched into a second interface task sub-queue of a next preset period;
and inquiring the information identification to be searched in the second interface task sub-queue through an information inquiry interface.
In some embodiments, the apparatus further comprises an updating unit for:
acquiring data information conforming to a preset data rule from each network page;
acquiring a target network address of a network page corresponding to each data message;
and when the history access record is detected not to contain the target network address, updating the acquired data information to the preset information base.
In some embodiments, the updating unit is further configured to:
when the historical access record contains the target network address, acquiring the historical access time of the target network address from the historical access record, and acquiring an access time interval according to the historical access time;
and when the access time interval is greater than or equal to a preset time threshold, replacing the target data information in the preset information base by using the acquired data information to obtain an updated preset information base.
In some embodiments, the updating unit is further configured to:
detecting the number of information tasks contained in an interface task queue;
when the number of the information tasks is detected to be larger than a preset task number threshold, acquiring data information corresponding to the information tasks through an information inquiry interface;
and updating the acquired data information to the preset information base.
In some embodiments, the updating unit is further configured to:
acquiring available query times of the information query interface in a target period;
when the available query times are detected to be smaller than the number of information tasks contained in the interface task queue, acquiring task time stamps of each information task, wherein the time stamps contain the generation time of corresponding task information;
determining executable information tasks in the target period according to the available inquiry times and task time stamps;
and acquiring data information corresponding to the executable information task through the information query interface.
In some embodiments, the detection unit is further configured to:
detecting whether the preset local information base contains target information corresponding to the information identifier to be searched;
when the fact that the preset local information base does not contain corresponding target information is detected, whether the preset distributed information base contains the target information corresponding to the information identification to be searched or not is detected;
The querying unit is further configured to:
when the preset distributed information base is detected to contain corresponding target information, updating the target information in the preset distributed information base to the preset local information base to obtain an updated preset local information base;
and acquiring target information corresponding to the information identifier to be searched from the updated preset local information base.
In some embodiments, the query unit is further configured to:
when the calling times of the information inquiry interface are detected to be greater than or equal to a preset times threshold value, adding the information mark to be searched into an interface task queue of the next preset time length;
and inquiring the information identifier to be searched in the next interface task queue with preset duration through the information inquiry interface to obtain target information corresponding to the information identifier to be searched.
In addition, the embodiment of the application also provides a computer device, which comprises a processor and a memory, wherein the memory stores an application program, and the processor is used for running the application program in the memory to realize the steps in the information query method provided by the embodiment of the application.
In addition, the embodiment of the application further provides a computer readable storage medium, wherein the computer readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps in any information query method provided by the embodiment of the application.
Furthermore, embodiments of the present application provide a computer program comprising computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in any of the information query methods provided in the embodiments of the present application.
The embodiment of the application can receive the information inquiry request, wherein the information inquiry request carries the information identifier to be searched; detecting whether a preset information base contains target information corresponding to an information identifier to be searched; if the fact that the preset information base does not contain corresponding target information is detected, the calling times of an information inquiry interface in the preset duration are obtained, and the information inquiry interface is an interface for obtaining information from other service information bases; and if the calling times of the information query interface are detected to be smaller than the preset times threshold, querying the information identifier to be searched through the information query interface to obtain queried target information. Therefore, the method and the device can obtain the target information from other service providers by detecting whether the target information corresponding to the information identification to be searched is contained in the preset information base or not, and when the target information cannot be searched, the information inquiry interface is called, so that inquiry service for providing full-ecological service data information is realized, the success rate of inquiring the information by a user is improved, and the user experience is enhanced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic view of a scenario of an information query system provided in an embodiment of the present application;
fig. 2 is a schematic step flow diagram of an information query method according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating another step of the information query method according to the embodiment of the present application;
fig. 4 is a schematic view of a scenario flow of an information query method provided in an embodiment of the present application;
fig. 5 is a schematic structural diagram of an information query apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
The embodiment of the application provides an information query method, an information query device and a computer readable storage medium. The embodiments of the present application will be described from the perspective of an information query apparatus, which may be specifically integrated in a computer device, where the computer device may be a device such as a terminal. The terminal may be a television, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal and the server may be directly or indirectly connected through wired or wireless communication, which is not limited herein.
For example, referring to fig. 1, a schematic view of a scenario of an information query method provided in an embodiment of the present application is shown. The scene comprises a terminal 10 and a server 20, wherein the terminal 10 and the server 20 are connected through wireless communication to realize data interaction.
When detecting an information inquiry request input or selected by a user, the terminal 10 sends a control signal to the server 20 to enable the server 20 to acquire corresponding target information according to an information identifier to be searched carried by the information inquiry request, and returns the target information to the terminal 10; the terminal 10 receives and displays the target information returned from the server 20.
The server 20 may receive an information query request, where the information query request carries an information identifier to be searched; detecting whether a preset information base contains target information corresponding to an information identifier to be searched; if the fact that the preset information base does not contain corresponding target information is detected, the calling times of an information inquiry interface in the preset duration are obtained, and the information inquiry interface is an inquiry interface of other service information bases; if the calling times of the information query interface are detected to be smaller than the preset times threshold value, querying the information identifier to be searched through the information query interface to obtain queried target information; further, the searched target information is returned to the terminal 10.
The information inquiry can include the processing modes of receiving an information inquiry request, searching target information from a preset information base, detecting the times of an information inquiry interface, inquiring the target information through the information inquiry interface and the like.
The following will describe in detail. The following description of the embodiments is not intended to limit the preferred embodiments.
In the embodiments of the present application, description will be made from the perspective of an information inquiry apparatus, which may be integrated in a computer device such as a server in particular. Referring to fig. 2, fig. 2 is a schematic step flow diagram of an information query method provided in the embodiment of the present application, and when a processor on a server executes a program corresponding to the information query method, the specific flow of the information query method is as follows:
101. An information query request is received.
Wherein the information inquiry requests the inquiry request sent by the user through the browser application or the application with the browser page, and the information inquiry request can reflect the intention or the requirement of the user when acquiring the data information.
It should be noted that, the information query request may carry an information identifier to be searched, where the information identifier to be searched may be an information identifier corresponding to the query request, and the data information required to be acquired by the user may be queried or matched through the information identifier.
In order to be able to efficiently learn about information query requests later, in the embodiment of the present application, whether there is an information query request may be actively queried every unit time. In this way, the information inquiry request received in real time is conveniently responded to later.
102. And detecting whether the preset information base contains target information corresponding to the information identification to be searched.
The preset information base may be an information base containing data information acquired in advance, that is, a large amount of data information is stored in the preset information base. It should be noted that, the preset information base may structurally include a preset local information base and a preset distributed information base at the service server side.
The preset local information base can be a local database of a service server and is used for storing data information and other resources.
The preset distributed information base can be a database which is parallel or parallel to the preset local information base, and the sharing of data information can be realized between the preset distributed information base and the preset local information base. The preset distributed information base may be other databases in the information query service platform besides the local information base, for example, the preset distributed information base may be other distributed databases of the information query service platform.
The target information may be network resource information, for example, the target information may include text information, graphic information, game resource, installation package, product profile, video information, audio information, program, script, etc., which are only some examples, and the target information may also be any information available through network.
In order to obtain the target information corresponding to the information query request, the embodiment of the application may respond to the information query request after receiving the information query request to find the corresponding target information. Specifically, an information identifier to be searched carried by an information inquiry request is obtained; detecting whether a preset information base contains target information corresponding to an information identifier to be searched; it can be understood that when it is detected that the preset information base includes the target information corresponding to the information identifier to be searched, the target information corresponding to the information identifier to be searched can be obtained from the preset information base. Therefore, the target information corresponding to the information query request can be obtained from the preset information base preferentially, the information obtaining frequency from the database of the third-party service platform is reduced, and the provided information query service cost is saved as much as possible.
In some embodiments, the step of detecting whether the preset information base includes the target information corresponding to the information identifier to be searched may include: detecting whether a preset local information base contains target information corresponding to an information identifier to be searched; and when detecting that the preset local information base does not contain corresponding target information, detecting whether the preset distributed information base contains target information corresponding to the information identification to be searched.
Further, after the step of detecting whether the preset information base includes the target information corresponding to the information identifier to be searched, the step further includes: when the fact that the preset distributed information base contains corresponding target information is detected, updating the target information in the preset distributed information base to a preset local information base to obtain an updated preset local information base; and acquiring target information corresponding to the information identifier to be searched from the updated preset local information base.
Specifically, whether the target information corresponding to the to-be-searched information identifier is contained is determined from the preset local information base, and it can be understood that if the target information corresponding to the to-be-searched identifier is detected to be contained in the preset local information base, the target information is acquired and returned.
When the fact that the preset local information base does not contain corresponding target information is detected, whether the preset distributed information base contains target information corresponding to the information identification to be searched or not is determined by detecting the preset distributed information base. On the one hand, if the preset distributed information base is detected to contain target information corresponding to the information identification to be searched, the target information corresponding to the information identification to be searched in the preset distributed information base is added to the preset local information base, so that the target information corresponding to the information identification to be searched is obtained based on the updated preset local information base, and the target information is returned to the terminal. On the other hand, when the preset distributed information base does not contain the target information corresponding to the information identification to be searched, searching the target information corresponding to the information identification to be searched through the information inquiry interface, updating the searched target information to the preset local information base, acquiring the target information corresponding to the information identification to be searched based on the updated preset local information base, returning the target information to the terminal, and displaying the target information on a network page of the information inquiry service platform.
It should be noted that, in order to provide an information query service database, the embodiment of the present application needs to expand and update the data information amount in the preset local information database of the real-time information query server, so that the data amount of the preset local information database is larger and larger, so as to satisfy the subsequent information query service. For example, the embodiment of the application may periodically or continuously acquire data information in a network, such as web page data information, through open source software and web crawler technology, and store the acquired data information in a preset local information base of an information query server for information query; in addition, for the distributed storage system (i.e. the preset distributed information base) corresponding to the information query server, the data information contained in the distributed storage system can be different from the local data information in the preset local information base, which is mainly based on the fact that the distributed storage system has independent data information capturing capability, for example, the distributed storage system can simulate the data acquisition mode of the preset local information base of the information query server, acquire the data information in the network through open source software and web crawler technology, and store the acquired data information in the distributed storage system, so that the data information in the distributed storage system is shared to the preset local information base of the information query server, and the data information amount of the information query service is improved.
In some embodiments, before the step of detecting whether the preset information base includes the target data corresponding to the information identifier to be searched, the step may include: A. acquiring data information conforming to a preset data rule from each network page; B. acquiring a target network address of a network page corresponding to each data message; and C1, when the history access record is detected to not contain the target network address, updating the acquired data information to a preset information base.
The preset data rule may include rules of format, type, etc. of the data information to be acquired, and may also include filtering rules of forbidden information. The preset data rule is used for screening the acquired data information. For example, the format and/or type of the searched data information are filtered according to the preset data rule, so that the data information conforming to the specific format and/or type is obtained; for another example, when the obtained data information is forbidden information, the searched forbidden information is filtered according to the preset data rule so as to obtain the data information which accords with health and green.
The target network address may be a logical address of a page where the data information is located in the network, for example, the target network address may be a uniform resource locator (Uniform Resoure Locator, URL).
In order to generate and/or expand data information in a preset information base in an information query server, the embodiment of the application can acquire the data information from each network page and update the acquired data information in the preset information base. Specifically, by searching the data information in each network page and screening the searched data information according to the preset data rule to collect the data information conforming to the preset data rule, the situation that some invalid data information or forbidden data information is added into a preset information base in the follow-up process can be avoided, and the healthy and green environment of the follow-up information query service is ensured. Furthermore, a target network address of a network page where the data information meeting the preset data rule is located is obtained, and whether the information searching record (i.e. the history access record) of the server contains the target network address is detected, so as to determine whether the data information meeting the preset data rule is searched, thereby further judging whether the data information meeting the preset data rule is stored in a preset information base. Further, on the one hand, if the information search record (i.e. the history access record) of the server includes the target network address, it is indicated that the data information which accords with the preset data rule currently has been searched in the history time, and the data information which accords with the preset data rule currently has been added into the preset information base, and at this time, in order to avoid the repetition of the data information, it is unnecessary to add the data information which accords with the preset data rule currently into the preset information base; on the other hand, if the information search record (i.e. the history access record) of the server does not include the target network address, it is indicated that the data information currently conforming to the preset data rule is not searched in the history time, and then the data information currently conforming to the preset data rule can be added into the preset information base. It should be noted that, in the above embodiment, the data information may be obtained by using open source software or web crawler technology, or other equivalent or similar manners, which is not limited herein.
In some embodiments, after the step "B" of obtaining the target network address of the network page corresponding to each data information "may further include: when the history access record is detected to contain the target network address, acquiring the history access time of the target network address from the history access record, and acquiring an access time interval according to the history access time; when the access time interval is greater than or equal to the preset time threshold, replacing target data information in the preset information base by using the acquired data information to obtain an updated preset information base.
In order to generate and/or expand data information in a preset information base in an information query server, the embodiment of the application can acquire the data information from each network page and update the acquired data information in the preset information base. Specifically, data information conforming to a preset data rule is obtained from each network page; acquiring a target network address of a network page corresponding to each piece of data information, detecting whether an information search record (i.e. a history access record) of a server contains the target network address or not to determine whether the data information which accords with a preset data rule is searched or not, and further judging whether a preset information base stores the data information which accords with the preset data rule or not; if the information search record (i.e. the history access record) of the server includes the target network address, it is indicated that the data information currently conforming to the preset data rule has been searched for in the history time, and the data information currently conforming to the preset data rule has been added to the preset information base. It should be noted that, since part of the data information in the network is generally updated iteratively over time, such as text information, game resources, installation packages, product introduction, etc., in order to ensure that the data information in the preset information base can be updated, in this embodiment, when detecting that the history access record includes the target network address, the history access time of the target network address is obtained from the history access record, and the current access time interval is determined according to the history access time, and then the current access time interval is compared with a preset time threshold to determine whether to update the data information meeting the preset data rule to the preset information base, where the preset time threshold may be 1 day, one week, 1 month, 3 months, 6 months, etc., and is not limited herein; on the one hand, when the current access time interval is determined to be smaller than the preset time threshold, the data information conforming to the preset data rule is added or updated to the preset information base in the recent time, and at this time, in order to avoid the repetition of the data information, the updating of the data information conforming to the preset data rule to the preset information base is stopped; on the other hand, when it is determined that the current access time interval is greater than or equal to the preset time threshold, it is indicated that the time interval for adding the corresponding data information last time is too long, and in order to update the mechanical energy of the related data information in the preset information base, the embodiment replaces the target data information in the preset information base with the acquired data information, so as to obtain the updated preset information base. Therefore, the data information in the preset information base can be ensured to be updated and replaced regularly, and the phenomenon of lower matching degree of the data information provided in the information query service due to too long time interval of the data information is avoided; therefore, through the mode, the data information in the preset information base can be updated regularly, and the information accuracy of the information query service provided later is improved.
In some embodiments, before the step of detecting whether the preset information base includes the target data corresponding to the information identifier to be searched, the step may further include:
(1) Detecting the number of information tasks contained in an interface task queue;
(2) When the number of the information tasks is detected to be larger than a preset task number threshold, acquiring data information corresponding to the information tasks through an information inquiry interface;
(3) And updating the acquired data information to a preset information base.
The interface task queue may be a task list that needs to call the information query interface to perform data query, where the interface task queue is used for registering a task of data information to be queried, that is, an information task. It should be noted that, the data information corresponding to the information task is information that needs to be queried in a targeted manner, and the data information corresponding to the information task may not be obtained directly from a web page, for example, rights may need to be obtained, or the data information may need to be obtained based on a third party collaboration protocol channel, or a direct obtaining manner is complex and cumbersome, so that the information task corresponding to the data information needs to be established, and the information task is added into the interface task queue of the embodiment of the present application, so that the query and the obtaining of the data information are sequentially performed based on the progress of the interface task queue. It should be noted that, the interface task queue corresponds to a preset duration, for example, the interface task queue belongs to a task queue of 1 day (24 hours).
In order to generate and/or expand data information in a preset information base in an information query server, for some data information needing to be acquired through a specific channel or a third party cooperation protocol mode, in the embodiment of the application, an information task is established in an interface task queue, and the data information corresponding to the information task is acquired through an information query interface, so that the acquired data information is added into the preset information base. Specifically, the number of information tasks in an interface task queue is detected; when the data of the information task is detected to be greater than or equal to the preset task number threshold, the fact that the interface task queue contains the information task to be executed is detected, if the preset task data threshold is set to be 1, when the number of the information task in the interface task queue is detected to be 1, the data information of the corresponding information task in the interface task queue is required to be inquired through a preset information inquiry interface, the inquired data information is obtained, and the obtained data information is updated to a preset information base. Therefore, the expansion of the data information in the preset information base is realized, the data information quantity in the preset information base is improved, and the availability and reliability of the subsequent information query service are improved.
In some embodiments, the "obtaining, through the information query interface, the data information corresponding to the information task" in step (2) may include:
acquiring available query times of an information query interface in a target period; when the available query times are detected to be smaller than the number of information tasks contained in the interface task queue, acquiring task time stamps of each information task, wherein the time stamps contain the generation time of corresponding task information; determining executable information tasks in a target period according to the available inquiry times and task time stamps; and acquiring data information corresponding to the executable information task through the information query interface.
The target period may be a remaining period within a preset period. It should be noted that, in the embodiment of the present application, the information query interface may be a service interface for acquiring data information from a third party service platform, and the number of times of calling the information query interface in the preset duration is limited, which is usually related to a third party collaboration protocol. For example, the third party collaboration protocol may include a total number of available queries of the information query interface by the information query server within a preset time period, for example, taking 1 day (24 hours) as an example of the preset time period, assuming that the total number of available queries of the information query interface within 1 day is 100 times, assuming that the remaining time period (i.e., the target time period) within the preset time period is 10 hours, and the number of called times of the information query interface is 40 times, the number of available queries of the information query interface within the target time period is: the number of available queries of the information query interface for the next 10 hours is 60. The above is merely an example, and specific values regarding the target period, the preset time period, the total number of available queries, the number of available queries, and the like are according to actual situations, and are not specifically limited herein. It should be noted that, each available query number of the information query interface may search for related data information once.
In order to ensure that the information tasks in the interface task queue can be sequentially executed, the embodiment of the application needs to determine the queriable times of the information query interface in the target period and determine the amount of the information tasks to be executed in the interface task queue so as to determine the executable information tasks in the interface task queue according to the queriable times of the information query interface in the target period. Specifically, the available query times of the information query interface in the target period are obtained, and the number of information tasks in the interface task queue is compared with the available query times of the information query interface; on the one hand, when the available query times are detected to be greater than or equal to the number of information tasks contained in the interface task queue, the current information task amount can be met by the current queriable times of the information query interface, so that the information tasks in the interface task queue can be sequentially or synchronously executed through the information query interface to respectively acquire data information corresponding to the information tasks; on the other hand, when the available query times are detected to be smaller than the number of information tasks contained in the interface task queue, the current information query times of the interface task queue cannot meet the current information task amount, at this time, a task time stamp of each information task in the interface task queue can be obtained, the task time stamp contains the generation time of corresponding task information, the information tasks executable in the target period are determined according to the current information query times and the task time stamp of each information task, and further, the data information corresponding to each executable information task is sequentially or synchronously queried through the information query interface so as to obtain the data information corresponding to each executable information task, and the data information corresponding to each executable information task is added into a preset information base. By the method, when the number of times of the information query interface which can be queried is limited, the information task with the earlier time stamp can be executed, and the data information corresponding to the information task is acquired through the information query interface, so that the information task which is established in advance is preferentially acquired, the condition that the preset information base lacks target data information is relieved, and the user experience on the information query service is improved.
In this embodiment of the present application, the data information in the preset information base may be extended by the above embodiments, so as to extend the data information amount of the preset information base (especially, the preset local information base), improve the information query service capability, and have reliability.
103. And if the fact that the preset information base does not contain the corresponding target information is detected, acquiring the calling times of the information query interface in the preset duration.
The information query interface is a query interface of other service information databases, and is used for the information query server in the embodiment of the application to acquire corresponding data information from the information databases of other service platforms, that is, the information query interface is an interface for acquiring data information from other service information databases by a preset information database.
In the embodiment of the application, an information inquiry request from a terminal is received, an information identifier to be searched carried in the information inquiry request is extracted, and whether target information corresponding to the information identifier to be searched is contained in a preset information base or not is detected; when the preset information base does not contain the target information corresponding to the information identification to be searched, the preset information base representing the information query server does not contain the data information corresponding to the target information in the historical time, and the target information needs to be acquired from the third-party service platform through the information query interface. In order to ensure that the target information corresponding to the information identifier to be searched can be searched through the information query interface within the preset duration, the embodiment of the application needs to acquire the calling times of the information query interface within the preset duration, namely the remaining using times of the information query interface within the preset duration, so as to conveniently determine whether the corresponding target information can be acquired through the information query interface within the preset duration according to the calling times of the information query interface. It should be noted that, once the information query interface is called, the related target information (data information) can be searched once.
For example, the third party collaboration protocol may include a total number of available queries of the information query interface by the information query server within a preset time period, for example, taking 1 day (24 hours) as an example of the preset time period, and assuming that the total number of invokable times of the information query interface within 1 day is 100 times, and the number of invocations of the information query interface is 80 times at present, the number of invocations of the information query interface within the preset time period is 20 times. The above is merely an example, and specific values of the preset duration, the total number of invokable times, the number of invokable times, and the like are determined according to actual situations, and are not specifically limited herein.
104. And if the calling times of the information query interface are detected to be smaller than the preset times threshold, querying the information identifier to be searched through the information query interface to obtain queried target information.
The preset time threshold may be a threshold for limiting the calling of the information query interface, where the preset time threshold corresponds to each preset duration, and the calling of the information query interface in each preset duration is limited. For example, the preset times threshold is set to 100, 200, etc., specifically, the preset times threshold may be set manually or automatically by reading parameters in the third party cooperation protocol.
In order to obtain target information corresponding to the information identifier to be searched, after the calling times of the information query interface in the preset time period are obtained, the calling times of the information query interface are compared with a preset time threshold value, and whether the target information corresponding to the information identifier to be searched is searched through the information query interface in the current preset time period is determined according to a comparison result.
On the one hand, when the number of times of calling the information query interface is detected to be smaller than the preset number of times threshold, the information query interface can be continuously called within a preset time period, at this time, the information query interface service can be started, communication connection between the Server of the established information query service and the servers of other service platforms is established, for example, communication connection is established based on a Server-Client (C/S) structure, and the information identifier to be searched is searched in (an information base of) other service platforms through the information query interface so as to acquire target information. The process of obtaining the target information may be: inquiring the information identifier to be searched through an information inquiry interface to obtain data information corresponding to the information identifier to be searched; updating data information corresponding to the information identifier to be searched to a preset information base to obtain an updated preset information base; and acquiring target information corresponding to the information identifier to be searched based on the updated preset information base.
On the other hand, after the step of comparing the number of times of calling the information query interface with the preset number of times threshold value, the method further includes: when the calling times of the information inquiry interface are detected to be greater than or equal to a preset times threshold value, adding the information mark to be searched into an interface task queue with the next preset time length; and inquiring the information identifier to be searched in the next interface task queue with preset duration through the information inquiry interface to obtain target information corresponding to the information identifier to be searched.
Specifically, in the preset duration, when the number of times of calling the information query interface reaches the preset number of times threshold, it is indicated that the number of times of calling the information query interface has reached the threshold corresponding to the third party cooperation protocol, at this time, the information task identified by the information to be searched may be established in the interface task queue of the next preset duration, so that, in the next preset duration, the data information corresponding to the information task identified by the information to be searched is queried through the information query interface, the queried data information is acquired, the data information is updated to a preset information base (such as a preset local information base), an updated preset information base is obtained, and the target information corresponding to the information identification to be searched is acquired through the updated preset information base.
In some embodiments, the step of querying, through the information query interface, the information identifier to be searched to obtain queried target information may include:
acquiring a first interface task sub-queue corresponding to an information query interface in a preset time period, wherein the preset time period is a unit time period in a preset time period; when the number of information tasks in the first interface task sub-queue reaches a preset task amount threshold of the information query interface, adding an information mark to be searched into a second interface task sub-queue of the next preset period; and inquiring the information identification to be searched in the second interface task sub-queue through the information inquiry interface.
The preset period may be a preset time or period, for example, the preset period may be 1 second, 10 seconds, 1 minute, etc.
The first interface task sub-queue may be an information task queue of the information query interface within the preset period, and may include one or more information tasks to be executed, where the number of information tasks to be executed in the interface task sub-queue is related to throughput of the information query interface. It should be noted that, the sub-queue of the interface task is a sub-queue in the sub-queue of the interface task, and the sub-queue of the interface task corresponds to a preset period, for example, the sub-queue of the interface task belongs to a task queue of 1 second.
The preset task amount threshold may be an information task amount threshold set for the information query interface, where the preset task amount threshold may represent a threshold of number of calls (or number of information tasks) allowed by the information query interface in each preset period. For example, assuming that the preset period is 1 second, the throughput of the information query interface is such that 10 accesses and data transmissions can be accommodated every 1 second, the number of information tasks in the first interface task sub-queue is typically not more than 10.
In order to ensure that the number of task information of information query in each preset period is not excessive, when a call instruction of an information query interface is received, the embodiment of the application firstly acquires a first interface task sub-queue corresponding to the information query interface in the preset period, acquires the number of information tasks contained in the first interface task sub-queue, compares the number of information tasks in the first interface task sub-queue with a preset task amount threshold of the information query interface, and determines whether to query data information corresponding to an information identifier to be searched through the information query interface in the preset period according to a comparison result. On the one hand, when the number of the information tasks in the first interface task sub-queue is detected to be smaller than the preset task number threshold of the information query interface, an information task corresponding to the information identifier to be searched is established in the first interface task sub-queue, and the information task corresponding to the information identifier to be searched in the first interface task sub-queue is executed through the information query interface so as to acquire target information corresponding to the information identifier to be searched. On the other hand, when the number of the information tasks in the first interface task sub-queue is detected to reach the preset task amount threshold of the information query interface, the information mark to be searched is added into a second interface task sub-queue of the next preset period, for example, an information task corresponding to the information mark to be searched is built in the second interface task sub-queue of one preset period, and in the next preset period, the information task corresponding to the information mark to be searched in the first interface task sub-queue is executed through the information query interface so as to acquire target information corresponding to the information mark to be searched.
By the method, the information task quantity in the interface task sub-queue of the information query interface in each preset time period is detected in real time, so that the information task quantity in each preset time period is smaller than the throughput of the information query interface, the risk that the information query server or other service platforms are blocked, delayed and even the system is running through the information query interface due to the high concurrent information task quantity is reduced, and reliability is achieved.
From the above, it can be seen that an information inquiry request is received, where the information inquiry request carries an information identifier to be searched; detecting whether a preset information base contains target information corresponding to an information identifier to be searched; if the fact that the preset information base does not contain corresponding target information is detected, the calling times of an information inquiry interface in the preset duration are obtained, and the information inquiry interface is an interface for obtaining information from other service information bases; and if the calling times of the information query interface are detected to be smaller than the preset times threshold, querying the information identifier to be searched through the information query interface to obtain queried target information. Therefore, the method and the device can obtain the target information from other service providers by detecting whether the target information corresponding to the information identification to be searched is contained in the preset information base or not, and when the target information cannot be searched, the information inquiry interface is called, so that inquiry service for providing full-ecological service data information is realized, the success rate of inquiring the information by a user is improved, and the user experience is enhanced.
In the embodiments of the present application, description will be made from the perspective of an information inquiry apparatus, which may be integrated in computer devices such as a terminal and a server in particular. Referring to fig. 3 and fig. 4, fig. 3 is a schematic step flow diagram of an information query method provided in an embodiment of the present application, and fig. 4 is a schematic scene flow diagram of the information query method provided in an embodiment of the present application, where, for ease of understanding, the embodiment will be described with reference to fig. 3 and fig. 4.
When a processor on the server executes a program corresponding to the information query method, the specific flow of the information query method is as follows:
201. and the server acquires data information conforming to a preset data rule from each network page.
The preset data rule may include rules of format, type, etc. of the data information to be acquired, and may also include filtering rules of forbidden information. The preset data rule is used for screening the acquired data information. For example, the format and/or type of the searched data information are filtered according to the preset data rule, so that the data information conforming to the specific format and/or type is obtained; for another example, when the obtained data information is forbidden information, the searched forbidden information is filtered according to the preset data rule so as to obtain the data information which accords with health and green.
The data information may be network resource information, for example, the data information may include text information, graphic information, game resource, installation package, product profile, video information, audio information, program, script, etc., which are only some examples, and the data information may also be any information available through network.
In order to generate and/or expand data information in a preset information base in an information query server, the embodiment of the application can acquire the data information from each network page. Specifically, by searching the data information in each network page and screening the searched data information according to the preset data rule to collect the data information conforming to the preset data rule, the situation that some invalid data information or forbidden data information is added into a preset information base in the follow-up process can be avoided, and the healthy and green environment of the follow-up information query service is ensured.
202. The server obtains the target network address of the network page corresponding to each data message.
The target network address may be a logical address of a page where the data information is located in the network, for example, the target network address may be a uniform resource locator (Uniform Resoure Locator, URL).
In this embodiment of the present application, after data information meeting a preset data rule is queried, a target network address of a network page where the data information meeting the preset data rule is located is obtained, and whether an information search record (i.e., a history access record) of a server includes the target network address is detected, so as to determine whether the data information meeting the preset data rule is searched currently, thereby further determining whether the preset information base includes the data information meeting the preset data rule.
203. And when the server detects that the history access record does not contain the target network address, updating the acquired data information to a preset information base.
The preset information base may be an information base containing data information acquired in advance, that is, a large amount of data information is stored in the preset information base. It should be noted that, the preset information base may structurally include a preset local information base and a preset distributed information base at the service server side.
The preset local information base can be a local database of a service server and is used for storing data information and other resources.
The preset distributed information base can be a database which is parallel or parallel to the preset local information base, and the sharing of data information can be realized between the preset distributed information base and the preset local information base. The preset distributed information base may be other databases in the information query service platform besides the local information base, for example, the preset distributed information base may be other distributed databases of the information query service platform.
In the implementation of the present application, if the information search record (i.e. the history access record) of the server does not include the target network address, it is indicated that the data information currently conforming to the preset data rule is not searched in the history time, and then the data information currently conforming to the preset data rule may be added into the preset information base.
On the other hand, if it is detected that the information search record (i.e., the history access record) of the server includes the target network address, which indicates that the data information currently conforming to the preset data rule has been searched for in the history time, and the data information currently conforming to the preset data rule has been added to the preset information base, the data information conforming to the preset data rule is not added to the preset information base.
It should be noted that, since part of data information in the network is generally updated iteratively over time, such as text information, game resources, installation packages, product introduction, etc., in order to ensure that data information in the preset information base can be updated, in the embodiment of the present application, when detecting that the history access record includes the target network address, the history access time of the target network address is obtained from the history access record, and the current access time interval is determined according to the history access time, and then the current access time interval is compared with a preset time threshold to determine whether to update the data information meeting the preset data rule to the preset information base, where the preset time threshold may be 1 day, one week, 1 month, 3 months, 6 months, etc., and the present application is not limited herein.
For example, when it is determined that the current access time interval is smaller than the preset time threshold, it is indicated that the data information conforming to the preset data rule has been added or updated to the preset information base in the recent time, and at this time, in order to avoid repetition of the data information, updating of the data information conforming to the preset data rule to the preset information base is stopped.
For another example, when it is determined that the current access time interval is greater than or equal to the preset time threshold, it is indicated that the time interval for adding the corresponding data information last time is too long, and in order to update the mechanical energy of the related data information in the preset information base, the embodiment replaces the target data information in the preset information base with the acquired data information, so as to obtain the updated preset information base. Therefore, the data information in the preset information base can be ensured to be updated and replaced regularly, and the phenomenon of lower matching degree of the data information provided in the information query service due to too long time interval of the data information is avoided; therefore, through the mode, the data information in the preset information base can be updated regularly, and the information accuracy of the information query service provided later is improved.
It should be noted that, in the embodiment of the present application, the data information may be obtained by using open source software or web crawler technology, or may be obtained by other equivalent or similar methods, which is not limited herein.
In addition, in the embodiment of the application, the data information can be acquired through other service platforms, and the implementation mode is mainly realized based on the information query interface, and the acquired data information is updated to the preset information base. The information query interface is a query interface of other service information databases, and is used for the information query server in the embodiment of the application to acquire corresponding data information from the information databases of other service platforms, that is, the information query interface is an interface for acquiring data information from other service information databases by a preset information database.
Specifically, in order to generate and/or expand data information in a preset information base in an information query server, for some data information needing to be acquired through a specific channel or a third party cooperation protocol mode, in the embodiment of the application, an information task is established in an interface task queue, and data information corresponding to the information task is acquired through an information query interface, so that the acquired data information is added into the preset information base.
By the method, the multi-source information base can be constructed, so that the query service of the full ecological business data information can be provided later.
204. And the terminal sends an information inquiry request to the server.
In the embodiment of the application, when the user has the information query requirement, the information query request containing the information identifier to be searched can be input or set through the application on the terminal or the web interface with the browser, so that the information query request is sent to the server through the terminal, and the target information returned from the server can be acquired later.
205. And the server receives the information inquiry request sent by the terminal.
Wherein the information inquiry requests the inquiry request sent by the user through the browser application or the application with the browser page, and the information inquiry request can reflect the intention or the requirement of the user when acquiring the data information.
It should be noted that, the information query request may carry an information identifier to be searched, where the information identifier to be searched may be an information identifier corresponding to the query request, and the data information required to be acquired by the user may be queried or matched through the information identifier.
In order to be able to efficiently learn about information query requests later, in the embodiment of the present application, whether there is an information query request may be actively queried every unit time. In this way, the information inquiry request received in real time is conveniently responded to later.
206. The server detects whether the preset information base contains target information corresponding to the information identification to be searched.
The target information may be network resource information, for example, the target information may include text information, graphic information, game resource, installation package, product profile, video information, audio information, program, script, etc., which are only some examples, and the target information may also be any information available through network.
In order to obtain the target information corresponding to the information query request, the embodiment of the application may respond to the information query request after receiving the information query request to find the corresponding target information. Specifically, an information identifier to be searched carried by an information inquiry request is obtained; detecting whether a preset information base contains target information corresponding to an information identifier to be searched; it can be understood that when it is detected that the preset information base includes the target information corresponding to the information identifier to be searched, the target information corresponding to the information identifier to be searched can be obtained from the preset information base. Therefore, the target information corresponding to the information query request can be obtained from the preset information base preferentially, the information obtaining frequency from the database of the third-party service platform is reduced, and the provided information query service cost is saved as much as possible.
207. And if the server detects that the preset information base does not contain the corresponding target information, acquiring the calling times of the information inquiry interface in the preset duration.
The target information may be network resource information, for example, the target information may include text information, graphic information, game resource, installation package, product profile, video information, audio information, program, script, etc., which are only some examples, and the target information may also be any information available through network.
Specifically, when it is detected that the preset information base does not include the target information corresponding to the information identifier to be searched, the preset information base representing the information query server does not include the data information corresponding to the target information in the history time, and at this time, the target information needs to be acquired from the third party service platform through the information query interface. In order to ensure that the target information corresponding to the information identifier to be searched can be searched through the information query interface within the preset duration, the embodiment of the application needs to acquire the calling times of the information query interface within the preset duration, namely the remaining using times of the information query interface within the preset duration, so as to conveniently determine whether the corresponding target information can be acquired through the information query interface within the preset duration according to the calling times of the information query interface. It should be noted that, once the information query interface is called, the related target information (data information) can be searched once.
For example, the third party collaboration protocol may include a total number of available queries of the information query interface by the information query server within a preset time period, for example, taking 1 day (24 hours) as an example of the preset time period, and assuming that the total number of invokable times of the information query interface within 1 day is 100 times, and the number of invocations of the information query interface is 80 times at present, the number of invocations of the information query interface within the preset time period is 20 times. The above is merely an example, and specific values of the preset duration, the total number of invokable times, the number of invokable times, and the like are determined according to actual situations, and are not specifically limited herein.
208. And if the server detects that the calling times of the information query interface are smaller than the preset times threshold, querying the information identifier to be searched through the information query interface to obtain queried target information.
The preset time threshold may be a threshold for limiting the calling of the information query interface, where the preset time threshold corresponds to each preset duration, and the calling of the information query interface in each preset duration is limited. For example, the preset times threshold is set to 100, 200, etc., specifically, the preset times threshold may be set manually or automatically by reading parameters in the third party cooperation protocol.
In order to obtain target information corresponding to the information identifier to be searched, after the calling times of the information query interface in the preset time period are obtained, the calling times of the information query interface are compared with a preset time threshold value, and whether the target information corresponding to the information identifier to be searched is searched through the information query interface in the current preset time period is determined according to a comparison result.
Specifically, when the number of times of calling the information query interface is detected to be smaller than the preset number of times threshold, the information query interface can be continuously called within a preset time period, at this time, the information query interface service can be started, communication connection between the Server of the established information query service and the servers of other service platforms is established, for example, communication connection is established based on a Server-Client (C/S) structure, and an information identifier to be searched is searched in (an information base of) other service platforms through the information query interface so as to acquire target information. The process of obtaining the target information may be: inquiring the information identifier to be searched through an information inquiry interface to obtain data information corresponding to the information identifier to be searched; updating data information corresponding to the information identifier to be searched to a preset information base to obtain an updated preset information base; and acquiring target information corresponding to the information identifier to be searched based on the updated preset information base.
On the other hand, in the preset duration, when the calling times of the information query interface reach the preset times threshold, it is indicated that the calling times of the information query interface reach the threshold corresponding to the third party cooperation protocol, at this time, the information task of the information identifier to be searched can be established in the interface task queue of the next preset duration, so that when the next preset duration is reached, the data information corresponding to the information task of the information identifier to be searched is queried through the information query interface, the queried data information is acquired, the data information is updated to a preset information base (such as a preset local information base), an updated preset information base is obtained, and the target information corresponding to the information identifier to be searched is acquired through the updated preset information base.
Further, in order to ensure that the number of task information queried in each preset time period in the preset time period is not exceeded, for example, in order to ensure that the number of task information queried in a certain moment in a day (preset time period) or in a time period (each preset time period) is not exceeded, when a call instruction of an information query interface is received, the embodiment of the application firstly acquires a first interface task sub-queue corresponding to the information query interface in the preset time period, acquires the number of information tasks contained in the first interface task sub-queue, and compares the number of information tasks in the first interface task sub-queue with a preset task number threshold of the information query interface, so as to determine whether to query data information corresponding to an information identifier to be searched through the information query interface in the preset time period according to a comparison result. On the one hand, when the number of the information tasks in the first interface task sub-queue is detected to be smaller than the preset task number threshold of the information query interface, an information task corresponding to the information identifier to be searched is established in the first interface task sub-queue, and the information task corresponding to the information identifier to be searched in the first interface task sub-queue is executed through the information query interface so as to acquire target information corresponding to the information identifier to be searched. On the other hand, when the number of the information tasks in the first interface task sub-queue is detected to reach the preset task amount threshold of the information query interface, the information mark to be searched is added into a second interface task sub-queue of the next preset period, for example, an information task corresponding to the information mark to be searched is built in the second interface task sub-queue of one preset period, and in the next preset period, the information task corresponding to the information mark to be searched in the first interface task sub-queue is executed through the information query interface so as to acquire target information corresponding to the information mark to be searched.
Through the method, the target information corresponding to the information identifier to be searched can be obtained, and meanwhile, the data information quantity of the preset information base is expanded; in addition, the information task quantity of the information query interface in each preset time length and each preset time period is detected in real time, so that the information task quantity in each preset time length and each preset time period is ensured to be smaller than the throughput of the information query interface, the risk that the information query server or other service platforms are blocked, delayed and even the system runs through the information query interface due to the high concurrent information task quantity is reduced, and reliability is achieved.
209. The server returns the target information to the terminal for display at the terminal.
In the embodiment of the application, after obtaining the target information corresponding to the information identifier to be searched, the server returns the target information to the terminal to display the target information on the terminal, for example, a browser interface of the terminal or an application with a browser page function, so that the user body is improved.
From the above, the embodiment of the application can receive an information query request, where the information query request carries an information identifier to be searched; detecting whether a preset information base contains target information corresponding to an information identifier to be searched; if the fact that the preset information base does not contain corresponding target information is detected, the calling times of an information inquiry interface in the preset duration are obtained, and the information inquiry interface is an interface for obtaining information from other service information bases; and if the calling times of the information query interface are detected to be smaller than the preset times threshold, querying the information identifier to be searched through the information query interface to obtain queried target information. Therefore, the method and the device can obtain the target information from other service providers by detecting whether the target information corresponding to the information identification to be searched is contained in the preset information base or not, and when the target information cannot be searched, the information inquiry interface is called, so that inquiry service for providing full-ecological service data information is realized, the success rate of inquiring the information by a user is improved, and the user experience is enhanced.
The specific implementation of each operation may be referred to the previous embodiments, and will not be described herein.
In order to better implement the above method, the embodiment of the application also provides an information query device, which can be integrated in a computer device, such as a server.
For example, as shown in fig. 5, the information inquiry apparatus may include a receiving unit 501, a detecting unit 502, an acquiring unit 503, and an inquiring unit 504.
A receiving unit 501, configured to receive an information query request, where the information query request carries an information identifier to be searched;
the detection unit 502 is configured to detect whether a preset information base includes target information corresponding to an information identifier to be searched;
an obtaining unit 503, configured to obtain the number of times of calling the information query interface in the preset duration if it is detected that the preset information base does not include the corresponding target information, where the information query interface is an interface for obtaining information from other service information bases;
and the query unit 504 is configured to query the information identifier to be searched through the information query interface if the number of times of calling the information query interface is detected to be smaller than the preset number of times threshold, so as to obtain queried target information.
In some embodiments, the query unit 504 is further configured to: acquiring a first interface task sub-queue corresponding to an information query interface in a preset time period, wherein the preset time period is a unit time period in a preset time period; when the number of information tasks in the first interface task sub-queue reaches a preset task amount threshold of the information query interface, adding an information mark to be searched into a second interface task sub-queue of the next preset period; and inquiring the information identification to be searched in the second interface task sub-queue through the information inquiry interface.
In some embodiments, the apparatus further comprises an updating unit for: acquiring data information conforming to a preset data rule from each network page; acquiring a target network address of a network page corresponding to each data message; and when the history access record is detected not to contain the target network address, updating the acquired data information to a preset information base.
In some embodiments, the updating unit is further configured to: when the history access record is detected to contain the target network address, acquiring the history access time of the target network address from the history access record, and acquiring an access time interval according to the history access time; when the access time interval is greater than or equal to the preset time threshold, replacing target data information in the preset information base by using the acquired data information to obtain an updated preset information base.
In some embodiments, the updating unit is further configured to: detecting the number of information tasks contained in an interface task queue; when the number of the information tasks is detected to be larger than a preset task number threshold, acquiring data information corresponding to the information tasks through an information inquiry interface; and updating the acquired data information to a preset information base.
In some embodiments, the updating unit is further configured to: acquiring available query times of an information query interface in a target period; when the available query times are detected to be smaller than the number of information tasks contained in the interface task queue, acquiring task time stamps of each information task, wherein the time stamps contain the generation time of corresponding task information; determining executable information tasks in a target period according to the available inquiry times and task time stamps; and acquiring data information corresponding to the executable information task through the information query interface.
In some embodiments, the detection unit is further configured to: detecting whether a preset local information base contains target information corresponding to an information identifier to be searched; when the fact that the preset local information base does not contain corresponding target information is detected, whether the preset distributed information base contains target information corresponding to the information identification to be searched or not is detected;
the query unit is further configured to: when the fact that the preset distributed information base contains corresponding target information is detected, updating the target information in the preset distributed information base to a preset local information base to obtain an updated preset local information base; and acquiring target information corresponding to the information identifier to be searched from the updated preset local information base.
In some embodiments, the query unit 504 is further configured to: when the calling times of the information inquiry interface are detected to be greater than or equal to a preset times threshold value, adding the information mark to be searched into an interface task queue with the next preset time length; and inquiring the information identifier to be searched in the next interface task queue with preset duration through the information inquiry interface to obtain target information corresponding to the information identifier to be searched.
As can be seen from the above, in the embodiment of the present application, the receiving unit 501 may receive an information query request, where the information query request carries an information identifier to be searched; detecting whether a preset information base contains target information corresponding to the information identifier to be searched or not through a detection unit 502; the obtaining unit 503 is configured to obtain the number of times of calling the information query interface in the preset duration if it is detected that the preset information base does not include the corresponding target information, where the information query interface is an interface for obtaining information from other service information bases; the query unit 504 is configured to query, through the information query interface, the information identifier to be searched to obtain queried target information if it is detected that the number of times of invoking the information query interface is smaller than a preset number of times threshold. Therefore, the method and the device can obtain the target information from other service providers by detecting whether the target information corresponding to the information identification to be searched is contained in the preset information base or not, and when the target information cannot be searched, the information inquiry interface is called, so that inquiry service for providing full-ecological service data information is realized, the success rate of inquiring the information by a user is improved, and the user experience is enhanced.
The embodiment of the application further provides a computer device, as shown in fig. 6, which shows a schematic structural diagram of the computer device according to the embodiment of the application, specifically:
the computer device may include one or more processing cores 'processors 601, one or more computer-readable storage media's memory 602, power supply 603, and input unit 604, among other components. Those skilled in the art will appreciate that the computer device structure shown in FIG. 6 is not limiting of the computer device and may include more or fewer components than shown, or may be combined with certain components, or a different arrangement of components. Wherein:
processor 601 is the control center of the computer device and connects the various parts of the overall computer device using various interfaces and lines to perform various functions and process data of the computer device by running or executing software programs and/or modules stored in memory 602 and invoking data stored in memory 602. Optionally, the processor 601 may include one or more processing cores; preferably, the processor 601 may integrate an application processor and a modem processor, wherein the application processor primarily handles operating systems, user interfaces, applications, etc., and the modem processor primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 601.
The memory 602 may be used to store software programs and modules, and the processor 601 may execute various functional applications and information queries by executing the software programs and modules stored in the memory 602. The memory 602 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data created according to the use of the computer device, etc. In addition, the memory 602 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 602 may also include a memory controller to provide access to the memory 602 by the processor 601.
The computer device further includes a power supply 603 for powering the various components, preferably, the power supply 603 can be logically coupled to the processor 601 through a power management system, such that functions of managing charging, discharging, and power consumption are performed by the power management system. The power supply 603 may also include one or more of any components, such as a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
The computer device may also include an input unit 604, which input unit 604 may be used to receive entered numerical or character information and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the computer device may further include a display unit or the like, which is not described herein. In particular, in this embodiment, the processor 601 in the computer device loads executable files corresponding to the processes of one or more application programs into the memory 602 according to the following instructions, and the processor 601 executes the application programs stored in the memory 602, so as to implement various functions as follows:
receiving an information inquiry request, wherein the information inquiry request carries an information identifier to be searched; detecting whether a preset information base contains target information corresponding to an information identifier to be searched; if the fact that the preset information base does not contain corresponding target information is detected, the calling times of an information inquiry interface in the preset duration are obtained, and the information inquiry interface is an interface for obtaining information from other service information bases; and if the calling times of the information query interface are detected to be smaller than the preset times threshold, querying the information identifier to be searched through the information query interface to obtain queried target information.
The specific implementation of each operation may be referred to the previous embodiments, and will not be described herein.
From the above, the embodiment of the application can receive an information query request, where the information query request carries an information identifier to be searched; detecting whether a preset information base contains target information corresponding to an information identifier to be searched; if the fact that the preset information base does not contain corresponding target information is detected, the calling times of an information inquiry interface in the preset duration are obtained, and the information inquiry interface is an interface for obtaining information from other service information bases; and if the calling times of the information query interface are detected to be smaller than the preset times threshold, querying the information identifier to be searched through the information query interface to obtain queried target information. Therefore, the method and the device can obtain the target information from other service providers by detecting whether the target information corresponding to the information identification to be searched is contained in the preset information base or not, and when the target information cannot be searched, the information inquiry interface is called, so that inquiry service for providing full-ecological service data information is realized, the success rate of inquiring the information by a user is improved, and the user experience is enhanced.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor.
To this end, embodiments of the present application provide a computer readable storage medium having stored therein a plurality of instructions capable of being loaded by a processor to perform steps in any of the information query methods provided by embodiments of the present application. For example, the instructions may perform the steps of:
receiving an information inquiry request, wherein the information inquiry request carries an information identifier to be searched; detecting whether a preset information base contains target information corresponding to an information identifier to be searched; when the fact that the preset information base does not contain corresponding target information is detected, the calling times of an information inquiry interface in the preset duration are obtained, wherein the information inquiry interface is an interface for obtaining information from other service information bases; and inquiring the information identification to be searched through the information inquiry interface when the calling times of the information inquiry interface are detected to be smaller than the preset times threshold value, so as to obtain inquired target information.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Wherein the computer-readable storage medium may comprise: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
The present application also provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the information query method provided in the various alternative implementations of the above embodiments.
Because the instructions stored in the computer readable storage medium may execute the steps in any information query method provided in the embodiments of the present application, the beneficial effects that any information query method provided in the embodiments of the present application may be achieved are described in detail in the previous embodiments, which are not described herein.
The foregoing has described in detail the methods, apparatuses and computer readable storage medium for querying information provided by the embodiments of the present application, and specific examples have been applied to illustrate the principles and embodiments of the present application, where the foregoing examples are only used to help understand the methods and core ideas of the present application; meanwhile, as those skilled in the art will vary in the specific embodiments and application scope according to the ideas of the present application, the contents of the present specification should not be construed as limiting the present application in summary.

Claims (8)

1. An information query method, comprising:
receiving an information inquiry request, wherein the information inquiry request carries an information identifier to be searched;
detecting whether a preset information base contains target information corresponding to the information identifier to be searched;
if the fact that the preset information base does not contain corresponding target information is detected, acquiring the calling times of an information inquiry interface in a preset duration, wherein the information inquiry interface is an inquiry interface of other service information bases;
if the calling times of the information inquiry interface are detected to be smaller than a preset times threshold value, a first interface task sub-queue corresponding to the information inquiry interface in a preset time period is obtained, wherein the preset time period is a unit time period in the preset time period;
when the number of information tasks in the first interface task sub-queue reaches a preset task amount threshold of the information query interface, adding the information mark to be searched into a second interface task sub-queue of a next preset period, wherein the preset task amount threshold is a threshold set according to the throughput of the information query interface;
inquiring the information mark to be searched in the second interface task sub-queue through an information inquiry interface to obtain inquired target information;
When the calling times of the information inquiry interface are detected to be greater than or equal to a preset times threshold value, adding the information mark to be searched into an interface task queue of the next preset time length;
and inquiring the information identifier to be searched in the next interface task queue with preset duration through the information inquiry interface to obtain target information corresponding to the information identifier to be searched.
2. The method according to claim 1, wherein before detecting whether the preset information base includes the target data corresponding to the information identifier to be searched, the method comprises:
acquiring data information conforming to a preset data rule from each network page;
acquiring a target network address of a network page corresponding to each data message;
and when the history access record is detected not to contain the target network address, updating the acquired data information to the preset information base.
3. The method as recited in claim 2, further comprising:
when the historical access record contains the target network address, acquiring the historical access time of the target network address from the historical access record, and acquiring an access time interval according to the historical access time;
And when the access time interval is greater than or equal to a preset time threshold, replacing the target data information in the preset information base by using the acquired data information to obtain an updated preset information base.
4. The method according to claim 1, wherein before detecting whether the preset information base includes the target data corresponding to the information identifier to be searched, the method comprises:
detecting the number of information tasks contained in an interface task queue;
when the number of the information tasks is detected to be greater than or equal to a preset task number threshold, acquiring data information corresponding to the information tasks through an information inquiry interface;
and updating the acquired data information to the preset information base.
5. The method according to claim 4, wherein the obtaining, through an information query interface, the data information corresponding to the information task includes:
acquiring available query times of the information query interface in a target period;
when the available query times are detected to be smaller than the number of information tasks contained in the interface task queue, acquiring task time stamps of each information task, wherein the time stamps contain the generation time of corresponding task information;
Determining executable information tasks in the target period according to the available inquiry times and task time stamps;
and acquiring data information corresponding to the executable information task through the information query interface.
6. The method according to claim 1, wherein the preset information base includes a preset local information base and a preset distributed information base, and the detecting whether the preset information base includes the target information corresponding to the information identifier to be searched includes:
detecting whether the preset local information base contains target information corresponding to the information identifier to be searched;
when the fact that the preset local information base does not contain corresponding target information is detected, whether the preset distributed information base contains the target information corresponding to the information identification to be searched or not is detected;
after detecting whether the preset information base contains the target information corresponding to the information identifier to be searched, the method further comprises the following steps:
when the preset distributed information base is detected to contain corresponding target information, updating the target information in the preset distributed information base to the preset local information base to obtain an updated preset local information base;
And acquiring target information corresponding to the information identifier to be searched from the updated preset local information base.
7. An information inquiry apparatus, characterized by comprising:
the receiving unit is used for receiving an information inquiry request, wherein the information inquiry request carries an information identifier to be searched;
the detection unit is used for detecting whether the preset information base contains target information corresponding to the information identifier to be searched;
the acquisition unit is used for acquiring the calling times of the information inquiry interface in the preset duration if the preset information base does not contain corresponding target information, wherein the information inquiry interface is an interface for acquiring information from other service information bases;
the query unit is used for acquiring a first interface task sub-queue corresponding to the information query interface in a preset period if the number of times of calling the information query interface is detected to be smaller than a preset number of times threshold, wherein the preset period is a unit period in the preset duration;
when the number of information tasks in the first interface task sub-queue reaches a preset task amount threshold of the information query interface, adding the information mark to be searched into a second interface task sub-queue of a next preset period, wherein the preset task amount threshold is a threshold set according to the throughput of the information query interface;
Inquiring the information mark to be searched in the second interface task sub-queue through an information inquiry interface to obtain inquired target information;
when the calling times of the information inquiry interface are detected to be greater than or equal to a preset times threshold value, adding the information mark to be searched into an interface task queue of the next preset time length;
and inquiring the information identifier to be searched in the next interface task queue with preset duration through the information inquiry interface to obtain target information corresponding to the information identifier to be searched.
8. A computer readable storage medium, characterized in that the computer readable storage medium is computer readable and stores a plurality of instructions adapted to be loaded by a processor for performing the steps in the information query method of any of claims 1 to 6.
CN202111057516.6A 2021-09-09 2021-09-09 Information query method, device and computer readable storage medium Active CN113836405B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111057516.6A CN113836405B (en) 2021-09-09 2021-09-09 Information query method, device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111057516.6A CN113836405B (en) 2021-09-09 2021-09-09 Information query method, device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN113836405A CN113836405A (en) 2021-12-24
CN113836405B true CN113836405B (en) 2024-03-12

Family

ID=78958891

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111057516.6A Active CN113836405B (en) 2021-09-09 2021-09-09 Information query method, device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113836405B (en)

Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101231661A (en) * 2008-02-19 2008-07-30 上海估家网络科技有限公司 Method and system for digging object grade knowledge
CN102402592A (en) * 2011-11-04 2012-04-04 同辉佳视(北京)信息技术股份有限公司 Information collecting method based on webpage data mining
CN102831252A (en) * 2012-09-21 2012-12-19 北京奇虎科技有限公司 Method and device for updating index database and search method and system
CN103916444A (en) * 2013-01-07 2014-07-09 上海博路信息技术有限公司 Method for displaying number information through cloud model
CN107070807A (en) * 2017-04-18 2017-08-18 北京思特奇信息技术股份有限公司 Global traffic control method and system that a kind of distributed environment lower interface is called
CN107741937A (en) * 2016-09-13 2018-02-27 腾讯科技(深圳)有限公司 A kind of data query method and device
CN108170843A (en) * 2018-01-17 2018-06-15 百度在线网络技术(北京)有限公司 For obtaining the method and apparatus of data
CN108664613A (en) * 2018-05-11 2018-10-16 中国平安人寿保险股份有限公司 Data query method, apparatus, computer equipment and storage medium
CN109194584A (en) * 2018-08-13 2019-01-11 中国平安人寿保险股份有限公司 A kind of flux monitoring method, device, computer equipment and storage medium
WO2019019644A1 (en) * 2017-07-24 2019-01-31 深圳壹账通智能科技有限公司 Push server allocation method and apparatus, and computer device and storage medium
CN110138669A (en) * 2019-04-15 2019-08-16 中国平安人寿保险股份有限公司 Interface access processing method, device, computer equipment and storage medium
WO2019178979A1 (en) * 2018-03-21 2019-09-26 平安科技(深圳)有限公司 Method for querying report data, apparatus, storage medium and server
CN110858843A (en) * 2018-08-22 2020-03-03 重庆小雨点小额贷款有限公司 Service request processing method and device and computer readable storage medium
CN111652685A (en) * 2020-06-05 2020-09-11 腾讯科技(深圳)有限公司 Information processing method, information processing device, computer equipment and computer readable storage medium
CN111931021A (en) * 2020-05-22 2020-11-13 淮阴工学院 Self-adaptive construction method of engineering national standard database based on data mining
CN112579898A (en) * 2020-12-17 2021-03-30 北京金山云网络技术有限公司 Enterprise information management method and device and server
CN113282630A (en) * 2021-06-22 2021-08-20 中国平安财产保险股份有限公司 Data query method and device based on interface switching

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11403356B2 (en) * 2019-04-16 2022-08-02 International Business Machines Corporation Personalizing a search of a search service
US11403354B2 (en) * 2019-04-16 2022-08-02 International Business Machines Corporation Managing search queries of a search service
CN111782872B (en) * 2020-06-30 2023-08-08 北京百度网讯科技有限公司 Query method, query device, electronic equipment and storage medium

Patent Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101231661A (en) * 2008-02-19 2008-07-30 上海估家网络科技有限公司 Method and system for digging object grade knowledge
CN102402592A (en) * 2011-11-04 2012-04-04 同辉佳视(北京)信息技术股份有限公司 Information collecting method based on webpage data mining
CN102831252A (en) * 2012-09-21 2012-12-19 北京奇虎科技有限公司 Method and device for updating index database and search method and system
CN103916444A (en) * 2013-01-07 2014-07-09 上海博路信息技术有限公司 Method for displaying number information through cloud model
CN107741937A (en) * 2016-09-13 2018-02-27 腾讯科技(深圳)有限公司 A kind of data query method and device
CN107070807A (en) * 2017-04-18 2017-08-18 北京思特奇信息技术股份有限公司 Global traffic control method and system that a kind of distributed environment lower interface is called
WO2019019644A1 (en) * 2017-07-24 2019-01-31 深圳壹账通智能科技有限公司 Push server allocation method and apparatus, and computer device and storage medium
CN108170843A (en) * 2018-01-17 2018-06-15 百度在线网络技术(北京)有限公司 For obtaining the method and apparatus of data
WO2019178979A1 (en) * 2018-03-21 2019-09-26 平安科技(深圳)有限公司 Method for querying report data, apparatus, storage medium and server
CN108664613A (en) * 2018-05-11 2018-10-16 中国平安人寿保险股份有限公司 Data query method, apparatus, computer equipment and storage medium
CN109194584A (en) * 2018-08-13 2019-01-11 中国平安人寿保险股份有限公司 A kind of flux monitoring method, device, computer equipment and storage medium
CN110858843A (en) * 2018-08-22 2020-03-03 重庆小雨点小额贷款有限公司 Service request processing method and device and computer readable storage medium
CN110138669A (en) * 2019-04-15 2019-08-16 中国平安人寿保险股份有限公司 Interface access processing method, device, computer equipment and storage medium
CN111931021A (en) * 2020-05-22 2020-11-13 淮阴工学院 Self-adaptive construction method of engineering national standard database based on data mining
CN111652685A (en) * 2020-06-05 2020-09-11 腾讯科技(深圳)有限公司 Information processing method, information processing device, computer equipment and computer readable storage medium
CN112579898A (en) * 2020-12-17 2021-03-30 北京金山云网络技术有限公司 Enterprise information management method and device and server
CN113282630A (en) * 2021-06-22 2021-08-20 中国平安财产保险股份有限公司 Data query method and device based on interface switching

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
基于Web Service的查询检索服务;王冠;李士雨;;计算机与应用化学(第08期);全文 *
基于异构数据库的海量数据查询系统设计;王言通;魏青;;信息通信(04);全文 *
王冠 ; 李士雨 ; .基于Web Service的查询检索服务.计算机与应用化学.2006,(第08期),全文. *

Also Published As

Publication number Publication date
CN113836405A (en) 2021-12-24

Similar Documents

Publication Publication Date Title
KR101863981B1 (en) Using text messages to interact with spreadsheets
CN107277029B (en) Remote procedure call method and device and computer equipment
CN109582470B (en) Data processing method and data processing device
US20220284020A1 (en) Data processing method, apparatus, and system
CN112507263A (en) Page loading updating method and device, electronic equipment and storage medium
CN107633080B (en) User task processing method and device
CN113836405B (en) Information query method, device and computer readable storage medium
CN116028696A (en) Resource information acquisition method and device, electronic equipment and storage medium
CN114745146B (en) Jump interception method, apparatus, readable storage medium and device
CN115563160A (en) Data processing method, data processing device, computer equipment and computer readable storage medium
CN112260933B (en) Communication method, communication device, electronic equipment and medium
CN112380411B (en) Sensitive word processing method, device, electronic equipment, system and storage medium
CN115344644A (en) Data synchronization method and device, electronic equipment and computer readable storage medium
CN112306797A (en) Embedded point information reporting method and device, storage medium and electronic equipment
CN112579682A (en) Data model change notification method and device, electronic device and storage medium
CN113568687A (en) Method for displaying Web page, related equipment and computer readable storage medium
CN111464574A (en) Calling, loading, registering and managing method and route, server, node and medium
CN113747100B (en) Audio and video call method and device, storage medium and electronic equipment
CN113890872B (en) Data set uploading method and device, electronic equipment and storage medium
CN110489469B (en) Data transmission method, device, computer equipment and storage medium
CN117407186A (en) Task execution method, device, electronic equipment and computer storage medium
CN117411830A (en) Request response method, request response device, gateway equipment and computer storage medium
CN113849751A (en) Data caching method and device, electronic equipment and computer readable storage medium
CN113783903A (en) Method and system for realizing shared display
CN117081872A (en) Conference call method, conference call device, electronic equipment and computer storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant