WO2019136837A1 - 一种智能加载系统、方法、存储介质及设备 - Google Patents

一种智能加载系统、方法、存储介质及设备 Download PDF

Info

Publication number
WO2019136837A1
WO2019136837A1 PCT/CN2018/081280 CN2018081280W WO2019136837A1 WO 2019136837 A1 WO2019136837 A1 WO 2019136837A1 CN 2018081280 W CN2018081280 W CN 2018081280W WO 2019136837 A1 WO2019136837 A1 WO 2019136837A1
Authority
WO
WIPO (PCT)
Prior art keywords
loading
unit
thread
update
resource
Prior art date
Application number
PCT/CN2018/081280
Other languages
English (en)
French (fr)
Inventor
张磊
张文明
陈少杰
Original Assignee
武汉斗鱼网络科技有限公司
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 武汉斗鱼网络科技有限公司 filed Critical 武汉斗鱼网络科技有限公司
Publication of WO2019136837A1 publication Critical patent/WO2019136837A1/zh

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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system

Definitions

  • the present invention relates to the field of intelligent loading technologies, and in particular, to an intelligent loading system, method, storage medium and device.
  • the traditional development process is to load the page by calling inflate in the main thread
  • the traditional method has defects.
  • the inflate is called multiple times, and the infalte call is run in the main thread, which causes the main thread to be overburdened, resulting in infalte calls.
  • the slower speed eventually results in slower page loading.
  • the object of the present invention is to provide an intelligent loading system, method, storage medium and device, which can effectively alleviate the pressure of loading layout in the main thread, greatly improve efficiency, and improve the page being presented. speed.
  • An intelligent loading system comprising:
  • Loading a protocol module which includes a loading protocol, and defines a loading method, where the loading method is configured to receive a resource ID of the tag view resource information, thereby acquiring a view resource corresponding to the resource ID;
  • a first unit which inherits the loading protocol, is used to invoke a main thread loader to perform page loading according to the view resource and perform UI update;
  • a second unit configured to invoke a sub-thread loader to perform page loading according to the view resource and perform UI update by using the first unit.
  • the smart loading system further includes:
  • Processing a thread unit the inner member of which processes the thread object, by means of which the processing thread can communicate with the main thread;
  • the second unit invokes a sub-thread loader to perform page loading, and communicates with the first unit by means of the processing thread to perform UI update.
  • the smart loading system further includes:
  • a CPU monitoring module which has a mapping relationship, wherein the mapping relationship includes a first parameter, a CPU temperature value, and a CPU usage rate, where the first parameter is used to represent a value of the loading thread;
  • the smart loading system further includes:
  • a plurality of the second units are created, and the plurality of the second units may call the child thread loader to perform page loading according to the view resource and perform UI update by using the first unit.
  • An intelligent loading method comprising:
  • the loading method defines a loading method, where the loading method is configured to receive a resource ID of the tag view resource information, so as to obtain a view resource corresponding to the resource ID;
  • first unit inheriting the loading protocol, using the first unit to invoke a main thread loader to perform page loading according to the view resource, and performing UI update, using the second unit
  • the calling child thread loader performs page loading according to the view resource and performs UI update by means of the first unit.
  • the smart loading method further includes the following steps:
  • processing thread internal component processing the thread object, and using the processing thread to communicate with the main thread by using the processing thread object;
  • the second unit calls the sub-thread loader to perform page loading, and communicates with the first unit by means of the processing thread to perform UI update.
  • the smart loading method further includes the following steps:
  • mapping relationship includes a first parameter, a CPU temperature value, and a CPU usage, where the first parameter is used to represent a value of the loading thread;
  • the smart loading method further includes the following steps:
  • a plurality of the second units are created, and the plurality of the second units may call the child thread loader to perform page loading according to the view resource and perform UI update by using the first unit.
  • a storage medium having stored thereon a computer program, the computer program being executed by a processor to implement the steps of the smart loading method in the above technical solution.
  • a smart loading device includes a memory, a processor, and a computer program stored on the processor and running on the processor, the processor executing the computer program to implement the smart loading method in the above technical solution step.
  • the result output module is further configured to number each of the trimmed sub-pictures according to the number of the trimmed sub-pictures.
  • the present invention utilizes a custom loading protocol module, a first unit, and a second unit to perform intelligent loading work, thereby avoiding excessive burden on the main thread, avoiding the problem that the infalte calling speed is slow, and eventually causing the page loading speed to be slow;
  • the invention can effectively alleviate the pressure of loading layout in the main thread, greatly improve efficiency, and improve the speed at which the page is presented.
  • the present invention creates a CPU monitoring module to select the first unit and the second unit;
  • the CPU monitoring module created by the invention enables the CPU to ensure the processing speed and avoid the slow processing speed caused by the high CPU usage rate.
  • FIG. 1 is a structural block diagram of an intelligent loading system according to an embodiment of the present invention.
  • FIG. 2 is a flowchart of a smart loading method according to an embodiment of the present invention.
  • FIG. 3 is a structural block diagram of a smart loading device according to an embodiment of the present invention.
  • an embodiment of the present invention provides an intelligent loading system, including:
  • Loading a protocol module which has a loading protocol built in, and defines a loading method, where the loading method is used to receive the resource ID of the tag view resource information, thereby obtaining the view resource corresponding to the resource ID;
  • the first unit which inherits the loading protocol, is used to call the main thread loader to perform page loading according to the view resource and perform UI update;
  • the second unit is configured to invoke the child thread loader to perform page loading according to the view resource and perform UI update by using the first unit.
  • the loading protocol module in the present invention is configured to receive a resource ID by using a loading method in a built-in loading protocol, and then obtain a view resource corresponding to the resource ID, thereby providing a data basis for a later UI update;
  • the first unit has the function of performing UI update directly, inherits the loading protocol, can call the main thread loader, and performs page loading according to the view resource acquired by the loading protocol, and performs UI update;
  • the second unit can open the UI update work, but does not have the UI update function itself.
  • the second unit calls the sub-thread loader to perform page loading according to the view resource, and performs UI update by using the first unit. .
  • the invention can effectively alleviate the pressure of loading the layout in the main thread, greatly improve the efficiency, and improve the speed at which the page is presented.
  • the loading method of the first unit is to load the page by calling the main thread loader, specifically by calling the infalte method in the InflaterManager to load the view resource, and then returning the loaded view object. ;
  • the loading method of the second unit is to load the page by calling the sub-thread loader, specifically by calling the exec method in the thread pool Threadpool to start a new thread, and then calling the infalte in the InflaterManager in the new thread.
  • the method loads the view resource and returns the loaded view object in the current thread.
  • a load protocol module is configured in the main thread loader, and a load protocol module is defined in the load protocol module.
  • Load the protocol the specific load protocol design is as follows:
  • the name of the loading protocol is InflateView. We define a set of loading methods in the loading protocol. The name of the loading method is inflate. The loading method needs to pass a parameter information.
  • the parameter is a resource ID, which can be recorded as resourceId. Used as a unique identifier for a view resource information;
  • the view object view corresponding to the resource ID is returned, that is, the view object view that we need to display.
  • the smart loading system further includes:
  • the inner member processes the thread object, and by processing the thread object, the processing thread can communicate with the main thread;
  • the second unit calls the child thread loader to perform page loading, and communicates with the first unit by means of the processing thread to perform UI update;
  • the processing thread unit is configured to help the second unit communicate with the first unit, so that the second unit performs UI update by means of the first unit, thereby implementing message delivery, and finally causing the first unit and the second unit to serve the UI update work.
  • HandlerThread class in the development process of Android, this class can realize the loop structure of the message, but need to specify a message loop thread when implementing the message loop;
  • the handlerThread object needs to be obtained at this time, and then the post method is called to forward the message to the main thread, and the main thread receives the message in the handlerMessage method, and then the corresponding message. Processing the UI information that needs to be updated in the update sub-thread;
  • the second unit calls the sub-thread loader to perform page loading, and communicates with the first unit by means of the processing thread to perform a UI update process.
  • the smart loading system further includes:
  • a CPU monitoring module which has a mapping relationship, wherein the mapping relationship includes a first parameter, a CPU temperature value, and a CPU usage rate, and the first parameter is used to indicate a value of the loading thread;
  • the CPU monitoring module is used to select the first unit and the second unit, so that the CPU can ensure the processing speed and avoid the slow processing speed caused by the high CPU usage rate.
  • the goal of setting the CPU monitoring module is to load the layout directly in the main thread when the main thread is rich in resources, because the system maintains a set of message loops in the main thread, so instead of separately servicing a set of messages Loop logic, which can update the interface elements directly in the main thread, so it is preferred to load the layout in the main thread;
  • the Cpu parameter indicates the current CPU usage. When the CPU usage rate is higher, the value of infalteThread is smaller, and vice versa.
  • the temp parameter indicates the current CPU temperature information. When the CPU temperature is higher, the CPU load is higher. Heavy, the value of inflateTheread at this time is smaller, the main parameter indicates the usage rate of the main thread. When the usage rate of the main thread is higher, the value of InflateThread is smaller, and vice versa.
  • K represents an adjustment factor, mainly used to adjust the range of parameters
  • InflateThread represents the value of the load thread. When the value of InflateThread is less than 1, it is loaded by the child thread. When it is greater than or equal to 1, it is loaded by the main thread.
  • the CPU monitoring module created according to the above technical solution can dynamically allocate the loader, and the CPU monitoring module configures a loader manager LoaderManager to let the LoaderManager dynamically adjust the loading mode;
  • the second unit is used to assign a value to the InflateView protocol in the manager, otherwise the first unit is used to assign a value to the InflateView protocol;
  • the manager implements the real loading process by calling the inflate method in the InflateView protocol.
  • the manager can dynamically adjust the target of the loader and implement the intelligent loader.
  • the smart loading system further includes:
  • a plurality of second units are created, and the plurality of second units can call the child thread loader to perform page loading according to the view resource and perform UI update by using the first unit.
  • an intelligent loading method includes the following steps:
  • a loading protocol is defined, and a loading method is defined in the loading protocol, where the loading method is configured to receive a resource ID of the tag view resource information, thereby obtaining a view resource corresponding to the resource ID;
  • the first unit inherits the loading protocol, uses the first unit to call the main thread loader to perform page loading according to the view resource, and performs UI update, and uses the second unit to call the child thread loader to perform the page according to the view resource. Load and update the UI with the first unit.
  • the smart loading method further includes the following steps:
  • the second unit calls the child thread loader for page loading, and communicates with the first unit by means of the processing thread to perform UI update.
  • the smart loading method further includes the following steps:
  • mapping relationship includes a first parameter, a CPU temperature value, and a CPU usage rate, where the first parameter is used to indicate a value of the loading thread;
  • the first unit or the second unit is selected to start the UI update work.
  • the smart loading method further includes the following steps:
  • a plurality of second units are created, and the plurality of second units can call the child thread loader to perform page loading according to the view resource and perform UI update by using the first unit.
  • a storage medium having stored thereon a computer program that, when executed by a processor, implements the steps of the smart loading method of the above embodiment.
  • a smart load device includes a memory, a processor, and a computer program stored on the memory and running on the processor.
  • the processor implements the steps of the smart load method in the above embodiment when executing the computer program.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

