CN107391382B - Target searching method and device - Google Patents

Target searching method and device Download PDF

Info

Publication number
CN107391382B
CN107391382B CN201710671862.0A CN201710671862A CN107391382B CN 107391382 B CN107391382 B CN 107391382B CN 201710671862 A CN201710671862 A CN 201710671862A CN 107391382 B CN107391382 B CN 107391382B
Authority
CN
China
Prior art keywords
search
searched
target
searching
condition
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710671862.0A
Other languages
Chinese (zh)
Other versions
CN107391382A (en
Inventor
蒋晓海
程明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Testin Information Technology Co Ltd
Original Assignee
Beijing Testin Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Testin Information Technology Co Ltd filed Critical Beijing Testin Information Technology Co Ltd
Priority to CN201710671862.0A priority Critical patent/CN107391382B/en
Publication of CN107391382A publication Critical patent/CN107391382A/en
Application granted granted Critical
Publication of CN107391382B publication Critical patent/CN107391382B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3636Software debugging by tracing the execution of the program

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a target searching method and a device, wherein the method comprises the following steps: determining a preset search condition for searching a target to be searched; determining a first search condition from the preset search conditions, wherein the first search condition is used for representing a necessary condition for obtaining the target to be searched through searching; and searching the target to be searched according to the first search condition. When the technical scheme provided by the embodiment of the application is used for searching the target control in the test result of the tested software, the optional condition for searching the target control can be determined from the preset search condition, and then the target control is searched in the test result according to the optional condition.

Description

Target searching method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a target search method and apparatus.
Background
In the software development process, software is usually tested, whether the software meets the design requirements is determined according to the test result, and then the performance of the software is evaluated. Specifically, whether the test result meets an expected result or not can be determined by judging whether the test result contains the target control or not, and then the performance of the tested software is evaluated.
When judging whether the test result contains the target control, firstly, the target control which accords with the expected result can be determined according to the expected result, and secondly, whether the test result contains the target control is judged in a mode of searching the target control in the test result. At this time, if the target control is searched in the test result, the test result can be determined to meet the expected result, and the performance of the tested software meets the test requirement; if the target control is not searched in the test result, the test result can be determined to be not in accordance with the expected result, and the performance of the tested software is determined to be not in accordance with the test requirement.
Generally, when searching for a target control in a test result, a plurality of preset search conditions for searching for the target control may be first determined, and then the target control may be searched in the test result according to the preset search conditions. However, in practical applications, when the target control is searched by using a plurality of preset search conditions, a plurality of searches from the test result are often required according to the plurality of preset search conditions, which results in low search efficiency.
Disclosure of Invention
The embodiment of the application provides a target searching method and device, which are used for solving the problem that in the prior art, when a target control is searched from a test result of tested software, the searching efficiency is low.
The embodiment of the application provides a target searching method, which comprises the following steps:
determining a preset search condition for searching a target to be searched;
determining a first search condition from the preset search conditions, wherein the first search condition is used for representing a necessary condition for obtaining the target to be searched through searching;
and searching the target to be searched according to the first search condition.
An embodiment of the present application provides a target search apparatus, including:
the device comprises a determining unit, a searching unit and a searching unit, wherein the determining unit is used for determining preset searching conditions for searching a target to be searched, and determining a first searching condition from the preset searching conditions, and the first searching condition is used for representing a necessary condition for obtaining the target to be searched by searching;
and the searching unit is used for searching the target to be searched according to the first searching condition determined by the determining unit.
An embodiment of the present application provides a target search apparatus, including: a memory and a processor, wherein:
a memory for storing a program;
a processor for executing the program stored in the memory, and specifically executing:
determining a preset search condition for searching a target to be searched;
determining a first search condition from the preset search conditions, wherein the first search condition is used for representing a necessary condition for obtaining the target to be searched through searching;
and searching the target to be searched according to the first search condition.
An embodiment of the present application provides a computer-readable storage medium storing one or more programs that, when executed by an electronic device including a plurality of application programs, cause the electronic device to perform a method of:
determining a preset search condition for searching a target to be searched;
determining a first search condition from the preset search conditions, wherein the first search condition is used for representing a necessary condition for obtaining the target to be searched through searching;
and searching the target to be searched according to the first search condition.
The embodiment of the application adopts at least one technical scheme which can achieve the following beneficial effects:
according to the technical scheme provided by the embodiment of the application, the preset search condition for searching the target to be searched is determined; determining a first search condition from the preset search conditions, wherein the first search condition is used for representing a necessary condition for obtaining the target to be searched through searching; and searching the target to be searched according to the first search condition. When the technical scheme provided by the embodiment of the application is used for searching the target control in the test result of the tested software, the optional condition for searching the target control can be determined from the preset search condition, and then the target control is searched in the test result according to the optional condition.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a schematic flowchart of a target search method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of another target search method provided in an embodiment of the present application;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a target search apparatus according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of another target search apparatus according to an embodiment of the present application;
Detailed Description
In the prior art, in the process of testing the software to be tested, a certain control in an expected result can be used as a target control, and whether the test result meets the expected result or not is judged in a mode of searching the target control in the test result, so that the performance of the software to be tested is evaluated.
For example, when testing the "login" performance of the software to be tested, the interface after the software to be tested is successfully logged in can be determined according to an expected result, and a certain control in the interface is used as a target control, so that after the "login" performance of the software to be tested is tested and the logged test interface is obtained, the target control can be searched in the test interface, if the target control can be searched in the test interface, the software to be tested can be considered to be successfully logged in, and the "login" performance of the software to be tested meets the test requirement; otherwise, if the target control is not searched in the test interface, it can be considered that the tested software is not successfully logged in, and the "logging" performance of the tested software does not meet the test requirement.
Generally, when searching for a target control in a test result, a plurality of search conditions (for example, an identifier of the target control (i.e., an ID of the target control), a type of the target control, a text included in the target control, and the like) for searching for the target control may be preset, and the target control may be searched in the test result according to the preset plurality of search conditions. However, research finds that, when the target control is searched according to a plurality of preset search conditions, at least the following problems exist:
(1) when searching is performed according to a plurality of preset search conditions, there is no unified rule, some search conditions may be randomly selected for searching, or some search conditions that may have a certain relationship may be selected for searching, for example, if the preset search conditions are A, B, C, D and E, then a and B may be randomly selected for searching, or B and C that may have a certain relationship may be selected for searching, so that the search logic is unclear, and after a target control is searched, it is unclear according to which preset search conditions the search conditions are searched;
(2) because the search logic is ambiguous, after the search is performed according to a plurality of search conditions and the search fails, the search conditions are reselected for the search, so that the search times are more, and the search efficiency is lower;
(3) when the preset search condition is used for searching, the test result needs to be traversed in each search, so that the searching efficiency is low.
In order to solve the above problem, an embodiment of the present application provides a target search method and an apparatus, where the target search method includes: determining a preset search condition for searching a target to be searched; determining a first search condition from the preset search conditions, wherein the first search condition is used for representing a necessary condition for obtaining the target to be searched through searching; and searching the target to be searched according to the first search condition.
When the technical scheme provided by the embodiment of the application is used for searching the target control in the test result of the tested software, the optional condition for searching the target control can be determined from the preset search condition, and then the target control is searched in the test result according to the optional condition.
The idea of the embodiment of the application can be as follows:
when searching for an object to be searched by using a plurality of preset search conditions, the plurality of preset search conditions can uniquely determine (i.e., search for) the object to be searched, however, when actually searching according to the plurality of search conditions, some search conditions are optional conditions (i.e., the object control, such as the identifier of the object control, can be searched by searching through the conditions), some search conditions are optional conditions (i.e., the object control can be searched by searching through the options, or the object control can be searched without searching through the conditions, such as the object control includes an input box, the text input in the input box is uncertain, the text condition can be regarded as an optional condition), and some search conditions are ignoring conditions (i.e., the object control can be searched without searching according to the conditions, such as the object control does not include text, the text condition may be considered an ignore condition).
In view of this, when searching for a target to be searched, the embodiment of the present application may determine which of a plurality of preset search conditions used for searching for the target to be searched is a required condition, which of the plurality of preset search conditions is an optional condition, and which of the plurality of preset search conditions is an ignoring condition (the optional condition and the ignoring condition may be collectively referred to as an optional condition), so that the target to be searched may be selectively searched according to the required condition and the optional condition. Meanwhile, because the search has logicality, the times of searching the target to be searched can be reduced, and the search efficiency is improved.
In addition, the target search method provided in the embodiment of the application may not be limited to a fixed policy or mode when determining the optional conditions and the optional conditions in the preset search conditions, so that which of the preset search conditions are optional conditions and which are optional conditions can be determined more flexibly.
The technical solutions of the present application will be described clearly and completely below with reference to the specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the target search method provided in the embodiment of the present application may be applied to: when or after testing the software to be tested, searching a target control (the target control is a target to be searched) in the test result, and the method can also be applied to: and (3) using a plurality of preset search conditions to search other application scenarios of the target to be searched, which is not specifically limited in the embodiment of the present application. The embodiment of the present application may be described by taking an example of testing software to be tested and searching a target control in a test result.
When the target to be searched is searched in the test result by using the target searching method provided by the embodiment of the application, the target to be searched can be a certain target control contained in an expected result corresponding to the test result, wherein the target control can be used for verifying whether the test result of the software to be tested is accurate.
After the target to be searched is searched, if the number of the obtained search results is one, it can be determined that the target to be searched is obtained through searching, and if the number of the obtained search results is not one, it can be determined that the target to be searched is not obtained through searching.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Fig. 1 is a schematic flowchart of a target search method according to an embodiment of the present application. The method is as follows.
The embodiment of the application is described by taking an example of searching a target control in a test result of tested software, where the target control may be a control included in an expected result corresponding to the test result, and the target control is used to verify whether the test result meets the expected result.
Step 101: and determining a preset search condition for searching the target to be searched.
In step 101, during the process of testing the software to be tested, or after the software to be tested is tested, the target control may be searched in the test result to verify whether the test result meets an expected result, where the target control may be regarded as the target to be searched. At this time, a preset search condition for searching the target to be searched may be determined.
In this embodiment of the application, if the target to be searched is a target control, the preset search condition may be a condition related to the control, for example, the preset search condition may be an identifier of the control (i.e., an ID of the control), a type of the control, a position of the control in the test result, and other attributes of the control. And is not particularly limited herein.
It should be noted that, in other application scenarios, the preset search condition may be specifically determined according to the target to be searched, and the embodiment of the present application is not specifically limited.
The number of the preset search conditions may be one or multiple, and the embodiment of the present application takes the number of the preset search conditions as an example for description.
After determining the preset search condition, step 102 may be performed.
Step 102: and determining a first search condition from the preset search conditions.
In step 102, after the preset search condition is determined, a first search condition may be further determined from the preset search condition, where the first search condition may be used to characterize a necessary condition for obtaining the target to be searched through search.
In this embodiment of the present application, determining a first search condition from the preset search conditions specifically includes:
determining the characteristic information of the target to be searched;
and determining the first search condition from the preset search conditions according to the characteristic information of the target to be searched.
The feature information of the target to be searched may be attribute information of the target to be searched, and the number of the feature information may be one or multiple, for example, the target to be searched has a unique identifier, includes a text input box, and belongs to a type a control, and then the feature information of the target to be searched may be identifier information, text information, and type information.
When the first search condition is determined according to the feature information of the target to be searched, all the feature information of the target to be searched may be used as the first search condition, or several feature information thereof may be selected as the first search condition, which is not specifically limited herein.
In practical applications, a policy for determining the first search condition may be preset, for example, an identifier of the target to be searched may be preset as the first search condition. Thus, when determining the first search condition, the first search condition may be determined according to a preset policy.
In addition, it may also be determined which preset search conditions may be used as the first search condition according to a specific situation or a business requirement, for example, the type of the target to be searched may be used as the first search condition according to a specific situation.
The method for determining the first search condition in the embodiment of the application is flexible, as long as the determined first search condition can be a necessary condition for obtaining the target to be searched through searching.
In this embodiment, the number of the first search conditions may be one, multiple, or zero, and when the number of the first search conditions is not zero, step 103 may be executed.
Step 103: and searching the target to be searched according to the first search condition.
In step 103, after determining the first search condition, the target to be searched may be searched according to the first search condition.
Based on the content described in step 102, the number of the first search conditions may be one or multiple, and for different numbers of the first search conditions, the embodiments of the present application may use different methods to search for the target to be searched. Specifically, the method comprises the following steps:
searching the target to be searched according to the first search condition, wherein the searching comprises the following steps:
if the number of the first search conditions is one, searching the target to be searched in a target library according to the first search conditions;
if the number of the first search conditions is more than one, searching the target to be searched in the target library according to one of the first search conditions, and screening search results by using the rest of the first search conditions.
The target library may be a database containing different targets, and in the embodiment of the present application, the target library may contain a control in a test result after the test of the software to be tested is performed.
That is, when the number of the first search conditions is one, the target library may be searched directly according to the first search conditions, and when the number of the first search conditions is plural, one of the first search conditions may be selected, the target library may be searched according to the selected first search condition, and the obtained search result may be filtered using the other first search condition. When one of the first search conditions is selected from the plurality of first search conditions, the selection may be in an arbitrary selection manner, or may be selected according to a preset manner (for example, the identifier of the target to be searched is preset to be selected for searching), which is not limited herein.
In this way, regardless of whether the number of the first search conditions is one or more, the target library can be traversed only once (other search processes are all screening processes of the search result of the previous step), and because the number of times of traversing the target library is reduced, the search efficiency of searching the target to be searched can be improved.
In the embodiment of the present application, after the target to be searched is searched according to the first search condition, the number of the obtained search results can be divided into the following three cases:
in the first case: the number of the search results is zero;
in the second case: the number of the search results is one;
in the third case: the number of the search results is greater than one.
In view of the first case described above,
the number of the search results is zero, which may indicate that the target to be searched does not exist in the target library, and at this time, it may be determined that the target to be searched is not searched.
In view of the second situation described above,
the number of the search results is one, which can indicate that the only target to be searched is searched in the target library, at this time, the target to be searched can be determined to be searched, and the search result is the searched target.
In view of the third situation described above,
the number of the search results is multiple, which may indicate that a unique result is not searched in the target library, and at this time, the multiple search results may be further filtered, so as to determine that a unique search result is obtained.
It should be noted that, in the embodiment of the present application, when a unique search result is not obtained, the unique search result is determined by screening the plurality of search results, instead of searching again from the target library to obtain the unique search result, so that on one hand, the number of times of traversing the target library is reduced, and the search efficiency is improved, and on the other hand, the time taken for screening the search result is shorter, and the search efficiency can be further improved.
When the plurality of search results are filtered, specifically, a second search condition may be determined from the preset search conditions, and the plurality of searches may be filtered by using the second search condition, so as to obtain a unique search result. The second search condition may be an optional condition for characterizing the search of the target to be searched.
When the second search condition is determined, all the other conditions except the first search condition in the preset search condition may be determined as the second search condition, or an ignoring condition may be determined from the preset search condition (that is, it is not necessary to search for the target to be searched according to these conditions, and it may be specifically determined according to the feature information of the target to be searched, for example, if the feature information of the target to be searched does not include text information, a text condition may be used as the ignoring condition), and other conditions except the first search condition and the ignoring condition in the preset search condition are used as the second search condition, which is not specifically limited herein.
In this embodiment of the application, the number of the second search criteria may be zero, one, or multiple, and then, when the second search criteria is used to filter multiple search results:
if the number of the second search conditions is zero, it may be stated that no search condition screens the plurality of search results, and at this time, it may be determined that the target to be searched is not searched under the condition that the plurality of search results are provided;
if the number of the second search conditions is one, the second search conditions can be directly used for screening a plurality of search results;
if the number of the second search conditions is multiple, each of the second search conditions may be sequentially used to filter the search results, where the order of filtering using the multiple second search conditions is not particularly limited.
After the method described above, the method further includes, after the second search condition is used to filter the plurality of search results, the method further including:
if the number of the screened search results is one, determining that the target to be searched is searched;
and if the number of the screened search results is not one, determining that the target to be searched is not searched.
That is to say, after the second search condition is used to screen the plurality of search results, if the number of the obtained search results is one, it may be determined that a unique search result is searched according to the first search condition and the second search condition, and at this time, the screened search result is the searched target; if the number of the obtained search results is not one, it may be determined that the target to be searched is not searched according to the first search condition and the second search condition.
It should be noted that, in practical applications, when a plurality of search results are filtered by using a plurality of second search criteria, not all of the second search criteria are used, for example, the number of the second search criteria is 3, and a unique search result can be obtained by filtering by using 2 of the second search criteria, so that the remaining second search criteria may not be used for filtering.
In another embodiment provided herein, the method further comprises:
if the number of the first search conditions is zero, determining second search conditions from the preset search conditions, wherein the second search conditions are used for representing optional conditions for searching the target to be searched;
and searching the target to be searched according to the second search condition.
In the embodiment of the present application, based on the content described in step 102, if the number of the first preset conditions determined from the preset search conditions is zero, the second search condition may be determined from the preset search conditions according to the method described above, and the target to be searched may be searched according to the second search condition.
In this embodiment of the present application, the number of the second search conditions may be one or multiple (in practical applications, if the number of the first search conditions is zero, the number of the second search conditions is usually not zero, and therefore, in this embodiment, the case that the number of the second search conditions is zero may not be considered), and when searching for the target to be searched according to the second search conditions, specifically, the method includes:
if the number of the second search conditions is one, searching the target to be searched in a target library according to the second search conditions;
and if the number of the second search conditions is more than one, selecting one of the second search conditions to search the target to be searched in the target library, and after a search result is obtained, screening the search result by using the rest of the second search conditions.
That is, when the number of the second search conditions is one, the target to be searched can be directly searched in the target library according to the second search conditions; when the number of the second search conditions is more than one, one of the second search conditions can be selected, the target library is searched according to the selected second search condition, and the obtained search result is screened by using the other second search conditions. When one of the second search conditions is selected from the plurality of second search conditions, the selection may be in an arbitrary selection manner, or may be selected according to a preset manner (for example, a text of the target to be searched is preset for searching), which is not limited herein.
In this way, the target library can be traversed only once no matter the number of the second search conditions is one or more, and the number of times of traversing the target library is reduced, so that the search efficiency of searching the target to be searched can be improved.
When a plurality of second search conditions are used and one of the second search conditions is selected for searching, if no target is searched from the target library, the second search condition is discarded or used as a skip condition, and one of the remaining second search conditions is selected for searching in the target library. In this way, the target to be searched can be searched from the target library to the maximum extent possible.
After the second search condition is used for searching the target to be searched, the number of searched search results may be one, may not be one, or may be multiple, if the number of the search results is one, it may be determined that the target to be searched is searched, and the search result is the searched target; if the number of the search results is not one, it may be determined that the target to be searched is not searched.
It should be noted that, in practical applications, when searching the target to be searched, the first search condition and the second search condition may be determined simultaneously according to the preset search condition, and it is determined whether the number of the first search condition is zero, if the number of the first search condition is not zero, the method described above is used, the target to be searched is searched in the target library according to the first search condition, and the second search condition is used to screen a plurality of search results according to the method described above; if the number of the first search conditions is zero, the target to be searched may be searched in the target library by using one of the second search conditions according to the method described above, and the search results may be screened by using the other second search conditions.
According to the technical scheme provided by the embodiment of the application, when the target control is searched in the test result of the tested software, the optional condition for searching the target control can be determined from the preset search condition, and then the target control is searched in the test result according to the optional condition.
In addition, because the search target can be searched according to the optional conditions and the optional conditions in the preset search conditions, compared with the prior art that the search target is searched without search logic according to a plurality of preset search conditions, the search has logicality, and after the search result is obtained, the search result can be clearly obtained according to which search conditions, so that the search process is controllable. Meanwhile, because the search has logicality, the times of searching the target to be searched can be reduced, and the search efficiency is improved.
Fig. 2 is a schematic flowchart of another target search method provided in an embodiment of the present application. The embodiment of the application takes the example of searching the target control in the test result of the tested software as an example for explanation. The method is as follows.
Firstly: the method comprises the steps of determining preset search conditions for searching a target to be searched, determining necessary conditions for representing and searching to obtain the target to be searched from the preset search conditions, and determining optional conditions for representing and searching the target to be searched.
Secondly, the method comprises the following steps: and searching the target control to be searched according to the necessary condition and the optional condition.
When the target control to be searched is searched, the number of the necessary conditions can be judged firstly. And then determining how to search the target control to be searched according to the number of the necessary conditions.
In this embodiment of the present application, the number of the optional conditions may be zero, one, or multiple, and then:
and searching the target control to be searched according to the optional condition when the number of the optional condition is zero. Specifically, the number of the optional conditions may be determined, and the search is performed according to the number of the optional conditions:
if the number of the selectable conditions is zero, determining that the target control to be searched is not searched;
if the number of the selectable conditions is one, searching from a target control library (the target control library can contain controls in test results) by using the selectable condition, after obtaining a search result, if the number of the search result is one, determining that the target control to be searched is obtained by searching, and if the number of the search result is not one, determining that the target control to be searched is not obtained by searching;
if the number of the optional conditions is multiple, one of the optional conditions is used for searching from the target control library, and the other optional conditions are used for screening the search results, at this time, if the number of the obtained search results is one, the target control to be searched can be determined to be obtained through searching, and if the number of the obtained search results is not one, the target control to be searched can be determined not to be obtained through searching.
When the number of the optional conditions is one, searching the target control to be searched from the target control library directly according to the optional conditions, judging whether the number of the obtained search results is one, if so, determining that the target control to be searched is obtained through searching, if not, judging whether the number of the search results is more than one, and if so, screening a plurality of search results by using the optional conditions; if not (namely the number of the search results is zero), the target control to be searched can be determined to be obtained without searching.
When the selectable conditions are used for screening a plurality of search results, whether the number of the selectable conditions is zero or not can be judged, if yes, the target control to be searched can be directly determined to be obtained without searching, and if not, the selectable conditions can be used for screening the plurality of search results. At this time, if the number of the screened search results is one, it may be determined that the target control to be searched is obtained by searching, and if the number of the screened search results is not one, it may be determined that the target control to be searched is not obtained by searching.
When the number of the optional conditions is multiple, the target control to be searched can be searched from the target control library according to one of the optional conditions, and the search results are screened by using other optional conditions. At this time, the method described above may be used to determine whether the number of search results searched using the required condition is one, and further determine whether the target control is searched for when the search of the target control to be searched is completed, and the description is not repeated here.
According to the technical scheme provided by the embodiment of the application, when the target control is searched, the preset search condition for searching the target control is determined, the optional condition and the optional condition are determined, when the number of the optional condition is zero, the search is performed according to the optional condition, when the number of the optional condition is not zero, the search is performed according to the optional condition and the optional condition, so that the search process has definite search logic, and when the optional condition of the optional condition is used for searching, the target control library is traversed once, and other search processes are all screening processes of the search result in the previous step, so that the search time can be shortened, and the search efficiency is improved.
Fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 3, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include hardware required for other services. The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to form the target searching device on the logic level. Of course, besides the software implementation, the present application does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.
Fig. 4 is a schematic structural diagram of a target search apparatus according to an embodiment of the present application. The target search apparatus includes: a determination unit 41 and a search unit 42, wherein:
the determining unit 41 is configured to determine preset search conditions for searching the target to be searched, and determine a first search condition from the preset search conditions, where the first search condition is used to represent a necessary condition for obtaining the target to be searched through searching;
the searching unit 42 searches the target to be searched according to the first searching condition determined by the determining unit 41.
The determining unit 41, configured to determine a first search condition from the preset search conditions, includes:
determining the characteristic information of the target to be searched;
and determining the first search condition from the preset search conditions according to the characteristic information of the target to be searched.
The searching unit 42, which searches the target to be searched according to the first search condition, includes:
if the number of the first search conditions is one, searching the target to be searched in a target library according to the first search conditions;
if the number of the first search conditions is more than one, searching the target to be searched in the target library according to one of the first search conditions, and screening search results by using the rest of the first search conditions.
In this embodiment, the target search apparatus further includes: a processing unit 43, wherein:
the processing unit 43, after the searching unit 42 searches the target to be searched according to the first search condition, if the number of the search results searched by the searching unit 42 is zero, determining that the target to be searched is not searched;
if the number of the search results is one, determining that the target to be searched is searched;
if the number of the search results is greater than one, determining a second search condition from the preset search conditions, if the number of the second search condition is zero, determining that the target to be searched is not obtained through searching, if the number of the second search condition is not zero, screening the search results according to the second search condition, wherein the second search condition is used for representing an optional condition for searching the target to be searched.
The processing unit 43, performing screening on the search result according to the second search condition, including:
if the number of the second search conditions is one, screening the search results according to the second search conditions;
and if the number of the second search conditions is more than one, screening the search results according to each second search condition in sequence.
The processing unit 43, after the search results are screened according to the second search condition, if the number of the screened search results is one, determining that the target to be searched is searched; and if the number of the screened search results is not one, determining that the target to be searched is not searched.
In another embodiment provided by the present application, if the number of the determined first search conditions is zero, the determining unit 41 determines a second search condition from the preset search conditions, where the second search condition is used to represent an optional condition for searching the target to be searched;
the searching unit 42 searches the target to be searched according to the second search condition determined by the determining unit 41.
The searching unit 42, which searches the target to be searched according to the second search condition, includes:
if the number of the second search conditions is one, searching the target to be searched in a target library according to the second search conditions;
and if the number of the second search conditions is more than one, selecting one of the second search conditions to search the target to be searched in the target library, and screening search results by using the rest of the second search conditions.
In this embodiment of the application, after the searching unit 42 searches the target to be searched according to the second search condition, if the number of the search results searched by the searching unit 42 is one, the processing unit 43 determines that the target to be searched is searched;
and if the number of the searched search results is not one, determining that the target to be searched is not searched.
Fig. 5 is a schematic structural diagram of another object searching apparatus according to an embodiment of the present application. The apparatus 500 may comprise: a channel interface 501 and a processor 502, optionally including a memory 503.
The channel interface 501, processor 502 and memory 503 may be interconnected by a bus 504 system. The bus 504 may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 5, but this does not indicate only one bus or one type of bus.
Optionally, a memory 503 is included for storing programs. In particular, the program may include program code comprising computer operating instructions. Memory 503 may include both read-only memory and random-access memory, and provides instructions and data to processor 502. The Memory 503 may include a Random-Access Memory (RAM) and may further include a non-volatile Memory (non-volatile Memory), such as at least 1 disk Memory.
The processor 502 is configured to execute the following operations, optionally, execute the program stored in the memory 503, and specifically, execute the following operations:
determining a preset search condition for searching a target to be searched;
determining a first search condition from the preset search conditions, wherein the first search condition is used for representing a necessary condition for obtaining the target to be searched through searching;
and searching the target to be searched according to the first search condition.
The method performed by the target search apparatus or the Master node according to the embodiments of fig. 1 to 2 of the present application may be applied to the processor 502 or implemented by the processor 502. The processor 502 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 502. The Processor 502 may be a general-purpose Processor including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 503, and the processor 502 reads the information in the memory 503 and completes the steps of the above method in combination with the hardware thereof.
The target search apparatus 500 may also perform the method of fig. 1 and implement the method performed by the manager node.
Embodiments of the present application also provide a computer-readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a portable electronic device comprising a plurality of application programs, enable the portable electronic device to perform the method recited in fig. 1.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (6)

1. A method of searching for an object, comprising:
determining a preset search condition for searching a target to be searched;
determining a first search condition from the preset search conditions, wherein the first search condition is used for representing a necessary condition for obtaining the target to be searched through searching;
searching the target to be searched according to the first search condition;
if the number of the searched search results is zero, determining that the target to be searched is not searched;
if the number of the search results is one, determining that the target to be searched is searched;
if the number of the search results is greater than one, determining a second search condition from the preset search conditions, if the number of the second search condition is zero, determining that the target to be searched is not obtained through searching, if the number of the second search condition is not zero, screening the search results according to the second search condition, wherein the second search condition is used for representing an optional condition for searching the target to be searched;
if the number of the screened search results is one, determining that the target to be searched is searched;
if the number of the screened search results is not one, determining that the target to be searched is not searched;
determining a first search condition from the preset search conditions, wherein the determining the first search condition comprises:
determining the characteristic information of the target to be searched; the target to be searched has a unique identifier, comprises a text input box and belongs to a type A control, and the characteristic information of the target to be searched is identifier information, text information and type information;
determining the first search condition from the preset search conditions according to the characteristic information of the target to be searched;
searching the target to be searched according to the first search condition, wherein the searching comprises the following steps:
if the number of the first search conditions is one, searching the target to be searched in a target library according to the first search conditions;
if the number of the first search conditions is more than one, searching the target to be searched in the target library according to one of the first search conditions, and screening search results by using the rest of the first search conditions;
when the number of the second search conditions is multiple and one of the second search conditions is selected for searching, if the target to be searched is not searched, the second search condition is discarded or used as a neglect condition, and one search condition is selected from the rest of the second search conditions for searching; and when the target to be searched is searched, simultaneously determining the first searching condition and the second searching condition according to the preset searching condition, and judging whether the number of the first searching condition is zero or not.
2. The object searching method of claim 1, wherein the filtering the search result according to the second search condition comprises:
if the number of the second search conditions is one, screening the search results according to the second search conditions;
and if the number of the second search conditions is more than one, screening the search results according to each second search condition in sequence.
3. The object search method of claim 1, wherein the method further comprises:
if the number of the first search conditions is zero, determining second search conditions from the preset search conditions, wherein the second search conditions are used for representing optional conditions for searching the target to be searched;
and searching the target to be searched according to the second search condition.
4. The target searching method of claim 3, wherein searching for the target to be searched according to the second search condition comprises:
if the number of the second search conditions is one, searching the target to be searched in a target library according to the second search conditions;
and if the number of the second search conditions is more than one, selecting one of the second search conditions to search the target to be searched in the target library, and screening search results by using the rest of the second search conditions.
5. The object searching method of claim 4, wherein after searching for the object to be searched according to the second search condition, the method further comprises:
if the number of the searched search results is one, determining that the target to be searched is searched;
and if the number of the searched search results is not one, determining that the target to be searched is not searched.
6. An object search apparatus, comprising:
the device comprises a determining unit, a searching unit and a searching unit, wherein the determining unit is used for determining preset searching conditions for searching a target to be searched, and determining a first searching condition from the preset searching conditions, and the first searching condition is used for representing a necessary condition for obtaining the target to be searched by searching;
the searching unit is used for searching the target to be searched according to the first searching condition determined by the determining unit;
the processing unit is used for determining that the target to be searched is not searched if the number of the search results searched by the search unit is zero after the search unit searches the target to be searched according to the first search condition;
if the number of the search results is one, determining that the target to be searched is searched;
if the number of the search results is greater than one, determining a second search condition from the preset search conditions, if the number of the second search condition is zero, determining that the target to be searched is not obtained through searching, if the number of the second search condition is not zero, screening the search results according to the second search condition, wherein the second search condition is used for representing an optional condition for searching the target to be searched;
after the search results are screened according to the second search condition, if the number of the screened search results is one, determining that the target to be searched is searched; if the number of the screened search results is not one, determining that the target to be searched is not searched;
wherein the determining unit determines a first search condition from the preset search conditions, and includes:
determining the characteristic information of the target to be searched; the target to be searched has a unique identifier, comprises a text input box and belongs to a type A control, and the characteristic information of the target to be searched is identifier information, text information and type information;
determining the first search condition from the preset search conditions according to the characteristic information of the target to be searched;
the searching unit searches the target to be searched according to the first searching condition, and comprises:
if the number of the first search conditions is one, searching the target to be searched in a target library according to the first search conditions;
if the number of the first search conditions is more than one, searching the target to be searched in the target library according to one of the first search conditions, and screening search results by using the rest of the first search conditions;
when the number of the second search conditions is multiple and one of the second search conditions is selected for searching, if the target to be searched is not searched, the second search condition is discarded or used as a neglect condition, and one search condition is selected from the rest of the second search conditions for searching; and when the target to be searched is searched, simultaneously determining the first searching condition and the second searching condition according to the preset searching condition, and judging whether the number of the first searching condition is zero or not.
CN201710671862.0A 2017-08-08 2017-08-08 Target searching method and device Active CN107391382B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710671862.0A CN107391382B (en) 2017-08-08 2017-08-08 Target searching method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710671862.0A CN107391382B (en) 2017-08-08 2017-08-08 Target searching method and device

Publications (2)

Publication Number Publication Date
CN107391382A CN107391382A (en) 2017-11-24
CN107391382B true CN107391382B (en) 2020-11-20

Family

ID=60355194

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710671862.0A Active CN107391382B (en) 2017-08-08 2017-08-08 Target searching method and device

Country Status (1)

Country Link
CN (1) CN107391382B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101013430A (en) * 2007-01-29 2007-08-08 华为技术有限公司 Searching method and apparatus
CN103425664A (en) * 2012-05-16 2013-12-04 阿里巴巴集团控股有限公司 Method and equipment for searching and displaying entity data units
CN104572654A (en) * 2013-10-12 2015-04-29 腾讯科技(深圳)有限公司 User searching method and device
CN104634350A (en) * 2013-11-14 2015-05-20 北京四维图新科技股份有限公司 Method and device for inquiring gas station information as well as navigation terminal
CN105786851A (en) * 2014-12-23 2016-07-20 北京奇虎科技有限公司 Question and answer knowledge base construction method as well as search provision method and apparatus
CN106407337A (en) * 2016-09-05 2017-02-15 深圳震有科技股份有限公司 Quick search method and system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9405832B2 (en) * 2012-05-31 2016-08-02 Apple Inc. Application search query classifier
CN103970761B (en) * 2013-01-28 2018-05-01 阿里巴巴集团控股有限公司 A kind of commodity data searching method and device
CN106815140A (en) * 2015-12-02 2017-06-09 北京奇虎科技有限公司 A kind of interface test method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101013430A (en) * 2007-01-29 2007-08-08 华为技术有限公司 Searching method and apparatus
CN103425664A (en) * 2012-05-16 2013-12-04 阿里巴巴集团控股有限公司 Method and equipment for searching and displaying entity data units
CN104572654A (en) * 2013-10-12 2015-04-29 腾讯科技(深圳)有限公司 User searching method and device
CN104634350A (en) * 2013-11-14 2015-05-20 北京四维图新科技股份有限公司 Method and device for inquiring gas station information as well as navigation terminal
CN105786851A (en) * 2014-12-23 2016-07-20 北京奇虎科技有限公司 Question and answer knowledge base construction method as well as search provision method and apparatus
CN106407337A (en) * 2016-09-05 2017-02-15 深圳震有科技股份有限公司 Quick search method and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于组合条件的Web信息搜索方法;雷鹏飞;《中国优秀硕士学位论文全文数据库 信息科技辑》;20170415(第04期);I139-25 *

Also Published As

Publication number Publication date
CN107391382A (en) 2017-11-24

Similar Documents

Publication Publication Date Title
CN108846749B (en) Partitioned transaction execution system and method based on block chain technology
CN109614324B (en) Test case generation method and device
CN108335718B (en) Test method and device
CN110175184B (en) Data dimension drilling-down method and system and electronic equipment
CN110515795B (en) Big data component monitoring method and device and electronic equipment
CN110222936B (en) Root cause positioning method and system of business scene and electronic equipment
CN109743309B (en) Illegal request identification method and device and electronic equipment
WO2020237508A1 (en) Assertion validation code binding method and apparatus
CN112836751A (en) Target detection method and device
CN109345081B (en) Data acquisition method and device and electronic equipment
CN109542785B (en) Invalid bug determination method and device
CN110008470B (en) Sensitivity grading method and device for report forms
CN111694992B (en) Data processing method and device
CN109753435B (en) Software testing method and device
CN109271453B (en) Method and device for determining database capacity
CN109376988B (en) Service data processing method and device
CN110661913B (en) User sorting method and device and electronic equipment
CN107391382B (en) Target searching method and device
CN109740336B (en) Method and device for identifying verification information in picture and electronic equipment
CN110928941A (en) Data fragment extraction method and device
CN109857665B (en) Test execution method and device for test case
CN110647463A (en) Method and device for restoring test breakpoint and electronic equipment
CN114840427A (en) Code testing and test case generating method and device
CN110018844B (en) Management method and device of decision triggering scheme and electronic equipment
CN110708414B (en) Telephone number sorting 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