Method and device for constructing composite search box, electronic equipment and storage medium

By extracting common elements from search boxes in Android development to form configuration parameters, a composite search box can be generated, solving the problem of low development efficiency in existing technologies. This enables the rapid construction of customizable search boxes that support both fuzzy and precise searches.

CN115905641BActive Publication Date: 2026-02-27CHENGDU PINGMENG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211659376.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-22
Publication Date
2026-02-27
Estimated Expiration
2042-12-22

AI Technical Summary

Technical Problem

In Android development, the existing technology requires custom development of the search box based on requirements, resulting in low development efficiency, a large workload, and an inability to quickly adapt to changes in requirements.

Method used

By extracting common elements from the search box to form configuration parameters, including style, position, function, and search method, a composite search box is generated, supporting fuzzy search and precise search, and providing a one-click configuration method for building search boxes.

Benefits of technology

It improves development efficiency, reduces development workload, enables the diversity and customization of search boxes, and supports rapid response to changes in requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115905641B_ABST
    Figure CN115905641B_ABST
Patent Text Reader

Abstract

The application discloses a construction method and device of a composite search box, electronic equipment and a storage medium. The common elements of different search boxes are abstracted and divided, the common elements are taken as configurable points, configuration parameters of the search box are generated according to the configurable points, and thus, the construction of the search box style, the construction of the search function and the configuration of the search mode can be performed based on each data in the configuration parameters, so that the composite search box is obtained. Through the above design, in the development, the developer only needs to configure the required style by one key, and the corresponding search box of the requirement can be obtained. The accurate search and the fuzzy search are fused, and thus, the composite search box with customizable style and search mode can be obtained. The development efficiency is improved, the development workload is reduced, and the problem of the diversity of the search box is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of Android development technology, specifically relating to a method, apparatus, electronic device, and storage medium for constructing a composite search box. Background Technology

[0002] In Android development, various search scenarios are frequently encountered. In some cases, search results may be displayed simultaneously as the user types, while in others, the user must click the search button after typing to see the results. Therefore, the style and functionality of the search box often vary depending on the scenario. Currently, most search box development is customized to meet specific needs, lacking a universal template. When requirements change, developers need to create separate code for each requirement, which consumes significant development time, reducing efficiency and increasing workload. Therefore, how to quickly build search boxes based on changing requirements to improve development efficiency and reduce workload has become a pressing issue. Summary of the Invention

[0003] The purpose of this invention is to provide a method, apparatus, electronic device, and storage medium for constructing a composite search box, in order to solve the problems of slow development efficiency and high development workload caused by the fact that the construction of search boxes in the prior art is customized according to requirements, and therefore requires redevelopment when requirements change.

[0004] To achieve the above objectives, the present invention adopts the following technical solution:

[0005] Firstly, a method for constructing a composite search box is provided, including:

[0006] Obtain the search box configuration parameters, wherein the search box configuration parameters include search box style parameters, search box position parameters, search box function parameters, and search method parameters;

[0007] A search frame is generated based on the search box style parameters and search box position parameters in the search box configuration parameters;

[0008] Based on the search box function parameters in the search box configuration parameters, configure function buttons for the search frame so that an initial search box is obtained after configuration;

[0009] According to the search mode parameter, a search mode is configured for the initial search box, so as to obtain a composite search box after the configuration, wherein the search mode comprises fuzzy search and / or accurate search, the fuzzy search is used to be triggered when a text input event is detected, and is used to perform content search according to input text corresponding to the text input event, the text input event is generated when a user performs text input interaction operation on the composite search box, and a text input event is generated for each input text, and the input text comprises at least one character;

[0010] The accurate search is used to be triggered when a search event is detected, and is used to perform content search according to target text, wherein the search event is generated when a user performs human-computer interaction on a search button on the composite search box, and the target text comprises all input characters that have existed in the composite search box before the search event is generated.

[0011] Based on the above disclosure, the present application first extracts common elements of different search boxes, and uses the common elements as configurable points, so as to generate configuration parameters of the search box according to the configurable points, wherein the configuration parameters comprise search box style parameters, search box position parameters, search box function parameters and search mode parameters, so that the search box style is constructed, the search function is constructed and the search mode is configured based on each data in the foregoing configuration parameters, so as to obtain a composite search box; through the above design, in the development, the developer only needs to configure the required style by one key, so as to obtain the search box corresponding to the requirement, and the accurate search and the fuzzy search are fused, so that the composite search box with customizable style and search mode is obtained, which not only improves the development efficiency and reduces the development workload, but also solves the problem of search box diversity.

[0012] In one possible design, the search box style parameter comprises search box style data, search box layout data and search box size data, and the search box position parameter comprises left spacing, right spacing, upper spacing and lower spacing of the search box and the search control box;

[0013] According to the search box style data and the search box size data, the search box size and the search box style are determined, and an initial search frame is constructed based on the determined search box size and search box style;

