CN110377654B - Data request processing method and device, electronic equipment and computer-readable storage medium - Google Patents
Data request processing method and device, electronic equipment and computer-readable storage medium Download PDFInfo
- Publication number
- CN110377654B CN110377654B CN201910656324.3A CN201910656324A CN110377654B CN 110377654 B CN110377654 B CN 110377654B CN 201910656324 A CN201910656324 A CN 201910656324A CN 110377654 B CN110377654 B CN 110377654B
- Authority
- CN
- China
- Prior art keywords
- data
- subdata
- target
- party
- request
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
- G06F16/252—Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The disclosure discloses a data request processing method and device, electronic equipment and a computer-readable storage medium. The method comprises the following steps: determining a data query range according to a data request, wherein the data request is used for acquiring data from a third party; generating a plurality of subdata requests according to the query range and the interface range of the third party, wherein the query range of the subdata requests is matched with the interface range of the third party; acquiring target data from a third party according to the plurality of sub-data requests; and outputting the acquired target data. According to the data request processing method and device, after the data query range of the data request is determined, the data request can be split according to the interface range of the third party, a plurality of subdata requests are obtained, each subdata request is matched with the interface range of the third party, the problem that a feedback result is abnormal due to the fact that the query range is inconsistent with the interface range can be avoided, data request processing efficiency is improved, and resource utilization rate is improved.
Description
Technical Field
The present disclosure relates to data processing technologies, and in particular, to a method and an apparatus for processing a data request, an electronic device, and a computer-readable storage medium.
Background
With the development of information technology, data interaction among multiple platforms is more and more. The data interaction among multiple parties has the condition that a user initiates a request to a third-party application through a certain application.
When a third-party system is used for searching, the number of the third-party system is limited when the local system specifies range searching. For example, a third party system may be used to perform pinyin fuzzy searches and only 10000 ids may be searched at a time. However, when the user initiates the pinyin fuzzy search, the user does not know the limit of the search quantity, so that when the user initiates an inquiry request, the inquiry range exceeds 10000 ids, such as 30000id, in some cases. At this time, the third-party system can only feed back results corresponding to 10000 ids, or feed back results of abnormal query, resulting in abnormal query results.
Therefore, in the current scheme, when a user initiates a data query request, data returned by a third-party application is often abnormal, so that query failure is caused, and the data request processing efficiency is low.
Disclosure of Invention
The present disclosure provides a data request processing method, device, electronic device and computer-readable storage medium, so as to improve data request processing efficiency and improve resource utilization rate.
In a first aspect, an embodiment of the present disclosure provides a method for processing a data request, including:
determining a data query range according to a data request, wherein the data request is used for acquiring data from a third party;
generating a plurality of subdata requests according to the query range and the interface range of the third party, wherein the query range of the subdata requests is matched with the interface range of the third party;
acquiring target data from a third party according to the plurality of subdata requests;
and outputting the acquired target data.
In a second aspect, an embodiment of the present disclosure provides a device for processing a data request, including:
the query range determining module is used for determining a data query range according to a data request, and the data request is used for acquiring data from a third party;
the subdata request generating module is used for generating a plurality of subdata requests according to the query range determined by the query range determining module and the interface range of the third party, and the query range of the subdata requests is matched with the interface range of the third party;
the target data acquisition module is used for acquiring target data from a third party according to the plurality of sub data requests generated by the sub data request generation module;
and the output module is used for outputting the acquired target data.
In a third aspect, an embodiment of the present disclosure further provides an electronic device, which includes a storage device, a processing device, and a computer program stored on the storage device and executable on the processing device, where the processing device implements the processing method for the data request shown in the first aspect when executing the program.
In a fourth aspect, the disclosed embodiments also provide a computer-readable storage medium, on which a computer program is stored, which when executed by a processor, implements the method for processing data requests as shown in the first aspect.
When a data request is received, determining a data query range according to the data request, and generating a plurality of subdata requests according to the query range and an interface range of a third party; acquiring target data from a third party according to the plurality of subdata requests; and outputting the acquired target data. Compared with the situation that the data request is directly forwarded to the third party and the feedback result is abnormal, the data request can be split according to the interface range of the third party after the data query range of the data request is determined, a plurality of subdata requests are obtained, each subdata request is matched with the interface range of the third party, the problem that the feedback result is abnormal due to the fact that the query range is inconsistent with the interface range can be further avoided, the data request processing efficiency is improved, and the resource utilization rate is improved.
Drawings
FIG. 1 is a system architecture diagram in an embodiment of the disclosure;
FIG. 2 is another system architecture diagram in an embodiment of the present disclosure;
FIG. 3 is a flow chart of a method of processing a data request in an embodiment of the disclosure;
FIG. 4 is a schematic diagram of a storage space in an embodiment of the disclosure;
FIG. 5 is a flow chart of another method of processing a data request in an embodiment of the present disclosure;
FIG. 6 is a block diagram of a data request processing device in an embodiment of the disclosure;
fig. 7 is a schematic structural diagram of an electronic device in an embodiment of the disclosure.
Detailed Description
The present disclosure is described in further detail below with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the disclosure and are not limiting of the disclosure. In the following embodiments, optional features and examples are provided in each embodiment, and various features described in the embodiments may be combined to form a plurality of alternatives, and each numbered embodiment should not be regarded as only one technical solution. It should be further noted that, for the convenience of description, only some of the structures relevant to the present disclosure are shown in the drawings, not all of them.
The embodiment of the disclosure provides a data request processing method, which can split a data request according to a data query range of the data request and an interface range of a third party after triggering the data request, obtain a plurality of sub-data requests, and acquire and output target data based on the sub-data requests. The subdata request received by the third party is matched with the interface range of the third party, the success rate of the data request is improved, and the processing efficiency of the data request is further improved. Meanwhile, repeated sending of data requests is avoided, and resource utilization rate is improved.
Fig. 1 is a schematic diagram of a system architecture used in the present disclosure, which includes an electronic device 001 and a third-party server 002, and a user 003 can operate the electronic device 001 to trigger a data request of the third-party server 002 through the electronic device 001. The electronic device 001 sends the data request to the third-party server 002, receives the target data fed back by the third-party server 002, and then outputs the received target data, so that the user 003 can obtain the target data. The electronic device 001 may interact with the third party server 002 via a network.
Optionally, as shown in fig. 2, the data request processing method provided by the present disclosure may perform local processing in the electronic device, and referring to the system architecture 100 shown in fig. 2, the data request processing method may also be applied to the server 105, after the user performs operation through the terminal-side device, the server performs calculation operation, and sends the display instruction to the terminal-side, and the terminal-side displays the processing result of the server 105. The terminal side can be a notebook computer 103, a tablet computer 102, a smart phone 101, and the like, and the terminal side communicates with the network test server 105 through the cloud network 104.
Fig. 3 is a flowchart of a data request processing method provided by an embodiment of the present disclosure, which may be applied to a case of processing a data request, and the method may be executed by an electronic device, which may include, but is not limited to, a mobile terminal device such as a mobile phone, a smart phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a navigation device, a vehicle-mounted terminal device, a vehicle-mounted display terminal, a vehicle-mounted electronic rearview mirror, and the like, and a fixed terminal device such as a digital TV, a desktop computer, and the like, and the method specifically includes the following steps:
step 110, determining a data query range according to a data request, wherein the data request is used for acquiring data from a third party.
A user may trigger a data request on an electronic device. For example, when a user needs to call information of a certain employee, the electronic device runs a payroll system, and needs to send a data request to a third party according to the name of the employee, and the third party feeds back the information of the employee and outputs the information to the user. For another example, the electronic device is installed with a mail application, and when a user needs to call an incoming mail record of a contact in the address book, the electronic device initiates an identifier of the contact to the third-party server, so that the third-party server returns an incoming mail of the contact.
When a data request is triggered, a data query range needs to be added to the data request, and generally, the data query range can be a full-range search or a search within a specified range. For example, the range of the ID interval for configuration search is 1-30000. The data query range may be a pre-recorded maximum searchable range. For the employee information query scenario, the total number of employees may be determined as the data query range. The address book scene may take the entire date as the search range.
And step 120, generating a plurality of subdata requests according to the query range and the interface range of the third party, wherein the query range of the subdata requests is matched with the interface range of the third party.
The third party's interface scope is the scope of searches that the third party can perform, which is typically smaller than the query scope. And subdividing the data request into a plurality of sub-data requests according to the query range of the data request and the interface range of a third party.
Optionally, splitting the query range according to the interface range of the third party to obtain a plurality of interface query ranges; and generating a sub-data request according to each interface query range.
And intercepting the query range by taking the interface range as a window to sequentially obtain a plurality of interface query ranges. And then, generating a corresponding sub-data request according to each interface query range. Illustratively, if the interface range is 0-100id and the query range is 0-299id, three interface query ranges are obtained, which are: 0-99id, 100-. Then, a sub data request A with a query range of 0-99id, a sub data request B with a query range of 100-199id and a sub data request C with a query range of 200-299id are respectively established.
Step 130, obtaining target data from a third party according to the plurality of sub data requests.
Step 130 may be implemented by: first, a plurality of sub-data requests are sent to a third party. And secondly, receiving target subdata returned by the third party according to each subdata request. And thirdly, determining target data according to the target subdata.
Selecting a part of sub data requests or all sub data requests from the plurality of sub data requests obtained in step 120, sending the selected sub data requests to a third party, and determining target data according to target sub data fed back by the third party. And the third party returns the target subdata corresponding to each subdata request according to the received subdata requests.
The target data can be the content displayed in the output interface, and different target data can be determined according to different display rules of the output interface. The display rule may include all query results corresponding to the display data request, where a set of all target sub-data corresponding to all sub-data requests is target data. The display rule may further include displaying a fixed number a of query results, and at this time, generating the target data every time the number of query results in the received target sub-data reaches the fixed number a.
In one implementation, all query results corresponding to the data request are output in the output interface. At this time, in the first step, a plurality of sub data requests are sent to the third party, which may be implemented as: and sending the all sub-data request to a third party.
In another implementation, the present disclosure may be applied to support online queries, where it may happen that different users initiate parallel data requests to the same third party. For this case, after the second step, the method further comprises: caching target subdata corresponding to each subdata request; and responding to the new subdata request according to the cached target subdata.
And storing an interface range corresponding to each sub data request and target sub data corresponding to each sub data request in a storage space for establishing a mapping relation between the sub data request and the received target sub data. After the data request is split into a plurality of sub data requests, the interface range of the third party corresponding to each sub data request is respectively stored. For example, a range pool may be established in the storage space, and the range pool is used to record the split multiple access ranges. As shown in FIG. 4, assuming that the upper limit of the word query (i.e., the interface range) supported by the third party is N, the current data request is split into three sub-data requests for querying the query results with the interface ranges of 0-N, N-2N and 2N-3N, respectively. The results received according to the three sub data requests are result 1, result 2 and result 3, respectively. Where result 1 includes query results numbered 0-10. Result 2 includes query results numbered 10-15. Result 3 includes query results numbered 15-20. A result pool may be established in the cache, and the received target sub-data may be stored in sequence.
If the interface range of a sub data request (i.e. a new sub data request) of a current user initiated data request is N-2N, the result corresponding to N-2N, i.e. result 2, can be read from the storage space. And taking the result 2 as the target subdata corresponding to the subdata request. The sub-data request is responded according to the query result of the local cache, and the processing efficiency of the data request is improved.
And further, updating the locally stored query result according to the preset time. The preset time may be 1 hour or 1 day.
The sub-data requests obtained in step 120 are sequentially stored in the request pool. The request pool may be an address space partitioned in a cache for storing sub data requests. When all the sub-data requests are obtained in step 120, all the sub-data requests are read from the request pool and sent to the third party.
Correspondingly, the third step, determining the target data according to the target subdata, which can be implemented as: and determining target data according to all the obtained target subdata.
After sending all the sub-data requests to the third party, the third party will continuously return the target sub-data corresponding to the sub-data requests. And determining whether the target subdata corresponding to the subdata request is received or not according to the identifier of the subdata request and the identifier carried in the target subdata returned by the third party. And after all the target subdata is received, determining target data according to all the target subdata.
In the above example, the sub-data request a, the sub-data request B, and the sub-data request C may be sent to a third party, and the third party returns target sub-data a corresponding to the sub-data request a, target sub-data B corresponding to the sub-data request B, and target sub-data C corresponding to the sub-data request C. The target subdata comprises at least one query result and a flag bit indicating no query result if no query result exists. And summarizing all query results to obtain target data.
And step 140, outputting the acquired target data.
The target data determined in step 130 is displayed in an output interface. Each query result may be displayed in sequence in a list.
According to the data request processing method provided by the embodiment of the disclosure, when a data request is received, a data query range is determined according to the data request, and a plurality of subdata requests are generated according to the query range and an interface range of a third party; acquiring target data from a third party according to the plurality of sub-data requests; and outputting the acquired target data. Compared with the situation that the data request is directly forwarded to the third party and the feedback result is abnormal, the data request can be split according to the interface range of the third party after the data query range of the data request is determined, a plurality of subdata requests are obtained, each subdata request is matched with the interface range of the third party, the problem that the feedback result is abnormal due to the fact that the query range is inconsistent with the interface range can be further avoided, the situation that errors occur due to overlarge data quantity of the interface of the third party is guaranteed, the data request processing efficiency is improved, and the resource utilization rate is improved.
In one use scenario, a user operates an employee payroll system in an electronic device, and initiates a pinyin fuzzy search request to a third party operating an employee database according to name pinyin of an employee when a payroll is manufactured. The electronic equipment determines a name query range according to a pinyin fuzzy search request, and the pinyin fuzzy search request is used for performing pinyin fuzzy query on names from a name server. Then, a plurality of person name inquiry sub-requests are generated according to the person name inquiry range and the inquiry interface range of the person name server. Then, the name information is obtained from the name server according to the plurality of name inquiry sub-requests. And finally, outputting the acquired name information.
Fig. 5 is a flowchart of a data request processing method provided in an embodiment of the present disclosure, as a further description of the above embodiment, an output interface may display a query result in a form of a page, and based on this scenario, the above embodiment may be implemented in the following manner:
step 110, determining a data query range according to a data request, wherein the data request is used for acquiring data from a third party.
And step 120, generating a plurality of subdata requests according to the query range and the interface range of the third party, wherein the query range of the subdata requests is matched with the interface range of the third party.
Step 210, sending a plurality of sub data requests to a third party.
In one implementation, only one sub-data request may be sent to the third party at a time. After the first sub-data request of a data request is sent to the third party, if it is determined in step 240 that the number of the received target sub-data does not match the result number, a second sub-data request of the data request is sent to the third party. And furthermore, the communication traffic of each time is reduced, and the query result expected by the user may exist in the target subdata corresponding to the first subdata request or the second subdata request, so that the subsequent subdata request does not need to be sent, unnecessary subdata requests are prevented from being sent, and a third party performs unnecessary query response, and the resource utilization rate is improved.
In another implementation manner, a preset number of sub data requests may be sent to the third party each time, where the preset number is smaller than the total number of the sub data requests. If the number of query results in the target sub data returned by each sub data request is less, the number of sub data requests sent each time can be adjusted.
And step 220, receiving the target subdata returned by the third party according to each subdata request.
And step 230, acquiring the number of results displayed in the output interface.
And step 240, judging whether the number of the received target subdata is matched with the result number.
Optionally, it is determined whether the number of the received target sub-data is greater than or equal to the result number. And if the number of the target subdata is larger than or equal to the result number, matching the number of the received target subdata with the result number. If so, the number of the received target sub-data does not match the number of the results.
Further, whether the sum of the number of the received target sub-data and the target sub-data which is not output in the cache is matched with the result number or not can be judged.
And step 250, determining target data according to the received target subdata when the number of the received target subdata is matched with the result number.
And step 140, outputting the acquired target data.
The output interface may display the target data in a paginated manner. The number of query results displayed per page is the same. Meanwhile, the paging interface comprises a page turning button, and when a user clicks the page turning button or triggers a page turning gesture, page turning operation is triggered.
Further, when the foreground triggers a result interface page turning operation, if the number of the target subdata which is not output is matched with the result number, the target data is determined according to the target subdata which is not output, and the target subdata which is not output is the target subdata which is not output in the cache.
When the target data is displayed in the form of pages, the number of query results contained in the target sub data returned by the sub data request may exceed the number of results displayed in one page. At this time, the query result in the target subdata which is not output is stored in the cache for identification.
When the page turning operation is triggered, whether the number of the query results in the target subdata which is not output in the cache is larger than or equal to the number of the results is checked firstly. And if the number of the results is larger than or equal to the number of the results, reading the query results in the target subdata which is not output and stored in the cache, and outputting the query results.
Further, when the foreground triggers a result interface page turning operation, if the number of target subdata which is not output is less than the result number, at least one subdata request is sent to a third party; and if the sum of the target sub-data quantity received according to the at least one sub-data request and the target sub-data quantity which is not output is matched with the result quantity, generating target data according to the target sub-data quantity received according to the at least one sub-data request and the target sub-data which is not output.
And if the number of target subdata which is not output in the cache is smaller than the result number, the subdata request needs to be sent to a third party. At this time, one sub data request may be sent, or a preset number of sub data requests may be sent. And after receiving target subdata corresponding to the newly sent subdata request, if the sum of the number of the query results in the target subdata and the number of the query results which are not output in the cache is more than or equal to the result number, indicating that the query results of the next page can be displayed. And generating target data from the query results which are not output in the cache and the query results in the newly received target subdata according to the number of the results.
Correspondingly, the step 210 of sending at least one sub-data request to the third party may be implemented in the following manner: sending at least one sub-data request to a third party; if the sum of the number of the target subdata received according to the subdata request and the number of the target subdata which is not output is smaller than the result number, the subdata request is sent again, and the target subdata is received according to the resent subdata request; until the sum of the number of the target subdata received according to the subdata request and the number of the target subdata which is not output is matched with the result number.
And when target subdata returned by the third party according to the subdata request is received, judging whether the quantity of the target subdata and the number of the query results which are not output in the cache are larger than the result quantity, and if so, generating the target data as paging display content. And if the number of the results is less than the number of the results, storing the received target subdata into a cache as a part of the query result which is not output, and sending the subdata request to the third party again until the number of the newly received target subdata and the query result which is not output in the cache is more than or equal to the number of the results.
The data request processing method provided by the embodiment of the disclosure can control whether to send the subdata request to a third party or not based on the number of results displayed in pages when a user starts a page turning operation, so that system resources can be more effectively utilized, and the utilization rate of the system resources is further improved.
Fig. 6 is a schematic structural diagram of a data request processing apparatus according to an embodiment of the present disclosure, where the apparatus according to the embodiment of the present disclosure is applicable to a case where a third party responds to a data request, the apparatus may be located in an electronic device, the electronic device may be a smart phone, a tablet computer, a wearable device, a personal computer, or a notebook computer, and the apparatus specifically includes:
a query range determining module 31, configured to determine a data query range according to a data request, where the data request is used to obtain data from a third party;
the subdata request generating module 32 is configured to generate a plurality of subdata requests according to the query range determined by the query range determining module 31 and the interface range of the third party, where the query range of the subdata requests matches the interface range of the third party;
a target data obtaining module 33, configured to obtain target data from a third party according to the multiple sub data requests generated by the sub data request generating module 32;
and the output module 34 is used for outputting the acquired target data.
Further, the sub-data request generating module 32 is configured to:
splitting the query range according to the interface range of the third party to obtain a plurality of interface query ranges;
and generating the sub data request according to each interface query range.
Further, the target data obtaining module 33 is configured to:
sending a plurality of subdata requests to a third party;
receiving target subdata returned by a third party according to each subdata request;
and determining target data according to the target subdata.
Further, the target data obtaining module 33 is configured to:
sending all sub-data requests to a third party;
and determining target data according to all the obtained target subdata.
Further, the target data obtaining module 33 is configured to:
acquiring the number of results displayed in an output interface;
and when the number of the received target subdata is matched with the result number, determining the target data according to the received target subdata.
Further, the target data obtaining module 33 is configured to:
when the foreground triggers a result interface page turning operation, if the number of the target subdata which is not output is matched with the result number, determining the target data according to the target subdata which is not output, wherein the target subdata which is not output is the target subdata which is not output in the cache.
Further, the target data obtaining module 33 is configured to:
when the foreground triggers a result interface page turning operation, if the number of target subdata which is not output is smaller than the result number, at least one subdata request is sent to a third party;
and if the sum of the target sub-data quantity received according to the at least one sub-data request and the target sub-data quantity which is not output is matched with the result quantity, generating target data according to the target sub-data quantity received according to the at least one sub-data request and the target sub-data which is not output.
Further, the target data obtaining module 33 is configured to:
sending at least one sub-data request to a third party;
if the sum of the number of the target subdata received according to the subdata request and the number of the target subdata which is not output is smaller than the result number, the subdata request is sent again, and the target subdata is received according to the resent subdata request;
until the sum of the number of the target subdata received according to the subdata request and the number of the target subdata which is not output is matched with the result number.
Further, the target data obtaining module 33 is configured to: caching target subdata corresponding to each subdata request;
and responding to the new subdata request according to the cached target subdata.
Further, the query range determining module 31 is configured to determine a name query range according to a pinyin fuzzy search request, where the pinyin fuzzy search request is used to perform pinyin fuzzy query on names from a name server;
the sub-data request generating module 32 is configured to generate a plurality of name inquiry sub-requests according to the name inquiry range and the inquiry interface range of the name server;
the target data acquisition module 33 is configured to acquire name information from a name server according to the plurality of name inquiry sub-requests;
outputting the acquired target data, including:
and outputting the acquired name information.
In the data request processing apparatus provided in the embodiment of the present disclosure, when receiving a data request, the query range determining module 31 determines a data query range according to the data request, and the sub-data request generating module 32 generates a plurality of sub-data requests according to the query range and an interface range of a third party; the target data obtaining module 33 obtains target data from a third party according to the plurality of sub-data requests; the output module 34 outputs the acquired target data. Compared with the situation that the data request is directly forwarded to the third party and the feedback result is abnormal, the data request can be split according to the interface range of the third party after the data query range of the data request is determined, a plurality of subdata requests are obtained, each subdata request is matched with the interface range of the third party, the problem that the feedback result is abnormal due to the fact that the query range is inconsistent with the interface range can be further avoided, the data request processing efficiency is improved, and the resource utilization rate is improved.
The device can execute the methods provided by all the embodiments of the disclosure, and has corresponding functional modules and beneficial effects for executing the methods. For technical details which are not described in detail in the embodiments of the present disclosure, reference may be made to the methods provided in all the aforementioned embodiments of the present disclosure.
Referring now to FIG. 7, a block diagram of an electronic device 800 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 7, an electronic device 800 may include a processing means (e.g., central processing unit, graphics processor, etc.) 801 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)802 or a program loaded from a storage means 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data necessary for the operation of the electronic apparatus 800 are also stored. The processing apparatus 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
Generally, the following devices may be connected to the I/O interface 805: input devices 806 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 807 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, and the like; storage 808 including, for example, magnetic tape, hard disk, etc.; and a communication device 809. The communication means 809 may allow the electronic device 800 to communicate wirelessly or by wire with other devices to exchange data. While fig. 7 illustrates an electronic device 800 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, the processes described above with reference to the flow diagrams may be implemented as computer software programs, according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication means 809, or installed from the storage means 808, or installed from the ROM 802. The computer program, when executed by the processing apparatus 801, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: determining a data query range according to a data request, wherein the data request is used for acquiring data from a third party; generating a plurality of subdata requests according to the query range and the interface range of the third party, wherein the query range of the subdata requests is matched with the interface range of the third party; acquiring target data from a third party according to the plurality of sub-data requests; and outputting the acquired target data.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of a module does not in some cases constitute a limitation on the module itself, for example, the query scope determining module may also be described as a "module for determining a data query scope from a data request for obtaining data from a third party".
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present disclosure and the technical principles employed. Those skilled in the art will appreciate that the present disclosure is not limited to the particular embodiments described herein, and that various obvious changes, adaptations, and substitutions are possible, without departing from the scope of the present disclosure. Therefore, although the present disclosure has been described in greater detail with reference to the above embodiments, the present disclosure is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present disclosure, the scope of which is determined by the scope of the appended claims.
Claims (9)
1. A method for processing a data request, comprising:
determining a data query range according to a data request, wherein the data request is used for acquiring data from a third party;
generating a plurality of subdata requests according to the query range and the interface range of a third party, wherein the query range of the subdata requests is matched with the interface range of the third party;
obtaining target data from the third party according to the plurality of sub-data requests;
outputting the obtained target data;
wherein the generating a plurality of sub-data requests according to the query range and the interface range of the third party comprises: splitting the query range according to an interface range of a third party to obtain a plurality of interface query ranges, and generating a subdata request according to each interface query range, wherein the interface range of the third party is a search range which can be executed by the third party; the obtaining target data from the third party according to the plurality of sub-data requests includes: sending a plurality of subdata requests to the third party, receiving target subdata returned by the third party according to each subdata request, and determining target data according to the target subdata; the sending the plurality of sub-data requests to the third party includes: sending all the subdata requests to the third party, and correspondingly, determining target data according to the target subdata, wherein the step of determining the target data comprises the following steps: determining target data according to all the obtained target subdata; the determining the target data according to the target sub-data includes: and acquiring the number of results displayed in an output interface, and determining target data according to the received target subdata when the number of the received target subdata is matched with the number of the results.
2. The method for processing the data request according to claim 1, further comprising, after outputting the acquired target data:
when the foreground triggers a result interface page turning operation, if the number of target subdata which is not output is matched with the result number, determining target data according to the target subdata which is not output, wherein the target subdata which is not output is target subdata which is not output in a cache.
3. The method for processing the data request according to claim 1, further comprising, after outputting the acquired target data:
when the foreground triggers a result interface page turning operation, if the number of target subdata which is not output is smaller than the result number, at least one subdata request is sent to the third party;
and if the sum of the target subdata quantity received according to the at least one subdata request and the target subdata quantity which is not output is matched with the result quantity, generating target data according to the target subdata quantity received by the at least one subdata request and the target subdata which is not output.
4. The method of claim 3, wherein the sending at least one sub data request to the third party comprises: sending at least one sub-data request to the third party;
if the sum of the number of the target subdata received according to the subdata request and the number of the target subdata not output is smaller than the result number, a subdata request is sent again, and the target subdata is received according to the resent subdata request;
until the sum of the target subdata quantity received according to the subdata request and the target subdata quantity which is not output is matched with the result quantity.
5. The method for processing the data request according to claim 1, after receiving the target sub-data returned by the third party according to each sub-data request, further comprising:
caching target subdata corresponding to each subdata request;
and responding to the new subdata request according to the cached target subdata.
6. The method for processing the data request according to claim 1, wherein the determining the data query range according to the data request, the data request being used for obtaining data from a third party, comprises:
determining a name query range according to a pinyin fuzzy search request, wherein the pinyin fuzzy search request is used for performing pinyin fuzzy query on names from a name server;
generating a plurality of subdata requests according to the query range and the interface range of the third party, wherein the generating comprises the following steps:
generating a plurality of name inquiry sub-requests according to the name inquiry range and the inquiry interface range of the name server;
the obtaining target data from the third party according to the plurality of sub-data requests includes:
acquiring name information from the name server according to the name inquiry sub-requests;
the outputting the acquired target data includes:
and outputting the acquired name information.
7. An apparatus for processing a data request, comprising:
the query range determining module is used for determining a data query range according to a data request, wherein the data request is used for acquiring data from a third party;
the subdata request generating module is used for generating a plurality of subdata requests according to the query range determined by the query range determining module and the interface range of a third party, and the query range of the subdata requests is matched with the interface range of the third party;
a target data obtaining module, configured to obtain target data from the third party according to the multiple sub data requests generated by the sub data request generating module;
the output module is used for outputting the acquired target data;
the subdata request generating module is used for splitting the query range according to the interface range of a third party to obtain a plurality of interface query ranges, and generating subdata requests according to each interface query range, wherein the interface range of the third party is a search range which can be executed by the third party; the target data acquisition module is used for sending a plurality of subdata requests to the third party, receiving target subdata returned by the third party according to each subdata request and determining target data according to the target subdata; the target data acquisition module is used for sending all subdata requests to the third party and determining target data according to all acquired target subdata; the target data obtaining module is used for obtaining the number of results displayed in an output interface, and when the number of the received target subdata is matched with the number of the results, determining target data according to the received target subdata.
8. An electronic device comprising storage means, processing means and a computer program stored on the storage means and executable on the processing means, characterized in that the processing means, when executing the program, implement the method of processing a data request according to any of claims 1-6.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out a method for processing a data request according to any one of claims 1 to 6.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910656324.3A CN110377654B (en) | 2019-07-19 | 2019-07-19 | Data request processing method and device, electronic equipment and computer-readable storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910656324.3A CN110377654B (en) | 2019-07-19 | 2019-07-19 | Data request processing method and device, electronic equipment and computer-readable storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN110377654A CN110377654A (en) | 2019-10-25 |
| CN110377654B true CN110377654B (en) | 2022-05-17 |
Family
ID=68254364
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201910656324.3A Active CN110377654B (en) | 2019-07-19 | 2019-07-19 | Data request processing method and device, electronic equipment and computer-readable storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN110377654B (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110996141B (en) * | 2019-11-05 | 2022-03-25 | 北京字节跳动网络技术有限公司 | Method and device for sending information in live broadcast room and electronic equipment |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1866918A (en) * | 2005-11-28 | 2006-11-22 | 华为技术有限公司 | Management and maintenance method for static multi-interface range matching table |
| CN106293948A (en) * | 2016-08-17 | 2017-01-04 | 金蝶软件(中国)有限公司 | Data syn-chronization, acquisition methods and device |
| CN106599310A (en) * | 2016-12-29 | 2017-04-26 | 中国建设银行股份有限公司 | Parallel query method and apparatus based on multi-data-source scene |
| US10095710B1 (en) * | 2014-12-19 | 2018-10-09 | EMC IP Holding Company LLC | Presenting cloud based storage as a virtual synthetic |
| CN109299148A (en) * | 2018-09-29 | 2019-02-01 | 网宿科技股份有限公司 | Data query method and server |
-
2019
- 2019-07-19 CN CN201910656324.3A patent/CN110377654B/en active Active
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1866918A (en) * | 2005-11-28 | 2006-11-22 | 华为技术有限公司 | Management and maintenance method for static multi-interface range matching table |
| US10095710B1 (en) * | 2014-12-19 | 2018-10-09 | EMC IP Holding Company LLC | Presenting cloud based storage as a virtual synthetic |
| CN106293948A (en) * | 2016-08-17 | 2017-01-04 | 金蝶软件(中国)有限公司 | Data syn-chronization, acquisition methods and device |
| CN106599310A (en) * | 2016-12-29 | 2017-04-26 | 中国建设银行股份有限公司 | Parallel query method and apparatus based on multi-data-source scene |
| CN109299148A (en) * | 2018-09-29 | 2019-02-01 | 网宿科技股份有限公司 | Data query method and server |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110377654A (en) | 2019-10-25 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US20210243045A1 (en) | Online document sharing method and apparatus, electronic device, and storage medium | |
| US20220075932A1 (en) | Method and apparatus for inserting information into online document | |
| CN111198859B (en) | Data processing method, device, electronic equipment and computer readable storage medium | |
| CN111488185B (en) | Page data processing method, device, electronic equipment and readable medium | |
| EP3709599B1 (en) | Integrating additional information into a telecommunications call | |
| CN111400625B (en) | Page processing method and device, electronic equipment and computer readable storage medium | |
| CN110825481A (en) | Method and device for displaying page information corresponding to page tag and electronic equipment | |
| CN110781373B (en) | List updating method and device, readable medium and electronic equipment | |
| CN111309496A (en) | Method, system, device, equipment and storage medium for realizing delay task | |
| CN114116247A (en) | Redis-based message processing method, device, system, server and medium | |
| CN111783010B (en) | Webpage blank page monitoring method, device, terminal and storage medium | |
| CN111432001A (en) | Method, apparatus, electronic device, and computer-readable medium for jumping scenes | |
| CN111787043A (en) | Data request method and device | |
| CN111641690B (en) | Session message processing method and device and electronic equipment | |
| CN111694629A (en) | Information display method and device and electronic equipment | |
| CN110852720A (en) | Document processing method, device, equipment and storage medium | |
| CN110377654B (en) | Data request processing method and device, electronic equipment and computer-readable storage medium | |
| CN113760178B (en) | Cache data processing method, device, electronic device and computer readable medium | |
| CN110633950A (en) | Task information processing method and device, electronic equipment and storage medium | |
| CN103379022B (en) | A kind of instant communication method based on Internet map search and system | |
| US20250209070A1 (en) | Method and apparatus for processing log request, device, and storage medium | |
| CN110519373B (en) | Method and device for pushing information | |
| CN113360704A (en) | Voice playing method and device and electronic equipment | |
| CN111274104B (en) | Data processing method, device, electronic equipment and computer readable storage medium | |
| CN111597439A (en) | Information processing method and device and electronic equipment |
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 |