Task-based batch search method, device, computer equipment and medium
By combining search conditions and using mapping tables to determine the starting position, the problem of low efficiency of task-based batch search is solved, real-time display and efficient search of data are realized.
Patent Information
- Application Number
- CN202211509850.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-29
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2042-11-29
AI Technical Summary
The existing task-based batch search method requires repeated searches when facing multiple search conditions, resulting in inefficiency and untimely data display.
By obtaining multiple search conditions from the front end to combine them into a search task, using the mapping table to determine the search starting position, determining the data to be searched in the database, and sending it to the front end to display in real time until the stop command is received, avoiding repeated traversal of the database.
It improves the efficiency of task-based data search and the timeliness of results display, reduces user waiting time, and improves user experience and search accuracy.
Smart Images

Figure CN116010665B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information retrieval technology, and in particular to a task-based batch search method, device, computer equipment and medium. Background Art
[0002] At present, task-based search methods usually adopt a background search method. The background searches the database according to the search conditions provided by the user, and saves the search results to the database. When the results need to be displayed, the saved search results are exported to a preset format to complete the task-based search.
[0003] However, background task-based batch search requires that the search results be stored in the database first, and then the results are saved in a compressed format for display. The data display is not timely enough. Moreover, when facing multiple search conditions, background task-based batch search needs to perform repeated searches according to different search conditions. As a result, the operation of implementing task-based batch search through the background is cumbersome and the search efficiency is low. Therefore, how to improve the efficiency of task-based batch search and display has become an urgent problem to be solved. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a task-based batch search method, apparatus, computer device, and medium to solve the problem of low efficiency of task-based batch search and display.
[0005] In a first aspect, an embodiment of the present invention provides a task-based batch search method, the task-based batch search method comprising:
[0006] Obtain N search conditions from the front end, and determine a combination of the N search conditions into a search task, where N is an integer greater than zero;
[0007] detecting whether a start task parameter sent by the front end is received, and when the start task parameter is detected, determining a search start position corresponding to the start task parameter using a preset mapping table, wherein the mapping table includes a mapping relationship between the start task parameter and the search start position;
[0008] Taking the search starting position as the target position, determining the data to be searched corresponding to the target position in the database, and sending the data to be searched to the front end when the data to be searched meets the search task;
[0009] Incrementing the target position by one, returning to the step of determining the to-be-searched data corresponding to the target position in the database, and sending the to-be-searched data to the front end when the to-be-searched data satisfies the search task, until the target position is equal to a preset value or a stop instruction is received from the front end, thereby stopping the search;
[0010] All the data to be searched received by the front end before stopping the search are saved in a target format, and the saved results are determined to be task-based batch search results.
[0011] In a second aspect, an embodiment of the present invention provides a task-based batch search device, the task-based batch search device comprising:
[0012] A condition acquisition module is used to obtain N search conditions from the front end and determine the combination of the N search conditions into a search task, where N is an integer greater than zero;
[0013] a parameter detection module, configured to detect whether a start task parameter sent by the front end is received, and upon detecting the start task parameter, determine a search start position corresponding to the start task parameter using a preset mapping table, wherein the mapping table includes a mapping relationship between the start task parameter and the search start position;
[0014] a data display module, configured to use the search starting position as a target position, determine the to-be-searched data corresponding to the target position in a database, and send the to-be-searched data to the front end when the to-be-searched data satisfies the search task;
[0015] a data search module configured to increase the target position by one, return to execute the steps of determining the search data corresponding to the target position in the database, and send the search data to the front end when the search data satisfies the search task, until the target position is the same as a preset value or a stop instruction is received from the front end, thereby stopping the search;
[0016] The result saving module is used to save all the to-be-searched data received by the front end before stopping the search in a target format, and determine that the saved results are task-based batch search results.
[0017] In a third aspect, an embodiment of the present invention provides a computer device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the task-based batch search method as described in the first aspect is implemented.
[0018] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the task-based batch search method as described in the first aspect is implemented.
[0019] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0020] N search conditions are obtained from the front end, the N search conditions are combined into a search task, and it is detected whether a start task parameter sent by the front end is received. When the start task parameter is detected, a preset mapping table is used to determine a search start position corresponding to the start task parameter, the mapping table containing a mapping relationship between the start task parameter and the search start position. The search start position is used as a target position, and the to-be-searched data corresponding to the target position is determined in a database. When the to-be-searched data meets the search task, the to-be-searched data is sent to the front end, the target position is increased by one, and the steps of determining the to-be-searched data corresponding to the target position in the database and sending the to-be-searched data to the front end when the to-be-searched data meets the search task are returned until the target position is the same as a preset value or a stop instruction is received from the front end, the search is stopped, and all the to-be-searched data received by the front end before the search is stopped are saved in a target format. The saved result is determined as a task-based batch search result. The search task is obtained by combining the search conditions, so that multiple search conditions can be judged simultaneously during the execution of the search task. In addition, the search start position in the database can be flexibly adjusted by the start task parameter, eliminating the need to repeatedly traverse the entire database data for searching, thereby effectively improving the efficiency of the task-based data search. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0022] Figure 1 This is a schematic diagram of an application environment of a task-based batch search method provided by the first embodiment of the present invention;
[0023] Figure 2 This is a flowchart of a task-based batch search method provided in Example 1 of the present invention;
[0024] Figure 3 This is a flowchart of a task-based batch search method provided in Example 2 of the present invention;
[0025] Figure 4 This is a structural diagram of a task-based batch search device provided by Embodiment 3 of the present invention;
[0026] Figure 5 This is a structural diagram of a computer device provided in Example 4 of the present invention. DETAILED DESCRIPTION
[0027] In the following description, specific details such as particular system structures and techniques are provided for purposes of illustration, not limitation, to facilitate a thorough understanding of the embodiments of the present invention. However, it will be apparent to those skilled in the art that the present invention may be practiced in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
[0028] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0029] It will also be understood that the term "and / or" used in the present description and appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0030] As used in the present specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0031] In addition, in the description of the present specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0032] References to "one embodiment" or "some embodiments" in the present specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present invention. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in yet other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0033] It should be understood that the order of execution of the steps in the following embodiments does not necessarily mean the order in which they are executed. The order in which each process is executed should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0034] In order to illustrate the technical solution of the present invention, specific embodiments are provided below.
[0035] The first embodiment of the present invention provides a task-based batch search method that can be applied to Figure 1 In an application environment, the client corresponding to the front end communicates with the server corresponding to the search end. The client includes but is not limited to PDAs, desktop computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, cloud terminal devices, personal digital assistants (PDAs) and other computer devices. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0036] See also Figure 2 , is a flow chart of a task-based batch search method provided by the first embodiment of the present invention. The task-based batch search method can be applied to Figure 1 The search end in the search end, the server end corresponding to the search end has a storage function, which is implemented through the database embedded in the server end corresponding to the search end. The database contains a number of data to be searched. The server end corresponding to the search end is connected to the client end corresponding to the front end to obtain search conditions, start task parameters and stop instructions from the front end, and send the searched data to the front end. The client end corresponding to the front end can directly interact with the user to obtain the search conditions provided by the user, and determine the start task parameters and stop instructions based on the user's operation data. Figure 2 As shown, the task-based batch search method may include the following steps:
[0037] Step S201: Obtain N search conditions from the front end, and determine that the N search conditions are combined into a search task.
[0038] Among them, the front end can interact directly with the user to obtain the search conditions provided by the user. The user may refer to a person who needs to perform a data search task in the database stored in the search end. The search conditions may be search conditions customized by the user and recognizable by the computer. N is an integer greater than zero. The search task may refer to the attributes satisfied by the target data when the search end performs a data search. The search task can be used to determine whether the searched data belongs to the target data.
[0039] Specifically, the computer device corresponding to the front end and the server corresponding to the search end can be applied to a big data search scenario. In this embodiment, the big data search scenario can be, for example, a facial image data search scenario. Since the database in the search end contains facial image data, when searching for data, it is necessary to compare the facial image data to be searched with the facial image data provided by the user through the front end. That is, it is necessary to perform post-processing operations on the searched facial image data to determine whether the searched facial image data meets the search conditions. Therefore, when conventional data search methods are used to traverse the database, a long search time is required. Moreover, when there are multiple search conditions, the database traversal needs to be repeated multiple times for each search condition. Therefore, the use of conventional data search methods will greatly extend the data search time, resulting in low data search efficiency. Moreover, in the case of data search with a long search time, the robustness of the search process will also be correspondingly poor, that is, it is difficult to effectively maintain the original search efficiency in the face of emergencies. For example, when the search needs to be stopped for some reason, the conventional data search method can only interrupt the search. When the search needs to be continued, the database needs to be traversed again, which further leads to low data search efficiency.
[0040] In this embodiment, the N search conditions obtained from the front end can be searched in parallel, that is, only one search is needed to obtain the search results under all search conditions. The search conditions may include similarity threshold intervals, acquisition time intervals, device range intervals, database identifiers, etc. The similarity threshold interval may refer to the interval that the similarity between the searched facial image data and the facial image data input by the user needs to meet, the acquisition time interval may refer to the acquisition time range that the facial image data in the database needs to meet, the device range interval may refer to the acquisition device identifier that the facial image data in the database needs to meet, and the database identifier may refer to the database identifier being searched, that is, the search end may include multiple databases, thereby providing richer data search services.
[0041] In one embodiment, the search conditions may also be conventional search conditions such as keyword matching, logical calculation results, etc. The form of multiple search conditions can provide users with more accurate search hit data.
[0042] In this embodiment, after the server obtains N search conditions from the front end, it combines the N search conditions and determines the combined result as the search task. The combination method can adopt an AND structure, that is, for the data searched subsequently, it is necessary to meet N search conditions at the same time before the searched data is determined to be the search hit data.
[0043] Optionally, obtaining N search conditions from the front end and determining the combination of the N search conditions into a search task includes:
[0044] Obtain the search method and N search conditions from the front end. The search methods include independent search and combined search.
[0045] When the search mode is independent search, determining N search condition combinations as a first search task;
[0046] When the search mode is a combined search, N search condition combinations are determined to form a second search task;
[0047] When the data to be searched meets the search task, the data to be searched is sent to the front end including:
[0048] When the data to be searched meets any search condition in the first search task, the data to be searched is sent to the front end;
[0049] When the data to be searched meets all the search conditions in the second search task, the data to be searched is sent to the front end.
[0050] Among them, the search method may refer to the judgment method when the searched data is judged as search hit data, the independent search may refer to judging the searched data according to N search conditions respectively, and determining that the searched data is search hit data when the searched data meets at least one search condition, and the merged search may refer to judging the searched data according to N search conditions respectively, and determining that the searched data is search hit data when the searched data meets all search conditions.
[0051] The first search task may include N search conditions and identification information corresponding to independent search methods, and the second search task may include N search conditions and identification information corresponding to a combined search method.
[0052] In this embodiment, the search method is added to the search task, so that in the subsequent data search process, the search hit data can be flexibly determined according to the search method, so that the search results are more in line with the user's search expectations, the accuracy of data search is improved, and at the same time the user's need for repeated searches is reduced, the user's search experience is improved, and the efficiency of data search is correspondingly improved.
[0053] The above steps of obtaining N search conditions from the front end and determining the combination of N search conditions into a search task can directly obtain multiple search conditions according to the actual needs of the user, without any restrictions on the search condition types, and combine multiple search conditions into a search task, so that the subsequent search process can directly search for data in the database based on the search task, without the need to traverse the database multiple times for multiple search conditions, thereby improving the efficiency of data search.
[0054] Step S202 , detecting whether the start task parameter sent by the front end is received, and when the start task parameter is detected, using a preset mapping table to determine a search start position corresponding to the start task parameter.
[0055] Among them, the start task parameters can be used to determine the location where the search starts in the database. The start task parameters can be saved by the front end or directly entered by the user. The mapping table contains the mapping relationship between the start task parameters and the search starting position. The search starting position can refer to the address information corresponding to the data where the search starts in the database.
[0056] Specifically, the front end can determine the value of the start-task parameter based on the user's operation data. For example, if the user's operation data is to traverse the database to search for data, the front end determines that the start-task parameter is zero based on the operation data. At this time, the start-task parameter corresponds to the address information of the first data in the database after being mapped by the preset mapping table; if the user's operation data is to search for data in the database starting from a specified data, the front end determines that the start-task parameter is the first specified value based on the operation data. At this time, the first specified value corresponds to the address information of the specified data in the database after being mapped by the preset mapping table; if the user's operation data is to search for data in the database starting from the stop data in the last search process, the front end determines that the start-task parameter is the second specified value based on the operation data. At this time, the second specified value corresponds to the address information of the stop data in the database after being mapped by the preset mapping table.
[0057] It should be noted that in order to provide users with a better search experience, implementers can add corresponding operation buttons in the search interface deployed on the front end to correspond to different user operation data. For example, the operation buttons may include: search from the beginning, search from a specified location, and continue search. Among them, search from the beginning can correspond to user operation data of traversing the database to search for data, search from a specified location can correspond to user operation data of searching for data in the database starting from a certain specified data, and continue search can correspond to user operation data of searching for data in the database starting from the stop data in the last search process. In particular, after the user clicks the operation button to search from a specified location, an input box is provided for the user to enter the specified location.
[0058] Optionally, after detecting whether the start task parameters sent by the front end are received, the method further includes:
[0059] When the start task parameters are not detected, check whether the start instruction sent by the front end is received;
[0060] When an open instruction is detected, the start position of the database is used as the search start position.
[0061] Among them, the start instruction can be used to control the start of the data search process, the starting position can refer to the position corresponding to the first data in the database, and the search starting position can refer to the position where the data search process starts searching. In this embodiment, the position is represented by the address corresponding to the data in the database.
[0062] Specifically, when receiving a search request from a new user, or after completing the user's search request, the front end will reset the start task parameters. At this time, since the search end stores multiple databases and the positions corresponding to the first data in different databases are different, it is impossible to directly pre-set the start task parameters. Therefore, resetting the start task parameters can refer to expressing the start task parameters in an unset form, for example, expressed as φ in this embodiment.
[0063] After receiving a search request from a new user, the database to be searched is determined based on the search request, and when the new user does not choose to search at a specified location, the starting position of the database to be searched is used as the search starting position. It should be noted that when the database to be searched is determined based on the search request, and the user does not choose to search at a specified location, the start task parameters can be set according to the starting position of the database to be searched, and the search starting position can be determined by the start task parameters, so that the start task parameters are changed to the set state, which facilitates timely adjustment of the start task parameters during subsequent searches.
[0064] In this embodiment, when the start-up task parameters are not detected, the search starting position is determined based on the start-up instruction, which can better adapt to the user's operation data and improve the user's operation experience. The user can flexibly choose simple search methods and complex search methods, avoiding additional time loss caused by waiting for the start-up task parameters, thereby improving the efficiency of data search.
[0065] The above detection determines whether the start task parameters sent by the front end are received. When the start task parameters are detected, a preset mapping table is used to determine the search starting position corresponding to the start task parameters, supporting users to search from different locations in the database. At the same time, it also effectively supports users to start and stop the search process, making the data search process more flexible. When facing emergencies, it can effectively retain the searched information and continue the search task in the future, avoiding the need to traverse the search in the database again, thereby effectively improving the efficiency of data search.
[0066] In step S203, the search starting position is used as the target position, and the data to be searched corresponding to the target position is determined in the database. When the data to be searched meets the search task, the data to be searched is sent to the front end.
[0067] Among them, the target location can refer to the location corresponding to the data to be searched that needs to be judged for the search task, and the data to be searched can be the data that needs to be judged for the search task. The front end can include an input page, and the input page can be used to obtain the user's operation data and search conditions.
[0068] Optionally, sending the data to be searched to the front end includes:
[0069] The data to be searched is sent to the front end, which then displays the data.
[0070] Among them, the front end can also include a display page, which can be used to display the searched hit data to the user in real time. The display can include the original data of the hit data to be searched, the search conditions satisfied by the hit data to be searched, and the quantitative value corresponding to the hit data to be searched under the search conditions it meets.
[0071] Specifically, in big data search tasks, the primary purpose of the search is often to first determine whether the database contains data that meets the search task. For example, in the facial image data retrieval scenario, the search task is to search for household registration facial image data. At this time, it is first determined that the facial image data input by the user matches any facial image data in the household registration facial image database. After knowing that there is at least one matching facial image data, the staff can handle household registration transfer, household registration update and other matters for the user. The matching facial image data subsequently searched may only be the retained facial image data of the user when handling household registration-related matters at different times. At this time, if you wait for the search process to complete the search in the entire household registration facial image database, it will undoubtedly take a lot of time to wait, which reduces the efficiency of household registration matters. Therefore, real-time display of search results has become an indispensable means to improve efficiency.
[0072] For example, in a facial image data search scenario, the original data of the hit data to be searched may refer to facial image data stored in a database. The search condition satisfied by the hit data to be searched may be a similarity threshold interval condition, such as the similarity threshold interval being [0.6, 1]. The quantized value corresponding to the hit data to be searched under the search condition it satisfies may refer to the similarity value between the hit data to be searched and the facial image data input by the user. In this embodiment, the similarity values are all normalized, and the quantized value corresponding to the hit data to be searched under the search condition it satisfies may be 0.8. The displayed result may include facial image data, the first search condition, and 0.8. The implementer may add corresponding explanatory text during the display process, for example, representing the displayed result as hit image: facial image data, satisfied search condition: similarity threshold interval [0.6, 1], similarity value: 0.8.
[0073] In this embodiment, after each pair of data to be searched is judged whether it meets the search task, if the data to be searched meets the search task, the data to be searched is sent to the front end for display. There is no need to wait for the completion of all five search processes before merging and displaying them, which improves the convenience of task-based batch search in actual applications.
[0074] Optionally, the front end includes preset display priorities;
[0075] The front-end displays the search data including:
[0076] According to the display priority, the data displayed and the data to be searched in the front end are sorted; according to the sorting results, the front end displays the data displayed and the data to be searched.
[0077] Among them, the display priority can be pre-set by the implementer, the display priority can be used to determine the display order of the data to be displayed, the sorting can refer to sorting the data displayed in the front end and the data to be searched from top to bottom according to the display priority, and the sorting result can refer to the result of sorting the data displayed in the front end and the data to be searched from top to bottom according to the display priority.
[0078] Specifically, the implementer can sort the data to be searched according to the number of data that meet the search conditions, so as to obtain the data that best meets the search conditions provided by the user.
[0079] In one embodiment, the data to be searched may be displayed in a table format on the front end. The table may include N columns, each column corresponds to a search condition, and each row corresponds to a data to be searched.
[0080] The element value in the table can represent the quantitative value of a to-be-searched data under a search condition. At this time, the user 0 can determine the display priority by himself. For example, when the user clicks the search condition in the first column, all the to-be-searched data under the search condition in the first column are sorted from top to bottom in descending order according to the quantitative value. Accordingly, the user can click repeatedly to switch between positive and reverse order. Positive order means sorting from top to bottom in descending order of quantitative value, and reverse order means sorting from top to bottom in descending order of quantitative value.
[0081] 5 In this embodiment, by setting the display priority during the front-end display process, users can
[0082] Defining the display method provides flexibility in real-time data display, improves the user experience, and makes it easier for users to quickly obtain information of interest, thereby improving the display effect and the display efficiency of data search results.
[0083] Optionally, the front end includes statistics corresponding to each search criterion;
[0084] 0 The front-end displays the search data including:
[0085] Among N search conditions, determine the search condition that the data to be searched meets as the target condition;
[0086] According to the data to be searched, the statistical data corresponding to the target condition is updated to obtain the updated statistical data corresponding to the target condition;
[0087] The front end displays the updated statistical data and data to be searched.
[0088] The target condition may refer to the search condition that the data to be searched meets, the statistical data may refer to the statistical value of the data that meets the target condition in all the data received by the front end, and the update may refer to the update of the statistical value.
[0089] Specifically, the statistical value can be a range statistic or a quantity statistic. For example, if the target condition is a similarity threshold range condition, the similarity threshold range condition is [0.6, 1], and the number of data that meet the target condition in the existing data at the front end is 5, when the statistical value is a quantity statistic, after the front end receives new data to be searched, the statistical value is updated to 6. When the statistical value is a range statistic, the similarity range corresponding to the data that meets the target condition in the existing data at the front end can be [0.8, 0.9]. At this time, if the similarity corresponding to the new data to be searched received by the front end exceeds the similarity range, for example, 0.7, the similarity range is updated to [0.7, 0.9]. The purpose of setting the statistical value is to facilitate providing users with real-time statistical information of search results.
[0090] This embodiment provides statistical information of hit data that meets the search criteria in the display page, thereby providing users with richer display information during the search process, facilitating subsequent rapid acquisition of required information, and thus improving the real-time display efficiency of data search results.
[0091] The above steps use the search starting position as the target position, determine the data to be searched corresponding to the target position in the database, and send the data to be searched to the front end when the data to be searched meets the search task, so that users can obtain the real-time results of the search in a timely manner, thereby improving the display efficiency of data search results.
[0092] Step S204, increase the target position by one, return to the step of determining the data to be searched corresponding to the target position in the database, and send the data to be searched to the front end when the data to be searched meets the search task, until the target position is the same as the preset value or a stop command sent by the front end is received, and the search stops.
[0093] The preset value may refer to a preset stop position, and the stop instruction may be used to control the stop during the search process.
[0094] Specifically, since the target position actually corresponds to the data address, an increase in the target position by one may mean an increase in the data address by one. After the target position increases by one, the increased target position corresponds to the next data to be searched in the database. At this time, a judgment is made again as to whether the data to be searched meets the search task, and when it is judged that the data to be searched meets the search task, the data to be searched is sent to the front end for display.
[0095] Each time the step of determining the data to be searched corresponding to the target position in the database and sending the data to be searched to the front end is completed when the data to be searched meets the search task, it is necessary to judge whether the target position is the same as the preset value or a stop command sent by the front end is received. After the target position is different from the preset value and the stop command sent by the front end is not received, the target position is increased by one again, and the step of determining the data to be searched corresponding to the target position in the database and sending the data to be searched to the front end when the data to be searched meets the search task is repeated until the target position is the same as the preset value or a stop command sent by the front end is received.
[0096] In this embodiment, after the search is stopped, the start-up task parameters are reset. The specific reset method may still be to reset the start-up task parameters to a non-startup state.
[0097] The preset value can be a stop position preset by the facility operator. For example, the address corresponding to the last data in the database can be set as the preset value. The stop instruction is determined by the front end based on the user's operation data, that is, the user's operation interface can include a stop operation button, which is used by the user to stop the search process.
[0098] In one embodiment, the preset value can also be determined based on the number of search data. For example, if the predetermined search number is set to 100, 99 is added to the search starting position, and the increased result is determined to be the preset value. At this time, if a stop instruction is not received, the search process will stop searching after searching for 100 data to be searched. The method of determining the preset value based on the number of search data can facilitate users to perform offline operations and improve the convenience of user searches.
[0099] The above-mentioned step increases the target position by one, returns the data to be searched corresponding to the target position determined in the database, and sends the data to be searched to the front end when the data to be searched meets the search task, until the target position is the same as the preset value or a stop instruction sent by the front end is received, and the search step stops. The data to be searched in the database are judged one by one in an iterative manner, and after obtaining the judgment result of the data to be searched, the data to be searched that meets the search task is directly sent to the front end for real-time display, realizing real-time display of search data and traversal search, thereby improving the efficiency of data search and display.
[0100] Step S205 , saving all the to-be-searched data received by the front end before stopping the search in a target format, and determining that the saved results are task-based batch search results.
[0101] The target format may refer to the format in which the data is saved, and the target format may include a compressed format, a table format, a text format, etc. The task-based batch search results may refer to the search results of a single task-based batch search performed by the user.
[0102] Specifically, since during the search process, all the data to be searched that meet the search task will be sent to the front end for display in real time, all the data to be searched received by the front end before stopping the search is the data of all search hits in this task-based batch search.
[0103] After saving all the data to be searched received by the front end before stopping the search in the target format, the saved results can be provided to the front end as new display data to provide the user with the search results of this task-based batch search. That is, this embodiment adopts a combination of real-time display and overall display to provide users with a richer search data display method.
[0104] The above steps will stop the search and save all the data to be searched received by the front end in the target format, determine the saved results as task-based batch search results, integrate the data to be searched that are hit by the search and save them in the target format, thereby providing users with more comprehensive overall search results and improving the display efficiency of data search results.
[0105] This embodiment obtains a search task through a combination of search conditions, so that multiple search conditions can be judged at the same time during the execution of the search task. Moreover, by turning on the task parameters, the search starting position in the database is flexibly adjusted, and there is no need to repeatedly traverse and search the data in the entire database, which effectively improves the efficiency of task-based data search. At the same time, during the search process, the searched data is sent to the front end for real-time display, which improves the efficiency of search result display, thereby improving the efficiency of task-based batch search and display.
[0106] See also Figure 3 , is a flow chart of a task-based batch search method provided in the second embodiment of the present invention. In this task-based batch search method, after stopping the search, the start task parameters can be reset to be quickly applied to the next search process, or the start task parameters can be updated according to the information of stopping the search to continue the current search process.
[0107] The steps for resetting the task parameters are as described in Example 1 and will not be repeated here.
[0108] The steps for updating the start task parameters based on the information of stopping the search include:
[0109] Step S301, determining the target position when the search is stopped as the stop search position;
[0110] Step S302: When the stop search position is different from the preset value, the stop search position is sent to the front end, and the start task parameters are updated with the stop search position.
[0111] The stop search position may refer to the position of the to-be-searched data corresponding to when the search is stopped, and the updated start task parameters are used to continue executing the search task.
[0112] Specifically, the target position corresponding to when the search is stopped is the position corresponding to the data to be searched that is judged as the unfinished search task. Therefore, the target position is used as the stop search position at this time, so that when the search continues, the data to be searched that is judged as the unfinished search task can still be judged.
[0113] In this embodiment, the preset value is set to the address corresponding to the last data to be searched in the database. If the stop search position is different from the preset value, it means that the reason for the stop is that the user performed a stop operation, causing the front end to send a stop instruction to the server, or it was stopped due to objective factors, such as system maintenance, network interruption, etc. At this time, there is a high possibility of continuing the search process. Therefore, the server sends the stop search position to the front end, and the front end updates the start task parameters with the stop search position.
[0114] In this embodiment, by determining the stop search position and updating the start task parameters based on the stop search position, the data search process can efficiently interrupt the search and continue the search, thereby improving the robustness of the data search process and further improving the efficiency of the data search process.
[0115] Corresponding to the task-based batch search method of the above embodiment, Figure 4 The structural block diagram of the task-based batch search device provided in the third embodiment of the present invention is shown. The above-mentioned task-based batch search device is applied to the search end. The server corresponding to the search end has a storage function. The storage function is realized by the database embedded in the server corresponding to the search end. The database contains a number of data to be searched. The server corresponding to the search end is connected to the client corresponding to the front end to obtain the search conditions, start-task parameters and stop instructions from the front end, and send the searched data to the front end. The client corresponding to the front end can directly interact with the user to obtain the search conditions provided by the user, and determine the start-task parameters and stop instructions according to the user's operation data. For the convenience of explanation, only the parts related to the embodiment of the present invention are shown.
[0116] See also Figure 4 , the task-based batch search device includes:
[0117] The condition acquisition module 41 is used to obtain N search conditions from the front end and determine the combination of the N search conditions into a search task, where N is an integer greater than zero;
[0118] The parameter detection module 42 is used to detect whether the start task parameter sent by the front end is received. When the start task parameter is detected, a preset mapping table is used to determine the search starting position corresponding to the start task parameter. The mapping table contains a mapping relationship between the start task parameter and the search starting position;
[0119] The data sending module 43 is used to determine the data to be searched corresponding to the target position in the database using the search starting position as the target position, and send the data to be searched to the front end when the data to be searched meets the search task;
[0120] The data search module 44 is configured to increase the target position by one, return to the database to determine the search data corresponding to the target position, and send the search data to the front end when the search data satisfies the search task, until the target position is the same as the preset value or a stop command is received from the front end, thereby stopping the search;
[0121] The result saving module 45 is used to save all the to-be-searched data received by the front end before stopping the search in a target format, and determine that the saved results are task-based batch search results.
[0122] Optionally, the condition acquisition module 41 includes:
[0123] The method acquisition unit is used to obtain the search method and N search conditions from the front end. The search method includes independent search and combined search;
[0124] A first task determining unit, configured to determine N search condition combinations as a first search task when the search mode is independent search;
[0125] A second task determining unit, configured to determine N search condition combinations as a second search task when the search mode is a combined search;
[0126] Accordingly, the data sending module 43 includes:
[0127] A first data sending unit, configured to send the data to be searched to the front end when the data to be searched meets any search condition in the first search task;
[0128] The second data sending unit is configured to send the data to be searched to the front end when the data to be searched meets all search conditions in the second search task.
[0129] Optionally, the task-based batch search device further includes:
[0130] The instruction detection module is used to detect whether the opening instruction sent by the front end is received when the opening task parameters are not detected;
[0131] The position determination module is used to use the starting position of the database as the search starting position when an opening instruction is detected.
[0132] Optionally, the data sending module 43 includes:
[0133] The data display unit is used to send the data to be searched to the front end, and the front end displays the data to be searched.
[0134] Optionally, the front end includes preset display priorities;
[0135] The above data display units include:
[0136] The data sorting subunit is used to sort the data displayed in the front end and the data to be searched according to the display priority;
[0137] The display update subunit is used to display the data displayed in the front end and the data to be searched according to the sorting results.
[0138] Optionally, the front end includes statistics corresponding to each search criterion;
[0139] The above data display units include:
[0140] The target condition determination subunit is used to send the data to be searched to the front end, and determine the search condition that the data to be searched meets as the target condition among N search conditions;
[0141] The statistical data updating subunit is used to update the statistical data corresponding to the target condition according to the data to be searched, and obtain the updated statistical data corresponding to the target condition;
[0142] The statistical data display subunit is used to display the updated statistical data and the data to be searched on the front end.
[0143] Optionally, the result saving module 45 includes:
[0144] a format acquisition unit, configured to acquire at least one target format, and save all the data to be searched received by the front end before stopping the search according to each target format, to obtain a saved result corresponding to the target format;
[0145] The result determination unit is used to determine that all saved results are task-based batch search results.
[0146] Optionally, the task-based batch search device further includes:
[0147] A stop position determination module is used to determine the target position when the search stops as the stop search position;
[0148] The parameter update module is used to send the stop search position to the front end when the stop search position is different from the preset value, and to update the start task parameters with the stop search position. The updated start task parameters are used to continue executing the search task.
[0149] It should be noted that the information interaction, execution process, etc. between the above-mentioned modules, units, and sub-units are based on the same concept as the embodiment of the method of the present invention. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0150] Figure 5 This is a schematic diagram of the structure of a computer device provided in the fourth embodiment of the present invention. Figure 5 As shown, the computer device of this embodiment includes: at least one processor ( Figure 5 Only one is shown), a memory, and a computer program stored in the memory and executable on at least one processor, wherein when the processor executes the computer program, the steps of any of the above-mentioned task-based batch search method embodiments are implemented.
[0151] The computer device may include, but is not limited to, a processor and a memory. It will be understood by those skilled in the art that Figure 5 The above is merely an example of a computer device and does not constitute a limitation on the computer device. The computer device may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include a network interface, a display screen, and an input device.
[0152] The processor may be a CPU, or other general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor or any conventional processor.
[0153] The memory includes a readable storage medium, an internal memory, etc., wherein the internal memory can be the memory of a computer device, and the internal memory provides an environment for the operation of the operating system and computer-readable instructions in the readable storage medium. The readable storage medium can be a hard disk of the computer device. In other embodiments, it can also be an external storage device of the computer device, for example, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device. Furthermore, the memory can also include both the internal storage unit 0 of the computer device and an external storage device. The memory is used to store the operating system, application programs, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory can also be used to temporarily store data that has been output or is about to be output.
[0154] Those skilled in the art will clearly understand that for the convenience and brevity of description, only the above
[0155] The division of the above functional units and modules is illustrated by way of example. In actual applications, the above functions can be distributed among different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in hardware.
[0156] The present invention can be realized in the form of software functional units. In addition, the specific names of the functional units and modules are only used to distinguish them from each other and are not used to limit the scope of protection of the present invention.
[0157] The specific working process of the centering unit and module can refer to the corresponding process in the above method embodiment, which will not be repeated here. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, this
[0158] The invention can implement all or part of the processes in the above-mentioned embodiment method by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, it can implement the steps of the above-mentioned method embodiment. The computer program includes computer program code, which can be in the form of source code, object code, executable file or some intermediate form. The computer-readable medium can at least include: a computer program capable of carrying the computer program.
[0159] Any entity or device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal, and software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, due to legislation and patent practice, computer-readable media cannot be electric carrier signals or telecommunication signals.
[0160] The present invention may implement all or part of the processes in the above-mentioned method embodiments, and may also be completed through a computer program product. When the computer program product runs on a computer device, the computer device can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0161] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0162] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0163] In the embodiments provided by the present invention, it should be understood that the disclosed apparatus / computer equipment and methods can be implemented in other ways. For example, the apparatus / computer equipment embodiments described above are merely illustrative. For example, the division of modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0164] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0165] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included in the scope of protection of the present invention.
Claims
1. A task-based batch search method, characterized in that: The task-based batch search method includes: Obtain N search conditions from the front end, and determine a combination of the N search conditions into a search task, where N is an integer greater than zero; detecting whether a start task parameter sent by the front end is received, and when the start task parameter is detected, determining a search start position corresponding to the start task parameter using a preset mapping table, wherein the mapping table includes a mapping relationship between the start task parameter and the search start position; Taking the search starting position as the target position, determining the data to be searched corresponding to the target position in the database, and sending the data to be searched to the front end when the data to be searched meets the search task; Incrementing the target position by one, returning to the step of determining the to-be-searched data corresponding to the target position in the database, and sending the to-be-searched data to the front end when the to-be-searched data satisfies the search task, until the target position is equal to a preset value or a stop instruction is received from the front end, thereby stopping the search; All the data to be searched received by the front end before stopping the search are saved in a target format, and the saved results are determined to be task-based batch search results.
2. The task-based batch search method according to claim 1, characterized in that: The acquiring N search conditions from the front end and determining the combination of the N search conditions into a search task includes: Acquire a search method and the N search conditions from the front end, wherein the search method includes independent search and combined search; When the search mode is independent search, determining the N search condition combinations as a first search task; When the search mode is a combined search, determining the N search conditions to be combined into a second search task; When the data to be searched meets the search task, sending the data to be searched to the front end includes: When the data to be searched meets any search condition in the first search task, sending the data to be searched to the front end; When the data to be searched meets all the search conditions in the second search task, the data to be searched is sent to the front end.
3. The task-based batch search method according to claim 1, characterized in that: The task-based batch search method further includes: When the start task parameter is not detected, detecting whether the start instruction sent by the front end is received; When the start instruction is detected, the starting position of the database is used as the search starting position.
4. The task-based batch search method according to claim 1, characterized in that: Sending the to-be-searched data to the front end includes: The data to be searched is sent to the front end, and the front end displays the data to be searched.
5. The task-based batch search method according to claim 4, characterized in that: The front end includes a preset display priority; The displaying of the to-be-searched data by the front end includes: sorting the data displayed in the front end and the data to be searched according to the display priority; According to the sorting result, the front end displays the displayed data and the data to be searched.
6. The task-based batch search method according to claim 4, characterized in that: The front end includes statistical data corresponding to each search condition; The displaying of the to-be-searched data by the front end includes: Among the N search conditions, determining the search condition that the data to be searched meets as the target condition; updating the statistical data corresponding to the target condition according to the data to be searched, to obtain updated statistical data corresponding to the target condition; The front end displays the updated statistical data and the data to be searched.
7. The task-based batch search method according to claim 1, characterized in that: The step of saving all the to-be-searched data received by the front end before stopping the search in a target format and determining that the saved results are task-based batch search results includes: Obtain at least one target format, and save all the data to be searched received by the front end before stopping the search according to each target format, to obtain a saved result corresponding to the target format; Determine that all saved results are the task-based batch search results.
8. The task-based batch search method according to any one of claims 1 to 7, characterized in that: After stopping the search, the method further includes: Determine the target position when the search is stopped as the stop search position; When the stop search position is different from a preset value, the stop search position is sent to the front end, and the start task parameter is updated with the stop search position. The updated start task parameter is used to continue executing the search task.
9. A task-based batch search device, characterized in that: The task-based batch search device includes: A condition acquisition module is used to obtain N search conditions from the front end and determine the combination of the N search conditions into a search task, where N is an integer greater than zero; a parameter detection module, configured to detect whether a start task parameter sent by the front end is received, and upon detecting the start task parameter, determine a search start position corresponding to the start task parameter using a preset mapping table, wherein the mapping table includes a mapping relationship between the start task parameter and the search start position; a data display module, configured to use the search starting position as a target position, determine the to-be-searched data corresponding to the target position in a database, and send the to-be-searched data to the front end when the to-be-searched data satisfies the search task; a data search module configured to increase the target position by one, return to execute the steps of determining the search data corresponding to the target position in the database, and send the search data to the front end when the search data satisfies the search task, until the target position is the same as a preset value or a stop instruction is received from the front end, thereby stopping the search; The result saving module is used to save all the to-be-searched data received by the front end before stopping the search in a target format, and determine that the saved results are task-based batch search results.
10. A computer device, characterized in that: The computer device includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the task-based batch search method according to any one of claims 1 to 8 is implemented.
11. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the task-based batch search method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Elasticsearch search engine index construction method and device
CN113672627A
Caching search-related data in a semi-structured database
US20160371391A1