Electronic equipment control method and related equipment
By automatically selecting and using target components with excellent performance to replace the original functions when the application function performance is below the threshold, the problem of cumbersome application performance optimization process is solved and automation performance improvement is achieved.
Patent Information
- Application Number
- CN202510401274.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-07-08
AI Technical Summary
The performance optimization process of application functions is cumbersome, and users need to manually discover and free up computing resources to improve performance.
By monitoring the performance parameters of application functions, the target component is automatically determined when the parameters are below the threshold. The functions provided by this component are consistent with the application functions and performs excellent performance, and performs tasks instead of the original functions to improve performance.
It realizes the performance performance of application functions that automatically improves application functions without user operations, simplifies the performance optimization process, and improves user experience.
Smart Images

Figure CN120276953A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of data processing, and particularly relates to an electronic device control method and related devices. Background Art
[0002] With the increasing variety of application programs, more and more application programs are available for users to choose from and install on electronic devices.
[0003] When an application program runs on an electronic device, if the performance of a function in the application program is poor when performing a task, the user will operate the electronic device so that the electronic device allocates computing resources based on the operation to improve the performance of the function.
[0004] However, the poor performance in the application program needs to be discovered by the user himself / herself, and if the user wants to improve the performance of the function, the user needs to find a cleaning method that can allocate computing resources. The operation process of the user is relatively cumbersome, that is, the performance optimization process of the function in the application program is relatively cumbersome. Summary of the Invention
[0005] The purpose of the embodiments of this application is to provide an electronic device control method and related devices to solve the problem that the performance optimization process of functions in application programs is relatively cumbersome.
[0006] In a first aspect, the embodiments of this application provide an electronic device control method, including:
[0007] Obtain a first performance parameter of a first function of a first application program during operation;
[0008] When the first performance parameter is less than the performance threshold corresponding to the first function, determine the target component corresponding to the first function;
[0009] Control the target component to run to execute a target task, where the target task is used to indicate the task executed by the first application program when running the first function, and the second performance parameter of the target component during operation is greater than or equal to the performance threshold corresponding to the first function.
[0010] In a second aspect, the embodiments of this application provide an electronic device, including:
[0011] An obtaining module, configured to obtain a first performance parameter of a first function of a first application program during operation;
[0012] A determining module, configured to determine the target component corresponding to the first function when the first performance parameter is less than the performance threshold corresponding to the first function;
[0013] A control module, configured to control the operation of the target component to execute a target task, where the target task is used to indicate the task executed by the first application to run the first function, and the second performance parameter of the target component in the running state is greater than or equal to the performance threshold corresponding to the first function.
[0014] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory. The memory stores a program or instruction that can run on the processor, and when the program or instruction is executed by the processor, the steps of the method described in the first aspect are implemented.
[0015] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0016] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor, and the processor is configured to run a program or instruction to implement the method described in the first aspect.
[0017] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.
[0018] In the embodiment of the present application, when the performance parameter of the function of the application is less than the performance threshold, the target component corresponding to the function is determined, and the function provided by the target component is the same as the function in the application, and the performance parameter of the target component in the running state is greater than or equal to the performance threshold, so that the running target component can improve the performance of the function in the application, that is, the electronic device realizes the automatic improvement of the performance in the application without the user's operation, and simplifies the performance optimization process of the function in the application. Description of the Drawings
[0019] Figure 1 is a schematic diagram of a scenario of an electronic device control method shown according to an exemplary embodiment;
[0020] Figure 2 is a first flowchart of an electronic device control method shown according to an exemplary embodiment;
[0021] Figure 3 is a second flowchart of an electronic device control method shown according to an exemplary embodiment;
[0022] Figure 4It is the third flowchart diagram of a method for controlling an electronic device shown according to an exemplary embodiment;
[0023] Figure 5 It is a brief flowchart diagram of a method for controlling an electronic device shown according to an exemplary embodiment;
[0024] Figure 6 It is the fourth flowchart diagram of a method for controlling an electronic device shown according to an exemplary embodiment;
[0025] Figure 7 It is a schematic diagram of a virtual module of an electronic device shown according to an exemplary embodiment;
[0026] Figure 8 It is a structural block diagram of an electronic device shown according to an exemplary embodiment;
[0027] Figure 9 It is a schematic diagram of the hardware structure of an electronic device for implementing the embodiments of the present application. Detailed implementation manners
[0028] Next, the technical solutions in the embodiments of the present application will be clearly described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application belong to the scope protected by the present application.
[0029] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such data may be interchanged under appropriate circumstances so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. generally belong to the same category, and do not limit the number of objects. For example, the first object may be one or multiple. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / " generally indicates an "or" relationship between the associated objects before and after.
[0030] With the enrichment of the types of application programs, more and more application programs are available for users to select and install on electronic devices.
[0031] When an application program runs on an electronic device, if the performance of the function in the application program is poor when performing tasks, the user will operate the electronic device so that the electronic device allocates computing resources based on the operation to improve the performance of the function.
[0032] In the exemplary technology, the poor performance in the application needs to be discovered by the user himself / herself. And if the user wants to improve the performance of the function, the user needs to find a way to free up computing resources for cleaning. The operation process of the user is rather cumbersome, that is, the performance optimization process of the application is rather cumbersome.
[0033] Regarding the problem of the cumbersome process for improving the performance in the application, the inventor of the present application thought that when the performance parameter of the function in the application is less than the performance threshold, the target component corresponding to the function is determined, and the function provided by the target component is the same as the function in the application, and the performance parameter of the target component in the running state is greater than or equal to the performance threshold, so that the running target component can improve the performance of the function in the application. That is, the electronic device realizes the automatic improvement of the performance in the application without the user's operation, simplifies the performance optimization process of the function in the application, and improves the user experience.
[0034] Refer to Figure 1 , and the scenario schematic diagram of the electronic device control method provided by the present application will be described. As Figure 1 shown, the electronic device 100 stores multiple components, and each component is, for example, component 110, component 120, and component 130. When the application 140 in the electronic device 100 runs, the electronic device 100 monitors the performance parameter of the function in the application 140. If the performance parameter is lower than the performance threshold, the component corresponding to the function is determined as the target component. For example, if component 110 provides this function and the performance parameter of the function provided by component 110 in the running state is greater than or equal to the performance threshold, then component 110 is the target component, and the electronic device 100 controls component 110 to run to continue the task execution instead of the function in the application 140.
[0035] Next, in combination with the accompanying drawings including Figure 1 , the electronic device control method and related devices provided by the embodiments of the present application will be described in detail through specific embodiments and their application scenarios.
[0036] The electronic device control method provided by the embodiments of the present application can be applied to the running scenario of the application in any electronic device.
[0037] Next, in combination with Figure 1 , the electronic device control method provided by the embodiments of the present application will be described in detail.
[0038] Refer to Figure 2 , Figure 2 is one of the flow schematic diagrams of the electronic device control method on the account usage side provided by the present application. As Figure 2 shown, the electronic device control method includes the following steps:
[0039] Step S201: Obtain the first performance parameter of the first function of the first application during runtime.
[0040] In this embodiment, the executing entity is an electronic device, which can be any terminal device loaded with application programs, such as a mobile phone, a computer, a tablet, etc. For the sake of convenience in description, the device is hereinafter used to refer to the electronic device.
[0041] The application program running in the device is defined as the first application. The first application runs in the application layer of the device. The service in the framework layer of the device monitors the performance of the functions of the first application to obtain the performance parameter. The function of the first application is defined as the first function, and the performance parameter of the first function is defined as the first performance parameter. The first function is, for example, image calculation, image animation, rendering, etc., and the first performance parameter can be power consumption. For example, the first performance parameter is 9 mAh.
[0042] A corresponding performance threshold is set for the first function in the first application. For example, when the first function is image calculation, the performance threshold for image calculation is 10 mAh. After the device obtains the first performance parameter of the first function, it compares the first performance parameter with the performance threshold.
[0043] Step S202: When the first performance parameter of the first function is less than the performance threshold corresponding to the first function, determine the target component corresponding to the function.
[0044] The framework layer of the device is provided with a common capability library, which stores multiple components. Each component can provide a corresponding function, and the performance of the component during runtime is relatively excellent, that is, the performance parameter of the component during runtime is greater than the performance threshold corresponding to the function provided by the component.
[0045] When the first performance parameter is less than the preset performance parameter, it can be determined that the performance of the first function is poor, and the device needs to improve the efficiency of the first function to execute tasks. The task executed by the first function is defined as the target task. The device determines the target component corresponding to the first function. The target component is the component that provides the first function, and the second performance parameter of the target component under the running condition is greater than or equal to the performance threshold.
[0046] Step S203: Control the target component to run to execute the target task. The target task is used to indicate the task executed by the first application to run the first function, and the second performance parameter of the target component under the running condition is greater than or equal to the performance threshold corresponding to the first function.
[0047] After the device determines the target component, it controls the target component to run. Specifically, the common capability library provides an interface for the target component. The virtual machine in the device obtains the target component through the interface. The target component can be an encapsulated code segment. The virtual machine converts the code segment into a binary file that can be executed by the virtual machine and loads the binary file into the process executing the target task, thereby replacing the task originally executed by the first function in the application to improve the performance of the first function in the application. The target task is the task executed by the first application using the function.
[0048] In this embodiment, when the performance parameter of the function of the application is less than the performance threshold, the target component corresponding to the function is determined. The function provided by the target component is the same as the function in the application, and the performance parameter of the target component in the running state is greater than or equal to the performance threshold, so that the running target component can improve the performance of the function in the application. That is, the electronic device realizes automatic improvement of the performance in the application without user operation, simplifying the performance optimization process of the function in the application.
[0049] Refer to Figure 3 , Figure 3 is the second flowchart of the electronic device control method on the account usage side provided by this application. Based on Figure 2 the embodiment shown, step S202 includes:
[0050] Step S301, obtain the first target parameter corresponding to the first function. The first target parameter includes at least one of the action scenario, task processing type, and open source protocol of the first function.
[0051] In this embodiment, each component in the device is set with a component label, which is defined as the first component label. The first component label is, for example, the action scenario, task processing type, and open source protocol of the component. The action scenario is, for example, the power consumption scenario, smooth scenario; the task processing type is, for example, image calculation, image animation effect. The task processing type can be regarded as the function provided by the component; the open source protocol refers to the protocol that allows the application using the component. The first component label can exist in the form of a value. For example, the first component label is 123. The position where 1 is located represents that the assigned value of the action scenario is 1, and the action scenario with the assigned value of 1 is the power consumption scenario; the position where 2 is located represents the task processing type, and the task processing type with the assigned value of 2 is the image animation effect; the position where 3 is located represents the open source protocol, and the open source protocol with the assigned value of 3 represents that the component is allowed to be used by a type of application.
[0052] Each component in the device has a corresponding first component label. To accurately determine the target component corresponding to a function, the device obtains the first target parameter corresponding to the first function, where the first target parameter includes at least one of the action scenario of the function, the task processing type, and the open source protocol. The device matches the first target parameter with the first component labels of each component, that is, determines the matching degree between the first function and the function corresponding to the first component label based on the first target parameter and the first component label, and takes the first component label corresponding to the component with the maximum matching degree as the first component label matched by the first target parameter.
[0053] Exemplarily, in the first component label, the action scenario is the power consumption scenario, the open source protocol is Class C, and the task processing type is image calculation. And in the first target parameter, the action scenario is the power consumption scenario, the open source protocol in the first target parameter is Class C, and the task processing type in the first target parameter is also image calculation. Then the first component label is 100% matched with the first target parameter, and it is determined that the first component label matches the first target parameter.
[0054] Step S302, determine the first component label that matches the target parameter, and determine the component indicated by the matching component label as the target component.
[0055] After the device determines the first component label matched by the first target parameter, the component corresponding to the first component label is determined as the target component.
[0056] In this embodiment, the device accurately determines the target component that can provide the first function based on the first target parameter of the first function.
[0057] Refer to Figure 4 , Figure 4 is the third schematic flowchart of the electronic device control method on the account usage client side provided by this application. Based on Figure 2 or Figure 3 the embodiments shown, before step S201, it further includes:
[0058] Step S401, obtain the second performance parameter during the operation of the second function of the second application, where the type of the first function is the same as that of the second function.
[0059] In this embodiment, the components in the device can be obtained from other applications, and other applications are defined as the second application.
[0060] The device obtains the performance parameter of the second function of the second application during operation, which is defined as the second performance parameter, and the types of the second function and the first function are the same. For example, both the first function and the second function are functions for image calculation. In one example, when the second application is installed or updated on the device, the device monitors the performance parameter of the second function in the second application during operation. In another example, the performance parameter of the second function in the second application during operation is stored in a database, and the terminal device where the second application is located has the same model as the device, so that the second performance parameter adopted by the device can be guaranteed to have reference value.
[0061] Furthermore, the developer of the application can provide annotation marks in the code segment of the code file, and the annotation marks are defined as the standard interface of the code file. The annotation marks are, for example, the usage scenario, task processing type, and open source type provided by the code segment. The device obtains the first code file corresponding to the second application. If the first code file contains the standard interface definition field of the second function, it can be determined that the developer of the second application allows the second function corresponding to the code segment to be used as a common function. Therefore, the device obtains the second performance parameter of the second function in the second application during operation, so as to determine whether the function corresponding to the code segment can be encapsulated as a component and used as a common function through the second performance parameter.
[0062] Step S402: When the second performance parameter is greater than or equal to the performance threshold corresponding to the second function, determine the first code segment of the second function in the first code file, where the first code file is used to indicate the code file of the second application.
[0063] When the second performance parameter is greater than or equal to the performance threshold corresponding to the second function, the performance of the second function in the second application is excellent, and the function A in the second application can be provided to other applications with poor performance of function A.
[0064] For this reason, the device obtains the code file in the second application, which is defined as the first code file. The code file can be obtained from the installation package of the second application, and the installation package can be downloaded from the platform where the second application is located.
[0065] The device determines the code segment of the function in the first code file, and this code segment is defined as the first code segment. Exemplarily, each code segment in the first code file is marked with the corresponding function, and the device can then determine the first code segment corresponding to the code from the first code file. For example, if the function is function a, the code segment A in the first code file is marked with function b, and the code segment B in the first code file is marked with function a, then the code segment B is the first code segment of function a in the first code file.
[0066] Step S403: Copy the first code segment and encapsulate the copied first code segment into a target component.
[0067] The device copies the first code segment from the first code file and then encapsulates the copied first code segment into a target component.
[0068] In one example, the device directly copies the first code segment.
[0069] In another example, the second application can handle the services assigned by the development team corresponding to the second application. That is, the first code file contains service codes, and the functions provided by the component are for other applications, and the other applications cannot handle the services that the second application needs to handle. Therefore, the device only extracts the code segment corresponding to the basic function. In this regard, the device determines the code segment of the function in the first code file, and this code segment is defined as the first initial code segment; the device determines the service code of the second application in the first initial code segment, and this service code is defined as the first service code, and the device determines the code other than the first service code in the first initial code as the first code segment.
[0070] Step S404: Store the target component.
[0071] The device copies the first code segment from the first code file and then encapsulates the copied first code segment into a target component. After encapsulating it into a target component, the device stores the target component.
[0072] In one example, the device associates and stores the target component with the second function in a common capability library.
[0073] In another example, the device determines the second target parameter corresponding to the second function, and the second target parameter includes at least one of the application scenario, task processing type, and open source protocol of the second function. The device then sets the first component label based on the second target parameter, so as to associate and store the first component label with the target component.
[0074] Refer to Figure 5 , the device includes an application layer and a framework layer. The listening service in the framework layer annotates the application scenario, task processing type, and open source protocol of the functions in APP1 (equivalent to the second application) in the application layer. That is Figure 5 the process 1 in Figure 5Process 2 in; if the performance of the function is excellent, the code segment of the function in APP1 is copied, and the copied code segment is encapsulated as a component and stored in the common capability library in the framework layer, that is, component 1 in the common capability library; the monitoring service monitors the performance of the function in APP2 (equivalent to the first application program) in the application layer, that is, the monitoring service executes Figure 5 Process 4 in; if the performance of the function in APP2 is poor, the virtual machine in the framework layer extracts component 1 from the common capability library; the virtual machine then controls the operation of component 1, that is, replaces the code segment corresponding to the function in APP2 with the code segment of component 1, corresponding to Figure 5 Process 6 in.
[0075] It should be noted that when there are functions of the same type in multiple second application programs, the code segment corresponding to the function with the best performance parameter is encapsulated as the target component.
[0076] In this embodiment, the device extracts the code segment of the function with excellent performance through the second application program, thereby encapsulating the code segment as a component for storage, and further can provide high-performance functions for other application programs with poor performance.
[0077] Refer to Figure 6 , Figure 6 is the fourth flowchart of the electronic device control method on the account usage side provided by the present application. Based on Figures 2 to 4 any of the embodiments shown in, after step S201, it further includes:
[0078] Step S601, in the case where the first performance parameter is greater than or equal to the performance threshold corresponding to the first function, determine the second code segment of the function in the second code file, where the second code file is used to indicate the code file corresponding to the first application program.
[0079] In this embodiment, when the first performance parameter is greater than or equal to the performance threshold corresponding to the first function, it can be determined that the performance of the function in the first application program is excellent, and the device can use this function as a common function. For this, the device determines the second code segment of the function in the second code file, where the second code file refers to the code file of the first application program.
[0080] In one example, the developer of the application can provide annotation tags in the code segments of the code file, and the annotation tags serve as the standard interface definition of the code file. The annotation tags are, for example, the usage scenarios provided by the code segments, the task processing types, and the open source types, etc. The device obtains the second code file corresponding to the first application. If the second code file contains the standard interface definition field of the function, it can be determined that the developer of the first application allows the function corresponding to the code segment to be a common function. Therefore, the device determines the second code segment of the function in the second code file to encapsulate the second code segment as a component as a common function.
[0081] In another example, the device obtains the second performance parameter of the target component during operation. If the first performance parameter is higher than the second performance parameter, it can be determined that the performance of the first function in the first application is more excellent than the performance of the function provided by the target component. Therefore, the device determines the second code segment of the first function in the second code file to facilitate subsequent encapsulation and storage of the second code segment.
[0082] Step S602, copy the second code segment and encapsulate the copied second code segment as a component.
[0083] The device copies the second code segment from the second code file and then encapsulates the copied second code segment as the target component.
[0084] In one example, the device directly copies the second code segment.
[0085] In another example, the first application can handle the business assigned by the development team corresponding to the first application, that is, the second code file contains business code, and the function provided by the component is used by other applications, and other applications cannot handle the business that the first application needs to handle. Therefore, the device only extracts the code segment corresponding to the basic function. In this regard, the device determines the code segment of the function in the second code file, and this code segment is defined as the second initial code segment; the device determines the business code of the first application in the second initial code segment, and this business code is defined as the second business code, and the device determines the code in the second initial code except the second business code as the second code segment.
[0086] Step S603, store the component corresponding to the copied second code segment.
[0087] The device copies the second code segment from the second code file and then encapsulates the copied second code segment as a component. After encapsulating it into a component, the device stores the component.
[0088] In one example, the device stores the component associated with the first function in the common capability library.
[0089] In another example, the device determines a first target parameter corresponding to a first function, where the first target parameter includes at least one of a function's action scenario, task processing type, and open source protocol. The device then sets a second component label based on the first target parameter, and thus stores the second component label in association with the component.
[0090] In still another example, since there is a target component for a function in the device, based on the first function, the device replaces the target component with a component corresponding to a copied second code segment, that is, deletes the target component and stores the first function in association with the component corresponding to the copied second code segment.
[0091] In this embodiment, when the performance of the first function in the first application is excellent, the code segment corresponding to the first function is encapsulated as a component, so that other applications can use this component to improve the performance of the functions in other applications.
[0092] In one embodiment, a performance optimization model is set in the device. Through the performance optimization model, the code segment corresponding to a function can be learned, that is, the code files in each application containing the first function are learned, so as to learn the target code segment of the first function with more excellent performance. That is, the target code segment provides the first function, and the performance parameter of the first function provided by the target code segment is higher than the performance threshold corresponding to the first function. The device constructs a target component based on the target code segment, and thus stores the target component in association with the first function, that is, stores the target component associated with the first function in a common capability library. The target component can also be set with a first component label determined by the first target parameter of the first function. The performance optimization model can be obtained by training a deep learning model.
[0093] In this embodiment, through the performance optimization model, the target component of the first function can be quickly constructed, so as to use the target component to improve the performance of the first function in the application, that is, use the performance optimization model to construct a common capability code library.
[0094] Based on the same inventive concept, the present application further provides an electronic device. The following combines Figure 7 to describe in detail the electronic device provided in the embodiments of the present application.
[0095] Figure 7 is a structural block diagram of an electronic device shown according to an exemplary embodiment.
[0096] As Figure 7 shown, the electronic device 700 may include:
[0097] An acquisition module 710, configured to acquire a first performance parameter of a first function of a first application during operation;
[0098] A determination module 720, configured to determine a target component corresponding to a first function when a first performance parameter is less than a performance threshold corresponding to the first function;
[0099] A control module 730, configured to control the target component to operate to execute a target task, where the target task is used to indicate a task performed by a first application when running the first function, and a second performance parameter of the target component when operating is greater than or equal to the performance threshold corresponding to the first function.
[0100] In one embodiment, the electronic device 700 is specifically configured to:
[0101] Obtain a first target parameter corresponding to the first function, where the first target parameter includes at least one of a usage scenario of the first function, a task processing type, and an open source protocol;
[0102] Determine a component label that matches the target parameter, and determine the component indicated by the matching component label as the target component.
[0103] In one embodiment, the electronic device 700 is specifically configured to:
[0104] Obtain a second performance parameter of a second function of a second application when running, where the first function and the second function are of the same type;
[0105] When the second performance parameter is greater than or equal to a performance threshold corresponding to the second function, determine a first code segment of the second function in a first code file, where the first code file is used to indicate the code file of the second application;
[0106] Copy the first code segment, and encapsulate the copied first code segment as the target component;
[0107] Store the target component.
[0108] In one embodiment, the electronic device 700 is specifically configured to:
[0109] Determine an initial code segment of the second function in the first code file;
[0110] Determine the business code of the second application in the initial code segment, and determine the code other than the business code in the initial code segment as the first code segment.
[0111] In one embodiment, the electronic device 700 is specifically configured to:
[0112] Determine a second target parameter corresponding to the second function, and set a component label according to the second target parameter, where the second target parameter includes at least one of a usage scenario of the function, a task processing type, and an open source protocol;
[0113] Associate and store the component label with the target component.
[0114] In one embodiment, the electronic device 700 is specifically configured to:
[0115] Obtain a first code file corresponding to a second application;
[0116] When the first code file contains a standard interface definition field of a first function, obtain a first performance parameter of the first function of the first application during runtime.
[0117] In one embodiment, the electronic device 700 is specifically configured to:
[0118] When the first performance parameter is greater than or equal to a performance threshold corresponding to the first function, determine a second code segment of the first function in a second code file, where the second code file is used to indicate the code file corresponding to the first application;
[0119] Copy the second code segment and encapsulate the copied second code segment as a component;
[0120] Store the component corresponding to the copied second code segment.
[0121] In one embodiment, the electronic device 700 is specifically configured to:
[0122] Learn a code segment corresponding to the first function through a performance optimization model to obtain a target code segment, where the target code segment provides the first function;
[0123] Construct a target component according to the target code segment and associate and store the target component with the first function.
[0124] The electronic device in the embodiments of the present application can be a terminal or other devices other than terminals. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a handheld computer, a vehicle-mounted electronic device, a Mobile Internet Device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. It can also be a server, a Network Attached Storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc. The embodiments of the present application do not make specific limitations.
[0125] The electronic device in the embodiments of the present application can be a device with an operating system. The operating system can be an Android operating system, an iOS operating system, or other possible operating systems. The embodiments of the present application do not make specific limitations.
[0126] The electronic device provided by the embodiments of the present application can implement Figures 2 - 6 each process implemented by the method embodiments in , achieving the same technical effects. To avoid repetition, details are not described here again.
[0127] In some embodiments, as Figure 8 shown, the embodiments of the present application further provide an electronic device 800, including a processor 801 and a memory 802. A program or instruction that can run on the processor 801 is stored on the memory 802. When the program or instruction is executed by the processor 801, it implements each step of the above-mentioned method embodiments for controlling the electronic device, and can achieve the same technical effects. To avoid repetition, details are not described here again.
[0128] It should be noted that the electronic device in the embodiments of the present application includes the above-mentioned mobile electronic devices and non-mobile electronic devices.
[0129] Figure 9 It is a schematic diagram of the hardware structure of an electronic device for implementing the embodiments of the present application.
[0130] The electronic device 900 includes, but is not limited to, components such as a radio frequency unit 901, a network module 902, an audio output unit 903, an input unit 904, a sensor 905, a display unit 906, a target user input unit 907, an interface unit 908, a memory 909, and a processor 910.
[0131] Those skilled in the art can understand that the electronic device 900 may further include a power source (such as a battery) for supplying power to each component. The power source can be logically connected to the processor 910 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system. Figure 9 The structure of the electronic device shown does not limit the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here. Among them, the processor 910 is used to implement the steps in any of the above embodiments.
[0132] It should be understood that in the embodiments of the present application, the input unit 1104 may include a graphics processing unit (GPU) 11041 and a microphone 11042. The graphics processing unit 11041 processes the image data of static pictures or videos obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 906 may include a display panel 9061, and the display panel 9061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The target user input unit 907 includes at least one of a touch panel 9071 and other input devices 9072. The touch panel 9071 is also called a touch screen. The touch panel 9071 may include two parts: a touch detection device and a touch controller. The other input devices 9072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be elaborated here.
[0133] The memory 909 can be used to store software programs and various data. The memory 909 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data. Among them, the first storage area may store an operating system, application programs or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 909 may include a volatile memory or a non-volatile memory, or the memory 909 may include both a volatile memory and a non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDR SDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synch link dynamic random access memory (SLDRAM), and a direct rambus random access memory (DRRAM). The memory 808 in the embodiments of the present application includes but is not limited to these and any other suitable types of memories.
[0134] The processor 910 may include one or more processing units; in some embodiments, the processor 910 integrates an application processor and a modem processor. Among them, the application processor mainly processes operations related to the operating system, the target user interface, and application programs, etc., and the modem processor mainly processes wireless communication signals, such as a baseband processor. It can be understood that the above-mentioned modem processor may not be integrated into the processor 910 either.
[0135] The embodiments of the present application also provide a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, it implements each process of the above-mentioned embodiment of the electronic device control method and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0136] Among them, the processor is the processor in the electronic device in the above-mentioned embodiment. The readable storage medium includes computer-readable storage media, such as computer read-only memory, random access memory, magnetic disk, or optical disc, etc.
[0137] Another embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement each process of the above-mentioned embodiment of the electronic device control method, and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0138] It should be understood that the chip mentioned in the embodiment of the present application may also be referred to as a system-on-chip, system chip, chip system, or system-on-chip, etc.
[0139] The embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement each process of the above-mentioned embodiment of the electronic device control method, and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0140] It should be noted that in this article, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of another identical element in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in a reverse order according to the functions involved. For example, the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0141] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc), and includes several instructions for causing a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of the present application.
[0142] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Those of ordinary skill in the art, under the inspiration of the present application and without departing from the spirit of the present application and the scope protected by the claims, can also make many forms, all of which fall within the protection scope of the present application.
Claims
1. A method for controlling an electronic device, characterized in that Including: Obtain the first performance parameter of the first function of the first application during runtime; When the first performance parameter is less than the performance threshold corresponding to the first function, determine the target component corresponding to the first function; Control the target component to run to execute a target task, where the target task is used to indicate the task executed by the first application when running the first function, and the second performance parameter of the target component during runtime is greater than or equal to the performance threshold corresponding to the first function.
2. The method according to claim 1, characterized in that, The determining the target component corresponding to the first function includes: Obtain the first target parameter corresponding to the first function, where the first target parameter includes at least one of the application scenario, task processing type, and open source protocol of the first function; Determine the component label that matches the target parameter, and determine the component indicated by the matching component label as the target component.
3. The method according to claim 1, wherein Before obtaining the first performance parameter of the first function of the first application during runtime, it further includes: Obtain the second performance parameter of the second function of the second application during runtime, where the type of the first function is the same as that of the second function; When the second performance parameter is greater than or equal to the performance threshold corresponding to the second function, determine the first code segment of the second function in the first code file, where the first code file is used to indicate the code file of the second application; Copy the first code segment and encapsulate the copied first code segment as a target component; Store the target component.
4. The method according to claim 3, characterized in that, The determining the first code segment of the second function in the first code file includes: Determine the initial code segment of the second function in the first code file; Determine the business code of the second application in the initial code segment, and determine the code other than the business code in the initial code segment as the first code segment.
5. The method according to claim 3, wherein The storing the target component includes: Determine the second target parameter corresponding to the second function, and set a component label according to the second target parameter, where the second target parameter includes at least one of the application scenario, task processing type, and open source protocol of the function; Associate and store the component label with the target component.
6. The method according to claim 3, characterized in that, The obtaining the first performance parameter of the first function of the first application during runtime includes: Obtain the first code file corresponding to the first application; When the first code file includes the standard interface definition field of the first function, obtain the first performance parameter of the first function of the first application during runtime.
7. The method according to claim 1, characterized in that After obtaining the first performance parameter of the first function of the first application during runtime, it further includes: When the first performance parameter is greater than or equal to the performance threshold corresponding to the first function, determine the second code segment of the first function in the second code file, where the second code file is used to indicate the code file corresponding to the first application; Copy the second code segment and encapsulate the copied second code segment as a component; Store the component corresponding to the copied second code segment.
8. The method according to claim 1, wherein Before obtaining the first performance parameter of the first function of the first application during runtime, it further includes: Learning the code segment corresponding to the first function through a performance optimization model to obtain a target code segment, where the target code segment provides the first function; Constructing a target component according to the target code segment and associatively storing the target component with the first function.
9. An electronic device, characterized in that, It includes: An acquisition module, configured to acquire the first performance parameter of the first function of the first application during runtime; A determination module, configured to determine the target component corresponding to the first function when the first performance parameter is less than the performance threshold corresponding to the first function; A control module, configured to control the operation of the target component to execute a target task, where the target task is used to indicate the task executed by the first application when running the first function, and the second performance parameter of the target component during operation is greater than or equal to the performance threshold corresponding to the first function.
10. An electronic device, characterized in that, It includes a processor and a memory, where the memory stores a program or instruction that can run on the processor, and when the program or instruction is executed by the processor, it implements the steps of the electronic device control method according to any one of claims 1-8.
11. A readable storage medium, characterized in that, The program or instruction is stored on the readable storage medium, and when the program or instruction is executed by the processor, it implements the steps of the electronic device control method according to any one of claims 1-8.
12. A computer program product, characterized in that, The program product is stored in the storage medium, and the program product is executed by at least one processor to implement the steps of the electronic device control method according to any one of claims 1-8.