本发明公开了一种智能加载系统、方法、存储介质及设备,涉及智能加载技术领域,该方法包括:加载协议模块,其内置一加载协议,并定义一加载方法,加载方法用于接收标记视图资源信息的资源ID,从而获取资源ID对应的视图资源;第一单元,其继承加载协议,用于调用主线程加载器根据视图资源进行页面加载并进行UI更新;第二单元,其用于调用子线程加载器根据视图资源进行页面加载并借助第一单元进行UI更新。本发明能够有效的缓解主线程中加载布局的压力,极大的提高效率,提高页面被呈现的速度。

Description

一种智能加载系统、方法、存储介质及设备 技术领域
本发明涉及智能加载技术领域,具体涉及一种智能加载系统、方法、存储介质及设备。
背景技术
在Android的开发过程中,传统的开发过程中是通过在主线程中调用inflate的方式来对页面进行加载的;
但传统的方法存在缺陷,当存在多个界面被同时加载的时候会导致inflate被多次调用,且infalte的调用工作都在主线程中运行,会导致主线程的负担过大,从而导致infalte调用速度变慢,最终导致页面加载速度变慢。
发明内容
针对现有技术中存在的缺陷,本发明的目的在于提供一种智能加载系统、方法、存储介质及设备,能够有效的缓解主线程中加载布局的压力,极大的提高效率,提高页面被呈现的速度。
为达到以上目的,本发明采取的技术方案是:
一种智能加载系统,该系统包括:
加载协议模块,其内置一加载协议,并定义一加载方法,所述加载方法用于接收标记视图资源信息的资源ID,从而获取所述资源ID对应的视图资源;
第一单元,其继承所述加载协议,用于调用主线程加载器根据所述视图资源进行页面加载并进行UI更新;
第二单元,其用于调用子线程加载器根据所述视图资源进行页面加载并借助所述第一单元进行UI更新。
在上述技术方案的基础上,智能加载系统还包括:
处理线程单元,其内构件一处理线程对象,借助所述处理线程对象,所述处理线程能够与主线程进行通信;
所述第二单元调用子线程加载器进行页面加载,并借助所述处理线程与所述第一单元通信,进行UI更新。
在上述技术方案的基础上,智能加载系统还包括:
CPU监测模块,其内置一映射关系,所述映射关系内包含第一参数、CPU温度值以及CPU使用率,所述第一参数用于表示加载线程的值;
根据所述第一参数的数值,选择所述第一单元或所述第二单元开启UI更新工作。
在上述技术方案的基础上,智能加载系统还包括:
创建多个所述第二单元,多个所述第二单元均可调用所述子线程加载器根据所述视图资源进行页面加载并借助所述第一单元进行UI更新。
一种智能加载方法,该方法包括:
创建一加载协议,所述加载协议中定义一加载方法,所述加载方法用于接收标记视图资源信息的资源ID,从而获取所述资源ID对应的视图资源;
创建第一单元以及第二单元,所述第一单元继承所述加载协议,利用所述第一单元调用主线程加载器根据所述视图资源进行页面加载并进行UI更新,利用所述第二单元调用子线程加载器根据所述视图资源进行页面加载并借助所述第一单元进行UI更新。
在上述技术方案的基础上,智能加载方法还包括以下步骤:
创建一处理线程,所述处理线程内构件一处理线程对象,利用所述处理线程借助所述处理线程对象与主线程进行通信;
利用所述第二单元调用子线程加载器进行页面加载,并借助所述处理线程与所述第一单元通信,进行UI更新。
在上述技术方案的基础上,智能加载方法还包括以下步骤:
创建一映射关系,所述映射关系内包含第一参数、CPU温度值以及CPU使用率,所述第一参数用于表示加载线程的值;
根据所述第一参数的数值,选择所述第一单元或所述第二单元开启UI更新工作。
在上述技术方案的基础上,智能加载方法还包括以下步骤:
创建多个所述第二单元,多个所述第二单元均可调用所述子线程加载器根据所述视图资源进行页面加载并借助所述第一单元进行UI更新。
一种存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述技术方案中的智能加载方法的步骤。
一种智能加载设备,包括存储器、处理器及存储在所述存储器上并在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述技术方案中的智能加载方法的步骤。
在上述技术方案的基础上,所述结果输出模块还用于依据所述剪裁子图片的数量,对各所述剪裁子图片进行编号。
与现有技术相比,本发明的优点在于:
(1)本发明利用自定义的加载协议模块、第一单元以及第二单元进行智能加载工作,避免主线程负担过大,避免导致infalte调用速度变慢,最终导致页面加载速度变慢的问题;
与现有技术相比,本发明能够有效的缓解主线程中加载布局的压力,极大的提高效率,提高页面被呈现的速度。
(2)本发明创建CPU监测模块,从而对第一单元以及第二单元进行选择;
与现有技术相比,本发明创建的CPU监测模块使得CPU能够在保证处理速度,避免因CPU使用率较高而造成的处理速度慢。
附图说明
图1为本发明实施例中智能加载系统的结构框图;
图2为本发明实施例中智能加载方法的流程图;
图3为本发明实施例中智能加载设备的结构框图。
具体实施方式
以下结合附图对本发明的实施例作进一步详细说明。
参见图1所示,本发明实施例提供一种智能加载系统,包括:
加载协议模块,其内置一加载协议,并定义一加载方法,加载方法用于接收标记视图资源信息的资源ID,从而获取资源ID对应的视图资源;
第一单元,其继承加载协议,用于调用主线程加载器根据视图资源进行页面加载并进行UI更新;
第二单元,其用于调用子线程加载器根据视图资源进行页面加载并借助第一单元进行UI更新。
本发明中的加载协议模块用于利用其内置的加载协议中的加载方法接收资源ID,进而获取资源ID对应的视图资源,从而为后期的UI更新提供数据依据;
第一单元具有直接进行UI更新的功能,其继承加载协议,能够 调用主线程加载器,并根据通过加载协议获取的视图资源进行页面加载,并进行UI更新;
第二单元能够开启UI更新工作,但其自身并不具备UI更新功能,在需要进行UI更新工作时,第二单元调用子线程加载器根据视图资源进行页面加载,并借助第一单元进行UI更新。
本发明能够有效的缓解主线程中加载布局的压力,极大的提高效率,提高页面被呈现的速度。
需要说明的是,第一单元的加载方法中是通过调用主线程加载器来对页面进行加载的,具体是通过调用InflaterManager中的infalte方法来对视图资源进行加载,然后将加载好的视图对象返回;
第二单元的加载方法中是通过调用子线程加载器来对页面进行加载的,具体是通过调用线程池Threadpool中的exec方法来开启一个新的线程,然后在新的线程中调用InflaterManager中的infalte方法来对视图资源进行加载,然后将加载好的视图对象在当前线程中进行返回。
其中,为了使得加载器能够具有更高的扩张性,尤其是主线程加载器,在设计主线程加载器时,在主线程加载器内配置一加载协议模块,并在加载协议模块内定义了一加载协议,具体的加载协议设计如下所示:
Public interface InflateView{
      Public View inflate(intresourceId)
}
接下来我们对上述的加载协议进行相关的说明。
加载协议的名称是InflateView,我们在该加载协议中定义了一套加载方法,加载方法的名称是inflate,该加载方法需要传递一个参数信息,参数是一个资源ID,可记作resourceId,该资源ID用于作为 一个视图资源信息的唯一标示;
通过inflate方法的处理后会将该资源ID所对应的视图对象view进行返回,也就是我们需要展示的视图对象view。
本实施例中,智能加载系统还包括:
处理线程单元,其内构件一处理线程对象,借助处理线程对象,处理线程能够与主线程进行通信;
第二单元调用子线程加载器进行页面加载,并借助处理线程与第一单元通信,进行UI更新;
处理线程单元用于帮助第二单元与第一单元进行通信,以便第二单元借助第一单元进行UI更新,从而实现消息的传递,最终使得第一单元、第二单元为UI更新工作进行服务。
其中,在Android的开发过程中有一个HandlerThread类,该类可以实现消息的循环结构,但是实现消息循环的时候需要指定一个消息循环线程;
由于每个应用在消息存在一个默认的消息循环线程,即主线程,所以我们通过构建一个HandlerThread类,通过该类的构造方法来构建一个handlerThread对象,并将主线程传递给该对象,这样handlerThread就具备了和主线程通信的能力;
当在第二单元中需要更新UI的时候,此时需要获取到handlerThread对象,然后调用其中的post方法将消息转发到主线程中,主线程会在handlerMessage方法中接收该消息,然后在对应的消息中处理更新子线程中所需要更新的UI信息;
从而实现第二单元调用子线程加载器进行页面加载,并借助处理线程与第一单元通信,进行UI更新的过程。
本实施例中,智能加载系统还包括:
CPU监测模块,其内置一映射关系,映射关系内包含第一参数、CPU温度值以及CPU使用率,第一参数用于表示加载线程的值;
根据第一参数的数值,选择第一单元或第二单元开启UI更新工作;
利用CPU监测模块,从而对第一单元以及第二单元进行选择,使得CPU能够在保证处理速度,避免因CPU使用率较高而造成的处理速度慢。
需要说明的是,设置CPU监测模块的目标是当主线程资源丰富的时候直接在主线程中对布局进行加载,因为在主线程中系统维护了一套消息循环,故而不用单独的去维系一套消息循环逻辑,可以直接在主线程中对界面元素进行更新,所以优先考虑在主线程中对布局进行加载;
但当主线程资源比较紧张的时,需要考虑在子线程中加载布局,在子线程中加载布局有一个缺陷就是子线程本身是不存在消息循环的,如果需要考虑使用消息循环逻辑,此时需要额外的维护一个消息处理器,并且在子线程中是无法对UI进行任何更新操作的,所以在子线程中被加载的界面如果需要对UI进行任何的操作都需要将消息通过消息器发送到主线程中,然后在主线程中对UI进行更新操作。
基于上述的分析,可知在主线程空闲就在主线程加载布局,否则在子线程加载布局逻辑;
为了将上述目标进行量化,设计了如下的映射关系:
InflateThread=K/(cpu*main*temp)
接下来我们将描述一下具体的映射关系含义。
Cpu参数表示当前的CPU使用率,当CPU使用率越高的时候infalteThread的值越小,反之越大,temp参数表示当前CPU的温度信息,当CPU的温度越高的时候此时说CPU负担越重,此时的 inflateTheread的值就越小,main参数表示的是主线程的使用率,当主线程使用率越高InflateThread的值越小,反之则越大;
K表示一个调节系数,主要是用于调节参数的区间范围的;
InflateThread表示的是加载线程的值,当InflateThread的值小于1的时候是使用子线程加载,大于等于1的时候使用主线程加载。
通过上述的定量映射关系我们可以通过判定InflateThread的值的取值范围来动态的调整加载策略。
依据上述技术方案创建的CPU监测模块能够对加载器进行动态的调配,CPU监测模块配置一加载器管理者LoaderManager,让LoaderManager来动态的调整加载模式;
当InflateThread的值小于1的时候使用第二单元来对管理器中的InflateView协议赋值,否则使用第一单元对InflateView协议赋值;
然后管理器通过调用InflateView协议中的inflate方法来实现真实的加载流程,通过这种设计就能够实现动态的调整加载器的目标,并进行智能的加载器的实现。
本实施例中,智能加载系统还包括:
创建多个第二单元,多个第二单元均可调用子线程加载器根据视图资源进行页面加载并借助第一单元进行UI更新。
参见图2所示,一种智能加载方法,该方法包括以下步骤:
创建一加载协议,加载协议中定义一加载方法,加载方法用于接收标记视图资源信息的资源ID,从而获取资源ID对应的视图资源;
创建第一单元以及第二单元,第一单元继承加载协议,利用第一单元调用主线程加载器根据视图资源进行页面加载并进行UI更新,利用第二单元调用子线程加载器根据视图资源进行页面加载并借助第一单元进行UI更新。
本实施例中,智能加载方法还包括以下步骤:
创建一处理线程,处理线程内构件一处理线程对象,利用处理线程借助处理线程对象与主线程进行通信;
利用第二单元调用子线程加载器进行页面加载,并借助处理线程与第一单元通信,进行UI更新。
本实施例中,智能加载方法还包括以下步骤:
创建一映射关系,映射关系内包含第一参数、CPU温度值以及CPU使用率,第一参数用于表示加载线程的值;
根据第一参数的数值,选择第一单元或第二单元开启UI更新工作。
本实施例中,智能加载方法还包括以下步骤:
创建多个第二单元,多个第二单元均可调用子线程加载器根据视图资源进行页面加载并借助第一单元进行UI更新。
一种存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述实施例中智能加载方法的步骤。
参见图3所示,一种智能加载设备,包括存储器、处理器及存储在存储器上并在处理器上运行的计算机程序,处理器执行计算机程序时实现上述实施例中智能加载方法的步骤。
需要说明的是:上述实施例提供的系统在实现智能加载操作时,仅以上述各功能模块的划分进行举例说明,实际应用中,可根据需要而将上述功能分配由不同功能模块完成,即将系统的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
本发明不局限于上述实施方式,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也视为本发明的保护范围之内。
本说明书中未作详细描述的内容属于本领域专业技术人员公知的现有技术。