[0014] According to the search box style data and the search box size data, the search box size and the search box style are determined, and an initial search frame is constructed based on the determined search box size and search box style;

[0015] According to the search box layout data, a search box page layout style is determined, and the initial search box framework is processed according to the search box page layout style, so that a pretreated search box framework is obtained after the processing, wherein the pretreated search box framework comprises a text input area and a function button area;

[0016] Based on the left spacing, the right spacing, the upper spacing and the lower spacing between the search box and the search control box, a search box filling position is determined;

[0017] According to the search box filling position, the pretreated search box framework is filled into the search control box, so that the search box framework is obtained after the filling.

[0018] Based on the above disclosure, the present application is configured with search box style data, size data and layout data, so that the required style, size and page layout of the search box can be constructed according to the foregoing data, and the left and right spacing and the upper and lower spacing between the search box and the search control box are given, so that the positioning of the search box can be realized, and the constructed search box is arranged in the control box to obtain the search box framework.

[0019] In one possible design, the search box style parameters further comprise search box background style data and search box character style data, wherein after the pretreated search box framework is obtained, the method further comprises:

[0020] Based on the search box background style, the background style of the text input area and the function button area in the pretreated search box framework is determined, and the text input area and the function button area are filled with the background according to the determined background style, so that a pretreated search box framework is obtained after the filling;

[0021] According to the search box character style data, an input character style is configured for the text input area in the pretreated search box framework, so that a target search box framework is obtained after the configuration, wherein the input character style is used to determine the display size and the display color of the characters in the text input area;

[0022] According to the search box filling position, the pretreated search box framework is filled into the search control box, so that the search box framework is obtained after the filling.

[0023] Based on the above disclosure, the present application is configured with background and character style data, so that the developer can also customize the background style of the search box and the size and color of the input characters in the search box according to the requirements; in this way, the expansibility is further improved, and the requirements of different use scenarios can be better met.

[0024] In a possible design, the search box function parameter includes: search box function information, a plurality of button icons, and a plurality of button filling positions.

[0025] The function buttons are configured for the search frame according to the search box function parameter in the search box configuration parameter, to obtain an initial search box after the configuration.

[0026] At least one initial function button is generated according to the search box function information.

[0027] An icon style of each initial function button is determined according to the plurality of button icons, and each initial function button is filled with an icon according to the determined icon style, to obtain at least one target function button.

[0028] For any target function button in the at least one target function button, a filling position of the any target function button is determined from the plurality of button filling positions, to fill the any target function button into the search frame based on the determined filling position, and the initial search box is obtained after filling of all target function buttons is completed.

[0029] In a possible design, before at least one initial function button is generated according to the search box function information, the method further includes:

[0030] It is judged whether the search box function information in the search box function parameter is empty.

[0031] If not, at least one initial function button is generated according to the search box function information.

[0032] In a possible design, the search frame includes a function button area, and if the search box function information in the search box function parameter is empty, the method further includes:

[0033] The function button area is blanked, to obtain the initial search box after the blanking, where the function button area in the initial search box is a blank area.

[0034] In a possible design, the search box configuration parameter further includes a text listening parameter, and after the composite search box is obtained, the method further includes:

[0035] configure a text listening event for the composite search box based on the text listening parameter, so as to obtain a target composite search box after the configuration, wherein the text listening event comprises an empty text event and a text event, the empty text event is used to be triggered when a text input area in the target composite search box is empty, and the text event is used to be triggered when any text content exists in the text input area in the target composite search box;

[0036] the text event is used to display a delete button in the target composite search box after being triggered, and send any text content in the text input area of the target composite search box to a development end, so that a developer of the development end configures a first search auxiliary parameter based on the any text content, wherein the first search auxiliary parameter is used to determine search display content corresponding to the any text content;

[0037] the empty text event is used to hide the delete button in the target composite search box after being triggered, and feed back empty event information to the development end, so that the developer of the development end configures a second search auxiliary parameter based on the empty event information, wherein the second search auxiliary parameter is used to determine search display content corresponding to the empty event information.

[0038] Based on the above disclosure, the application further provides a text listening parameter, which is used to listen to content changes in an input text area of a composite search box and set different event interfaces for different content changes. If any text content exists in the text event of the input text area, a delete button is displayed, and the any text content is sent to a development end. In this way, a developer of the development end can customize search auxiliary parameters according to the any text content, so as to facilitate setting of search display content corresponding to the any text content after the any text content is input by a user. Of course, the empty text event is triggered when the input text area is empty, and the empty text event also has the same effect. Through the foregoing design, the application triggers different listening events by listening to content changes in a text input area, so as to return text in the text input area to a development end. In this way, different event interfaces are provided for a search box, so that a developer can customize and configure processing logic according to returned content, thereby further improving the expansibility of development.

[0039] In a second aspect, a construction device of a composite search box is provided, comprising:

[0040] a configuration acquisition unit configured to acquire a search box configuration parameter, wherein the search box configuration parameter comprises a search box style parameter, a search box position parameter, a search box function parameter, and a search mode parameter;

[0041] The search box construction unit is configured to generate a search frame based on a search box style parameter and a search box position parameter in the search box configuration parameter.

[0042] The search box construction unit is configured to configure a function button for the search frame according to a search box function parameter in the search box configuration parameter, so as to obtain an initial search box after the configuration.

[0043] The search box construction unit is configured to configure a search mode for the initial search box according to the search mode parameter, so as to obtain a composite search box after the configuration, wherein the search mode includes fuzzy search and / or accurate search.

[0044] The accurate search is configured to be triggered when a search event is detected, and is configured to perform content search according to a target text, wherein the search event is generated when a user performs human-computer interaction on a search button of the composite search box, and the target text includes all input characters that have existed in the composite search box before the search event is generated.

[0045] In a third aspect, another construction device of a composite search box is provided, taking an electronic device as an example, including a memory, a processor and a transceiver connected in sequence, wherein the memory is configured to store a computer program, the transceiver is configured to transceive messages, and the processor is configured to read the computer program and execute the construction method of the composite search box as in the first aspect or any possible design in the first aspect.

[0046] In a fourth aspect, a storage medium is provided, and the storage medium stores instructions, when the instructions are run on a computer, the construction method of the composite search box as in the first aspect or any possible design in the first aspect is executed.

[0047] In a fifth aspect, a computer program product including instructions is provided, when the instructions are run on a computer, the computer is caused to execute the construction method of the composite search box as in the first aspect or any possible design in the first aspect.

[0048] Advantages:

[0049] (1) The present application first extracts common elements of different search boxes, and uses the common elements as configurable points to generate configuration parameters of the search boxes according to the configurable points, wherein the configuration parameters include search box style parameters, search box position parameters, search box function parameters and search mode parameters, so that the search box style, the search function and the search mode can be configured based on the data in the configuration parameters, thereby obtaining a composite search box; through the above design, the developer only needs to configure the required style by one key during development, and the composite search box with customizable style and search mode can be obtained by combining the exact search and the fuzzy search, which not only improves the development efficiency and reduces the development workload, but also solves the problem of search box diversity.

[0050] (2) The present application triggers different listening events by listening to the content changes of the text input area to return the text in the text input area to the development end; in this way, different event interfaces are provided for the search box, so that the developer can customize the processing logic according to the returned content, thereby further improving the development extensibility. BRIEF DESCRIPTION OF DRAWINGS

[0051] Figure 1 The step flowchart of the construction method of the composite search box provided by the embodiment of the present application is shown in the figure;

[0052] Figure 2 The effect diagram of the composite search box provided by the embodiment of the present application is shown in the figure;

[0053] Figure 3 The structure diagram of the construction device of the composite search box provided by the embodiment of the present application is shown in the figure;

[0054] Figure 4 The structure diagram of the electronic device provided by the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION

[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the present application will be briefly introduced with reference to the drawings and the descriptions of the embodiments or the prior art. Obviously, the following description of the drawings is only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor. It should be noted that the description of these embodiments is used to help understand the present application, but does not constitute a limitation on the present application.

[0056] It should be understood that, although the terms first, second, etc. can be used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first element could be termed a second element, and, similarly, a second element could be termed a first element, without departing from the scope of example embodiments of the present application.

[0057] It should be understood that, for the term "and / or" which can occur in the present document, it only describes an association relationship of associated objects, which means that there can be three relationships, for example, A and / or B, which means that there are three cases of A alone, B alone, and A and B together; for the term " / and" which can occur in the present document, it is another description of the association relationship of another associated object, which means that there can be two relationships, for example, A / and B, which means that there are two cases of A alone and A and B together; in addition, for the character " / " which can occur in the present document, it generally means that the associated objects before and after are an "or" relationship.

[0058] Embodiment:

[0059] Referring to Figure 1 As shown in the figure, the method for constructing the composite search box provided by the embodiment forms configuration parameters by extracting common elements of different search boxes, and constructs the search box according to the configuration parameters; in this way, when the demand changes, the developer only needs to change the configuration parameters with one key, so as to realize the drawing of search boxes of different styles and search modes, without the need to redevelop the code according to the changed demand, thereby the method can quickly construct the composite search box of customizable style and search mode, not only improves the development efficiency and reduces the development workload, but also solves the problem of diversity of search boxes; in the embodiment, the method can be but is not limited to running on the Android development end, wherein the Android development end can be but is not limited to a personal computer (PC), a tablet computer or a smart phone, it can be understood that the foregoing execution subject does not constitute a limitation on the embodiments of the present application, and correspondingly, the running steps of the method can be but are not limited to the steps S1-S4 shown below.

[0060] S1. Obtain search box configuration parameters, wherein the search box configuration parameters include search box style parameters, search box position parameters, search box function parameters and search mode parameters; in a specific application, the configuration parameters are formed by abstracting common elements of different search boxes, and are preset by a developer to an Android development end; optionally, the abstracted common elements are search box styles, positions, functions and search modes, etc.; therefore, according to the aforementioned common elements to construct a search box, only different contents need to be given to the common elements, and search boxes of different styles and search modes can be obtained; in this embodiment, the search box style parameters can include but are not limited to search box style data (such as search box is rectangular, circular or other shapes, etc.), search box layout data (such as text input area and function button area inside the search box are up-down layout, left-right layout or other layout modes, etc.), search box size data, search box background style data (such as search box background is picture, text, color or no background, etc.) and search box character style data (used to determine the character number font and display color of the user to the text input area after the search box is constructed, etc.); similarly, the search box position parameters can include but are not limited to left spacing, right spacing, upper spacing and lower spacing of the search box and the search control box (see FIG. 13O); of course, the aforementioned data can be specifically set according to actual use, which is not specifically limited here. Figure 2

[0061] After obtaining the configuration parameters of the search box, the search box can be constructed according to the configuration parameters, wherein the construction process can include but is not limited to the following steps S2-S5.

[0062] S2. Generate a search box frame based on the search box style parameters and the search box position parameters in the search box configuration parameters; in this embodiment, step S2 is to build a search box frame according to the search box style parameters and the position parameters, and the search box frame includes search box shape, page layout, background and character style, etc.; optionally, the specific building process of the search box frame can include but is not limited to the following steps S21-S24.

[0063] ​S21. Determine the search box size and the search box style according to the search box style data and the search box size data, and construct an initial search box frame based on the determined search box size and the search box style. In a specific application, the search box style data and the search box size data are configured by the developer according to the requirements, so the framework can be built according to the configured data. For example, assuming that the search box style data is a rectangle and the search box size data is 20 cm long and 5 cm wide, then a rectangle with a length of 20 cm and a width of 5 cm is constructed, which serves as the initial search box frame. At this time, the page layout of the initial search box frame also needs to be determined, that is, how to set the text input area and the function button area in the rectangle area constructed above. Specifically, the layout process can be but is not limited to the following step S22.

[0064] S22. Determine the search box page layout style according to the search box layout data, and perform layout processing on the initial search box frame according to the search box page layout style, so as to obtain a preprocessed search box frame after the layout processing, wherein the preprocessed search box frame includes a text input area and a function button area. In a specific application, the search box layout data contains the number of text input areas, the number of function button areas, and the arrangement of the text input areas and the function button areas. Further, assuming that one text input area and two function button areas are set, the three areas can be arranged in a zigzag shape or in a triangular shape, and a function button area is set at each end of the text input area (this layout method can be referred to in FIG. 5). Figure 2

[0065] After the arrangement of the text input area and the function button area is completed, the preprocessed search box frame obtained by the layout processing can be filled into the search control box to obtain the final search box frame. The filling process is shown in the following steps S23 and S24.

[0066] S23. Determine the search box filling position based on the left spacing, the right spacing, the upper spacing, and the lower spacing of the search box and the search control box.

[0067] ​S24. Fill the pre-processed search frame into the search control frame according to the filling position to obtain the search frame after filling; in the embodiment, since the up-down and left-right intervals of the search frame and the search control frame are configured, the filling position can be determined according to the four intervals, and then the pre-processed search frame can be filled into the search control frame according to the filling position; for example, assuming that the search frame style data is a rectangle, the left interval of the search frame and the search control frame is the vertical distance between the top-left end point of the rectangle and the left side of the search control frame, and the up interval is the vertical distance between the top-left end point of the rectangle and the top side of the search control frame, so the arrangement coordinates of the top-left end point of the pre-processed search frame can be obtained according to the left interval and the up interval; similarly, the arrangement coordinates of the remaining three end points can be obtained according to the same principle, and then the pre-processed search frame can be filled according to the four end point coordinates; of course, in the embodiment, the search frame position parameter can also directly include the filling coordinates, so that the pre-processed search frame can be filled directly according to the filling coordinates.

[0068] Therefore, the search frame can be built through the foregoing steps S21-S24, thereby providing a basis for the configuration of the subsequent function buttons; further, as described above, the search frame style parameter also includes search frame background style data and search frame character style data, so the background and character style can be configured before filling, as shown in the following steps S22a-S22c.

[0069] S22a. Determine the background style of the text input area and the function button area in the pre-processed search frame based on the search frame background style, and fill the background of the text input area and the function button area based on the determined background style to obtain the pre-processed search frame after filling; in specific applications, the search frame background style can include but is not limited to patterns, characters, colors (such as solid color background) or no background, etc.; of course, the background style can be set according to actual use requirements, which is not limited to the foregoing examples; thus, after the background style is set, the text input area and the function button area can be filled with the background according to the set background style to obtain the pre-processed search frame; similarly, after the background is filled, the character style can be configured for the text input area, as shown in the following step S22b.

[0070] S22b. According to the search box character style data, configure the input character style for the text input area in the preprocessed search box, so as to obtain a target search box after the configuration, wherein the input character style is used to determine the display size and display color of the characters in the text input area; in a specific application, for example, the search box character style data can include but is not limited to character size, font type and font color; therefore, the input character style of the text input area can be configured according to the set character style; for example, if the search box character style data is: the character size is small four, the font type is Songti and the font color is red, when the user inputs characters into the text input area after the construction of the search box is completed, the input characters are displayed in the text input area in the format of Songti, small four and red; of course, the search box character style data can be set according to actual needs, which is not limited to the foregoing example.

[0071] After the foregoing background filling and input character style configuration are completed, the foregoing obtained target search box can be filled into the search control box to obtain a search box, as shown in the following step S22c.

[0072] S22c. According to the search box filling position, fill the target search box into the search control box to obtain the search box after the filling; in a specific application, the principle of step S22c is consistent with the principles of the foregoing steps S24 and S23, which will not be described here.

[0073] Therefore, through the foregoing steps, a search box with page layout, background and character style can be constructed, so that the construction of the search box can be completed only by configuring the functions and search methods of the search box according to needs, wherein the function configuration process is shown in the following step S3.

[0074] S3. According to the search box function parameter in the search box configuration parameter, configure the function button for the search box to obtain an initial search box after the configuration; in a specific application, for example, the search box function parameter can include but is not limited to: search box function information (such as search function, delete function, confirmation function, copy function, paste function, etc.), a plurality of button icons (such as search icon, delete icon, confirmation icon, copy icon, paste icon) and a plurality of button filling positions (such as search button position coordinates, delete button position coordinates, confirmation button position coordinates, copy button position coordinates, paste button position coordinates, etc.); therefore, the function button can be generated based on the function information, the icon can be filled for each function button, and finally the function button with the filled icon can be arranged at the corresponding position to obtain the initial search box, wherein the specific process of the function configuration can include but is not limited to the following steps S31-S34.

[0075] S31. Determine whether the search box function information in the search box function parameter is empty; in specific application, first determine whether the developer has configured the search box with corresponding function, so as to make corresponding settings according to the determination result, as shown in the following step S32.

[0076] S32. If not, generate at least one initial function button according to the search box function information; otherwise, perform blank processing on the function button area to obtain the initial search box after the blank processing, wherein the function button area in the initial search box is a blank area; in specific application, if the search box function information is empty, it means that the developer has not set the corresponding function for the search box, at this time, no function button is displayed in the function button area; if the search box function information is not empty, it means that the corresponding function is configured, therefore, the initial function button can be generated according to the configured function, for example, if the search function and the delete function are configured, the search initial function button and the delete initial function button are generated, of course, the remaining functions are the same, which will not be repeated here.

[0077] After generating at least one initial function button, the icon filling can be performed, as shown in the following step S33.

[0078] S33. According to the plurality of button icons, determine the icon style of each initial function button, and perform icon filling on each initial function button according to the determined icon style to obtain at least one target function button; in specific application, it has been explained above that the plurality of button icons include different function button icons, therefore, the matching can be performed according to the function, and the icon style can be specifically set according to actual needs, which is not limited here.

[0079] After completing the icon filling of the buttons, the filling of each target function button can be performed according to the button filling position, as shown in the following step S34.

[0080] S34. For any target function button in the at least one target function button, determine the filling position of the any target function button from the plurality of button filling positions, fill the any target function button into the search frame based on the determined filling position, and obtain the initial search box after filling all target function buttons; in specific application, it has been explained above that the button filling position is actually the button position coordinate, therefore, the position coordinate of the corresponding function can be matched according to each target function button, so as to complete the filling of the target function button, and the initial search box can be obtained after the filling is completed; for example, refer to Figure 2As shown, the search function button can be filled into the function button area on the left side, and the delete function button can be filled into the function button area on the right side; of course, the filling positions of the buttons can be set according to actual use requirements, and are not limited to the foregoing examples.

[0081] After the function configuration of the search box is completed, the search mode configuration can be performed, as shown in the following step S4.

[0082] S4. Configuring a search mode for the initial search box according to the search mode parameter, so as to obtain a composite search box after the configuration, wherein the search mode includes fuzzy search and / or accurate search, the fuzzy search is used to be triggered when a text input event is detected, and is used to perform content search according to the input text corresponding to the text input event, the text input event is generated when a user performs a text input interactive operation on the composite search box, and a text input event is generated for each input text, and the input text includes at least one character; the accurate search is used to be triggered when a search event is detected, and is used to perform content search according to a target text, wherein the search event is generated when a user performs a human-computer interaction on a search button on the composite search box, and the target text includes all input characters that have existed in the composite search box before the search event is generated.

[0083] In a specific application, the corresponding search mode of the initial search box is set according to the search mode parameter configured by the developer, such as accurate search and / or fuzzy search, wherein the fuzzy search is triggered when a user inputs a character into the text input area of the composite search box, that is, the search function is triggered according to the input character and the characters that have existed in the text input area, and the search content is displayed to the user, for example, when a user inputs the first character "electric" into the text input area (there is no character in the text input area), then the search is performed according to the character, the search content related to "electric" is obtained, and the search content is displayed below the composite search box; similarly, the accurate search is triggered after the user clicks the search button of the composite search box.

[0084] Therefore, the composite search box construction method described in detail in the foregoing steps S1-S4, the present application forms a configuration parameter by extracting common elements of different search boxes, and constructs a search box according to the configuration parameter; in this way, when the demand changes, the developer only needs to change the configuration parameter with one key, so as to realize the drawing of search boxes with different styles and search modes, without the need to redevelop the code according to the changed demand, thereby the present method can quickly construct the composite search box with customizable style and search mode, not only improves the development efficiency and reduces the development workload, but also solves the problem of search box diversity, and is suitable for large-scale application and promotion.

[0085] In a possible design, the second aspect of the embodiment is further optimized on the basis of the first aspect of the embodiment, that is, a text monitoring parameter is set for the composite search box, so as to trigger different monitoring events according to the text content in the text input area in the composite search box, thereby realizing the customized configuration of the text content processing logic according to the different monitoring events.

[0086] In the embodiment, the search box configuration parameter can further include, but is not limited to, a text monitoring parameter. The configuration process of the text monitoring parameter can be, but is not limited to, as shown in the following step S5.

[0087] S5. A text monitoring event is configured for the composite search box based on the text monitoring parameter, so as to obtain a target composite search box after the configuration. The text monitoring event includes an empty text event and a text event. The empty text event is used to be triggered when the text input area in the target composite search box is empty. The text event is used to be triggered when there is any text content in the text input area in the target composite search box.

[0088] In the embodiment, the text event is used to display a delete button in the target composite search box after being triggered, and send any text content in the text input area of the target composite search box to the development end, so as to enable the developer of the development end to configure a first search auxiliary parameter based on the any text content. The first search auxiliary parameter is used to determine the search display content corresponding to the any text content. Specifically, when there is text content in the text input area, the text event displays the delete button (if not configured, it is not displayed), and then returns the text content to the development end, so that the developer configures the first search auxiliary parameter according to the text content. Optionally, the first search auxiliary parameter is used to associate the associated word corresponding to the text content. For example, if the feedback text content is computer, the search display content can be, but is not limited to, displaying the associated words of the computer, such as computer assembly, computer host, computer display screen, computer accessories, and the like, below the text input area. Of course, the search display content in the example can be configured according to the actual requirement of the first search auxiliary parameter, which is not limited herein.

[0089] Similarly, the empty text event is used to hide the delete button in the target composite search box after being triggered, and feedback empty event information to the development end, so that the developer of the development end configures a second search auxiliary parameter based on the empty event information, wherein the second search auxiliary parameter is used to determine the search display content corresponding to the empty event information; in this embodiment, the operation process after the empty text event is triggered, the principle is the same as that of the text event operation process, only the triggering condition is different, and the delete button is hidden when triggered; optionally, the search display content determined by the second search auxiliary parameter corresponding to the empty event information may be, but is not limited to, search history records or current hot search words, of course, the second search auxiliary parameter can also be specifically configured according to actual needs, so as to achieve the function of customizing the search display content.

[0090] Therefore, through the foregoing design, the application triggers different listening events by listening to the content change of the text input area to return the text in the text input area to the development end; in this way, different event interfaces are provided for the search box, so that the developer can customize and configure the processing logic according to the returned content, thereby further improving the development extensibility.

[0091] As shown in Figure 3 The third aspect of the present embodiment provides a hardware device for implementing the construction method of the composite search box in the first aspect and the second aspect of the embodiment, comprising:

[0092] A configuration acquisition unit is configured to acquire search box configuration parameters, wherein the search box configuration parameters include search box style parameters, search box position parameters, search box function parameters, and search mode parameters.

[0093] A search box construction unit is configured to generate a search frame based on the search box style parameters and the search box position parameters in the search box configuration parameters.

[0094] The search box construction unit is configured to configure a function button for the search frame according to the search box function parameters in the search box configuration parameters, so as to obtain an initial search box after configuration.

[0095] The search box construction unit is configured to configure a search mode for the initial search box according to the search mode parameters, so as to obtain a composite search box after configuration, wherein the search mode includes fuzzy search and / or accurate search, the fuzzy search is used to be triggered when detecting a text input event, and is used to perform content search according to the input text corresponding to the text input event, the text input event is generated when the user performs text input interaction operation on the composite search box, and one text input event is generated for each detected input text, and the input text includes at least one character.

[0096] The precise search is used to be triggered when a search event is detected, and is used to search content according to target text, wherein the search event is generated when a user performs human-computer interaction with a search button on the composite search box, and the target text includes all input characters that have existed in the composite search box before the search event is generated.

[0097] The working process, working details and technical effects of the device provided by the embodiment can be referred to the first aspect and the second aspect of the embodiment, and will not be repeated here.

[0098] As shown in Figure 4 The fourth aspect of the embodiment provides another device for constructing a composite search box. Taking an electronic device as an example, the device comprises a memory, a processor and a transceiver which are connected in sequence, wherein the memory is configured to store a computer program, the transceiver is configured to transceive messages, and the processor is configured to read the computer program and execute the method for constructing a composite search box according to the first aspect and / or the second aspect of the embodiment.

[0099] For example, the memory can include, but is not limited to, a random access memory (RAM), a read only memory (ROM), a flash memory, a first input first output (FIFO) memory and / or a first in last out (FILO) memory, etc.; specifically, the processor can include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor can be implemented in at least one of a digital signal processing (DSP), a field-programmable gate array (FPGA) and a programmable logic array (PLA), and the processor can also include a main processor and a coprocessor. The main processor is a processor for processing data in a wake-up state, also known as a CPU (central processing unit). The coprocessor is a low-power processor for processing data in a standby state.

[0100] In some embodiments, the processor can be integrated with a GPU (Graphics Processing Unit) that is responsible for rendering and drawing the content required to be displayed on the display screen, for example, the processor can not be limited to a microprocessor of STM32F105 series, a RISC (reduced instruction set computer) microprocessor, an X86 architecture processor, or a processor integrated with an embedded NPU (neural-network processing units); the transceiver can be but not limited to a WIFI transceiver, a Bluetooth transceiver, a GPRS transceiver, a ZigBee transceiver, a 3G transceiver, a 4G transceiver, a 5G transceiver, and the like. In addition, the device can further include a power module, a display screen, and other necessary components.

[0101] The working process, working details and technical effects of the electronic device provided in the embodiments can be referred to the first aspect and the second aspect of the embodiments, and will not be repeated here.

[0102] The fifth aspect of the embodiments provides a storage medium storing instructions of the construction method of the composite search box according to the first aspect and / or the second aspect of the embodiments, that is, the storage medium stores instructions, and when the instructions run on a computer, the construction method of the composite search box according to the first aspect and / or the second aspect is executed.

[0103] The storage medium refers to a carrier for storing data, which can include, but is not limited to, a floppy disk, an optical disk, a hard disk, a flash memory, a USB flash disk, a Memory Stick, and the like. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.

[0104] The working process, working details and technical effects of the storage medium provided in the embodiments can be referred to the first aspect and the second aspect of the embodiments, and will not be repeated here.

[0105] The sixth aspect of the embodiments provides a computer program product containing instructions, which, when running on a computer, causes the computer to execute the construction method of the composite search box according to the first aspect and / or the second aspect of the embodiments. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.

[0106] Finally, it should be noted that the above description is only the preferred embodiment of the present application, and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for constructing a composite search box, characterized in that, include: Obtain the search box configuration parameters, wherein the search box configuration parameters include search box style parameters, search box position parameters, search box function parameters, and search method parameters; A search frame is generated based on the search box style parameters and search box position parameters in the search box configuration parameters; Based on the search box function parameters in the search box configuration parameters, configure function buttons for the search frame so that an initial search box is obtained after configuration; Based on the search method parameters, a search method is configured for the initial search box to obtain a composite search box after configuration. The search method includes fuzzy search and / or precise search. The fuzzy search is triggered when a text input event is detected and is used to search for content based on the input text corresponding to the text input event. The text input event is generated when the user interacts with the composite search box by inputting text. A text input event is generated for each piece of input text detected. The input text includes at least one character. The precise search is triggered when a search event is detected and is used to search for content based on the target text. The search event is generated when the user interacts with the search button on the composite search box, and the target text includes all input characters that already exist in the composite search box before the search event is generated. The search box style parameters include: search box style data, search box layout data, and search box size data, and the search box position parameters include the left spacing, right spacing, top spacing, and bottom spacing between the search box and the search control box; The search framework is generated based on the search box style parameters and search box position parameters in the search box configuration parameters, including: Based on the search box style data and the search box size data, the search box size and style are determined, and an initial search framework is constructed based on the determined search box size and style. Based on the search box layout data, the search box page layout style is determined, and the initial search frame is laid out according to the search box page layout style to obtain a pre-processed search frame after layout processing. The pre-processed search frame includes a text input area and a function button area. The fill position of the search box is determined based on the left, right, top, and bottom spacing between the search box and the search control box. Based on the search box fill position, the preprocessed search frame is filled into the search control box to obtain the search frame after filling.

2. The method according to claim 1, characterized in that, The search box style parameters also include: search box background style data and search box character style data. After obtaining the preprocessed search frame, the method further includes: Based on the background style data of the search box, the background style of the text input area and function button area in the preprocessed search frame is determined, and based on the determined background style, the background of the text input area and function button area is filled so that the preprocessed search frame is obtained after filling. Based on the search box character style data, the input character style is configured for the text input area in the preprocessed search frame so that the target search frame is obtained after configuration. The input character style is used to determine the display size and display color of the characters in the text input area. Based on the search box fill position, the target search frame is filled into the search control box to obtain the search frame after filling.

3. The method according to claim 1, characterized in that, The search box function parameters include: search box function information, several button icons, and several button fill positions; Specifically, based on the search box function parameters in the search box configuration parameters, function buttons are configured for the search frame to obtain an initial search box after configuration, including: Generate at least one initial function button based on the search box function information; Based on the aforementioned button icons, determine the icon style of each initial function button, and fill each initial function button with an icon according to the determined icon style to obtain at least one target function button. For any one of the at least one target function buttons, the fill position of the target function button is determined from the fill positions of the plurality of buttons, and the target function button is filled into the search frame based on the determined fill position, and the initial search box is obtained after all the target function buttons are filled.

4. The method according to claim 3, characterized in that, Before generating at least one initial function button based on the search box function information, the method further includes: Determine whether the search box function information in the search box function parameters is empty; If not, at least one initial function button is generated based on the search box function information.

5. The method according to claim 4, characterized in that, The search frame includes a function button area, wherein if the search box function information in the search box function parameters is empty, the method further includes: The function button area is blanked out to obtain the initial search box, wherein the function button area of ​​the initial search box is a blank area.

6. The method according to claim 1, characterized in that, The search box configuration parameters also include: text monitoring parameters, wherein, after obtaining the composite search box, the method further includes: Based on the text listening parameters, a text listening event is configured for the composite search box so that a target composite search box is obtained after configuration. The text listening event includes an empty text event and a text event. The empty text event is triggered when the text input area of ​​the target composite search box is empty, and the text event is triggered when any text content exists in the text input area of ​​the target composite search box. After the text event is triggered, it is used to display the delete button in the target composite search box and send any text content in the text input area of ​​the target composite search box to the development end, so that the developers on the development end can configure the first search auxiliary parameter based on the any text content, wherein the first search auxiliary parameter is used to determine the search display content corresponding to the any text content; After the empty text event is triggered, it is used to hide the delete button in the target composite search box and to feed back empty event information to the development end, so that the developers on the development end can configure the second search auxiliary parameters based on the empty event information. The second search auxiliary parameters are used to determine the search display content corresponding to the empty event information.

7. A device for constructing a composite search box, characterized in that, include: The configuration acquisition unit is used to acquire the search box configuration parameters, wherein the search box configuration parameters include search box style parameters, search box position parameters, search box function parameters, and search method parameters; The search box construction unit is used to generate a search frame based on the search box style parameters and search box position parameters in the search box configuration parameters; The search box construction unit is used to configure function buttons for the search frame according to the search box function parameters in the search box configuration parameters, so as to obtain an initial search box after configuration; The search box construction unit is used to configure the search method for the initial search box according to the search method parameters, so as to obtain a composite search box after configuration. The search method includes fuzzy search and / or precise search. The fuzzy search is triggered when a text input event is detected and is used to search for content based on the input text corresponding to the text input event. The text input event is generated when the user interacts with the composite search box by inputting text. A text input event is generated for each input text detected. The input text includes at least one character. The precise search is triggered when a search event is detected and is used to search for content based on the target text. The search event is generated when the user interacts with the search button on the composite search box, and the target text includes all input characters that already exist in the composite search box before the search event is generated. The search box style parameters include: search box style data, search box layout data, and search box size data, and the search box position parameters include the left spacing, right spacing, top spacing, and bottom spacing between the search box and the search control box; The search framework is generated based on the search box style parameters and search box position parameters in the search box configuration parameters, including: Based on the search box style data and the search box size data, the search box size and style are determined, and an initial search framework is constructed based on the determined search box size and style. Based on the search box layout data, the search box page layout style is determined, and the initial search frame is laid out according to the search box page layout style to obtain a pre-processed search frame after layout processing. The pre-processed search frame includes a text input area and a function button area. The fill position of the search box is determined based on the left, right, top, and bottom spacing between the search box and the search control box. Based on the search box fill position, the preprocessed search frame is filled into the search control box to obtain the search frame after filling.

8. An electronic device, characterized in that, include: A memory, a processor, and a transceiver are sequentially connected in communication, wherein the memory is used to store computer programs, the transceiver is used to send and receive messages, and the processor is used to read the computer programs and execute the method for constructing a composite search box as described in any one of claims 1 to 6.

9. A storage medium, characterized in that, The storage medium stores instructions that, when executed on a computer, perform the method for constructing the composite search box as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and device for generating combinatorial search box

    CN107463685A

  • Searching method and device and computer equipment

    CN112749328A