Disclosure of Invention
In order to solve the problems in the prior art, embodiments of the present invention provide a method and an apparatus for managing component codes. The technical scheme is as follows:
according to a first aspect of embodiments of the present invention, there is provided a method of managing component code, the method comprising:
in the editing process of a target application page, when a function list display instruction of a target component in the target application page is received, displaying a to-be-selected function list of the target component, wherein the to-be-selected function list comprises a plurality of function options;
after receiving a selection instruction of an option of a target function, acquiring pre-stored configuration information of the target function;
and adding the configuration information of the target function into the configuration information of the target component, and generating a complete code of the target component based on the added configuration information.
Optionally, when receiving a function list display instruction of a target component in a target application page in an editing state, before displaying a list of functions to be selected of the target component, the method further includes:
and when an adding instruction of the target component is received, adding the target component in the target application page based on the basic code of the target component.
Optionally, the method further comprises:
and when a page code generation instruction of the target application page is received, generating the code of the target application page based on the complete code of the target component and the complete codes of other components in the target application page.
Optionally, the method further comprises:
and when the description information query instruction of the target function is received, acquiring the function description information of the target function from the pre-stored function description information of each function, and displaying the acquired function description information. Optionally, the adding the function code to the base code of the target component to generate a complete code of the target component includes:
displaying a parameter input window;
acquiring the configuration parameters input in the parameter input window, and adding the configuration parameters into the function codes;
adding the configuration information of the target function added with the configuration parameters into the configuration information of the target assembly, introducing the function code added with the configuration parameters into the basic code of the target assembly based on the added configuration information, and generating the complete code of the target assembly.
According to a second aspect of embodiments of the present invention, there is provided an apparatus for managing component code, the apparatus comprising:
the device comprises a first display module, a second display module and a third display module, wherein the first display module is used for displaying a to-be-selected function list of a target component in a target application page when a function list display instruction of the target component in the target application page is received in the editing process of the target application page, and the to-be-selected function list comprises a plurality of function options;
the acquisition module is used for acquiring pre-stored configuration information of the target function after receiving a selection instruction of the option of the target function;
and the first generation module is used for adding the configuration information of the target function into the configuration information of the target component and generating a complete code of the target component based on the added configuration information.
Optionally, the apparatus further comprises:
and the adding module is used for adding the target component in the target application page based on the basic code of the target component when the adding instruction of the target component is received before the function list display instruction of the target component in the target application page in the editing state is received and the to-be-selected function list of the target component is displayed.
Optionally, the apparatus further comprises:
and the second generation module is used for generating the code of the target application page based on the complete code of the target component and the complete codes of other components in the target application page when receiving the page code generation instruction of the target application page.
Optionally, the apparatus further comprises:
and the second display module is used for acquiring the function description information of the target function from the pre-stored function description information of each function and displaying the acquired function description information when the description information query instruction of the target function is received.
Optionally, the first generating module is configured to:
displaying a parameter input window;
acquiring the configuration parameters input in the parameter input window, and adding the configuration parameters into the function codes;
adding the configuration information of the target function added with the configuration parameters into the configuration information of the target assembly, introducing the function code added with the configuration parameters into the basic code of the target assembly based on the added configuration information, and generating the complete code of the target assembly.
According to a third aspect of embodiments of the present invention, there is provided a terminal, the terminal comprising a processor and a memory, the memory having stored therein at least one instruction, the instruction being loaded and executed by the processor to implement the method for managing component code as set forth in the first aspect.
According to a fourth aspect of embodiments of the present invention, there is provided a computer-readable storage medium having stored therein at least one instruction which is loaded and executed by a processor to implement the method of managing component code as set forth in the first aspect.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, in the editing process of a target application page, when a function list display instruction of a target component in the target application page is received, a to-be-selected function list of the target component is displayed, wherein the to-be-selected function list comprises a plurality of function options; after receiving a selection instruction of an option of a target function, acquiring pre-stored configuration information of the target function; and adding the configuration information of the target function into the configuration information of the target component, and generating a complete code of the target component based on the added configuration information. Therefore, the functions of the components in the visual development tool can be selected by a user, the functions of the components can be changed without changing component source codes by technicians, and the efficiency of application page development is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
The embodiment of the invention provides a method for managing component codes, which can be realized by a terminal. Wherein the terminal is a terminal installed with a visual development tool.
The terminal may include components such as a processor, memory, screen, etc. The processor, which may be a Central Processing Unit (CPU), may be configured to parse the function list display instruction, control the screen to display a candidate function list of the target component, and obtain a function code of the target function stored in advance. The Memory may be a RAM (Random Access Memory), a Flash Memory, or the like, and may be configured to store received data, data required by the processing procedure, data generated in the processing procedure, or the like, such as a function code, a function list display instruction, a list of functions to be selected, a selection instruction of an option of a target function, or the like. The screen may be a display screen, and may be used to display a list of functions to be selected, a target application page, an editing interface of a visual development tool, and the like.
The terminal may further include a transceiver, an image detection part, an audio output part, an audio input part, and the like. The transceiver may be used for data transmission with other devices, for example, to send feedback information of a user to a background server, and may include an antenna, a matching circuit, a modem, and the like. The image detection means may be a camera or the like. The audio output component may be a speaker, headphones, or the like. The audio input means may be a microphone or the like.
As shown in fig. 1, the processing flow of the method may include the following steps:
instep 101, in the editing process of the target application page, when a function list display instruction of a target component in the target application page is received, a list of functions to be selected of the target component is displayed.
The list of functions to be selected includes options of a plurality of functions.
In implementation, when a user uses a visual development tool to make an application page, the visual development tool is firstly opened, an editing interface of the visual development tool may include a component selection area, a page editing area and an operation selection area, an icon of a component for selection may be displayed in the component selection area, an application page in an editing state may be displayed in the page editing area, and operation options used in various editing processes may be displayed in the operation selection area. The terminal stores basic codes of each component, and the basic codes comprise display image data of the components and codes for executing display logic. In addition, the terminal can also pre-store a list of functions to be selected corresponding to each component, and the list of functions to be selected of any component includes a function which can be set for the component by a technician in advance. For example, a technician sets a function of jumping to a web page after clicking a component, a function of displaying a dialog box, and a function of displaying a form for clicking the component, where the function of jumping to a web page is used to jump to a web page after clicking the component, the function of displaying a dialog box is used to display a dialog box after clicking the component, and the function of displaying a form is used to display a form after clicking the component.
The user may select a desired component (i.e., a target component) in the component selection area and then drag it to a corresponding position of the target application page in an edited state. At this time, the terminal receives the adding instruction of the target component, and then the terminal can acquire the basic code of the target component stored in advance, and display the target component at the position based on the basic code. The user can find the function list option in the operation selection area, click the function list option, the terminal can receive the function list display instruction of the target assembly, and then the terminal can display the function list to be selected of the target assembly.
In addition, when the function list to be selected has many functions, a search function may be set for the convenience of the user to search, as shown in fig. 2, a search window may be set in the function list to be selected, the user may input a function name to be searched in the search window, and the terminal may search for a corresponding function in all functions of the target component based on the function name input by the user and display the searched function in the function list to be selected, so that the user may use the function more conveniently, and the editing efficiency may be improved. When a user wants a certain function but does not have the function in the list of the functions to be selected, the visualization development tool may also provide a user feedback mechanism, as shown in fig. 3, a feedback option may be set in the list of the functions to be selected, the user clicks the feedback option, a description of the desired function is input in a pop-up feedback window, and a determination option is clicked. The terminal can send the feedback information of the user to the technical staff, so that the technical staff can add functions in time according to the user requirements, and the visual development tool can better meet the requirements of the user.
For example, as shown in fig. 4, a user wants to add a picture in a target application page, and may jump to a web page when clicking the picture, and after the user opens the visual development tool, the user may see that the editing interface may include a component selection area, a page editing area, and an operation selection area, an icon of a component for selection may be displayed in the component selection area, a target application page currently in an editing state is displayed in the page editing area, and a function list option may be included in the operation selection area. The user can first select the content display component in the selection area of the component, drag the content display component to the position where the user wants the component to be displayed in the target application page, then right click the content display component in the target application page, select the option of inserting the picture, and select the picture to be inserted in the pop-up picture selection window, so that the picture is added. And then selecting the component in the target application page, finding a function list option in a menu selection area, clicking the function list option, and displaying a function list to be selected below the option. The user selects the function of the webpage jump in the function list to be selected, and the component can have the function of the webpage jump by clicking the option of the function.
Alternatively, when the user does not know the function of a certain function, the function description information of the function may be queried, and the corresponding processing may be as follows: when a description information query instruction of a target function is received, acquiring function description information of the target function from the pre-stored function description information of each function, and displaying the acquired function description information.
In implementation, when writing function codes of functions, a technician writes function description information for each function, the function description information is used for describing names of the functions and functions of the functions, and stores the function description information.
After a user opens a function list to be selected of a target assembly, if the function or the achieved effect of a certain function in the function list to be selected is unknown, the terminal can be operated to inquire the description information of the function (namely the target function), after the terminal receives a description information inquiry instruction of the target function, the terminal finds the function description information of each function which is stored in advance, searches the function description information of the target function according to the description information inquiry instruction of the target function, and then displays the found function description information in a function description information display frame. For example, when the user does not know a function in the list of functions to be selected, the user may place the cursor of the mouse on the option of the function for a certain time period, and the terminal may automatically present a display frame in which description information of the function and the achieved effect is displayed, and the user may know the function by reading the description information.
Instep 102, after receiving a selection instruction of an option of a target function, configuration information of the target function stored in advance is acquired.
In implementation, after a user selects a function (i.e., a target function) to be set for a target component in a to-be-selected function list and clicks a target function option, a terminal receives a selection instruction of the target function option, and after the selection instruction is analyzed, the terminal queries configuration information corresponding to the target function in a pre-stored code set according to the selection instruction.
Instep 103, the configuration information of the target function is added to the configuration information of the target component, and the code of the target component is generated based on the added configuration information.
In implementation, after the configuration information corresponding to the target function is inquired, the terminal controls to add the configuration information into the configuration information of the target component, and according to the added configuration information, the code of the target function is introduced into the basic code of the target component by calling the binding function, so that the complete code of the target component is generated. Thus, through the complete code, the display of the target component and the execution of the target function can be achieved.
Alternatively, in the process of adding the target function to the target component, the configuration parameters in the function code may need to be set by the user, and the related processing may be as follows: displaying a parameter input window, acquiring configuration parameters input in the parameter input window, adding the configuration parameters into a function code, adding the configuration information of the target function after the configuration parameters are added into the configuration information of the target component, introducing the function code after the configuration parameters are added into a basic code of the target component based on the added configuration information, and generating a complete code of the target component.
In implementation, for some functions of the component, some configuration parameters may need to be set by the user in the corresponding function code, for example, a jump website in the function code of the jump web function is a configuration parameter that needs to be configured by the user, and the adding process of such functions will be described in detail below. When configuration parameters exist in the target function and need to be set by a user, the terminal can automatically display a parameter input window corresponding to the target function after the user clicks the option of the target function. The terminal can acquire the configuration parameters input by the user in the parameter input window after clicking the determined option, and adds the configuration parameters to the position preset by the technical personnel in the function code to acquire the function code with the added configuration parameters. Then, adding the configuration information of the target function after adding the configuration parameters into the configuration information of the target component, introducing the function code after adding the configuration parameters into the basic code of the target component according to the added configuration information, and synthesizing the complete code of the target component with the basic code of the target component. For example, as shown in fig. 5, when a user edits a target application page, the user may jump to a web page when he/she wants to click a certain picture, and after the user selects the function of jumping to the web page for this component, the visualization development tool may automatically pop up a parameter input window that can input a web address, and input the web address of the web page that the user wants to jump to in the parameter input window, and click a determination option, this component may have the function of jumping to the web page.
Optionally, after the user finishes editing the target application page, the terminal may be operated to generate the target application page, and the corresponding processing may be as follows: and when a page code generation instruction of the target application page is received, generating the code of the target application page based on the complete code of the target component and the complete codes of other components in the target application page.
In implementation, a user can add various components in a target application page based on the processing mode and set corresponding functions for the components based on own requirements. As shown in fig. 6, when a user finishes editing a target application page and wants to generate the target application page, a finish option may be found in an operation selection area and the finish option is clicked, the terminal may receive a page code generation instruction of the target application page, then the terminal may display a window of a storage location, where the window includes a filling window of information such as a storage location, a file name, and a file type, where the user may fill in the storage location, the file name, and the file type of the complete code of the target application page, and click a save option, the terminal may call the complete code of the target component and the codes of other components, combine the codes into the code of the target application page, and store the code in the storage location selected by the user. Thus, the target application page edited by the user can be saved.
In the embodiment of the invention, in the editing process of a target application page, when a function list display instruction of a target component in the target application page is received, a to-be-selected function list of the target component is displayed, wherein the to-be-selected function list comprises a plurality of function options; after receiving a selection instruction of an option of a target function, acquiring pre-stored configuration information of the target function; and adding the configuration information of the target function into the configuration information of the target component, and generating a complete code of the target component based on the added configuration information. Therefore, the functions of the components in the visual development tool can be selected by a user, the functions of the components can be changed without changing component source codes by technicians, and the efficiency of application page development is improved.
Based on the same technical concept, an embodiment of the present invention further provides an apparatus for managing component codes, as shown in fig. 7, the apparatus including: afirst display module 710, anacquisition module 720 and afirst generation module 730.
Thefirst display module 710 is configured to, in an editing process of a target application page, when a function list display instruction of a target component in the target application page is received, display a to-be-selected function list of the target component, where the to-be-selected function list includes options of a plurality of functions;
the obtainingmodule 720 is configured to obtain pre-stored configuration information of the target function after receiving a selection instruction of an option of the target function;
thefirst generating module 730 is configured to add the configuration information of the target function to the configuration information of the target component, and generate a complete code of the target component based on the added configuration information.
Optionally, as shown in fig. 8, the apparatus further includes:
the addingmodule 740 is configured to add the target component in the target application page based on the basic code of the target component when receiving the adding instruction of the target component before displaying the to-be-selected function list of the target component when receiving the function list display instruction of the target component in the target application page in the editing state.
Optionally, as shown in fig. 9, the apparatus further includes:
thesecond generation module 750 is configured to generate the code of the target application page based on the complete code of the target component and the complete codes of the other components in the target application page when receiving the page code generation instruction of the target application page.
Optionally, as shown in fig. 10, the apparatus further includes:
thesecond display module 760 is configured to, when receiving the description information query instruction of the target function, acquire the function description information of the target function from the function description information of each function stored in advance, and display the acquired function description information.
Optionally, thefirst generating module 730 is configured to:
displaying a parameter input window;
acquiring the configuration parameters input in the parameter input window, and adding the configuration parameters into the function codes;
adding the configuration information of the target function added with the configuration parameters into the configuration information of the target assembly, introducing the function code added with the configuration parameters into the basic code of the target assembly based on the added configuration information, and generating the complete code of the target assembly.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
In the embodiment of the invention, in the editing process of a target application page, when a function list display instruction of a target component in the target application page is received, a to-be-selected function list of the target component is displayed, wherein the to-be-selected function list comprises a plurality of function options; after receiving a selection instruction of an option of a target function, acquiring pre-stored configuration information of the target function; and adding the configuration information of the target function into the configuration information of the target component, and generating a complete code of the target component based on the added configuration information. Therefore, the functions of the components in the visual development tool can be selected by a user, the functions of the components can be changed without changing component source codes by technicians, and the efficiency of application page development is improved.
It should be noted that: the management component code provided in the foregoing embodiment is only illustrated by the division of the functional modules when managing the component code, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the terminal is divided into different functional modules to complete all or part of the above described functions. In addition, the device for managing component codes and the method embodiment for managing component codes provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiment and are not described herein again.
The embodiment of the invention also provides a terminal structure block diagram. As shown in fig. 11, the terminal 1100 may be a portable mobile terminal such as: smart phones, tablet computers. The terminal 1100 may also be referred to by other names such as user equipment, portable terminal, etc.
In general, terminal 1100 includes: aprocessor 1101 and amemory 1102.
Processor 1101 may include one or more processing cores, such as a 4-core processor, an 8-core processor, or the like. Theprocessor 1101 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). Theprocessor 1101 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, theprocessor 1101 may be integrated with a GPU (Graphics Processing Unit) that is responsible for rendering and drawing the content that the display screen needs to display. In some embodiments, theprocessor 1101 may further include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.
Memory 1102 may include one or more computer-readable storage media, which may be tangible and non-transitory.Memory 1102 can also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium inmemory 1102 is used to store at least one instruction for execution byprocessor 1101 to implement the methods of managing component code provided herein.
In some embodiments, the terminal 1100 may further include: a peripheral interface 1103 and at least one peripheral. Specifically, the peripheral device includes: at least one ofradio frequency circuitry 1104,touch display screen 1105,camera 1106,audio circuitry 1107,positioning component 1108, andpower supply 1109.
The peripheral interface 1103 may be used to connect at least one peripheral associated with I/O (Input/Output) to theprocessor 1101 and thememory 1102. In some embodiments, theprocessor 1101,memory 1102, and peripheral interface 1103 are integrated on the same chip or circuit board; in some other embodiments, any one or two of theprocessor 1101, thememory 1102 and the peripheral device interface 1103 may be implemented on separate chips or circuit boards, which is not limited by this embodiment.
TheRadio Frequency circuit 1104 is used to receive and transmit RF (Radio Frequency) signals, also called electromagnetic signals. Theradio frequency circuit 1104 communicates with communication networks and other communication devices via electromagnetic signals. Theradio frequency circuit 1104 converts an electric signal into an electromagnetic signal to transmit, or converts a received electromagnetic signal into an electric signal. Optionally, theradio frequency circuit 1104 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so forth. Theradio frequency circuit 1104 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocols include, but are not limited to: the world wide web, metropolitan area networks, intranets, generations of mobile communication networks (2G, 3G, 4G, and 5G), Wireless local area networks, and/or WiFi (Wireless Fidelity) networks. In some embodiments, therf circuit 1104 may further include NFC (Near Field Communication) related circuits, which are not limited in this application.
Thetouch display screen 1105 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. Thetouch display screen 1105 also has the ability to capture touch signals on or over the surface of thetouch display screen 1105. The touch signal may be input to theprocessor 1101 as a control signal for processing.Touch display 1105 is used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, thetouch display screen 1105 can be one, providing the front panel of the terminal 1100; in other embodiments, thetouch display screens 1105 can be at least two, respectively disposed on different surfaces of the terminal 1100 or in a folded design; in still other embodiments,touch display 1105 can be a flexible display disposed on a curved surface or on a folded surface of terminal 1100. Even more, thetouch display screen 1105 can be arranged in a non-rectangular irregular pattern, i.e., a shaped screen. Thetouch Display screen 1105 can be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), and other materials.
Camera assembly 1106 is used to capture images or video. Optionally,camera assembly 1106 includes a front camera and a rear camera. Generally, a front camera is used for realizing video call or self-shooting, and a rear camera is used for realizing shooting of pictures or videos. In some embodiments, the number of the rear cameras is at least two, and each of the rear cameras is any one of a main camera, a depth-of-field camera and a wide-angle camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize a panoramic shooting function and a VR (Virtual Reality) shooting function. In some embodiments,camera assembly 1106 may also include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp, and can be used for light compensation at different color temperatures.
Theaudio circuit 1107 is used to provide an audio interface between the user and theterminal 1100. Theaudio circuitry 1107 may include a microphone and a speaker. The microphone is used for collecting sound waves of a user and the environment, converting the sound waves into electric signals, and inputting the electric signals to theprocessor 1101 for processing or inputting the electric signals to theradio frequency circuit 1104 to achieve voice communication. For stereo capture or noise reduction purposes, multiple microphones may be provided, each at a different location of terminal 1100. The microphone may also be an array microphone or an omni-directional pick-up microphone. The speaker is used to convert electrical signals from theprocessor 1101 or theradio frequency circuit 1104 into sound waves. The loudspeaker can be a traditional film loudspeaker or a piezoelectric ceramic loudspeaker. When the speaker is a piezoelectric ceramic speaker, the speaker can be used for purposes such as converting an electric signal into a sound wave audible to a human being, or converting an electric signal into a sound wave inaudible to a human being to measure a distance. In some embodiments, theaudio circuitry 1107 may also include a headphone jack.
Positioning component 1108 is used to locate the current geographic position of terminal 1100 for purposes of navigation or LBS (Location Based Service). ThePositioning component 1108 may be a Positioning component based on the Global Positioning System (GPS) in the united states, the beidou System in china, or the galileo System in russia.
Power supply 1109 is configured to provide power to various components within terminal 1100. Thepower supply 1109 may be alternating current, direct current, disposable or rechargeable. When thepower supply 1109 includes a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. The wired rechargeable battery is a battery charged through a wired line, and the wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, terminal 1100 can also include one or more sensors 1110. The one or more sensors 1110 include, but are not limited to: acceleration sensor 1111, gyro sensor 1112, pressure sensor 1113, fingerprint sensor 1114, optical sensor 1115, and proximity sensor 1116.
Acceleration sensor 1111 may detect acceleration levels in three coordinate axes of a coordinate system established with terminal 1100. For example, the acceleration sensor 1111 may be configured to detect components of the gravitational acceleration in three coordinate axes. Theprocessor 1101 may control thetouch display screen 1105 to display a user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 1111. The acceleration sensor 1111 may also be used for acquisition of motion data of a game or a user.
The gyro sensor 1112 may detect a body direction and a rotation angle of the terminal 1100, and the gyro sensor 1112 may cooperate with the acceleration sensor 1111 to acquire a 3D motion of the user with respect to theterminal 1100. From the data collected by gyroscope sensor 1112,processor 1101 may implement the following functions: motion sensing (such as changing the UI according to a user's tilting operation), image stabilization at the time of photographing, game control, and inertial navigation.
Pressure sensor 1113 may be disposed on a side bezel of terminal 1100 and/or on an underlying layer oftouch display screen 1105. When the pressure sensor 1113 is disposed on the side frame of the terminal 1100, a holding signal of the terminal 1100 by the user can be detected, and left-right hand recognition or shortcut operation can be performed according to the holding signal. When the pressure sensor 1113 is disposed at the lower layer of thetouch display screen 1105, the operability control on the UI interface can be controlled according to the pressure operation of the user on thetouch display screen 1105. The operability control comprises at least one of a button control, a scroll bar control, an icon control and a menu control.
The fingerprint sensor 1114 is used for collecting a fingerprint of a user to identify the identity of the user according to the collected fingerprint. Upon recognizing that the user's identity is a trusted identity, the user is authorized by theprocessor 1101 to perform relevant sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying for and changing settings, etc. Fingerprint sensor 1114 may be disposed on the front, back, or side of terminal 1100. When a physical button or vendor Logo is provided on the terminal 1100, the fingerprint sensor 1114 may be integrated with the physical button or vendor Logo.
Optical sensor 1115 is used to collect ambient light intensity. In one embodiment, theprocessor 1101 may control the display brightness of thetouch display screen 1105 based on the ambient light intensity collected by the optical sensor 1115. Specifically, when the ambient light intensity is high, the display brightness of thetouch display screen 1105 is increased; when the ambient light intensity is low, the display brightness of thetouch display screen 1105 is turned down. In another embodiment,processor 1101 may also dynamically adjust the shooting parameters ofcamera assembly 1106 based on the ambient light intensity collected by optical sensor 1115.
Proximity sensor 1116, also referred to as a distance sensor, is typically disposed on the front face of terminal 1100. Proximity sensor 1116 is used to capture the distance between the user and the front face of terminal 1100. In one embodiment, thetouch display screen 1105 is controlled by theprocessor 1101 to switch from a bright screen state to a dark screen state when the proximity sensor 1116 detects that the distance between the user and the front face of the terminal 1100 is gradually decreasing; when the proximity sensor 1116 detects that the distance between the user and the front face of the terminal 1100 becomes gradually larger, thetouch display screen 1105 is controlled by theprocessor 1101 to switch from a breath-screen state to a bright-screen state.
Those skilled in the art will appreciate that the configuration shown in fig. 11 does not constitute a limitation of terminal 1100, and may include more or fewer components than those shown, or may combine certain components, or may employ a different arrangement of components.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.