Claims (10)

  1. 一种智能加载系统,其特征在于,该系统包括:
    加载协议模块,其内置一加载协议,并定义一加载方法,所述加载方法用于接收标记视图资源信息的资源ID,从而获取所述资源ID对应的视图资源;
    第一单元,其继承所述加载协议,用于调用主线程加载器根据所述视图资源进行页面加载并进行UI更新;
    第二单元,其用于调用子线程加载器根据所述视图资源进行页面加载并借助所述第一单元进行UI更新。
  2. 如权利要求1所述的智能加载系统,其特征在于,该系统还包括:
    处理线程单元,其内构件一处理线程对象,借助所述处理线程对象,所述处理线程能够与主线程进行通信;
    所述第二单元调用子线程加载器进行页面加载,并借助所述处理线程与所述第一单元通信,进行UI更新。
  3. 如权利要求1所述的智能加载系统,其特征在于,该系统还包括:
    CPU监测模块,其内置一映射关系,所述映射关系内包含第一参数、CPU温度值以及CPU使用率,所述第一参数用于表示加载线程的值;
    根据所述第一参数的数值,选择所述第一单元或所述第二单元开启UI更新工作。
  4. 如权利要求1所述的智能加载系统,其特征在于,该系统还包括:
    创建多个所述第二单元,多个所述第二单元均可调用所述子线程 加载器根据所述视图资源进行页面加载并借助所述第一单元进行UI更新。
  5. 一种智能加载方法,其特征在于,该方法包括:
    创建一加载协议,所述加载协议中定义一加载方法,所述加载方法用于接收标记视图资源信息的资源ID,从而获取所述资源ID对应的视图资源;
    创建第一单元以及第二单元,所述第一单元继承所述加载协议,利用所述第一单元调用主线程加载器根据所述视图资源进行页面加载并进行UI更新,利用所述第二单元调用子线程加载器根据所述视图资源进行页面加载并借助所述第一单元进行UI更新。
  6. 如权利要求5所述的智能加载方法,其特征在于,该方法还包括以下步骤:
    创建一处理线程,所述处理线程内构件一处理线程对象,利用所述处理线程借助所述处理线程对象与主线程进行通信;
    利用所述第二单元调用子线程加载器进行页面加载,并借助所述处理线程与所述第一单元通信,进行UI更新。
  7. 如权利要求5所述的智能加载方法,其特征在于,还包括以下步骤:
    创建一映射关系,所述映射关系内包含第一参数、CPU温度值以及CPU使用率,所述第一参数用于表示加载线程的值;
    根据所述第一参数的数值,选择所述第一单元或所述第二单元开启UI更新工作。
  8. 如权利要求5所述的智能加载方法,其特征在于,还包括以下步骤:
    创建多个所述第二单元,多个所述第二单元均可调用所述子线程 加载器根据所述视图资源进行页面加载并借助所述第一单元进行UI更新。
  9. 一种存储介质,其上存储有计算机程序,其特征在于:所述计算机程序被处理器执行时实现上述权利要求5至8中任一项所述方法的步骤。
  10. 一种智能加载设备,包括存储器、处理器及存储在所述存储器上并在所述处理器上运行的计算机程序,其特征在于:所述处理器执行所述计算机程序时实现上述权利要求5至8中任一项所述方法的步骤。
