Nothing Special   »   [go: up one dir, main page]

CN110109759B - Catton optimization method, server, electronic device and computer-readable storage medium - Google Patents

Catton optimization method, server, electronic device and computer-readable storage medium Download PDF

Info

Publication number
CN110109759B
CN110109759B CN201910376335.6A CN201910376335A CN110109759B CN 110109759 B CN110109759 B CN 110109759B CN 201910376335 A CN201910376335 A CN 201910376335A CN 110109759 B CN110109759 B CN 110109759B
Authority
CN
China
Prior art keywords
target
stuck
data
behavior
optimization strategy
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910376335.6A
Other languages
Chinese (zh)
Other versions
CN110109759A (en
Inventor
郑健平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201910376335.6A priority Critical patent/CN110109759B/en
Publication of CN110109759A publication Critical patent/CN110109759A/en
Application granted granted Critical
Publication of CN110109759B publication Critical patent/CN110109759B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本发明实施例公开了一种卡顿优化方法,应用于通信技术领域,该方法包括:获取发生线程卡顿的卡顿数据,并将其中的第一卡顿时长符合预设条件的函数调用行为确定为目标行为,将目标行为的函数调用行为数据以及优化策略发送给目标电子装置,当线程执行目标行为发生卡顿时,获取目标电子装置执行优化策略时的第二卡顿时长,若在大于预设数量的目标电子装置中,存在同一个目标行为对应的第二卡顿时长小于第一卡顿时长达到预设数值,则根据优化策略生成目标行为对应的优化配置数据,并将优化配置数据发送给所有电子装置。本发明实施例还公开了一种服务器、一种电子装置和一种计算机可读存储介质,可降低卡顿,提高解决卡顿问题的适用性。

Figure 201910376335

The embodiment of the present invention discloses a stuck optimization method, which is applied to the field of communication technology. The method includes: acquiring the stuck data in which thread stuck occurs, and assigning a function calling behavior in which the first stuck duration meets a preset condition. Determine it as the target behavior, send the function call behavior data of the target behavior and the optimization strategy to the target electronic device, and when the thread execution of the target behavior is stuck, obtain the second freeze duration when the target electronic device executes the optimization strategy. In the set number of target electronic devices, if there is a second freeze duration corresponding to the same target behavior, the second freeze duration is smaller than the first freeze duration and reaches the preset value, then the optimized configuration data corresponding to the target behavior is generated according to the optimization strategy, and the optimized configuration data is sent. for all electronic devices. The embodiment of the present invention also discloses a server, an electronic device and a computer-readable storage medium, which can reduce the stuck and improve the applicability of solving the stuck problem.

Figure 201910376335

Description

Catton optimization method, server, electronic device and computer-readable storage medium
Technical Field
The invention belongs to the technical field of electronic devices, and particularly relates to a Cartton optimization method, a server, an electronic device and a computer-readable storage medium.
Background
The development of internet technology and electronic technology promotes the popularization of mobile terminals such as smart phones, tablet computers and the like in the life of people. In order to implement various functions of a mobile terminal, various application programs need to be installed in the mobile terminal. Due to compatibility problems among software, software and hardware and allocation problems of system resources, the phenomenon of pause is frequent. In order to avoid the jamming, the prior art approach is to periodically and automatically clear the memory space, or periodically accelerate the hardware to reduce the jamming condition. However, this processing method can only perform the optimization operation at a specific time point, and cannot adapt to different changes of the operating environments of different mobile terminals, which lacks flexibility and universality.
Disclosure of Invention
The invention provides a card pause optimization method, a server, an electronic device and a computer readable storage medium, and aims to solve the problem that the card pause is reduced in lack of flexibility and universality.
The first aspect of the embodiments of the present invention provides a morton optimization method, including:
acquiring pause data in a plurality of electronic devices in which thread pause occurs, wherein the pause data comprises function calling behavior data of the thread in which the thread pause occurs and a first pause time length, and determining the function calling behavior of which the first pause time length meets a preset condition as a target behavior;
randomly selecting a plurality of target electronic devices from the plurality of electronic devices, and sending function call behavior data and an optimization strategy of the target behavior to the target electronic devices;
when the thread executes the target behavior and is stuck, acquiring a second stuck time length when the target electronic device executes the optimization strategy;
if the second pause-time length corresponding to the same target behavior is smaller than the first pause-time length and reaches a preset value in the target electronic devices with the number larger than the preset number, generating optimized configuration data corresponding to the target behavior according to the optimization strategy, and sending the optimized configuration data to all the electronic devices.
A second aspect of the embodiments of the present invention provides a morton optimization method, including:
when the thread is detected to generate pause, acquiring pause data and sending the pause data to a server, wherein the pause data comprises function call behavior data of the thread generating pause and a first pause duration;
receiving function call behavior data of a target behavior and an optimization strategy sent by the server, and executing the optimization strategy according to the function call behavior data of the target behavior so as to accelerate target hardware;
and acquiring a second Kanton time length when the optimization strategy is executed and sending the second Kanton time length to the server.
A third aspect of an embodiment of the present invention provides a server, including:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring pause data in a plurality of electronic devices in which thread pause occurs, and the pause data comprises function calling behavior data of the thread in which the thread pause occurs and a first pause time length;
the determining module is used for determining the function call behavior of which the first pause time length meets the preset condition as a target behavior;
a selecting module for randomly selecting a plurality of target electronic devices from the plurality of electronic devices;
a sending module, configured to send the function call behavior data of the target behavior and the optimization policy to the target electronic device;
the obtaining module is further configured to obtain a second stuck time length when the target electronic device executes the optimization policy when the thread executes the target behavior and the stuck time occurs;
and the optimization configuration module is used for generating optimization configuration data corresponding to the target behavior according to the optimization strategy and sending the optimization configuration data to all the electronic devices if the second pause-time length corresponding to the same target behavior is smaller than the first pause-time length and reaches a preset value in the target electronic devices with the number larger than the preset number.
A fourth aspect of an embodiment of the present invention provides an electronic apparatus, including:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring stuck data when a thread is detected to be stuck, and the stuck data comprises function calling behavior data of the thread which is stuck and a first stuck time length;
the sending module is used for sending the stuck data to a server;
the receiving module is used for receiving the function call behavior data of the target behavior and the optimization strategy, which are sent by the server;
the execution module is used for executing the optimization strategy according to the function call behavior data of the target behavior so as to accelerate the target hardware;
the obtaining module is further configured to obtain a second pause duration when the optimization strategy is executed;
the sending module is further configured to send the second card pause time duration to the server.
A fifth aspect of an embodiment of the present invention provides an electronic apparatus, including:
a memory and a processor;
the memory stores executable program code;
the processor coupled to the memory calls the executable program code stored in the memory to perform the katton optimization method provided by the second aspect of the embodiment of the present invention.
A sixth aspect of embodiments of the present invention provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, performs the katton optimization method provided by the first aspect of embodiments of the present invention or the katton optimization method provided by the second aspect of embodiments of the present invention.
It can be known from the foregoing embodiments of the present invention that, by obtaining function call behavior data and a first stuck time length of a thread in an electronic device, where the function call behavior conforming to a preset condition is determined as a target behavior to be tested, sending the function call behavior data and an optimization policy corresponding to the target behavior to a target electronic device in the electronic device for optimization testing, after the thread executes the target behavior and correspondingly executes the optimization policy to generate the stuck, obtaining a second stuck time length, and if the second stuck time length corresponding to the same target behavior is far shorter than the second stuck time length in target electronic devices larger than a preset number, determining that the optimization policy is valid, obtaining optimization configuration data according to the optimization policy and sending the optimization configuration data to all electronic devices for promotion and optimization, the target behavior in which the stuck occurs can be identified more intelligently and quickly according to the function call behavior data, the accuracy of confirming the stuck state can be improved, and the applicability of optimizing the stuck state is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention.
Fig. 1 is a schematic view of an application scenario of a stuck optimization method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an implementation flow of a stuck optimization method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an implementation flow of a stuck optimization method according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a server according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of an electronic device according to an embodiment of the invention;
fig. 6 shows a hardware configuration diagram of an electronic apparatus.
Detailed Description
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a schematic view of an application scenario of the stuck optimization method according to the embodiment of the present invention. The cloud server 100 is connected to a plurality of electronic devices 200 through a network, and the electronic devices 200 include electronic data processing devices that can be used in mobile, such as smart phones, tablet computers, and notebook computers. The electronic device 200 runs a UI (user interface) main thread, and the thread jamming in this embodiment means that the UI main thread is jammed during running, and the jamming may cause a frame drop, and the time length of the jamming is equal to the time length of the frame drop. The electronic device 200 is provided with a detection thread, and configured to send mortgage data to the server 100 when detecting that the UI main thread is stuck and dropped, where the mortgage data includes function call behavior data of the thread that is stuck, a first mortgage time length, and identification information of an application corresponding to the UI main thread that is stuck, where the function call behavior data is stack data, that is, function call behavior occurring when the UI main thread is stuck is reported to the server 100, and the function call behavior at this time is a cause of the UI main thread being stuck. The server 100 analyzes the stuck data, and if the first stuck time length of the same function call behavior exceeds a first preset time length and the number of times exceeding the first preset time length is greater than a preset number, the function call behavior is determined to be a target behavior, that is, the function call behavior causes stuck, and the stuck data corresponding to the function call behavior is added to the test sample. The method comprises the steps of randomly selecting a plurality of target electronic devices from a plurality of electronic devices 200 for uploading stuck data to carry out optimization testing, and sending function call behavior data of target behaviors and an optimization strategy to each target electronic device, wherein the function call behavior data of the target behaviors are used for the target electronic devices to identify the function call behavior of the stuck data (namely, identify the target behaviors), and then the target electronic devices execute the optimization strategy when the stuck data occurs again. The target electronic device sends a second card pause time length when the card pause occurs again to the server 100, the second card pause time length is the card pause time length after the optimization strategy is executed, if the second card pause time length corresponding to the same target behavior is smaller than the first card pause time length and reaches a preset value, namely, the second card pause time length is smaller than the first card pause time length, the difference between the second card pause time length and the first card pause time length is larger than or equal to the preset value, and the second card pause time lengths in the target electronic devices larger than the preset number meet the conditions, it indicates that the card pause time length is obviously shortened due to the execution of the optimization strategy, so the optimization strategy is very effective, the card pause problem can be solved well, and therefore, the optimization configuration data corresponding to the optimization strategy is sent to all electronic devices connected to the current network for popularization and application, wherein the optimization configuration data comprises identification information of the application, Function call behavior data corresponding to the target behavior, a katton time length for triggering CPU acceleration, and a CPU acceleration time length.
Referring to fig. 2, fig. 2 is a schematic view of an implementation flow of the morton optimization method provided by the embodiment of the present invention, and the method can be applied to a server in a cloud. The method comprises the following steps:
201. acquiring pause data in a plurality of electronic devices in which thread pause occurs, wherein the pause data comprises function calling behavior data of the thread in which the thread pause occurs and a first pause time length, and determining the function calling behavior of which the first pause time length meets a preset condition as a target behavior;
the electronic device is provided with a detection thread for detecting the occurrence of thread jamming of the electronic device and acquiring jamming data when the thread jamming occurs, wherein the jamming data comprises function call behavior data of the thread which occurs jamming and a first jamming time length. Specifically, the probe thread is a stack probe thread, the function call behavior data is stack data, and the stack data records function call behaviors, that is, a function name, a function call order, and the like.
Further, the morton data also includes identification information of the application which is subjected to the morton, and the identification information is used for uniquely identifying the application.
The electronic device which generates the thread jamming sends the jamming data to the server, the server obtains the jamming data in the electronic devices which generate the thread jamming, and determines the function calling behavior of which the first jamming duration meets the preset condition as the target behavior, wherein the preset condition is that the first jamming duration exceeds a first preset duration, and the times of exceeding the first preset duration are greater than preset times, namely the time of the thread jamming is long enough and the times of the thread jamming are large enough.
202. Randomly selecting a plurality of target electronic devices from the plurality of electronic devices, and sending function call behavior data and an optimization strategy of the target behavior to the target electronic devices;
because the target electronic device is used for executing the optimization strategy and testing the optimization effect, all electronic devices with thread jamming do not need to be tested. The number of target electronic devices is less than the number of electronic devices that are stuck, and may be randomly selected according to a preset ratio, for example, 10% or 20%.
The function call behavior data of the target behavior is for causing the target electronic device to recognize the function call behavior, and the optimization policy is executed when the function call behavior occurs.
The optimization strategy can be a single optimization strategy or a combined optimization strategy.
The single optimization strategy includes a katton time period to trigger CPU acceleration and a CPU acceleration time period. The CPU acceleration means that the CPU working frequency is increased and the CPU operation speed is increased.
The combined optimization strategy comprises the following steps: the optimization method comprises a first optimization strategy for central processor acceleration, a second optimization strategy for Graphic Processing Unit (GPU) acceleration and a third optimization strategy for data read-write acceleration. The first optimization strategy is the same as the single optimization strategy, the second optimization strategy comprises a card pause time length for triggering GPU acceleration and a GPU acceleration time length, the GPU acceleration comprises the improvement of CPU working frequency and the acceleration of GPU operation speed, the third optimization strategy comprises the card pause time length for triggering data read-write acceleration and the data read-write acceleration time length, the data read-write acceleration refers to the speed of accelerating an application program to read data in a memory, wherein the memory can be a buffer memory area in the CPU and the GPU, and can also be an external memory or an internal memory, such as a hard disk.
203. When the thread executes the target behavior and is stuck, acquiring a second stuck time length when the target electronic device executes the optimization strategy;
the electronic device executes the optimization strategy when the thread executes the target behavior, and if the jamming occurs again, a second jamming duration of the jamming is sent to the server, and the server obtains the second jamming durations of the plurality of target electronic devices.
When the optimization strategy is a single optimization strategy, the electronic device executes the optimization strategy and accelerates the CPU according to the optimization strategy;
when the optimization strategy is a combined optimization strategy, the electronic device executes the optimization strategy, performs CPU acceleration according to the first optimization strategy, performs graphics processor acceleration according to the second optimization strategy, and performs data read-write acceleration according to the third optimization strategy. The combined optimization strategy can be executed in each target electronic device, that is, when the thread executes the target behavior and is stuck, the target electronic device executes one of the optimization strategies according to the sequence of the first optimization strategy, the second optimization strategy and the third optimization strategy, and correspondingly accelerates the central processing unit or accelerates the graphics processing unit; or, the data reading and writing speed is accelerated, so that the accidental property of selecting an optimal optimization strategy is avoided to the maximum extent; the target electronic devices may also be divided into three groups, and each group of electronic devices respectively executes one of the optimization strategies in the combined optimization strategies, so that the optimal optimization strategy is easier to compare.
When the thread executes the target behavior and is stuck, the server obtains a second stuck time length when the first optimization strategy is executed in the plurality of target electronic devices, a second stuck time length when the second optimization strategy is executed and a second stuck time length when the third optimization strategy is executed.
204. If the second pause time length corresponding to the same target behavior is smaller than the first pause time length preset value in the target electronic devices with the number larger than the preset number, generating optimized configuration data corresponding to the target behavior according to the optimization strategy, and sending the optimized configuration data to all the electronic devices.
If the second pause time length corresponding to the same target behavior is smaller than the first pause time length, and the difference between the second pause time length and the first pause time length is larger than or equal to a preset value, the difference is larger, and the pause is obviously improved by the optimization strategy.
When the second pause time lengths of the target electronic devices larger than the preset number are all smaller than the first pause time lengths and reach the preset value, the optimization effect of the optimization strategy is universal, the test effect is good, the promotion significance is achieved, then the optimization configuration data are generated according to the optimization strategy, and the optimization configuration data comprise: the application identification information, the function call behavior data corresponding to the target behavior, the pause time of the card triggering CPU acceleration and the CPU acceleration time are updated through the RUS (rom update system) to take effect. The method does not need to take effect by releasing a new upgrade version, and has short update period and quick effect taking.
It should be noted that, if the second katton time length is obtained by executing the first optimization strategy, the second optimization strategy, and the third optimization strategy respectively, the optimization strategy corresponding to the shortest second katton time length is used as the selected optimization strategy, that is, the most effective optimization strategy is selected for promotion, and the optimized configuration data corresponding to the target behavior is generated according to the selected optimization strategy and then sent over the whole network.
Specifically, when all the target electronic devices respectively execute different optimization strategies, and when the thread executes the target behavior and a pause occurs, a second pause duration when the target electronic device respectively executes the first optimization strategy, a second pause duration when the second optimization strategy is executed, and a second pause duration when the third optimization strategy is executed are obtained. If there is a target electronic device in which the second pause-time length corresponding to the same target behavior exceeding the target number is smaller than the first pause-time length by a preset value in the target electronic device, generating optimized configuration data corresponding to the target behavior according to the optimization policy, where the optimized configuration data specifically includes: the identification information, the function call behavior data of the thread, and the optimization strategy, among the optimization strategies, that is, the second pause time length corresponding to the same target behavior is smaller than the preset value of the first pause time length in the target electronic device exceeding the target number, and the second pause time length is the shortest.
When the target electronic devices execute different optimization strategies in groups, and when the thread executes the target behavior and a pause occurs, respectively obtaining a second pause time length when the first group of electronic devices execute the first optimization strategy, a second pause time length when the second group of electronic devices execute the second optimization strategy, and a second pause time length when a third group of electronic devices execute the third group of optimization strategies, at this time, if there is a target electronic device group in which the second pause time length corresponding to the same target behavior exceeding a target number is smaller than the first pause time length by a preset value in each group of target electronic devices, generating optimization configuration data corresponding to the target behavior according to the optimization strategy, where the optimization configuration data specifically includes: the identification information, the function call behavior data of the thread, and the optimization strategy that makes the second pause time length corresponding to the same target behavior smaller than the preset value of the first pause time length and the second pause time length shortest in each optimization strategy in the target electronic device group.
In the embodiment of the invention, by acquiring function call behavior data and a first pause time of a thread in which a pause occurs in an electronic device, determining a function call behavior meeting a preset condition as a target behavior to be tested, sending the function call behavior data and an optimization strategy corresponding to the target behavior to the target electronic device in the electronic device for optimization test, after the thread executes the target behavior and executes the optimization strategy correspondingly for the pause, acquiring a second pause time, if the second pause time corresponding to the same target behavior exists in target electronic equipment with the number larger than the preset number and is far shorter than the second pause time, determining that the optimization strategy is valid, obtaining optimization configuration data according to the optimization strategy and sending the optimization configuration data to all electronic devices for promotion and optimization, and identifying the target behavior in which the pause occurs more intelligently and quickly according to the function call behavior data, the accuracy of confirming the stuck state can be improved, and the applicability of optimizing the stuck state is improved.
Referring to fig. 3, fig. 3 is a schematic flow chart illustrating an implementation process of the morton optimization method according to the embodiment of the present invention, where the method is applicable to an electronic device, and the electronic device includes an electronic data processing device that can be used in a mobile device, such as a smart phone, a tablet computer, and a notebook computer. The method mainly comprises the following steps:
301. when the thread is detected to generate pause, acquiring pause data and sending the pause data to a server, wherein the pause data comprises function calling behavior data of the thread generating pause and a first pause time length;
the method comprises the steps that a stack detection process is arranged in an electronic device and used for detecting whether jamming occurs or not, when the jamming of a thread is detected through the stack detection process, stack data of the thread are obtained and used as function call behavior data, frame dropping duration during the jamming is obtained and used as first jamming duration, and the jamming data are sent to a server.
Furthermore, the identification information of the application in which the thread is stuck is also sent to the server as the stuck data.
302. Receiving function call behavior data of a target behavior and an optimization strategy sent by the server, and executing the optimization strategy according to the function call behavior data of the target behavior so as to accelerate target hardware;
specifically, the function call behavior data sent by the server and an optimization policy for processor acceleration are received, and according to the function call behavior data, when the thread executes the target behavior and is stuck, the central processing unit is accelerated according to the optimization policy. I.e. the single optimization strategy in the embodiment shown in fig. 2, accelerates the cpu and accelerates its computation speed.
Further, if the optimization strategy is a combination strategy, the method includes: the optimization method comprises a first optimization strategy for central processor acceleration, a second optimization strategy for graphic processor acceleration and a third optimization strategy for data read-write acceleration. The electronic device receives the function call behavior data sent by the server, and the first optimization strategy, the second optimization strategy and the third optimization strategy;
according to the function call behavior data, when the thread executes the target behavior and is in pause, one of the optimization strategies is executed according to the sequence of the first optimization strategy, the second optimization strategy and the third optimization strategy, and the central processing unit is accelerated correspondingly or the graphic processing unit is accelerated; or, the data read-write speed is accelerated. Specifically, according to the function call behavior data, when the thread executes the target behavior and a pause occurs for the first time, the central processing unit is accelerated according to the first optimization strategy; accelerating the graphics processor according to the second optimization strategy when the thread executes the target behavior and the checkpoint occurs for the second time; and accelerating the data reading and writing speed according to the third optimization strategy when the thread executes the target behavior and the third time of card pause occurs.
303. And acquiring a second pause time length when the optimization strategy is executed, and sending the second pause time length to the server.
This embodiment is not described in detail with reference to the previous description of the embodiment shown in fig. 2.
In the embodiment of the invention, the stuck data of the thread with stuck occurrence is sent to the server to determine the target behavior to be tested, the function call behavior data and the optimization strategy corresponding to the target behavior sent by the server are received, after the thread executes the target behavior and the optimization strategy is correspondingly executed to cause stuck, the second stuck duration is sent to the server to feed back the test effect, so that the server confirms the effective optimization strategy according to the stuck data and the second stuck duration, the optimization configuration data is obtained according to the optimization strategy sent by the server, and the possibility of stuck occurrence of the thread is reduced.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a server according to an embodiment of the present invention, and for convenience of description, only a portion related to the embodiment of the present invention is shown. The server illustrated in fig. 4 may be an execution subject of the morton optimization method provided in the foregoing embodiment illustrated in fig. 2. The server includes:
an obtaining module 401, configured to obtain morton data in the plurality of electronic devices where thread morton occurs, where the morton data includes function call behavior data of the thread that the thread morton occurs and a first morton time;
a determining module 402, configured to determine a function call behavior in which the first katton time length meets a preset condition as a target behavior;
a selecting module 403, configured to randomly select a plurality of target electronic devices from the plurality of electronic devices;
a sending module 404, configured to send the function call behavior data of the target behavior and the optimization policy to the target electronic apparatus;
the obtaining module 401 is further configured to obtain a second stuck time length when the target electronic device executes the optimization policy when the thread executes the target behavior and the target behavior is stuck;
an optimal configuration module 405, configured to generate optimal configuration data corresponding to the target behavior according to the optimization policy if the second pause time length corresponding to the same target behavior is smaller than the first pause time length and reaches a preset value in the target electronic devices larger than the preset number, and send the optimal configuration data to all electronic devices.
Further, the sending module 404 is further configured to send the function call behavior data of the target behavior and the optimization policy for central processor acceleration to the target electronic device.
The obtaining module 401 is further configured to obtain a second stuck time duration when the target electronic device accelerates the central processing unit according to the optimization policy when the thread executes the target behavior and the target behavior is stuck.
Further, the optimization strategy comprises: the optimization method comprises a first optimization strategy for central processor acceleration, a second optimization strategy for graphic processor acceleration and a third optimization strategy for data read-write acceleration.
The sending module 404 is further configured to send function call behavior data of the target behavior, and the first optimization strategy, the second optimization strategy, and the third optimization strategy to the target electronic device.
The obtaining module 402 is further configured to, when a pause occurs in the execution of the target behavior by the thread, obtain a second pause duration when the target electronic device executes the first optimization policy, a second pause duration when the second optimization policy is executed, and a second pause duration when the third optimization policy is executed, respectively.
Further, the morton data further comprises identification information of the application corresponding to the thread.
The optimal configuration module 405 is further configured to, if there is a target electronic device in the target electronic device, where the second katron time length corresponding to the same target behavior exceeding a target number is smaller than the first katron time length and reaches a preset value, generate optimal configuration data corresponding to the target behavior according to the optimization policy, where the optimal configuration data specifically includes: the identification information, the function call behavior data of the thread, and the optimization strategy, among the optimization strategies, which makes the second pause time length corresponding to the same target behavior smaller than the preset value of the first pause time length and the shortest second pause time length among the target electronic devices exceeding the target number, are also used for sending the optimized configuration data to all the electronic devices in a way of updating a system through a ROM.
Further, the sending module 404 is further configured to send the function call behavior data of the target behavior and the first optimization policy to a first group of electronic devices in the target electronic device; sending the function call behavior data of the target behavior and the second optimization strategy to a second group of electronic devices in the target electronic devices; and sending the function call behavior data of the target behavior and the third optimization strategy to a third group of electronic devices in the target electronic devices.
The obtaining module 401 is further configured to obtain a second stuck duration when the first group of electronic devices executes the first optimization policy when the thread executes the target behavior and is stuck; when the thread executes the target behavior and is stuck, acquiring a second stuck time length when the second group of electronic devices execute the second optimization strategy; and when the thread executes the target behavior and is stuck, acquiring a second stuck time length when the third group of electronic devices execute the third group of optimization strategies.
The optimal configuration module 405 is further configured to, if there is a target electronic device group in which the second pause-time length corresponding to the same target behavior exceeding a target number is smaller than the first pause-time length and reaches a preset value in each group of target electronic devices, generate optimal configuration data corresponding to the target behavior according to the optimization policy, where the optimal configuration data specifically includes: the identification information, the function call behavior data of the thread, and the optimization strategy that makes the second pause time length corresponding to the same target behavior smaller than the preset value of the first pause time length and the second pause time length shortest in each optimization strategy in the target electronic device group.
In this embodiment, by obtaining function call behavior data and a first stuck time length of a thread in an electronic device, where the thread is stuck, the function call behavior conforming to a preset condition is determined as a target behavior to be tested, the function call behavior data and an optimization policy corresponding to the target behavior are sent to a target electronic device in the electronic device for an optimization test, after the thread executes the target behavior and executes the optimization policy correspondingly, a second stuck time length is obtained, if the second stuck time length corresponding to the same target behavior is far shorter than the second stuck time length in target electronic devices larger than a preset number, it is determined that the optimization policy is valid, optimization configuration data is obtained according to the optimization policy and sent to all electronic devices for promotion and optimization, the target behavior in which the stuck occurs can be identified more intelligently and quickly according to the function call behavior data, the accuracy of confirming the stuck state can be improved, and the applicability of optimizing the stuck state is improved.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, and for convenience of description, only portions related to the embodiment of the present invention are shown. The electronic device illustrated in fig. 5 may be an execution subject of the katton optimization method provided in the foregoing embodiment illustrated in fig. 3. The electronic device includes:
an obtaining module 501, configured to obtain stuck data when it is detected that a thread is stuck, where the stuck data includes function call behavior data of the thread where the stuck occurs and a first stuck duration;
a sending module 502, configured to send the morton data to a server;
a receiving module 503, configured to receive function call behavior data of the target behavior and the optimization policy sent by the server;
an executing module 504, configured to execute the optimization policy according to the function call behavior data of the target behavior, so as to accelerate target hardware;
the obtaining module 501 is further configured to obtain a second pause duration when the optimization policy is executed;
the sending module 502 is further configured to send the second card pause duration to the server.
Further, the obtaining module 501 is further configured to, when it is detected that a thread is stuck through a stack detection process, obtain stack data of the thread as the function call behavior data, and obtain a frame dropping time of the thread stuck as the stuck time.
Further, the receiving module 503 is further configured to receive the function call behavior data sent by the server and an optimization policy for processor acceleration;
the execution module 504 is further configured to accelerate the central processing unit according to the optimization policy when the thread executes the target behavior and a checkpoint occurs according to the function call behavior data.
Further, the optimization strategy comprises: the optimization method comprises a first optimization strategy for central processor acceleration, a second optimization strategy for graphic processor acceleration and a third optimization strategy for data read-write acceleration.
A receiving module 503, further configured to receive the function call behavior data sent by the server, and the first optimization policy, the second optimization policy, and the third optimization policy;
the execution module 504 is further configured to, according to the function call behavior data, execute one of the optimization policies according to the order of the first optimization policy, the second optimization policy, and the third optimization policy when the thread executes the target behavior and is stuck, and correspondingly accelerate the central processing unit or accelerate the graphics processing unit; or, the data read-write speed is accelerated.
For details that are not described in the present embodiment, please refer to the description of the embodiment shown in fig. 1 to fig. 4, which will not be described herein again.
In the embodiment of the invention, the stuck data of the thread with stuck occurrence is sent to the server to determine the target behavior to be tested, the function call behavior data and the optimization strategy corresponding to the target behavior sent by the server are received, after the thread executes the target behavior and the optimization strategy is correspondingly executed to cause stuck, the second stuck duration is sent to the server to feed back the test effect, so that the server confirms the effective optimization strategy according to the stuck data and the second stuck duration, the optimization configuration data is obtained according to the optimization strategy sent by the server, and the possibility of stuck occurrence of the thread is reduced.
An embodiment of the present invention further provides an electronic device, including: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the katton optimization method as described in the foregoing fig. 3 when executing the computer program.
Referring to fig. 6, fig. 6 is a hardware structure diagram of an electronic device according to an embodiment of the invention.
For example, the electronic device may be any of various types of computer system apparatuses that are mobile or portable and perform wireless communication. In particular, the electronic apparatus may be a mobile phone or a smart phone (e.g., iPhone (TM) -based phone), a Portable game device (e.g., Nintendo DS (TM), PlayStation Portable (TM), Gameboy Advance (TM), iPhone (TM)), a laptop, a PDA, a Portable internet appliance, a music player and a data storage device, other handheld devices and a head-mounted device (HMD) such as a watch, a headset, a pendant, a headset, etc., and other wearable devices (e.g., electronic glasses, electronic clothes, an electronic bracelet, an electronic necklace, an electronic tattoo, an electronic device, or a smart watch).
The electronic apparatus may also be any of a number of electronic devices including, but not limited to, cellular phones, smart phones, other wireless communication devices, personal digital assistants, audio players, other media players, music recorders, video recorders, cameras, other media recorders, radios, medical devices, vehicle transportation equipment, calculators, programmable remote controllers, pagers, laptop computers, desktop computers, printers, netbook computers, Personal Digital Assistants (PDAs), Portable Multimedia Players (PMPs), moving picture experts group (MPEG-1 or MPEG-2) audio layer 3(MP3) players, portable medical devices, and digital cameras and combinations thereof.
In some cases, the electronic device may perform a variety of functions (e.g., playing music, displaying video, storing pictures, and receiving and sending telephone calls). If desired, the electronic apparatus may be a portable device such as a cellular telephone, media player, other handheld device, wristwatch device, pendant device, earpiece device, or other compact portable device.
As shown in fig. 6, the electronic device 10 may include control circuitry, which may include storage and processing circuitry 30. The storage and processing circuitry 30 may include memory, such as hard drive memory, non-volatile memory (e.g., flash memory or other electronically programmable erase limit memory used to form solid state drives, etc.), volatile memory (e.g., static or dynamic random access memory, etc.), and so forth, although the embodiments of the present application are not limited thereto. Processing circuitry in the storage and processing circuitry 30 may be used to control the operation of the electronic device 10. The processing circuitry may be implemented based on one or more microprocessors, microcontrollers, digital signal processors, baseband processors, power management units, audio codec chips, application specific integrated circuits, display driver integrated circuits, and the like.
The storage and processing circuitry 30 may be used to run software within the electronic device 10 such as, for example, an Internet browsing application, a Voice Over Internet Protocol (VOIP) telephone call application, an email application, a media playing application, operating system functions, etc. Such software may be used to perform control operations such as, for example, camera-based image capture, ambient light measurement based on an ambient light sensor, proximity sensor measurement based on a proximity sensor, information display functionality based on status indicators such as status indicator lights of light emitting diodes, touch event detection based on a touch sensor, functionality associated with displaying information on multiple (e.g., layered) displays, operations associated with performing wireless communication functions, operations associated with collecting and generating audio signals, control operations associated with collecting and processing button press event data, and other functions in the electronic device 10, and the like, without limitation of the embodiments of the present application.
The electronic device 10 may also include input-output circuitry 42. The input-output circuitry 42 may be used to enable the electronic device 10 to enable input and output of data, i.e., to allow the electronic device 10 to receive data from external devices and also to allow the electronic device 10 to output data from the electronic device 10 to external devices. The input-output circuitry 42 may further include the sensor 32. The sensors 32 may include ambient light sensors, optical and capacitive based proximity sensors, touch sensors (e.g., optical based touch sensors and/or capacitive touch sensors, where the touch sensors may be part of a touch display screen or may be used independently as a touch sensor structure), acceleration sensors, and other sensors, among others.
Input-output circuitry 42 may also include one or more displays, such as display 14. The display 14 may include one or a combination of liquid crystal displays, organic light emitting diode displays, electronic ink displays, plasma displays, displays using other display technologies. The display 14 may include an array of touch sensors (i.e., the display 14 may be a touch display screen). The touch sensor may be a capacitive touch sensor formed by a transparent touch sensor electrode (e.g., an Indium Tin Oxide (ITO) electrode) array, or may be a touch sensor formed using other touch technologies, such as acoustic wave touch, pressure sensitive touch, resistive touch, optical touch, and the like, and the embodiments of the present application are not limited thereto.
The electronic device 10 may also include an audio component 36. The audio component 36 may be used to provide audio input and output functionality for the electronic device 10. Audio components 36 in electronic device 10 may include speakers, microphones, buzzers, tone generators, and other components for generating and detecting sound.
The communication circuitry 38 may be used to provide the electronic device 10 with the ability to communicate with external devices. The communication circuit 38 may include analog and digital input-output interface circuits, and wireless communication circuits based on radio frequency signals and/or optical signals. The wireless communication circuitry in communication circuitry 38 may include radio-frequency transceiver circuitry, power amplifier circuitry, low noise amplifiers, switches, filters, and antennas. For example, the wireless Communication circuitry in Communication circuitry 38 may include circuitry to support Near Field Communication (NFC) by transmitting and receiving Near Field coupled electromagnetic signals. For example, the communication circuitry 38 may include a near field communication antenna and a near field communication transceiver. The communications circuitry 38 may also include a cellular telephone transceiver and antenna, a wireless local area network transceiver circuit and antenna, and the like.
The electronic device 10 may further include a battery, power management circuitry, and other input-output units 40. The input-output unit 40 may include buttons, joysticks, click wheels, scroll wheels, touch pads, keypads, keyboards, cameras, light emitting diodes and other status indicators, etc.
A user may enter commands through input-output circuitry 42 to control the operation of electronic device 10, and may use output data of input-output circuitry 42 to enable receipt of status information and other outputs from electronic device 10.
Further, an embodiment of the present invention further provides a computer-readable storage medium, which may be disposed in the electronic device in the foregoing embodiments, and the computer-readable storage medium may be a memory in the storage and processing circuit 30 in the foregoing embodiment shown in fig. 6. The computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the stuck optimization method described in the foregoing embodiment illustrated in fig. 3. Further, the computer-readable storage medium may be various media that can store program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a RAM, a magnetic disk, or an optical disk.
It should be noted that, for the sake of simplicity, the above-mentioned method embodiments are described as a series of acts or combinations, but those skilled in the art should understand that the present invention is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no acts or modules are necessarily required of the invention.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the above description, for a person skilled in the art, there are variations to the embodiments and application ranges according to the concepts of the embodiments of the present invention, and in summary, the present disclosure should not be construed as limiting the invention.

Claims (14)

1.一种卡顿优化方法,应用于服务器,其特征在于,所述方法包括:1. A stuck optimization method, applied to a server, is characterized in that, the method comprises: 获取发生线程卡顿的多个电子装置中的卡顿数据,所述卡顿数据包括发生卡顿的线程的函数调用行为数据以及第一卡顿时长,并将所述第一卡顿时长符合预设条件的函数调用行为确定为目标行为;Acquiring the stall data in the multiple electronic devices where the thread stall occurs, the stall data includes the function call behavior data of the thread in which stall occurs and the first stall duration, and matches the first stall duration to the expected duration. The conditional function call behavior is determined as the target behavior; 在所述多个电子装置中随机选取多个目标电子装置,并将所述目标行为的函数调用行为数据,以及,用于中央处理器加速的优化策略发送给所述目标电子装置;randomly select a plurality of target electronic devices from the plurality of electronic devices, and send the function call behavior data of the target behavior and the optimization strategy for the acceleration of the central processing unit to the target electronic device; 当所述线程执行所述目标行为发生卡顿时,获取所述目标电子装置按照所述优化策略将所述中央处理器进行加速时的第二卡顿时长;When the thread performs the target behavior and is stuck, acquiring the second stuck duration when the target electronic device accelerates the central processing unit according to the optimization strategy; 若在大于预设数量的所述目标电子装置中,存在同一个目标行为对应的所述第二卡顿时长小于所述第一卡顿时长达到预设数值,则根据所述优化策略生成所述目标行为对应的优化配置数据,并将所述优化配置数据发送给所有电子装置。If in the target electronic devices greater than the preset number, the second jam duration corresponding to the same target behavior is smaller than the first jam duration and reaches a preset value, then the optimization strategy is used to generate the The optimized configuration data corresponding to the target behavior is sent to all electronic devices. 2.根据权利要求1所述的方法,其特征在于,所述优化策略包括:用于中央处理器加速的第一优化策略,用于图形处理器加速的第二优化策略以及用于数据读写加速的第三优化策略,则所述将所述目标行为的函数调用行为数据以及优化策略发送给所述目标电子装置包括:2. The method according to claim 1, wherein the optimization strategy comprises: a first optimization strategy for CPU acceleration, a second optimization strategy for graphics processor acceleration, and a data read and write strategy The accelerated third optimization strategy, the sending the function call behavior data of the target behavior and the optimization strategy to the target electronic device includes: 将所述目标行为的函数调用行为数据,以及,所述第一优化策略、所述第二优化策略和所述第三优化策略发送给所述目标电子装置;sending the function call behavior data of the target behavior, and the first optimization strategy, the second optimization strategy and the third optimization strategy to the target electronic device; 则,所述当所述线程执行所述目标行为发生卡顿时,获取所述目标电子装置执行所述优化策略时的第二卡顿时长包括:Then, when the thread is stuck executing the target behavior, acquiring the second stuck duration when the target electronic device executes the optimization strategy includes: 当所述线程执行所述目标行为发生卡顿时,获取所述目标电子装置分别执行所述第一优化策略时的第二卡顿时长,执行所述第二优化策略时的第二卡顿时长,执行所述第三优化策略时的第二卡顿时长。When the thread is stuck when executing the target behavior, obtain the second stuck duration when the target electronic device executes the first optimization strategy respectively, and obtain the second stuck duration when the second optimization strategy is executed, The second freeze duration when the third optimization strategy is executed. 3.根据权利要求2所述的方法,其特征在于,所述卡顿数据还包括所述线程对应的应用的标识信息,则所述方法还包括:3. The method according to claim 2, wherein the stuck data further comprises identification information of the application corresponding to the thread, and the method further comprises: 若所述目标电子装置中,存在超过目标数量的同一个所述目标行为对应的所述第二卡顿时长小于所述第一卡顿时长达到预设数值的目标电子装置,则根据所述优化策略生成所述目标行为对应的优化配置数据,则所述优化配置数据具体包括:所述标识信息,所述线程的函数调用行为数据,以及,各所述优化策略中使得在超过所述目标数量的所述目标电子装置中,同一个所述目标行为对应的所述第二卡顿时长小于所述第一卡顿时长预设数值,且所述第二卡顿时长最短的优化策略;If, in the target electronic device, there is a target electronic device in which the second freeze duration corresponding to the same target behavior exceeds the target number and the second freeze duration is shorter than the first freeze duration and reaches a preset value, the optimization is performed according to the target electronic device. The optimization configuration data corresponding to the target behavior is generated by the strategy, and the optimization configuration data specifically includes: the identification information, the function call behavior data of the thread, and, in each of the optimization strategies, the target number is exceeded. In the target electronic device, the second freeze duration corresponding to the same target behavior is less than the preset value of the first freeze duration, and the optimization strategy that the second freeze duration is the shortest; 将所述优化配置数据通过ROM更新系统的方式发送给所有电子装置。The optimized configuration data is sent to all electronic devices by means of a ROM update system. 4.根据权利要求1所述的方法,其特征在于,所述优化策略包括:用于中央处理器加速的第一优化策略,用于图形处理器加速的第二优化策略以及用于数据读写加速的第三优化策略,则所述将所述目标行为的函数调用行为数据以及优化策略发送给所述目标电子装置包括:4. The method according to claim 1, wherein the optimization strategy comprises: a first optimization strategy for CPU acceleration, a second optimization strategy for graphics processor acceleration, and a data read and write strategy The accelerated third optimization strategy, the sending the function call behavior data of the target behavior and the optimization strategy to the target electronic device includes: 将所述目标行为的函数调用行为数据以及所述第一优化策略,发送给所述目标电子装置中的第一组电子装置;sending the function call behavior data of the target behavior and the first optimization strategy to a first group of electronic devices in the target electronic device; 将所述目标行为的函数调用行为数据以及所述第二优化策略,发送给所述目标电子装置中的第二组电子装置;sending the function call behavior data of the target behavior and the second optimization strategy to a second group of electronic devices in the target electronic device; 将所述目标行为的函数调用行为数据以及所述第三优化策略,发送给所述目标电子装置中的第三组电子装置;sending the function call behavior data of the target behavior and the third optimization strategy to a third group of electronic devices in the target electronic device; 则,所述当所述线程执行所述目标行为发生卡顿时,获取所述目标电子装置执行所述优化策略时的第二卡顿时长包括:Then, when the thread is stuck executing the target behavior, acquiring the second stuck duration when the target electronic device executes the optimization strategy includes: 当所述线程执行所述目标行为发生卡顿时,获取所述第一组电子装置执行所述第一优化策略时的第二卡顿时长;When the thread is stuck executing the target behavior, acquiring a second stuck duration when the first group of electronic devices executes the first optimization strategy; 当所述线程执行所述目标行为发生卡顿时,获取所述第二组电子装置执行所述第二优化策略时的第二卡顿时长;When the thread is stuck executing the target behavior, acquiring a second stuck duration when the second group of electronic devices executes the second optimization strategy; 当所述线程执行所述目标行为发生卡顿时,获取所述第三组电子装置执行所述第三优化策略时的第二卡顿时长。When the thread is stuck when executing the target behavior, the second stuck duration when the third group of electronic devices executes the third optimization strategy is acquired. 5.根据权利要求4所述的方法,其特征在于,所述卡顿数据还包括所述线程对应的应用的标识信息,则所述方法还包括:5. The method according to claim 4, wherein the stuck data further comprises identification information of the application corresponding to the thread, and the method further comprises: 若各组目标电子装置中,存在超过目标数量的同一个所述目标行为对应的所述第二卡顿时长小于所述第一卡顿时长达到预设数值的目标电子装置组别,则根据所述优化策略生成所述目标行为对应的优化配置数据,则所述优化配置数据具体包括:所述标识信息,所述线程的函数调用行为数据,以及,各所述优化策略中使得若在所述目标电子装置组别中,同一个所述目标行为对应的所述第二卡顿时长小于所述第一卡顿时长预设数值,且所述第二卡顿时长最短的优化策略;If in each group of target electronic devices, there is a target electronic device group in which the second freeze duration corresponding to the same target behavior exceeds the target number and the second freeze duration is shorter than the first freeze duration and reaches a preset value, then according to the If the optimization strategy generates the optimization configuration data corresponding to the target behavior, the optimization configuration data specifically includes: the identification information, the function call behavior data of the thread, and, in each of the optimization strategies, if in the In the target electronic device group, the second freezing duration corresponding to the same target behavior is smaller than the preset value of the first freezing duration, and the optimization strategy that the second freezing duration is the shortest; 将所述优化配置数据通过ROM更新系统的方式发送给所有电子装置。The optimized configuration data is sent to all electronic devices by means of a ROM update system. 6.根据权利要求1所述的方法,其特征在于,所述将所述第一卡顿时长符合预设条件的函数调用行为确定为目标行为包括:6. The method according to claim 1, wherein the determining the function call behavior whose first freeze duration meets a preset condition as the target behavior comprises: 将所述第一卡顿时长超过第一预设时长且超过的次数大于预设次数的函数调用行为,确定为目标行为。Determining the function invocation behavior in which the first freeze duration exceeds the first preset duration and the number of times exceeds the preset number of times as the target behavior. 7.一种卡顿优化方法,应用于电子装置,其特征在于,所述方法包括:7. A stuck optimization method, applied to an electronic device, wherein the method comprises: 当检测到线程发生卡顿时,获取卡顿数据并将所述卡顿数据发送给服务器,所述卡顿数据包括发生卡顿的线程的函数调用行为数据以及第一卡顿时长;When it is detected that the thread is stuck, acquire the stuck data and send the stuck data to the server, where the stuck data includes the function call behavior data of the thread where stuck and the first stuck duration; 接收所述服务器发送的目标行为的函数调用行为数据以及优化策略,并根据所述目标行为的函数调用行为数据执行所述优化策略,以对目标硬件进行加速;Receive the function call behavior data of the target behavior and the optimization strategy sent by the server, and execute the optimization strategy according to the function call behavior data of the target behavior to accelerate the target hardware; 获取执行所述优化策略时的第二卡顿时长并发送给所述服务器。Acquire the second freeze duration when the optimization strategy is executed, and send it to the server. 8.根据权利要求7所述的方法,其特征在于,所述当检测到线程发生卡顿时,获取卡顿数据并将所述卡顿数据发送给服务器,所述卡顿数据包括发生卡顿的线程的函数调用行为数据以及第一卡顿时长包括:8 . The method according to claim 7 , wherein when it is detected that the thread is stuck, acquiring the stuck data and sending the stuck data to the server, wherein the stuck data includes the stuck data. 9 . The function call behavior data of the thread and the length of the first freeze include: 当通过堆栈探测进程检测到线程发生卡顿时,获取所述线程的堆栈数据作为所述函数调用行为数据,获取卡顿时的掉帧时长作为所述卡顿时长,并将所述卡顿数据发送给所述服务器。When it is detected that the thread is stuck through the stack detection process, the stack data of the thread is obtained as the function call behavior data, the frame drop duration when the stuck is obtained as the stuck duration, and the stuck data is sent to the server. 9.根据权利要求7所述的方法,其特征在于,所述接收所述服务器发送的目标行为的函数调用行为数据以及优化策略,并根据所述目标行为的函数调用行为数据执行所述优化策略,以对目标硬件进行加速,具体包括:9. The method according to claim 7, wherein the function call behavior data and an optimization strategy of the target behavior sent by the server are received, and the optimization strategy is executed according to the function call behavior data of the target behavior. , to accelerate the target hardware, including: 接收所述服务器发送的所述函数调用行为数据以及用于处理器加速的优化策略;receiving the function call behavior data and an optimization strategy for processor acceleration sent by the server; 根据所述函数调用行为数据,当所述线程执行所述目标行为发生卡顿时,按照所述优化策略将所述电子装置的中央处理器进行加速。According to the function calling behavior data, when the thread performs the target behavior and becomes stuck, the central processing unit of the electronic device is accelerated according to the optimization strategy. 10.根据权利要求7所述的方法,其特征在于,所述优化策略包括:用于中央处理器加速的第一优化策略,用于图形处理器加速的第二优化策略以及用于数据读写加速的第三优化策略,则将所述目标行为的函数调用行为数据以及优化策略发送给目标电子装置,则所述接收所述服务器发送的目标行为的函数调用行为数据以及优化策略,并根据所述目标行为的函数调用行为数据执行所述优化策略,以对目标硬件进行加速,具体包括:10. The method according to claim 7, wherein the optimization strategy comprises: a first optimization strategy for CPU acceleration, a second optimization strategy for graphics processor acceleration, and a data read and write strategy The third accelerated optimization strategy is to send the function call behavior data of the target behavior and the optimization strategy to the target electronic device, and then the function call behavior data and the optimization strategy of the target behavior sent by the server are received, and based on the The function call behavior data of the target behavior executes the optimization strategy to accelerate the target hardware, specifically including: 接收所述服务器发送的所述函数调用行为数据,以及,所述第一优化策略,所述第二优化策略和所述第三优化策略;receiving the function call behavior data sent by the server, and the first optimization strategy, the second optimization strategy and the third optimization strategy; 根据所述函数调用行为数据,当所述线程执行所述目标行为发生卡顿时,按照所述第一优化策略、所述第二优化策略以及所述第三优化策略的顺序,执行其中一个优化策略,对应将所述中央处理器进行加速,或,将所述图形处理器进行加速;或,将所述数据读写速度进行加速。According to the function call behavior data, when the thread is stuck executing the target behavior, one of the optimization strategies is executed in the order of the first optimization strategy, the second optimization strategy and the third optimization strategy , corresponding to the acceleration of the central processing unit, or the acceleration of the graphics processor; or the acceleration of the data reading and writing speed. 11.一种服务器,其特征在于,所述服务器包括:11. A server, characterized in that the server comprises: 获取模块,用于获取发生线程卡顿的多个电子装置中的卡顿数据,所述卡顿数据包括发生卡顿的线程的函数调用行为数据以及第一卡顿时长;an acquisition module, configured to acquire the stall data in multiple electronic devices where the thread stall occurs, where the stall data includes the function call behavior data of the thread in which stall occurs and the first stall duration; 确定模块,用于将所述第一卡顿时长符合预设条件的函数调用行为确定为目标行为;A determination module, configured to determine the function calling behavior whose first freeze duration meets the preset condition as the target behavior; 选取模块,用于在所述多个电子装置中随机选取多个目标电子装置;a selection module for randomly selecting a plurality of target electronic devices among the plurality of electronic devices; 发送模块,用于将所述目标行为的函数调用行为数据,以及,用于中央处理器加速的优化策略发送给所述目标电子装置;a sending module, configured to send the function call behavior data of the target behavior and the optimization strategy for the acceleration of the central processing unit to the target electronic device; 所述获取模块,还用于当所述线程执行所述目标行为发生卡顿时,获取所述目标电子装置按照所述优化策略将所述中央处理器进行加速时的第二卡顿时长;The acquiring module is further configured to acquire a second stall duration when the target electronic device accelerates the central processing unit according to the optimization strategy when a stall occurs when the thread executes the target behavior; 优化配置模块,用于若在大于预设数量的所述目标电子装置中,存在同一个目标行为对应的所述第二卡顿时长小于所述第一卡顿时长达到预设数值,则根据所述优化策略生成所述目标行为对应的优化配置数据,并将所述优化配置数据发送给所有电子装置。The optimized configuration module is configured to, if in the target electronic devices greater than the preset number, the second stuck duration corresponding to the same target behavior is smaller than the first stuck duration and reaches a preset value, then according to the The optimization strategy generates optimized configuration data corresponding to the target behavior, and sends the optimized configuration data to all electronic devices. 12.一种电子装置,其特征在于,所述电子装置包括:12. An electronic device, wherein the electronic device comprises: 获取模块,用于当检测到线程发生卡顿时,获取卡顿数据,所述卡顿数据包括发生卡顿的线程的函数调用行为数据以及第一卡顿时长;an acquisition module, configured to acquire the stuck data when it is detected that the thread is stuck, and the stuck data includes the function call behavior data of the thread where stuck and the length of the first stuck; 发送模块,用于将所述卡顿数据发送给服务器;a sending module, configured to send the stuck data to a server; 接收模块,用于接收所述服务器发送的目标行为的函数调用行为数据以及优化策略;a receiving module, configured to receive the function call behavior data and the optimization strategy of the target behavior sent by the server; 执行模块,用于根据所述目标行为的函数调用行为数据执行所述优化策略,以对目标硬件进行加速;an execution module, configured to execute the optimization strategy according to the function call behavior data of the target behavior to accelerate the target hardware; 所述获取模块,还用于获取执行所述优化策略时的第二卡顿时长;The obtaining module is further configured to obtain the second stall duration when the optimization strategy is executed; 所述发送模块,还用于将所述第二卡顿时长发送给所述服务器。The sending module is further configured to send the second freeze duration to the server. 13.一种电子装置,其特征在于,所述电子装置包括:13. An electronic device, characterized in that the electronic device comprises: 存储器和处理器;memory and processor; 所述存储器存储有可执行程序代码;The memory stores executable program codes; 与所述存储器耦合的所述处理器,调用所述存储器中存储的所述可执行程序代码,执行如权利要求7至10中任一项所述的卡顿优化方法。The processor coupled with the memory invokes the executable program code stored in the memory to execute the stuck optimization method according to any one of claims 7 to 10. 14.一种计算机可读存储介质,其特征在于,其上存储有计算机程序,所述计算机程序在被处理器运行时,执行如权利要求1至6中任一项或权利要求7至10中任一项所述的卡顿优化方法。14. A computer-readable storage medium, characterized in that, a computer program is stored thereon, and when the computer program is run by a processor, executes any one of claims 1 to 6 or claims 7 to 10. Any one of the stuck optimization methods.
CN201910376335.6A 2019-05-07 2019-05-07 Catton optimization method, server, electronic device and computer-readable storage medium Active CN110109759B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910376335.6A CN110109759B (en) 2019-05-07 2019-05-07 Catton optimization method, server, electronic device and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910376335.6A CN110109759B (en) 2019-05-07 2019-05-07 Catton optimization method, server, electronic device and computer-readable storage medium

Publications (2)

Publication Number Publication Date
CN110109759A CN110109759A (en) 2019-08-09
CN110109759B true CN110109759B (en) 2021-11-26

Family

ID=67488570

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910376335.6A Active CN110109759B (en) 2019-05-07 2019-05-07 Catton optimization method, server, electronic device and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN110109759B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110647366B (en) * 2019-09-19 2023-08-22 Oppo广东移动通信有限公司 Method, device, terminal and storage medium for processing blocking
CN112667486B (en) * 2019-10-16 2024-08-16 腾讯科技(深圳)有限公司 Determination method and device of cartoon thread, electronic equipment and storage medium
CN110941551B (en) * 2019-11-21 2021-04-30 腾讯科技(深圳)有限公司 Application stuck detection method, device and equipment and computer storage medium
CN110888781B (en) * 2019-11-21 2021-11-16 腾讯科技(深圳)有限公司 Application blockage detection method and detection device
CN113190427B (en) * 2021-05-11 2024-07-19 抖音视界有限公司 Method and device for monitoring blocking, electronic equipment and storage medium
CN116028210B (en) * 2022-05-16 2023-10-20 荣耀终端有限公司 Resource scheduling method, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106095577A (en) * 2016-06-08 2016-11-09 东北林业大学 The optimized treatment method of shared drives based on many path processors and device
CN106453338A (en) * 2016-10-21 2017-02-22 高道华 Resource optimization method of wireless mesh network in cloud environment
CN107622003A (en) * 2016-07-13 2018-01-23 阿里巴巴集团控股有限公司 A kind of performance optimum results Forecasting Methodology and device
CN107967177A (en) * 2017-11-30 2018-04-27 努比亚技术有限公司 Memory Optimize Method, mobile terminal and readable storage medium storing program for executing based on kernel process
CN108647051A (en) * 2018-03-13 2018-10-12 广东欧珀移动通信有限公司 Optimisation strategy acquisition methods, providing method, device and equipment
CN108829469A (en) * 2018-04-18 2018-11-16 北京奇艺世纪科技有限公司 A kind of application program page methods of exhibiting and device
CN109491702A (en) * 2018-11-02 2019-03-19 广州虎牙科技有限公司 A kind of prioritization scheme determines method, apparatus, terminal device and storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8316194B2 (en) * 2009-12-15 2012-11-20 Intel Corporation Mechanisms to accelerate transactions using buffered stores
CN104391742B (en) * 2014-11-11 2019-03-01 小米科技有限责任公司 Optimizing application method and apparatus
US10241834B2 (en) * 2016-11-29 2019-03-26 International Business Machines Corporation Bandwidth aware resource optimization
CN108984264B (en) * 2017-06-02 2022-11-15 阿里巴巴集团控股有限公司 Virtual GPU (graphics processing Unit) implementation method, device and system
CN107943568B (en) * 2017-10-31 2021-11-26 北京航空航天大学 Two-stage scheduling model and prototype platform of integrated modular avionics system
CN108600086B (en) * 2018-04-08 2021-02-23 Oppo广东移动通信有限公司 Information processing method, electronic device, and computer-readable storage medium
CN109597687B (en) * 2018-10-31 2020-11-13 东软集团股份有限公司 Resource allocation method and device for data synchronization, storage medium and electronic equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106095577A (en) * 2016-06-08 2016-11-09 东北林业大学 The optimized treatment method of shared drives based on many path processors and device
CN107622003A (en) * 2016-07-13 2018-01-23 阿里巴巴集团控股有限公司 A kind of performance optimum results Forecasting Methodology and device
CN106453338A (en) * 2016-10-21 2017-02-22 高道华 Resource optimization method of wireless mesh network in cloud environment
CN107967177A (en) * 2017-11-30 2018-04-27 努比亚技术有限公司 Memory Optimize Method, mobile terminal and readable storage medium storing program for executing based on kernel process
CN108647051A (en) * 2018-03-13 2018-10-12 广东欧珀移动通信有限公司 Optimisation strategy acquisition methods, providing method, device and equipment
CN108829469A (en) * 2018-04-18 2018-11-16 北京奇艺世纪科技有限公司 A kind of application program page methods of exhibiting and device
CN109491702A (en) * 2018-11-02 2019-03-19 广州虎牙科技有限公司 A kind of prioritization scheme determines method, apparatus, terminal device and storage medium

Also Published As

Publication number Publication date
CN110109759A (en) 2019-08-09

Similar Documents

Publication Publication Date Title
CN110109759B (en) Catton optimization method, server, electronic device and computer-readable storage medium
CN109074158B (en) Electronic equipment and method for starting application thereof
CN108874466B (en) Control calling method, electronic device and computer readable storage medium
WO2017206902A1 (en) Application control method and related device
CN108983211B (en) Proximity sensor, method of controlling the same, electronic device, and computer-readable storage medium
CN109495871B (en) Bluetooth connection control method, electronic device and computer readable storage medium
CN109067984B (en) Data transmission method, electronic device and computer readable storage medium
CN109348467B (en) Emergency call implementation method, electronic device and computer-readable storage medium
CN107193598B (en) Application starting method, mobile terminal and computer readable storage medium
CN110865884A (en) Memory management method and device
CN109150326A (en) Antenna impedance adjustment method, electronic device and computer readable storage medium
CN110429696B (en) Battery charging method, electronic device and computer readable storage medium
CN109684011B (en) Interface display control method, electronic device and computer readable storage medium
CN108924358A (en) Proximity sensor control method, electronic device, and computer-readable storage medium
CN107295183A (en) An alarm clock reminder method, device, storage medium and terminal
CN110058980B (en) Terminal start time early warning method, electronic device and computer readable storage medium
CN103347093B (en) User data update method and relevant device and communication system
CN110741346A (en) Application management method and terminal
CN109885201B (en) Touch area detection method for touch screen, electronic device and computer readable storage medium
US20200201923A1 (en) Information Recommendation Method, Terminal Device, and Server
WO2018214745A1 (en) Application control method and related product
CN109902484B (en) Processing method of associated application and terminal
WO2019072179A1 (en) Application running control method and apparatus
CN107679870A (en) Brush amount resource determining method and device
CN109739577A (en) Application freezing-free method, electronic device and computer-readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant