Disclosure of Invention
The embodiment of the application provides a method, equipment and storage medium for determining trigger subject information, which can determine each trigger subject information corresponding to a modified objective function and prompt a tester to test each trigger mode corresponding to the modified objective function. The technical scheme is as follows:
in one aspect, a method of determining trigger body information is provided, the method comprising:
Determining calling relations among functions in a target program and determining modified target functions in the target program;
Determining at least one function call link for calling the target function based on the call relation;
And determining triggering subject information corresponding to the target function based on the first-level function in the at least one function call link.
Optionally, the determining the modified objective function in the objective program includes:
determining the position of each function in the target program;
and determining the modified target function in the target program based on the positions of the functions in the target program and the recorded positions of the modified codes in the target program.
Optionally, the determining, based on the calling relationship, at least one function calling link for calling the objective function includes:
determining at least one function that directly and indirectly invokes the objective function;
At least one function call link for calling the target function is determined based on the call relationship between the at least one function.
Optionally, the determining at least one function call link for calling the objective function based on the call relationship between the objective function and the at least one function includes:
And determining the first-level function added to the head of the target function call link in turn based on the call relation among the functions in at least one function and a recursion algorithm, determining whether the first-level function added to the head of the target function call link is a target class function or not each time, and if the first-level function added currently is the target class function, determining the currently determined target function call link as the function call link in the at least one function call link.
Optionally, the objective category function includes an operation function and a page exposure function.
Optionally, the determining triggering subject information corresponding to the objective function based on the first-level function in the at least one function call link includes:
Acquiring the corresponding relation between the function identifier and the triggering subject information;
and determining triggering subject information corresponding to the objective function in the corresponding relation based on the objective function identification of the objective function.
Optionally, before determining the calling relationship between the functions in the target program, the method further includes:
Receiving a program version identifier sent by a test management terminal, and determining a target program based on the program version identifier;
after determining the triggering subject information corresponding to the objective function, the method further includes:
and sending trigger subject information corresponding to the objective function to the test management terminal so that the test management terminal displays the received trigger subject information.
Optionally, the method further comprises:
receiving a function call link query request sent by a test management terminal, wherein the function call link query request carries a function identifier of a target function and target trigger subject information;
Determining an objective function call link in the at least one function call link based on the function identification of the objective function carried in the function call link query request and the objective trigger subject information;
And sending the target function call link to the test management terminal so that the test management terminal displays the received target function call link.
Optionally, the trigger body information includes page information and page operation information.
In another aspect, there is provided an apparatus for determining trigger subject information, the apparatus comprising:
the first determining module is used for determining calling relations among functions in the target program and determining modified target functions in the target program;
The second determining module is used for determining at least one function call link for calling the target function based on the call relation;
and the third determining module is used for determining triggering subject information corresponding to the target function based on the first-level function in the at least one function call link.
Optionally, the first determining module is configured to:
determining the position of each function in the target program;
and determining the modified target function in the target program based on the positions of the functions in the target program and the recorded positions of the modified codes in the target program.
Optionally, the second determining module is configured to:
determining at least one function that directly and indirectly invokes the objective function;
At least one function call link for calling the target function is determined based on the call relationship between the at least one function.
Optionally, the second determining module is configured to:
And determining the first-level function added to the head of the target function call link in turn based on the call relation among the functions in at least one function and a recursion algorithm, determining whether the first-level function added to the head of the target function call link is a target class function or not each time, and if the first-level function added currently is the target class function, determining the currently determined target function call link as the function call link in the at least one function call link.
Optionally, the third determining module is configured to:
Acquiring the corresponding relation between the function identifier and the triggering subject information;
and determining triggering subject information corresponding to the objective function in the corresponding relation based on the objective function identification of the objective function.
Optionally, the device further includes a transceiver module configured to:
Receiving a program version identifier sent by a test management terminal, and determining a target program based on the program version identifier;
the transceiver module is used for:
and sending trigger subject information corresponding to the objective function to the test management terminal so that the test management terminal displays the received trigger subject information.
Optionally, the transceiver module is further configured to:
receiving a function call link query request sent by a test management terminal, wherein the function call link query request carries a function identifier of a target function and target trigger subject information;
Determining an objective function call link in the at least one function call link based on the function identification of the objective function carried in the function call link query request and the objective trigger subject information;
And sending the target function call link to the test management terminal so that the test management terminal displays the received target function call link.
In yet another aspect, a computer device is provided that includes a processor and a memory having stored therein at least one instruction that is loaded and executed by the processor to perform the operations performed by the method of determining trigger subject information as described above.
In yet another aspect, a computer readable storage medium is provided, wherein at least one instruction is stored in the storage medium, the at least one instruction being loaded and executed by a processor to implement operations performed by a method of determining trigger subject information as described above.
The technical scheme provided by the embodiment of the application has the beneficial effects that:
The embodiment of the application determines the calling relation among the functions in the target program and the modified target function in the target program, then determines at least one function calling link for calling the target function according to the calling relation, and the first-stage function in the at least one function calling link for calling the target function is the function for starting to trigger the target function, so that after determining the triggering subject information of the first-stage function of each function calling link (namely the triggering subject information corresponding to the target function), the triggering subject corresponding to the modified target function can be determined. According to the application, a tester does not need to analyze the modified program, so that the tester can directly obtain each trigger main body corresponding to the modified target function, and the target function can be triggered according to each trigger main body to test the target function.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail with reference to the accompanying drawings.
The method for determining the triggering main body information provided by the application can be realized by the terminal or realized by the terminal and the server together. The terminal can be connected to the Internet, and the terminal can be a mobile phone, a tablet personal computer, an intelligent wearable device, a desktop computer, a notebook computer and the like. The server may be a server establishing network connection with the terminal, and may be a single server or a server group, if the server is a single server, the server may be responsible for all the processes in the following schemes, and if the server is a server group, different servers in the server group may be respectively responsible for different processes in the following schemes, and specific process allocation situations may be set arbitrarily by a technician according to actual requirements, which will not be described herein.
Different functions in the application program can be realized by different functions in corresponding program codes, each function corresponding to the application program comprises an operation function for monitoring operation events of a user, such as clicking a control, a sliding page and the like in the application program, and other functions can be called to realize corresponding functions after the operation function is triggered. For example, in the music playing application program, the user clicks the music playing control, and the function corresponding to the music playing control may call the music data downloading function, the music playing function, the lyric display function, etc. to realize the function of playing music by the music playing application program.
As shown in fig. 1, a function may be called through a plurality of different function call links, when a function is modified, it may affect the different function call links to normally call the function, so after the function is modified, a tester is required to test whether the modified function can be normally called according to each function call link, thereby implementing the function corresponding to the modified function. Wherein, the function of the first stage in each function call link is a trigger function for triggering the modified function, and the function is generally an operation function or a page exposure function of a user. The method for determining the triggering subject information provided by the embodiment of the application can determine the triggering function corresponding to the modified function and the operation or page corresponding to the triggering function.
Fig. 2 is a method for determining trigger body information according to an embodiment of the present application, as shown in fig. 2, the method includes:
Step 201, determining calling relations among functions in the target program and determining modified target functions in the target program.
The target program is a program code corresponding to the tested application program modified by the technician, and the target function is a function modified by the technician in the program code corresponding to the tested application program.
In implementation, after the technician finishes modifying the target program in the programming software, a program file corresponding to the target program may be obtained, and if the application program is an android application program, the corresponding program file may be an apk (android application package ) file. And then decompiling the program file to obtain the calling relation of each function in the target program. As shown in fig. 3, the apk to be tested is a program file of the target program, and each smali (a file format) file included in the apk file may be scanned and parsed one by one, each class (class) is traversed and parsed to obtain a parsed class variable and a method body, and then the method body is traversed and parsed to obtain a variable invoke and a function invoke. The method body is a function caller, and the variables invoke and the function invoke are callees. After all the function call relations are obtained, the call relations of the functions can be stored. The calling relation of each function can be represented by a plurality of function pairs, and each function pair comprises a function caller and a callee, as shown in a table one.
List one
In addition, before the calling relation of each function is stored, the calling relation of each function can be subjected to de-duplication processing so as to reduce the stored data quantity.
Alternatively, the process of determining the modified objective function in the objective program may be such that the location of each function in the objective program is determined, and the modified objective function in the objective program is determined based on the location of each function in the objective program and the pre-recorded location of the modified code in the objective program.
In implementation, after decompiling the target program, the calling relation of each function can be obtained, and the corresponding line number of each function in the target program can also be obtained. And when a technician modifies the code in the target program by the programming software, the programming software may record the location of the modified code, such as the number of lines of the modified code in the target program, where the programming development software may be git (open source distributed version control system). Thus, the function modified by the technician in the target program can be determined by acquiring the number of lines of the modified code recorded by the programming software and the corresponding number of lines of each function in the target program.
Step 202, determining at least one function call link for calling the target function based on the call relation.
In an implementation, after obtaining the calling relation of each function and the modified target function, at least one function calling link for calling the target function may be determined according to the calling relation of each function. A plurality of functions can be included in one function call link, the function of the previous stage in the function call link can call the function of the next stage, and the target function is the function of the last stage of the function call link.
It should be noted that, in the embodiment of the present application, at least one function call link for calling the objective function may be all function call links for calling the objective function.
In the embodiment of the application, all trigger functions corresponding to the target function can be determined by calling all function call links corresponding to the target function, so that testers are prompted to test the target function through each trigger function, wherein the process of determining each function call link for calling the target function can be as follows, at least one function for directly and indirectly calling the target function is determined, and at least one function call link for calling the target function is determined based on the calling relation between the at least one function.
In implementation, at least one function that directly and indirectly invokes the target function may be determined by the calling relationship between the respective functions, respectively. Wherein a function that indirectly invokes a target function is a function that invokes the target function by invoking one or more other functions. And then, according to the calling relation of each function in at least one function, each function calling link for calling the target function can be determined in turn. In any function call link corresponding to the target function, the target function is the function of the last stage in the function call link, the penultimate function in the function call link is the function for directly calling the target function, the penultimate function in the function call link is the function for directly calling the penultimate function, and so on, and the first-stage function in the function call link is the trigger function for triggering the target function.
Optionally, the process of determining at least one function call link according to the call relation of each function in the at least one function may include sequentially determining a first-level function added to the header of the object function call link based on the call relation between each function in the at least one function and a recursive algorithm, determining whether the first-level function added to the header of the object function call link is an object class function each time, and if the first-level function added currently is an object class function, determining the currently determined object function call link as a function call link in the at least one function call link.
In practice, the functions and relationships between the functions may form a graph of function relationship calls, where each function is a vertex in the graph, and the relationships between functions may be considered as directed edges between vertices. In the embodiment of the application, a tree taking the target function as a root node can be generated according to the function relation call graph, and a plurality of corresponding function call links for calling the target function are expressed in the form of the tree. As shown in fig. 4, a first function directly calling the objective function may be obtained as a first child node of the root node, then a second function calling the first function may be obtained as a second child node of each first child node, and so on, a function call relationship tree with the objective function as the root node may be obtained. The specific generation of the function call relation tree can be realized through a recursive algorithm, which belongs to the prior art and is not repeated here. The number of the multiple function call links for calling the target function in the function call relation tree is the same as the number of the nodes without sub-nodes in the function call relation tree, each branch corresponding to the root node of the function call relation tree is a function call link, wherein the function corresponding to the node without sub-node is a trigger function, namely a first-stage function in the function call link, and the path from the node corresponding to each trigger function to the root node is each function call link corresponding to the target function.
Wherein, each time a child node newly added to the tree is determined by a recursive algorithm, it can be determined whether the function corresponding to the newly added child node is a target class function. If the corresponding function is the target class function, searching for the child node corresponding to the newly added child node can be stopped, and if the corresponding function is the target class function, searching for the child node corresponding to the newly added child node can be continued. In addition, the existing recursive algorithm can avoid the dead loop in the calling relation of the query function, and the specific algorithm process is the prior art and is not repeated here.
The objective class function may be an operation function and a page exposure function. Therefore, the first-stage function in the function call link for calling the target function is the operation function and the page exposure function, and a tester can perform corresponding operation or trigger a corresponding page according to the operation function and the page exposure function in the function call link, so that the execution of the target function is triggered.
Step 203, determining triggering subject information corresponding to the objective function based on the first-level function in the at least one function call link.
The first-level function is a function triggered by a user through an operation application program, and after the first-level function is triggered, the first-level function can call the target function according to the function calling relation, so that the execution of the target function is triggered. However, after the first-level function is obtained, it may not be clear how to operate the application program to trigger the first-level function, so in the embodiment of the application, trigger subject information of the first-level function, that is, trigger subject information corresponding to the trigger target function, may also be determined, so that the tester is prompted to trigger the target function according to the trigger subject information, and test the target function.
The triggering subject information comprises page information and page operation information. The page information is page information corresponding to a page displayable in the application program, and can be a page identifier or a page name, such as a login page, a song playing page and the like. The page operation information is an operation that a user can perform in a page displayed by the application program, for example, a name of a control that can trigger an objective function in a certain page, such as a play button, a record button, etc., or is operation information that is performed in a certain page, for example, a sliding operation, a clicking operation, etc. Thus, the tester can trigger the execution of the objective function only by opening the corresponding page or performing corresponding operation in the corresponding page.
Optionally, determining trigger subject information corresponding to the objective function based on a first-level function in at least one function call link comprises obtaining a corresponding relation between a function identifier and the trigger subject information, and determining the trigger subject information corresponding to the objective function in the corresponding relation based on the objective function identifier of the objective function.
The corresponding relation between the function identifier and the triggering subject information can be obtained in two ways.
The first mode is that when the application program is provided with a user operation behavior reporting function, namely, when a user clicks a key in the application program and slides and opens a page, the application program can send the operation behavior of the user to a corresponding service server, and the reporting function requires a technician to embed points in the corresponding function in advance. That is, reporting logic is added in the corresponding function, and when the corresponding function is triggered, a corresponding key (key) can be reported to the server, wherein the key is a character string in the corresponding function. The service server may record the correspondence between the key and the trigger body information, as shown in table two below.
Watch II
The service server is a background server corresponding to the application program, and when receiving the key sent by the terminal for installing the target application program, the service server can determine the current operation of the user according to the corresponding relationship recorded in the table two. The keys in the correspondence are written in the corresponding functions. The correspondence between the key and the trigger subject information is preset by a technician. Therefore, in the embodiment of the application, the corresponding relation between the key preset by the technician and the triggering subject information can be acquired, after the first-level function is determined, the key included in the first-level function can be acquired, and the triggering subject information corresponding to each first-level function can be determined according to the corresponding relation between the key set as shown in the table II and the triggering subject information.
In a second mode, a technician can perform AOP dynamic instrumentation in each operation function of the application program through an AOP (Aspect Oriented Programming, tangential programming oriented) technology, and record the operation behavior of a user on the application program, such as recording an operation log of the application program. The AOP dynamic instrumentation technique is different from the reporting function in the first mode, and cannot directly obtain recorded operation information from the function, and a tester is required to test the modified application program at a test terminal for installing the modified application program, so as to obtain operation information corresponding to each triggering main body recorded by the application program, and thus obtain a corresponding relation between each function identifier and triggering main body information. The function identifier may be a control identifier, a page identifier, etc. included in the function, so that after the first-level function is determined, trigger subject information corresponding to the target function may be determined according to the control, the page identifier, and the correspondence between the function identifier and the trigger subject information included in the first-level function.
It should be noted that an application program may include both a user operation behavior reporting function in the first mode and an AOP dynamic instrumentation function in the second mode. In the embodiment of the application, the trigger subject information corresponding to the objective function can be determined by adopting the method of the first mode, and if the trigger subject information corresponding to all the objective functions cannot be determined by adopting the method of the second mode, the trigger subject information corresponding to the rest of the objective functions can be determined by adopting the method of the second mode.
The embodiment of the application determines the calling relation among the functions in the target program and the modified target function in the target program, then determines at least one function calling link for calling the target function according to the calling relation, and the first-stage function in the at least one function calling link for calling the target function is the entry function for starting to trigger the target function, so that after determining the triggering subject information corresponding to the first-stage function of each function calling link, the triggering subject corresponding to the modified target function can be determined. According to the application, a tester does not need to analyze the modified program, so that the tester can directly obtain each trigger main body corresponding to the modified target function, and the target function can be triggered according to each trigger main body to test the target function.
Fig. 5 is a method for determining triggering subject information according to an embodiment of the present application, where the method may be implemented by a test management terminal and a management server together, and the corresponding processing is as follows:
step 501, the test management terminal sends a test notification for determining the target program to the management server.
The target program test notification comprises a program version number corresponding to the target program. As shown in fig. 6, fig. 6 is a test management interface. The test management terminal can access the test management interface through the Internet, and a tester can acquire a program identifier corresponding to the target program to be tested. For example, the program development software for modifying the target program is git, and the program version number corresponding to the target program may be the git version (version number) of the modified target program, which may be provided by a technician. The tester can input the corresponding git version to the corresponding position in the test management interface, and click on "start analysis". After the tester clicks "start analysis", the test management terminal may send the git version input by the tester to the management server.
Step 502, a management server receives a test notification of a target program sent by a test management terminal, determines the target program, determines a calling relation among functions in the target program and determines a modified target function in the target program, determines at least one function calling link for calling the target function based on the calling relation, and determines triggering subject information corresponding to the target function based on a first-stage function in the at least one function calling link.
After receiving the test notification of the target program sent by the test management terminal, the management server can further have the program version number corresponding to the target program in the test notification of the target program to determine the target program to be tested by the tester. The processing after determining the target program is the same as the processing in steps 201 to 203 described above, and will not be described here again.
Step 503, the management server sends trigger subject information corresponding to the objective function to the test management terminal.
And the management server obtains triggering subject information corresponding to the modified objective function in the objective program. And then the triggering subject information corresponding to the objective function can be sent to the test management terminal.
And 504, the test management terminal displays the trigger subject information corresponding to the objective function.
After the test management terminal receives the trigger main body information sent by the management server, the trigger main body information can be displayed so as to prompt a tester to test the modified application program.
In addition, the management server can also receive a function call link inquiry request sent by the test management terminal. Determining an objective function call link in at least one function call link based on the function identification of the objective function and the objective trigger subject information carried in the function call link query request; and sending the target function call link to the test management terminal so that the test management terminal displays the received target function call link. The function call link inquiry request carries function identification of the target function and target trigger subject information.
As shown in the test management interface of fig. 6, a tester may click on an objective function in the test management interface, and a first-level function in each function call link corresponding to the objective function and corresponding trigger body information may be displayed on one side of the test management interface. The tester can click the corresponding triggering subject information and check the function call link corresponding to the clicked triggering subject information. After the tester clicks the corresponding triggering subject information, the test management terminal can send a function call link query request to the management server.
After receiving the function call link query request sent by the test management terminal, the management server can determine an objective function call link in at least one function call link according to the function identifier of the objective function and the objective trigger main body information carried in the function call link query request, and the corresponding processing can be as follows:
In implementation, at least one function call link corresponding to the objective function is saved through a tree structure. And determining a triggering function corresponding to the target triggering subject information in the determined target function call link corresponding to the target triggering subject information, and determining a first node corresponding to the triggering function in a function call relation tree corresponding to the target function, wherein the first node has no child node. The trigger function is the first level function in the target function call link. After the first node is determined, the second level functions corresponding to the father node (second node) of the first node and the third level functions corresponding to the father node (third node) of the second node can be sequentially determined until the corresponding father node is determined to be the root node of the tree, so that the target function call link corresponding to the target trigger main body is obtained. And then the target function call link can be sent to the test management terminal to enable the test management terminal to display, so that the tester is prompted to test the modified application program.
According to the embodiment of the application, the calling relation among the functions in the target program and the modified target function in the target program are determined, then at least one function calling link for calling the target function is determined according to the calling relation, and the triggering subject information corresponding to the first-level function of each function calling link is determined. Therefore, the triggering main body corresponding to the modified objective function can be determined, a tester is not required to analyze the modified program, and the tester can be enabled to complete testing of the modified objective function.
Any combination of the above-mentioned optional solutions may be adopted to form an optional embodiment of the present disclosure, which is not described herein in detail.
Fig. 7 is a device for determining trigger body information according to an embodiment of the present application, where the device may be a server in the foregoing embodiment, and the device includes:
a first determining module 710, configured to determine a calling relationship between functions in a target program and determine a modified target function in the target program;
A second determining module 720, configured to determine at least one function call link for calling the objective function based on the call relationship;
And a third determining module 730, configured to determine trigger body information corresponding to the objective function based on the first-level function in the at least one function call link.
Optionally, the first determining module 710 is configured to:
determining the position of each function in the target program;
and determining the modified target function in the target program based on the positions of the functions in the target program and the recorded positions of the modified codes in the target program.
Optionally, the second determining module 720 is configured to:
determining at least one function that directly and indirectly invokes the objective function;
At least one function call link for calling the target function is determined based on the call relationship between the at least one function.
Optionally, the second determining module 720 is configured to:
And determining the first-level function added to the head of the target function call link in turn based on the call relation among the functions in at least one function and a recursion algorithm, determining whether the first-level function added to the head of the target function call link is a target class function or not each time, and if the first-level function added currently is the target class function, determining the currently determined target function call link as the function call link in the at least one function call link.
Optionally, the third determining module 730 is configured to:
Acquiring the corresponding relation between the function identifier and the triggering subject information;
and determining triggering subject information corresponding to the objective function in the corresponding relation based on the objective function identification of the objective function.
Optionally, the device further includes a transceiver module configured to:
Receiving a program version identifier sent by a test management terminal, and determining a target program based on the program version identifier;
the transceiver module is used for:
and sending trigger subject information corresponding to the objective function to the test management terminal so that the test management terminal displays the received trigger subject information.
Optionally, the transceiver module is further configured to:
receiving a function call link query request sent by a test management terminal, wherein the function call link query request carries a function identifier of a target function and target trigger subject information;
Determining an objective function call link in the at least one function call link based on the function identification of the objective function carried in the function call link query request and the objective trigger subject information;
And sending the target function call link to the test management terminal so that the test management terminal displays the received target function call link.
It should be noted that, when determining the trigger main information, the device for determining the trigger main information provided in the above embodiment only uses the division of the above functional modules to illustrate, in practical application, the above functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device for determining the trigger main information provided in the above embodiment belongs to the same concept as the method embodiment for determining the trigger main information, and the detailed implementation process of the device is referred to in the method embodiment, which is not described herein again.
Fig. 8 shows a block diagram of an electronic device 800 provided by an exemplary embodiment of the application. The electronic device 800 may be a portable mobile terminal such as a smart phone, tablet, MP3 player (moving picture experts group audio layer III, MPEG 3), MP4 (moving picture experts group audio layer IV, MPEG 4) player, notebook, or desktop. Electronic device 800 may also be referred to by other names of user devices, portable terminals, laptop terminals, desktop terminals, and the like.
In general, the electronic device 800 includes a processor 801 and a memory 802.
Processor 801 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 801 may be implemented in at least one hardware form of DSP (DIGITAL SIGNAL processing), FPGA (field-programmable gate array) GATE ARRAY, PLA (programmable logic array ). The processor 801 may also include a main processor, which is a processor for processing data in a wake-up state, also called a CPU (central processing unit ), and a coprocessor, which is a low-power processor for processing data in a standby state. In some embodiments, the processor 801 may integrate a GPU (graphics processing unit, image processor) for rendering and drawing of content required to be displayed by the display screen. In some embodiments, the processor 801 may also include an AI (ARTIFICIAL INTELLIGENCE ) processor for processing computing operations related to machine learning.
Memory 802 may include one or more computer-readable storage media, which may be non-transitory. Memory 802 may 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 in memory 802 is used to store at least one instruction for execution by processor 801 to implement the method of determining trigger body information provided by the method embodiments of the present application.
In some embodiments, the electronic device 800 may also optionally include a peripheral interface 803 and at least one peripheral. The processor 801, the memory 802, and the peripheral interface 803 may be connected by a bus or signal line. Individual peripheral devices may be connected to the peripheral device interface 803 by buses, signal lines, or a circuit board. Specifically, the peripheral devices include at least one of radio frequency circuitry 804, a display 805, a camera assembly 806, audio circuitry 807, a positioning assembly 808, and a power supply 809.
Peripheral interface 803 may be used to connect at least one input/output (I/O) related peripheral device to processor 801 and memory 802. In some embodiments, processor 801, memory 802, and peripheral interface 803 are integrated on the same chip or circuit board, and in some other embodiments, either or both of processor 801, memory 802, and peripheral interface 803 may be implemented on separate chips or circuit boards, which is not limited in this embodiment.
The radio frequency circuit 804 is used to receive and transmit RF (radio frequency) signals, also known as electromagnetic signals. The radio frequency circuit 804 communicates with a communication network and other communication devices via electromagnetic signals. The radio frequency circuit 804 converts an electrical signal into an electromagnetic signal for transmission, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuitry 804 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. The radio frequency circuitry 804 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, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (WIRELESS FIDELITY ) networks. In some embodiments, the radio frequency circuit 804 may further include NFC (NEAR FIELD communication) related circuits, which are not limited by the present application.
The display screen 805 is used to display a UI (user interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display 805 is a touch display, the display 805 also has the ability to collect touch signals at or above the surface of the display 805. The touch signal may be input as a control signal to the processor 801 for processing. At this time, the display 805 may also be used to provide virtual buttons and/or virtual keyboards, also referred to as soft buttons and/or soft keyboards. In some embodiments, the display 805 may be one, disposed on a front panel of the electronic device 800, in other embodiments, the display 805 may be at least two, disposed on different surfaces of the electronic device 800 or in a folded design, respectively, and in other embodiments, the display 805 may be a flexible display, disposed on a curved surface or a folded surface of the electronic device 800. Even more, the display 805 may be arranged in an irregular pattern other than rectangular, i.e., a shaped screen. The display 805 may be made of LCD (liquid CRYSTAL DISPLAY), OLED (organic light-emitting diode), or other materials.
The camera assembly 806 is used to capture images or video. Optionally, the camera assembly 806 includes a front camera and a rear camera. Typically, the front camera is disposed on the front panel of the terminal and the rear camera is disposed on the rear surface of the terminal. In some embodiments, the at least two rear cameras are any one of a main camera, a depth camera, a wide-angle camera, and a tele camera, so as to realize that the main camera and the depth 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 and VR (virtual reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 806 may also include a flash. The flash lamp can be a single-color temperature flash lamp or a double-color temperature flash lamp. The dual-color temperature flash lamp refers to a combination of a warm light flash lamp and a cold light flash lamp, and can be used for light compensation under different color temperatures.
Audio circuitry 807 may include a microphone and a speaker. The microphone is used for collecting sound waves of users and the environment, converting the sound waves into electric signals, inputting the electric signals to the processor 801 for processing, or inputting the electric signals to the radio frequency circuit 804 for voice communication. For purposes of stereo acquisition or noise reduction, the microphone may be multiple and separately disposed at different locations of the electronic device 800. The microphone may also be an array microphone or an omni-directional pickup microphone. The speaker is used to convert electrical signals from the processor 801 or the radio frequency circuit 804 into sound waves. The speaker may be a conventional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only the electric signal can be converted into a sound wave audible to humans, but also the electric signal can be converted into a sound wave inaudible to humans for ranging and other purposes. In some embodiments, audio circuit 807 may also include a headphone jack.
The location component 808 is utilized to locate the current geographic location of the electronic device 800 for navigation or LBS (location based service, location-based services). The positioning component 808 may be a positioning component based on the United states GPS (global positioning system ), the Beidou system of China, or the Galileo system of Russia.
The power supply 809 is used to power the various components in the electronic device 800. The power supply 809 may be an alternating current, direct current, disposable battery, or rechargeable battery. When the power supply 809 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, the electronic device 800 also includes one or more sensors 810. The one or more sensors 810 include, but are not limited to, an acceleration sensor 811, a gyroscope sensor 812, a pressure sensor 813, a fingerprint sensor 814, an optical sensor 815, and a proximity sensor 816.
The acceleration sensor 811 can detect the magnitudes of accelerations on three coordinate axes of the coordinate system established with the electronic device 800. For example, the acceleration sensor 811 may be used to detect components of gravitational acceleration in three coordinate axes. The processor 801 may control the display screen 805 to display a user interface in a landscape view or a portrait view based on the gravitational acceleration signal acquired by the acceleration sensor 811. Acceleration sensor 811 may also be used for the acquisition of motion data of a game or user.
The gyro sensor 812 may detect a body direction and a rotation angle of the electronic device 800, and the gyro sensor 812 may collect a 3D motion of the user on the electronic device 800 in cooperation with the acceleration sensor 811. The processor 801 can realize functions such as motion sensing (e.g., changing a UI according to a tilting operation of a user), image stabilization at photographing, game control, and inertial navigation, based on data acquired by the gyro sensor 812.
The pressure sensor 813 may be disposed at a side frame of the electronic device 800 and/or at an underlying layer of the display 805. When the pressure sensor 813 is disposed on a side frame of the electronic device 800, a grip signal of the electronic device 800 by a user may be detected, and the processor 801 performs left-right hand recognition or shortcut operation according to the grip signal collected by the pressure sensor 813. When the pressure sensor 813 is disposed at the lower layer of the display screen 805, the processor 801 controls the operability control on the UI interface according to the pressure operation of the user on the display screen 805. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
The fingerprint sensor 814 is used to collect a fingerprint of a user, and the processor 801 identifies the identity of the user based on the fingerprint collected by the fingerprint sensor 814, or the fingerprint sensor 814 identifies the identity of the user based on the collected fingerprint. Upon recognizing that the user's identity is a trusted identity, the processor 801 authorizes the user to perform relevant sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying for and changing settings, etc. The fingerprint sensor 814 may be disposed on the front, back, or side of the electronic device 800. When a physical key or vendor Logo is provided on the electronic device 800, the fingerprint sensor 814 may be integrated with the physical key or vendor Logo.
The optical sensor 815 is used to collect the ambient light intensity. In one embodiment, the processor 801 may control the display brightness of the display screen 805 based on the intensity of ambient light collected by the optical sensor 815. Specifically, the display luminance of the display screen 805 is turned up when the ambient light intensity is high, and the display luminance of the display screen 805 is turned down when the ambient light intensity is low. In another embodiment, the processor 801 may also dynamically adjust the shooting parameters of the camera module 806 based on the ambient light intensity collected by the optical sensor 815.
A proximity sensor 816, also referred to as a distance sensor, is typically provided on the front panel of the electronic device 800. The proximity sensor 816 is used to collect the distance between the user and the front of the electronic device 800. In one embodiment, the processor 801 controls the display 805 to switch from the on-screen state to the off-screen state when the proximity sensor 816 detects a gradual decrease in the distance between the user and the front of the electronic device 800, and the processor 801 controls the display 805 to switch from the off-screen state to the on-screen state when the proximity sensor 816 detects a gradual increase in the distance between the user and the front of the electronic device 800.
Those skilled in the art will appreciate that the structure shown in fig. 8 is not limiting and that more or fewer components than shown may be included or certain components may be combined or a different arrangement of components may be employed.
Fig. 9 is a schematic structural diagram of a server according to an embodiment of the present application, where the server 900 may have a relatively large difference due to different configurations or performances, and may include one or more processors (central processing units, cpu) 901 and one or more memories 902, where at least one instruction is stored in the memories 902, and the at least one instruction is loaded and executed by the processors 901 to implement the methods provided in the foregoing method embodiments. Of course, the server may also have a wired or wireless network interface, a keyboard, an input/output interface, and other components for implementing the functions of the device, which are not described herein.
In an exemplary embodiment, a computer readable storage medium, such as a memory comprising instructions executable by a processor in a terminal to perform the method of determining trigger body information in the above embodiment is also provided. The computer readable storage medium may be non-transitory. For example, the computer readable storage medium may be a ROM (read-only memory), RAM (random access memory ), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
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 for instructing relevant hardware, where the program may be stored in a computer readable storage medium, and the storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The foregoing description of the preferred embodiments of the application is not intended to limit the application to the precise form disclosed, and any such modifications, equivalents, and alternatives falling within the spirit and scope of the application are intended to be included within the scope of the application.