PCT/CN2018/081280 2018-01-09 2018-03-30 一种智能加载系统、方法、存储介质及设备 WO2019136837A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810019601.5 2018-01-09
CN201810019601.5A CN108196929B (zh) 2018-01-09 2018-01-09 一种智能加载系统、方法、存储介质及设备

Publications (1)

Publication Number Publication Date
WO2019136837A1 true WO2019136837A1 (zh) 2019-07-18

Family

ID=62588947

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/081280 WO2019136837A1 (zh) 2018-01-09 2018-03-30 一种智能加载系统、方法、存储介质及设备

Country Status (2)

Country Link
CN (1) CN108196929B (zh)
WO (1) WO2019136837A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110032406B (zh) * 2019-04-16 2022-07-05 武汉斗鱼鱼乐网络科技有限公司 基于消息的视图加载方法、装置、设备和存储介质
CN110347952A (zh) * 2019-07-18 2019-10-18 武汉斗鱼网络科技有限公司 一种打开直播间页面的方法、装置及计算机设备
CN111562913B (zh) * 2020-04-28 2023-03-14 抖音视界有限公司 视图组件的预创建方法、装置、设备及计算机可读介质
CN113590210A (zh) * 2020-04-30 2021-11-02 华为技术有限公司 应用程序中的类验证方法和装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110078703A1 (en) * 2009-09-30 2011-03-31 Sap Ag HTTP Request Preservation
CN103593231A (zh) * 2012-08-14 2014-02-19 腾讯科技(深圳)有限公司 一种数据处理方法、装置及移动终端
CN104834544A (zh) * 2015-05-04 2015-08-12 广州杰赛科技股份有限公司 数据加载方法及装置
CN105183547A (zh) * 2015-08-13 2015-12-23 青岛海信移动通信技术股份有限公司 一种用户界面的任务调度方法和装置
CN106990946A (zh) * 2016-01-21 2017-07-28 阿里巴巴集团控股有限公司 一种界面处理方法、装置和智能终端

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110078703A1 (en) * 2009-09-30 2011-03-31 Sap Ag HTTP Request Preservation
CN103593231A (zh) * 2012-08-14 2014-02-19 腾讯科技(深圳)有限公司 一种数据处理方法、装置及移动终端
CN104834544A (zh) * 2015-05-04 2015-08-12 广州杰赛科技股份有限公司 数据加载方法及装置
CN105183547A (zh) * 2015-08-13 2015-12-23 青岛海信移动通信技术股份有限公司 一种用户界面的任务调度方法和装置
CN106990946A (zh) * 2016-01-21 2017-07-28 阿里巴巴集团控股有限公司 一种界面处理方法、装置和智能终端

