Component detection method and electronic equipment
By loading predefined component detection characters in the application interface and triggering the display of preset visual styles, the problem of low component detection efficiency in the prior art is solved, and the efficiency and accuracy of component detection are achieved.
Patent Information
- Application Number
- CN202411599291.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-02-18
AI Technical Summary
In the prior art, the document recording method has low efficiency in tracking and detection of components in development projects, and may not be able to cover all software developers. It is easy to cause omissions when manually checking the code, resulting in low component detection efficiency.
When the application interface is updated, if the storage space contains predefined component detection characters, component detection is performed, and the application interface is triggered to display based on the preset visual style, thereby providing the user with a visual visual effect and determining that the application interface contains components.
Through component detection characters loading and visual style modification, the efficiency and effectiveness of component detection are improved, ensuring the visualization and accuracy of component detection.
Smart Images

Figure CN119473483A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of front-end interface technology, and in particular to a component detection method and electronic equipment. Background Art
[0002] In the process of software development such as web pages and applications, in order to improve development efficiency and facilitate code maintenance, pre-packaged public components are usually applied in the development project. However, since software developers often make changes, it is easy to cause repeated development of public components. To avoid this situation, related technologies use document records to track and detect all components in the development project to determine whether public components are included. With the iteration of public components or development project versions, the documents need to be continuously summarized.
[0003] In the process of implementing the technology of the present invention, the inventor found that the prior art has the following technical problems: the efficiency of document transmission between software developers is low, and it may not cover all software developers. Alternatively, software developers manually check the code to detect whether the development project contains common components. When the number of components encapsulated in the development project is large, manual code checking is prone to omissions, thus resulting in low component detection efficiency. Summary of the invention
[0004] The embodiments of the present invention provide a component detection method and an electronic device, which solve the problem that the component detection efficiency is low due to the use of document records to track and detect components in a development project.
[0005] In a first aspect, an embodiment of the present application provides a component detection method, which is applied to an electronic device, and the method includes: when updating an application interface on the electronic device, if the storage space corresponding to the application interface includes the predefined component detection character, performing component detection of the application interface; if the application interface displays a preset visual style, determining that the application interface contains the component, wherein the component is displayed in the preset visual style.
[0006] Based on the above technical solution, when the storage space corresponding to the application interface includes predefined component detection characters, component detection is performed, and the application interface is triggered to be displayed based on a preset visual style, thereby providing users with a visual visual effect, determining that the application interface contains corresponding components, effectively improving the component detection efficiency, and further optimizing the component detection effect.
[0007] In one possible implementation, before executing component detection of the application interface, the method also includes: displaying a component detection control on the application interface based on a user operation; and loading the predefined component detection character into a storage space corresponding to the application interface in response to the user's operation of the component detection control.
[0008] Based on the above technical solution, a component detection control is added to the application interface. If the user triggers the component detection control, the predefined component detection characters are loaded into the storage space corresponding to the application interface, triggering the components in the application to be displayed based on the preset visual style, thereby providing the user with a visual visual effect and determining that the corresponding components are included in the application, effectively improving the component detection efficiency and optimizing the component detection effect.
[0009] In a possible implementation, the method further includes: adding a control code to the code of the application interface to generate the component detection control, and setting the display property of the component detection control to hidden. Based on the above technical solution, a component detection control can be embedded in the application interface, and by hiding the component detection control, the application interface will not be affected when component detection is not needed.
[0010] In a possible implementation, displaying the component detection control on the application interface based on a user operation includes: displaying the component detection control on the application interface based on an operation by a user to modify a display property of the component detection control to display.
[0011] Based on the above technical solution, when component detection is required, the display property of the embedded component detection control can be modified to display, so that the component detection control is displayed on the application interface, making it easier for users to trigger the component detection control.
[0012] In a possible implementation, loading the predefined component detection characters into a storage space corresponding to the application interface includes: acquiring the predefined component detection characters, loading the predefined component detection characters into the storage space, and generating a preset key-value pair.
[0013] Based on the above technical solution, by loading predefined component detection characters in the storage space corresponding to the application interface, the corresponding component in the application interface can be triggered to modify the visual style, thereby visually indicating that the application interface contains the corresponding component.
[0014] In a possible implementation, the component may also be displayed based on an initial visual style, where the preset visual style is different from visual styles of other components on the application interface.
[0015] Based on the above technical solution, different visual styles are set for components in advance, and the preset visual style is different from the visual styles of other components. In this way, when the component displays the preset visual style, a striking visual effect can be presented on the application interface.
[0016] In a possible implementation, the method further includes: if the application interface includes the component and the storage space includes the predefined component detection character, modifying the initial visual style of the component to the preset visual style so that the application interface displays the preset visual style.
[0017] Based on the above technical solution, by modifying the initial visual style of the component to a preset visual style, it is visually indicated that the application interface contains the component.
[0018] In a possible implementation, the method further includes: in response to a refresh operation on the application interface, not displaying the component detection control on the application interface, and clearing the component detection character in the storage space.
[0019] Based on the above technical solution, after refreshing the application interface, the application interface can be restored to its original state, so that the user can operate the application interface normally.
[0020] In one possible implementation, the method further includes: displaying another application interface in response to an interface switching operation; if the storage space includes the predefined component detection character and the other application interface displays the preset visual style, determining that the other application interface contains the component.
[0021] Based on the above technical solution, after the interface switching occurs, the component detection characters in the storage space are retained. In this way, the user does not need to trigger the component detection control on the application interface after the switching, which simplifies the user operation in the component detection process and improves the component detection efficiency.
[0022] In a possible implementation manner, the method further includes: if the application interface does not display the preset visual style, determining that the application interface does not include the component.
[0023] Based on the above technical solution, it can be visually indicated that the application interface does not include the component.
[0024] In a second aspect, an embodiment of the present application provides an electronic device, comprising a memory and a processor: wherein the memory is used to store program instructions; the processor is used to read and execute the program instructions stored in the memory, and when the program instructions are executed by the processor, the electronic device executes the above-mentioned component detection method.
[0025] In a third aspect, an embodiment of the present application provides a computer storage medium, wherein the computer storage medium stores program instructions, and when the program instructions are executed on an electronic device, a processor of the electronic device executes the above-mentioned component detection method.
[0026] The component detection method, electronic device and storage medium provided in the embodiments of the present application can perform component detection when the storage space corresponding to the application interface includes predefined component detection characters, and trigger the components on the application interface to be displayed based on a preset visual style, thereby providing users with a visual visual effect, determining that the application interface contains corresponding components, effectively improving component detection efficiency, and optimizing component detection effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0028] Figure 1 It is a flowchart of a component detection method provided in one embodiment of the present application.
[0029] Figure 2 This is a flow chart of a display component detection control provided by an embodiment of the present application.
[0030] Figure 3 It is a schematic diagram of an application interface provided by an embodiment of the present application.
[0031] Figure 4 This is another schematic diagram of an application interface provided by an embodiment of the present application.
[0032] Figure 5 It is a schematic diagram of another application interface provided by an embodiment of the present application.
[0033] Figure 6 It is a schematic diagram of another application interface provided by an embodiment of the present application.
[0034] Figure 7 It is a schematic diagram of another application interface provided by an embodiment of the present application.
[0035] Figure 8 It is a flowchart of a component detection method provided by another embodiment of the present application.
[0036] Fig. 9 It is a schematic diagram of another application interface provided by an embodiment of the present application.
[0037] Fig.10 It is a schematic diagram of another application interface provided by an embodiment of the present application.
[0038] Fig.11 It is a structural schematic diagram of a component detection device provided in one embodiment of the present application.
[0039] Fig.12 It is a schematic diagram of the hardware structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0040] The terms "first" and "second" involved in the embodiments of the present application are only used for descriptive purposes and should not be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way.
[0041] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by technicians in the technical field in this application. The terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. It should be understood that, unless otherwise specified in this application, " / " means or. For example, A / B can represent A or B. "And / or" in this application is only a description of the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. "At least one" refers to one or more. "Multiple" refers to two or more than two. For example, at least one of a, b or c can represent: a, b, c, a and b, a and c, b and c, a, b and c. In the absence of conflict, the following embodiments and the features in the embodiments can be combined with each other.
[0042] The user interface (UI) in the embodiments of the present application is a medium interface for interaction and information exchange between an application or operating system and a user. The user interface of an application is a source code written in a specific computer language such as JAVA or extensible markup language (XML). The interface source code is parsed and rendered on an electronic device, and ultimately presented as content that the user can recognize, such as pictures, text, buttons and other controls. Controls are the basic elements of a user interface. Typical controls include buttons, widgets, toolbars, menu bars, text boxes, scroll bars, images and text. The properties and contents of controls in the interface are defined by tags or nodes, such as XML through <textview> 、 <imgview> 、 <videoview>The controls contained in the interface are specified by nodes such as HTML and CSS. A node corresponds to a control or attribute in the interface. After parsing and rendering, the node is presented as user-visible content. In addition, many applications, such as hybrid applications, usually also contain web pages in their interfaces. A web page, also known as a page, can be understood as a special control embedded in the application interface. A web page is source code written in a specific computer language, such as hypertext markup language (HTML), cascading style sheets (CSS), scripting language (JavaScript, JS), etc. The web page source code can be loaded and displayed as user-recognizable content by a browser or a web page display component with similar functions to a browser. The specific content contained in a web page is also defined by tags or nodes in the web page source code. For example, HTML is defined by tags or nodes in the web page source code. 、 、 <video> 、 <canvas>To define the elements and attributes of a web page.
[0043] The commonly used form of user interface is graphical user interface (GUI), which refers to an application interface related to computer operation that is displayed in a graphical manner. It can display interface elements such as icons, windows, and controls on the display screen of an electronic device.
[0044] The embodiment of the present application provides a component detection method. When a user updates an application interface and the storage space corresponding to the application interface includes predefined component detection characters, the component detection of the application interface is performed. If the application interface displays a preset visual style, thereby providing a visual effect to the user, it is determined that the application interface contains the component, which effectively improves the efficiency of component detection and optimizes the component detection effect. The component is a common component, which is an element shared by multiple web pages or multiple application program interfaces, such as a navigation bar, a button, or a form.
[0045] See also Figure 1 FIG. 1 is a flow chart of a component detection method provided in an embodiment of the present application. The method is applied in an electronic device, and the component detection method includes: S101, in the case of updating the application interface on the electronic device, if the storage space corresponding to the application interface includes the predefined component detection character, the process enters S102; if the storage space corresponding to the application interface does not include the predefined component detection character, continue to execute S101.
[0046] In one embodiment of the present application, the user updating the application interface on the electronic device includes displaying and clicking the component detection control on the current application interface, and switching the current application interface to another application interface. Figure 2 As shown, it is a flowchart of updating the application interface on the electronic device provided in an embodiment of the present application.
[0047] S1011, displaying a component detection control on the application interface based on the user operation.
[0048] In one embodiment of the present application, the application interface may be an interface of a preset application, for example, the preset application may be a web browser, or an application in a personal computer or a smart phone. The control code of the component detection control is pre-added to the code of the application interface. After the user starts the preset application, the component detection control is displayed on the application interface of the preset application based on the user operation.
[0049] In one embodiment of the present application, a control code is added to the code of a preset application program to generate a component detection control, and the display property of the component detection control is set to hidden.
[0050] In an embodiment of the present application, the interface element code of the preset application can be HTML (Hypertext Markup Language) code. For example, the code of the component detection control can be: <button_ngcontent-bhc-c334 style="display: none; padding: 8px; background-color: #5aa6e0; border-radius: 5px; color: white;">Enable component detection.< / button_ngcontent-bhc-c334
[0051] In an embodiment of the present application, by setting the value of the display attribute in the style code of the component detection control to none, the display attribute of the component detection control is set to hidden. Refer to Figure 3 As shown, it is a schematic diagram of the application interface provided by an embodiment of the present application. After setting the display attribute of the component detection control to hidden, even if the component detection control is pre-added to the application interface, when component detection is not required, the component detection control is invisible on the application interface and has no impact on the original application interface.
[0052] S1012, in response to the user's operation on the component detection control, load the predefined component detection characters into the storage space corresponding to the application interface.
[0053] In an embodiment of the present application, based on the user's operation of modifying the display attribute of the component detection control to display, the component detection control is displayed on the application interface.
[0054] In an embodiment of the present application, after the preset application is started, if the user needs to detect whether the application interface of the preset application contains a component, the display attribute of the component detection control can be modified by performing a preset operation. For example, the preset operation is to change the value of the display attribute display in the style code of the component detection control from none to inline-block, so as to set the display attribute of the component detection control to display, and then make the component detection control displayed on the application interface.
[0055] In an embodiment of the present application, the component detection control is displayed on the application interface based on the preset style in the interface element code. For example, based on the above interface element code, the text content displayed in the component detection control is "Enable component detection", the inner padding between the text content and the control boundary is 8 pixels, the background color is blue, the rounded corners of the control border are 5 pixels, and the color of the text content is white. The display style, position, etc. of the component detection control in the embodiments of the present application are only for illustrative purposes and are not limited in actual applications.
[0056] See also Figure 4 , which is another schematic diagram of an application interface provided by an embodiment of the present application. After the display property of the component detection control is set to display, the component detection control is displayed on the application interface, so that the user can detect whether the application interface contains the component by triggering the component detection control.
[0057] S102, executing component detection of the application interface.
[0058] In one embodiment of the present application, the application interface executes the following code: if(localStorage.checkComponet == 'openswitch'){ Start detection }else{ Do not start detection }.
[0059] In one embodiment of the present application, a predefined component detection character is stored in the memory of the electronic device, and a preset application program monitors whether the component detection control is triggered. If the user needs to detect whether the current application interface contains a target component (such as a common component), the component detection control can be triggered. For example, if the electronic device is a laptop or desktop computer, the user can control the mouse cursor to click the component detection control to trigger the component detection control. If the electronic device is a device with a touch screen such as a tablet computer or a smart phone, the component detection control can be clicked with a finger to trigger the component detection control.
[0060] In one embodiment of the present application, if a user triggers a component detection control, the preset application can monitor the event of the component detection control being triggered (which can be referred to as a "trigger event"), process the trigger event, obtain a predefined component detection character from the memory, and load the predefined component detection character into the storage space of the preset application to generate a key-value pair. The storage space is the local storage space LocalStorage of the preset application, which can also be referred to as the local storage space of the application interface. For example, the predefined component detection character can be openSwitch. It can be understood that the predefined component detection character can also be set to other characters, and the embodiment of the present application does not limit this.
[0061] See also Figure 5 , which is a schematic diagram of another application interface provided by an embodiment of the present application. The local storage space of the preset application includes a key-value pair with a key of checkComponent, and when the component detection control is not triggered, the value of the key-value pair is empty.
[0062] See also Figure 6 As shown, it is a schematic diagram of another application interface provided by an embodiment of the present application. After the component detection control is triggered, the preset application processes the event of the component detection control being triggered, obtains the predefined component detection character openSwitch from the memory, and loads the predefined component detection character openSwitch into the local storage space, specifically, sets the predefined component detection character openSwitch to the value corresponding to the key checkComponent, thereby generating a corresponding key-value pair.
[0063] In one embodiment of the present application, after the predefined component detection characters are loaded into the storage space, it is determined whether the storage space includes the predefined component detection characters, that is, it is determined whether the component detection characters are completely loaded into the storage space. In the case where the storage space includes the predefined component detection characters, that is, it is determined that the component detection characters are completely loaded into the storage space, and component detection of the application interface is performed.
[0064] S103, determining whether the application interface displays a preset visual style. If the application interface displays a preset visual style, the process proceeds to S104; if the application interface does not display a preset visual style, the process proceeds to S105.
[0065] In one embodiment of the present application, the pre-packaged target component includes an initial visual style and a preset visual style. The target component can be displayed in the initial visual style or the preset visual style; the target component is displayed based on the initial visual style in the initial state, and the preset visual style is different from the visual style of other components in the preset application or application interface. The visual style of the target component can be defined using the CSS (Cascading Style Sheet) language. For example, the target component can be a window, a button, a text box, a drop-down menu, a toolbar, etc.
[0066] Taking the target component as a toolbar as an example, the initial visual style code of the toolbar is: / * Toolbar overall style * / .toolbar { display: flex; / * Using Flexbox for layout * / background-color: #FFFFFF; / * White background * / border: 1px solid #ccc; / * Border Color * / padding: 5px; / * Padding * / border-radius: 5px; / * Border rounding * / box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); / * Shadow Effect * / margin-bottom: 10px; / * Spacing to elements below * / }.
[0067] The default visual style code for the toolbar is: / * Toolbar overall style * / .toolbar { display: flex; / * Using Flexbox for layout * / background-color: #FF0000; / * Red background * / border: 1px solid #ccc; / * Border Color * / padding: 5px; / * Padding * / border-radius: 5px; / * Border rounding * / box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); / * Shadow Effect * / margin-bottom: 10px; / * Spacing to elements below * / }.
[0068] The codes involved in the above embodiments are only for illustration and are not limited in practical applications. In one embodiment of the present application, the layout, background color, border color, inner margin, border shape, shadow effect, and spacing from the lower element in the above visual style are visual style types, and at least one of the visual style types in the initial visual style and the preset visual style is different. Taking the above initial visual style code and preset visual style code as examples, the background color in the initial visual style is different from the background color in the preset visual style. In other embodiments of the present application, the background color and border color in the initial visual style are different from the background color and border color in the preset visual style; or, the preset visual style contains a visual style type that is not included in the initial visual style, for example, the preset visual style contains preset text content, and the initial visual style does not contain the preset text content, and the preset text content can be a "common component". The embodiment of the present application does not specifically limit the different visual style types in the initial visual style and the preset visual style, and only needs to present different visual effects on the application interface after the initial visual style is switched to the preset visual style.
[0069] In one embodiment of the present application, after the user triggers the component detection control, the preset application responds to the triggering event of the component detection control, loads the predefined component detection characters into the local storage space, and then further processes the triggering event. If the application interface contains the target component and the local storage space contains the preset key-value pair, that is, the local storage space includes the predefined component detection characters, the initial visual style of the target component is modified to the preset visual style, and the target component is displayed based on the preset visual style, so that the application interface displays the preset visual style. Among them, if the value in the key-value pair corresponding to the key checkComponent in the local storage space is openSwitch, it is determined that the local storage space contains the preset key-value pair and the local storage space includes the predefined component detection characters; if the value in the key-value pair corresponding to the key checkComponent in the local storage space is not openSwitch, it is determined that the local storage space does not contain the preset key-value pair and the local storage space does not include the predefined component detection characters.
[0070] S104: Determine whether the application interface includes the component.
[0071] In one embodiment of the present application, if the visual style of at least one component in the application interface is switched from the initial visual style to the preset visual style, the at least one component is determined to be the target component, that is, the application interface is determined to include the target component. From the perspective of the visual effect visible to the user, when the visual style of at least one component in the application interface is switched from the initial visual style to the preset visual style, the at least one component can present a visual effect different from the initial visual effect.
[0072] See also Figure 7 As shown, it is a schematic diagram of another application interface provided by an embodiment of the present application. For example, the background color of a component in the initial visual style is white, and the background color in the preset visual style is red. After the visual style of the component is switched from the initial visual style to the preset visual style, the background color is switched from white to red, thereby visually indicating that the component is a target component.
[0073] For another example, the border color of a component in the initial visual style is black, and the border color of the preset visual style is red. After the visual style of the component is switched from the initial visual style to the preset visual style, the border color is switched from black to red, thereby visually indicating that the component is a target component. For another example, the initial visual style of a component does not contain text content, and the preset visual style contains the text content "public component". After the visual style of the component is switched from the initial visual style to the preset visual style, the area corresponding to the component displays the text content "public component", thereby visually indicating that the component is a target component.
[0074] S105: Determine that the application interface does not include the component.
[0075] In one embodiment of the present application, if the application interface does not display a preset visual style, it is determined that the application interface does not include the target component. From the perspective of visual effects visible to the user, if the visual styles of all components in the application interface do not change, the visual effects of all components in the application interface will not change either, thereby indicating from the visual effect that the application interface does not include the target component.
[0076] Through the above-mentioned embodiments of the present application, by adding a component detection control in the application, a preset visual style is set for the target component. If the user triggers the component detection control, the predefined component detection characters are loaded into the storage space of the application, triggering the target component in the application to be displayed based on the preset visual style, thereby providing the user with a visual visual effect, determining that the target component is included in the application, effectively improving the component detection efficiency, and optimizing the component detection effect.
[0077] See also Figure 8 FIG. 1 is a flow chart of a component detection method provided by another embodiment of the present application. The method is applied in an electronic device, and the component detection method includes: S201, when a user updates an application interface on an electronic device, if the storage space corresponding to the application interface includes a predefined component detection character, the process enters S202.
[0078] S202, executing component detection of the application interface.
[0079] S203, determining whether the application interface displays a preset visual style. If the application interface displays a preset visual style, the process proceeds to S204; if the application interface does not display a preset visual style, the process proceeds to S205.
[0080] S204: Determine whether the application interface includes a target component.
[0081] S205: Determine that the application interface does not include the target component.
[0082] The specific implementation of S201-S205 is the same as that of S101-S105, and will not be repeated here.
[0083] S206, in response to the interface switching operation, display another application interface.
[0084] In one embodiment of the present application, in response to an operation of automatically switching an application interface by a preset application, or in response to an operation of manually switching an application interface by a user, the application interface is switched to another application interface and another application interface is displayed. At this time, the storage space of the preset application includes a component detection character. For example, the value in the key-value pair corresponding to the key checkComponent in the local storage space of the preset application remains openSwitch unchanged.
[0085] S207, determining whether another application interface displays a preset visual style. If another application interface displays a preset visual style, the process proceeds to S208; if another application interface does not display a preset visual style, the process proceeds to S209.
[0086] In one embodiment of the present application, if another application interface includes a target component and the local storage space includes a preset key-value pair, that is, the local storage space includes a predefined component detection character, the initial visual style of the target component in the other application interface is modified to the preset visual style, so that the preset visual style is displayed in the other application interface. The method for determining whether the other application interface displays the preset visual style is the same as the method for determining whether the application interface displays the preset visual style in S103, and is not described in detail here.
[0087] S208: Determine whether another application interface includes the component.
[0088] S209: Determine that another application interface does not include the component.
[0089] See also Fig. 9 , which is a schematic diagram of another application interface provided by an embodiment of the present application. For example, if the visual styles of all components in another application interface have not changed, it is determined that the other application interface does not include the target component.
[0090] Through the above-mentioned embodiments of the present application, after the application switches the interface, the component detection characters in the storage space are retained. In this way, there is no need for the user to trigger the component detection control again. The application can automatically trigger the target component in the switched application interface to be displayed based on the preset visual style, thereby providing the user with a visual visual effect and determining that the switched application interface contains the target component, thereby effectively improving the component detection efficiency of multiple application interfaces.
[0091] In one embodiment of the present application, the method further includes: in response to a refresh operation on the application interface, not displaying the component detection control on the application interface, and clearing the component detection characters in the storage space. In one embodiment of the present application, in response to an automatic refresh operation of the application interface by a preset application, or in response to a manual refresh operation of the application interface by a user, the code of the preset application is restored to the initial code, so that the component detection control is not displayed on the application interface, and the component detection characters in the storage space are also cleared, so that the application interface is restored to the initial state.
[0092] See also Fig.10 , which is a schematic diagram of another application interface provided by an embodiment of the present application. After the application interface is refreshed, the application interface does not display the component detection control, and the component detection characters in the local storage space are also cleared. In this way, after the preset application is released, the user can operate the application interface normally.
[0093] See also Fig.11 , which is a schematic diagram of the structure of a component detection device provided in one embodiment of the present application. In one embodiment of the present application, the component detection device 200 may include a plurality of functional modules composed of computer program segments. The computer program segments in the component detection device 200 may be stored in a memory of an electronic device and executed by at least one processor to perform the component detection function.
[0094] In one embodiment of the present application, the component detection device 200 can be divided into multiple functional modules according to the functions it performs. The functional modules of the component detection device 200 may include: a judgment module 201, an execution module 202, and a determination module 203. The module in the embodiment of the present application refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, which are stored in a memory.
[0095] The determination module 201 is used to determine whether the storage space corresponding to the application interface includes a predefined component detection character when the user updates the application interface on the electronic device.
[0096] The execution module 202 is used to execute component detection of the application interface.
[0097] The determination module 201 is further configured to determine whether the application interface displays a preset visual style.
[0098] The determination module 203 is configured to determine that the application interface includes the component when the determination module 201 determines that the application interface displays a preset visual style.
[0099] The determination module 203 is further configured to determine that the application interface does not include the component when the determination module 201 determines that the application interface does not display the preset visual style.
[0100] See also Fig.12 As shown, it is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. The embodiment of the present application also provides an electronic device 100, which can be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (Ultra-mobile Personal Computer, UMPC), a netbook, and a cellular phone, a personal digital assistant (Personal Digital Assistant, PDA), an augmented reality (Augmented Reality, AR) device, a virtual reality (Virtual Reality, VR) device, an artificial intelligence (Artificial Intelligence, AI) device, a wearable device, a vehicle-mounted device, a smart home device and / or a smart city device. The embodiment of the present application does not impose any special restrictions on the specific type of the electronic device 100.
[0101] The electronic device 100 includes, but is not limited to, a processor 110 and a memory 120 connected via a communication bus 130 . Fig.12 This is merely an example of an electronic device and does not constitute a corresponding limitation. In other embodiments, the electronic device may include more components than those shown in the figure.
[0102] The memory 120 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM). The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data. The random access memory may include static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), etc.
[0103] The non-volatile memory may also store executable programs and user and application data, etc., and may be pre-loaded into the random access memory for direct reading and writing by the processor 110. The non-volatile memory may include a disk storage device and a flash memory.
[0104] The memory 120 is used to store one or more computer programs. The one or more computer programs are configured to be executed by the processor 110. The one or more computer programs include a plurality of instructions, and when the plurality of instructions are executed by the processor 110, the component detection method executed on the electronic device 100 can be implemented.
[0105] In other embodiments, the electronic device 100 further includes an external memory interface for connecting to an external memory to expand the storage capacity of the electronic device 100 .
[0106] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0107] The processor 110 provides computing and control capabilities. For example, the processor 110 is used to execute a computer program stored in the memory 120 to implement the above-mentioned component detection method.
[0108] The communication bus 130 is at least used to provide a channel for the memory 120 and the processor 110 in the electronic device 100 to communicate with each other.
[0109] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0110] An embodiment of the present application also provides a computer storage medium, in which computer instructions are stored. When the computer instructions are executed on the electronic device 100, the electronic device 100 executes the above-mentioned related method steps to implement the component detection method in the above-mentioned embodiment.
[0111] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement the component detection method in the above-mentioned embodiment.
[0112] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer execution instructions, and when the device is running, the processor can execute the computer execution instructions stored in the memory so that the chip executes the component detection method in the above-mentioned method embodiments.
[0113] Among them, the electronic device, computer storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above and will not be repeated here.
[0114] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0115] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0116] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0117] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0118] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the software product is stored in a storage medium, including a number of instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (RandomAccess Memory, RAM), disk or optical disk and other media that can store program code.
[0119] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application and are not intended to limit it. Although the present application has been described in detail with reference to the preferred embodiments, a person of ordinary skill in the art should understand that the technical solution of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present application.< / canvas> < / video> < / videoview> < / imgview> < / textview>
Claims
1. A component detection method, applied to electronic equipment, characterized in that: The method comprises: In case of updating an application interface on the electronic device, if the storage space corresponding to the application interface includes the predefined component detection character, performing component detection of the application interface; If the application interface displays a preset visual style, it is determined that the application interface includes the component; wherein the component is displayed in the preset visual style.
2. The component detection method according to claim 1, characterized in that: Before performing component detection of the application interface, the method further includes: Displaying a component detection control on the application interface based on a user operation; In response to a user's operation on the component detection control, the predefined component detection character is loaded into a storage space corresponding to the application interface.
3. The component detection method according to claim 2, characterized in that: The displaying of a component detection control on the application interface based on a user operation includes: Based on the user modifying the display attribute of the component detection control to display, the component detection control is displayed on the application interface.
4. The component detection method according to claim 2, characterized in that: The step of loading the predefined component detection character into a storage space corresponding to the application interface includes: The predefined component detection characters are obtained, and the predefined component detection characters are loaded into the storage space to generate preset key-value pairs.
5. The component detection method according to any one of claims 1 to 4, characterized in that: The component may also be displayed based on an initial visual style, where the preset visual style is different from the visual styles of other components on the application interface.
6. The component detection method according to claim 5, characterized in that: The method further comprises: If the application interface includes the component, and the storage space includes the predefined component detection character, the initial visual style of the component is modified to the preset visual style, so that the application interface displays the preset visual style.
7. The component detection method according to claim 2, characterized in that: The method further comprises: In response to a refresh operation on the application interface, the component detection control is not displayed on the application interface, and the component detection character in the storage space is cleared.
8. The component detection method according to claim 1, characterized in that: The method further comprises: In response to the interface switching operation, display another application interface; If the storage space includes the predefined component detection character, and the other application interface displays the preset visual style, it is determined that the other application interface includes the component.
9. The component detection method according to claim 1, characterized in that: The method further comprises: If the application interface does not display the preset visual style, it is determined that the application interface does not include the component.
10. An electronic device, characterized in that: The electronic device comprises a memory and a processor: Wherein, the memory is used to store program instructions; The processor is used to read and execute the program instructions stored in the memory. When the program instructions are executed by the processor, the electronic device executes the component detection method according to any one of claims 1 to 9.