Also Published As

Publication number Publication date
CN108196929B (zh) 2020-10-16
CN108196929A (zh) 2018-06-22

Similar Documents

Publication Publication Date Title
WO2019136837A1 (zh) 一种智能加载系统、方法、存储介质及设备
US10452605B2 (en) Method and apparatus for task scheduling on heterogeneous multi-core reconfigurable computing platform
CN108614726B (zh) 虚拟机创建方法及装置
US11861341B2 (en) Node selection method and apparatus
CN105786603B (zh) 一种基于分布式的高并发业务处理系统及方法
Mora et al. Distributed computational model for shared processing on Cyber-Physical System environments
CN105378689B (zh) 用于统一可扩展固件接口(uefi)驱动器和协议的方法和装置
CN111414256B (zh) 基于麒麟移动操作系统的应用程序进程派生方法、系统及介质
CN108809683B (zh) 部署云应用系统的方法及装置
CN111596927B (zh) 服务部署方法、装置及电子设备
WO2021143590A1 (zh) 一种分布式容器镜像构建调度系统及方法
CN109408216A (zh) 任务生成方法、装置、设备及存储介质
CN110347952A (zh) 一种打开直播间页面的方法、装置及计算机设备
CN111953503B (zh) Nfv资源部署编排方法和网络功能虚拟化编排器
CN106354801B (zh) 分布式数据库连接方法和装置
CN109660393B (zh) 一种云主机规格的更新方法及其装置
CN110362356A (zh) 函数数据处理方法、装置、计算机设备和存储介质
EP3737038A1 (en) Method and device for configuring base station
WO2021098257A1 (zh) 一种基于异构计算平台的业务处理方法
CN106874129B (zh) 一种操作系统进程调度顺序确定方法及控制方法
WO2023071291A1 (zh) 一种任务处理方法及电子装置
CN106815061B (zh) 一种业务处理方法及装置
EP4145283A1 (en) Task allocation method and apparatus, electronic device, and computer readable storage medium
CN111475998B (zh) 延迟获取远程资源的电子设计自动化(eda)过程的混合执行
CN101246421A (zh) 一种基于工作流引擎实现的通用框架

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18899535

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18899535

Country of ref document: EP

Kind code of ref document: A1