CN109876453A - A kind of default body optimization method and device - Google Patents

A kind of default body optimization method and device Download PDF

Info

Publication number
CN109876453A
CN109876453A CN201910033320.XA CN201910033320A CN109876453A CN 109876453 A CN109876453 A CN 109876453A CN 201910033320 A CN201910033320 A CN 201910033320A CN 109876453 A CN109876453 A CN 109876453A
Authority
CN
China
Prior art keywords
file
default body
time
load
instantiation
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.)
Pending
Application number
CN201910033320.XA
Other languages
Chinese (zh)
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.)
Zhuhai Xishan Mobile Game Technology Co Ltd
Zhuhai Kingsoft Online Game Technology Co Ltd
Original Assignee
Zhuhai Xishan Mobile Game Technology Co Ltd
Zhuhai Kingsoft Online Game Technology Co 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 Zhuhai Xishan Mobile Game Technology Co Ltd, Zhuhai Kingsoft Online Game Technology Co Ltd filed Critical Zhuhai Xishan Mobile Game Technology Co Ltd
Priority to CN201910033320.XA priority Critical patent/CN109876453A/en
Publication of CN109876453A publication Critical patent/CN109876453A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention relates to a kind of default body optimization method and devices.Wherein method includes step S100) obtain default body file and its file path;S200) statistics loads the load time of the default body file according to the file path;S300 the instantiation time for instantiating the default body file that load is completed) is counted;S400) according to the load time and the instantiation time selected default body file for needing to optimize.Wherein device including memory, processor and stores the computer program that can be run on a memory and on a processor, and the processor realizes the above method step when executing described program.Default body resource all under catalogue is loaded and is instantiated, and counted to its event of consuming using the interface with various operations is written and read to resource by the present invention, provides important clue with instantiation for optimization game resource load.

Description

A kind of default body optimization method and device
Technical field
The present invention relates to a kind of default body optimization method and devices, belong to Advance data quality field.
Background technique
After mobile phone games become mainstream, the severe of game is increasingly heavier, promotes frame rate of game, becomes influence trip One important link of quality of playing.In the game developed using Unity engine, default body (Perfab) is a kind of most common File, and load and the elapsed time of the default body of instantiation are often different in size, bring very big obstruction for the optimization of game.
Summary of the invention
The present invention provides a kind of default body optimization method and device, in view of the drawbacks of the prior art, utilizes AssetDatabase (one is written and read the interface with various operations to resource) can be by default body resource all under catalogue Loaded and instantiated, and its event of consuming is counted, for optimization game resource load with instantiation provide it is important Clue.
Technical solution of the present invention first aspect is a kind of default body optimization method, be the described method comprises the following steps:
S100 default body file and its file path) are obtained;
S200) statistics loads the load time of the default body file according to the file path;
S300 the instantiation time for instantiating the default body file that load is completed) is counted;
S400) according to the load time and the instantiation time selected default body file for needing to optimize.
Further, the step S100 includes:
S110) start editing machine and call search assets method;
S120 default body file and its file path) are obtained by described search assets method.
Further, the step S200 includes:
S210 default body file) is loaded one by one according to the file path;
S220) statistics each presets the body file corresponding load time respectively.
Further, the step S300 includes:
S310 the object for the default body file that load is completed) is obtained;
S320 the object) is subjected to instantiation processing one by one;
S330 statistics each presets the instantiation corresponding instantiation time described in body file.
Further, the step S400 includes:
S410 each default corresponding elapsed time of body file) is obtained, the elapsed time includes load time and reality The exampleization time;
S420 processing) is ranked up according to descending mode to elapsed time;
S430 the forward corresponding default body file of n elapsed time that sorts) is chosen as the default body text for needing to optimize Part.
Further, the method further includes the configuration information and level for obtaining the component for needing the default body file optimized Relationship;Weakening process is carried out to the component according to the configuration information;The component is deleted according to described hierarchical relationship Except processing.
Technical solution of the present invention second aspect is a kind of default body optimization device, comprising:
Module is obtained, for obtaining default body file and its file path;
Load time statistical module, when loading the load of the default body file according to the file path for counting Between;
Time statistical module is instantiated, for counting the example for instantiating the default body file that load is completed Change the time;
File selection module, for according to the load time and the instantiation time selected default body for needing to optimize File.
Further, module is obtained to be also used to execute following steps:
S110) start editing machine and call search assets method;
S120 default body file and its file path) are obtained by described search assets method.
Further, load time statistical module is also used to execute following steps:
S210 default body file) is loaded one by one according to the file path;
S220) statistics each presets the body file corresponding load time respectively.
Further, instantiation time statistical module is also used to execute following steps:
S310 the object for the default body file that load is completed) is obtained;
S320 the object) is subjected to instantiation processing one by one;
S330) statistics each presets the instantiation corresponding instantiation time described in body file.
Further, file selection module is also used to execute following steps:
S410 processing) is ranked up according to descending mode to elapsed time;
S420 the forward corresponding default body file of n elapsed time that sorts) is chosen as the default body text for needing to optimize Part.
Further, file selection module is also used to execute following steps:
Obtain the configuration information and hierarchical relationship for needing the component of the default body file optimized;
Weakening process is carried out to the component according to the configuration information;
Delete processing is carried out to the component according to described hierarchical relationship.
The technical solution of the present invention third aspect is a kind of computer readable storage medium, stores computer journey thereon Sequence, the computer program perform the steps of when being executed by processor
S100 default body file and its file path) are obtained;
S200) statistics loads the load time of the default body file according to the file path;
S300 the instantiation time for instantiating the default body file that load is completed) is counted;
S400) according to the load time and the instantiation time selected default body file for needing to optimize.
Detailed description of the invention
Fig. 1 show overview flow chart according to the method for the present invention;
Fig. 2 is shown in one embodiment of the application, obtains the flow chart of default body file and its file path;
Fig. 3 is shown in one embodiment of the application, counts the flow chart of load time;
Fig. 4 is shown in one embodiment of the application, the flow chart of statistics instantiation time;
Fig. 5 is shown in one embodiment of the application, determines the flow chart for needing the default body file optimized;
Fig. 6 is shown in one embodiment of the application, presets the structure chart of body optimization device.
Specific embodiment
It is carried out below with reference to technical effect of the embodiment and attached drawing to design of the invention, specific structure and generation clear Chu, complete description, to be completely understood by the purpose of the present invention, scheme and effect.
It should be noted that unless otherwise specified, when a certain feature referred to as " fixation ", " connection " are in another feature, It can directly fix, be connected to another feature, and can also fix, be connected to another feature indirectly.In addition, this The descriptions such as the upper and lower, left and right used in open are only the mutual alignment pass relative to each component part of the disclosure in attached drawing For system.The "an" of used singular, " described " and "the" are also intended to including most forms in the disclosure, are removed Non- context clearly expresses other meaning.In addition, unless otherwise defined, all technical and scientific terms used herein It is identical as the normally understood meaning of those skilled in the art.Term used in the description is intended merely to describe herein Specific embodiment is not intended to be limiting of the invention.Term as used herein "and/or" includes one or more relevant The arbitrary combination of listed item.
It will be appreciated that though various elements, but this may be described using term first, second, third, etc. in the disclosure A little elements should not necessarily be limited by these terms.These terms are only used to for same type of element being distinguished from each other out.For example, not departing from In the case where disclosure range, first element can also be referred to as second element, and similarly, second element can also be referred to as One element.The use of provided in this article any and all example or exemplary language (" such as ", " such as ") is intended merely to more Illustrate the embodiment of the present invention well, and unless the context requires otherwise, otherwise the scope of the present invention will not be applied and be limited.
With reference to Fig. 1.It can be used for load and instantiation time by counting default body according to the method for the present invention to obtain Elapsed time determines the default body file for needing to optimize by being ranked up to elapsed time.Method includes the following steps:
S100 default body file and its file path) are obtained;
S200) statistics loads the load time of the default body file according to the file path;
S300 the instantiation time for instantiating the default body file that load is completed) is counted;
S400) according to the load time and the instantiation time selected default body file for needing to optimize.
It further include the flow chart of submethod as shown in Figure 2 in step S100).Such as it can be with:
S110) start editing machine and call search assets method;
S120 default body file and its file path) are obtained by described search assets method.
It is to be understood that obtaining all default body files by AssetDatabase.FindAssets, and record every The file path of a default body file.
It further include the flow chart of submethod as shown in Figure 3 in step S200).Such as it can be with:
S210 default body file) is loaded one by one according to the file path;
S220) statistics each presets the body file corresponding load time respectively.
I.e. according to the file path got above, loaded by AssetDatabase.LoadAssetAtPath pre- If body file, and count its load time.
It further include the flow chart of submethod as shown in Figure 4 in step S300).Such as it can be with:
S310 the object for the default body file that load is completed) is obtained;
S320 the object) is subjected to instantiation processing one by one;
S330) statistics each presets the instantiation corresponding instantiation time described in body file.
The object (Object) that the default body file that will have been loaded above obtains is instantiated, and counts the example Time.
It further include the flow chart of submethod as shown in Figure 5 in step S400).Such as it can be with:
S410 each default corresponding elapsed time of body file) is obtained, the elapsed time includes load time and reality The exampleization time;
S420 processing) is ranked up according to descending mode to elapsed time;
S430 the forward corresponding default body file of n elapsed time that sorts) is chosen as the default body text for needing to optimize Part.
In this step, the configuration information and hierarchical relationship of the component of the available default body file for needing to optimize;Root Weakening process is carried out to the component according to the configuration information;Delete processing is carried out to the component according to described hierarchical relationship. The load time and instantiation time for recording each default body file, the elapsed time of body file is preset as this, will be consumed Time is ranked up processing according to descending mode, i.e. the more forward default body file of ranking needs higher elapsed time.With row For the default body file of name first, it is first determined the component of the default body file, each component have the configuration information (category of component Property) and hierarchical relationship (relationship with other assemblies).Component is handled, reduces some unnecessary hierarchy nodes, and cut The component of some useless unactivated states is subtracted.And then reduce the elapsed time of the default body, that is, it realizes to default body Optimization.
In another embodiment, it is described by taking Mobile phone game as an example:
Step 1: starting unity editing machine searches all default body resource types, its Resources list is obtained.
Step 2: loading default body file one by one according to the Resources list and obtaining its Object object, counts its front and back and disappear Time-consuming.
Step 3: being instantiated to the Object object that above-mentioned load obtains, elapsed time before and after the statistics exampleization.
Step 4: then elapsed time is analyzed and optimized according to descending sort, choose one of UI's here Default body is explained, this UI presets UI component many thousands of of body, and its level is deeper.Therefore, we are to this UI hierarchical relationship is adjusted, and some unnecessary hierarchy nodes are reduced, and reduces some useless unactivated states Component, therefore optimize the later period load with instantiate the time cut down significantly.
Function structure chart referring to Figure 5 presets body and optimizes device in one or more embodiments of the application, It include: to obtain module 51, load time statistical module 52, instantiation time statistical module 53 and file selection module 54.Wherein,
Module 51 is obtained, for obtaining default body file and its file path;
Load time statistical module 52, when loading the load of the default body file according to the file path for counting Between;
Time statistical module 53 is instantiated, for counting the reality for instantiating the default body file that load is completed The exampleization time;
File selection module 54, it is default for being optimized according to the load time and the instantiation time selected needs Body file.
The present invention provides a kind of default body optimization method and device, in view of the drawbacks of the prior art, utilizes AssetDatabase (one is written and read the interface with various operations to resource) can be by default body resource all under catalogue Loaded and instantiated, and its event of consuming is counted, for optimization game resource load with instantiation provide it is important Clue
Further, obtain module and be also used to execute following steps: starting editing machine simultaneously calls search assets method;Pass through Described search assets method obtains default body file and its file path.
Further, load time statistical module is also used to execute following steps: being loaded one by one according to the file path Default body file;Statistics each presets the body file corresponding load time respectively.
Further, instantiation time statistical module is also used to execute following steps: obtaining the described default of load completion The object of body file;The object is subjected to instantiation processing one by one;It is corresponding that statistics each presets instantiation described in body file Instantiate the time.
Further, file selection module is also used to execute following steps: is arranged according to descending mode elapsed time Sequence processing;Choose the default body file that the forward corresponding default body file of n elapsed time that sorts optimizes as needs.
Further, file selection module is also used to execute following steps: obtaining the group for needing the default body file optimized The configuration information and hierarchical relationship of part;Weakening process is carried out to the component according to the configuration information;It is closed according to the level System carries out delete processing to the component.
It should be appreciated that the embodiment of the present invention can be by computer hardware, the combination of hardware and software or by depositing The computer instruction in non-transitory computer-readable memory is stored up to be effected or carried out.Standard volume can be used in the method Journey technology.Each program can be realized with the programming language of level process or object-oriented to communicate with computer system.So And, if desired, the program can be realized with compilation or machine language.Under any circumstance, which can be compiling or explanation Language.In addition, the program can be run on the specific integrated circuit of programming for this purpose.
In addition, the operation of process described herein can be performed in any suitable order, unless herein in addition instruction or Otherwise significantly with contradicted by context.Process described herein (or modification and/or combination thereof) can be held being configured with It executes, and is can be used as jointly on the one or more processors under the control of one or more computer systems of row instruction The code (for example, executable instruction, one or more computer program or one or more application) of execution, by hardware or its group It closes to realize.The computer program includes the multiple instruction that can be performed by one or more processors.
Further, the method can be realized in being operably coupled to suitable any kind of computing platform, wrap Include but be not limited to PC, mini-computer, main frame, work station, network or distributed computing environment, individual or integrated Computer platform or communicated with charged particle tool or other imaging devices etc..Each aspect of the present invention can be to deposit The machine readable code on non-transitory storage medium or equipment is stored up to realize no matter be moveable or be integrated to calculating Platform, such as hard disk, optical reading and/or write-in storage medium, RAM, ROM, so that it can be read by programmable calculator, when Storage medium or equipment can be used for configuration and operation computer to execute process described herein when being read by computer.This Outside, machine readable code, or part thereof can be transmitted by wired or wireless network.When such media include combining microprocessor Or other data processors realize steps described above instruction or program when, invention as described herein including these and other not The non-transitory computer-readable storage media of same type.When methods and techniques according to the present invention programming, the present invention It further include computer itself.
Computer program can be applied to input data to execute function as described herein, to convert input data with life At storing to the output data of nonvolatile memory.Output information can also be applied to one or more output equipments as shown Device.In the preferred embodiment of the invention, the data of conversion indicate physics and tangible object, including the object generated on display Reason and the particular visual of physical objects are described.
The above, only presently preferred embodiments of the present invention, the invention is not limited to above embodiment, as long as It reaches technical effect of the invention with identical means, all within the spirits and principles of the present invention, any modification for being made, Equivalent replacement, improvement etc., should be included within the scope of the present invention.Its technical solution within the scope of the present invention And/or embodiment can have a variety of different modifications and variations.

Claims (8)

1. a kind of default body optimization method, which is characterized in that the described method comprises the following steps:
S100 default body file and its file path) are obtained;
S200) statistics loads the load time of the default body file according to the file path;
S300 the instantiation time for instantiating the default body file that load is completed) is counted;
S400) according to the load time and the instantiation time selected default body file for needing to optimize.
2. the method according to claim 1, wherein the step S100 includes:
S110) start editing machine and call search assets method;
S120 default body file and its file path) are obtained by described search assets method.
3. the method according to claim 1, wherein the step S200 includes:
S210 default body file) is loaded one by one according to the file path;
S220) statistics each presets the body file corresponding load time respectively.
4. according to claim 1 or the method, which is characterized in that the step S300 includes:
S310 the object for the default body file that load is completed) is obtained;
S320 the object) is subjected to instantiation processing one by one;
S330) statistics each presets the instantiation corresponding instantiation time described in body file.
5. according to claim 1 or the method, which is characterized in that the step S400 includes:
Each default corresponding elapsed time of body file is obtained, the elapsed time includes load time and instantiation time;
S410 processing) is ranked up according to descending mode to elapsed time;
S420 the default body file that the forward corresponding default body file of n elapsed time that sorts optimizes as needs) is chosen.
6. according to the method described in claim 5, it is characterized by further comprising:
Obtain the configuration information and hierarchical relationship for needing the component of the default body file optimized;
Weakening process is carried out to the component according to the configuration information;
Delete processing is carried out to the component according to described hierarchical relationship.
7. a kind of default body optimizes device characterized by comprising
Module is obtained, for obtaining default body file and its file path;
Load time statistical module, for counting the load time for loading the default body file according to the file path;
Time statistical module is instantiated, when for counting the instantiation for instantiating the default body file that load is completed Between;
File selection module, for according to the load time and the instantiation the time selected default body text for needing to optimize Part.
8. a kind of computer readable storage medium, is stored thereon with computer instruction, it is characterised in that the instruction is held by processor It realizes when row such as the step of method described in any one of claims 1 to 6.
CN201910033320.XA 2019-01-14 2019-01-14 A kind of default body optimization method and device Pending CN109876453A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910033320.XA CN109876453A (en) 2019-01-14 2019-01-14 A kind of default body optimization method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910033320.XA CN109876453A (en) 2019-01-14 2019-01-14 A kind of default body optimization method and device

Publications (1)

Publication Number Publication Date
CN109876453A true CN109876453A (en) 2019-06-14

Family

ID=66926009

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910033320.XA Pending CN109876453A (en) 2019-01-14 2019-01-14 A kind of default body optimization method and device

Country Status (1)

Country Link
CN (1) CN109876453A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001134622A (en) * 1999-11-02 2001-05-18 Misawa Homes Co Ltd Cad system for prefabricated building
CN104102545A (en) * 2014-07-04 2014-10-15 北京理工大学 Three-dimensional resource allocation and loading optimization method for mobile augmented reality browser
CN108786112A (en) * 2018-04-26 2018-11-13 腾讯科技(上海)有限公司 A kind of application scenarios configuration method, device and storage medium
CN108845802A (en) * 2018-05-15 2018-11-20 天津大学 Unmanned plane cluster formation interactive simulation verifies system and implementation method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001134622A (en) * 1999-11-02 2001-05-18 Misawa Homes Co Ltd Cad system for prefabricated building
CN104102545A (en) * 2014-07-04 2014-10-15 北京理工大学 Three-dimensional resource allocation and loading optimization method for mobile augmented reality browser
CN108786112A (en) * 2018-04-26 2018-11-13 腾讯科技(上海)有限公司 A kind of application scenarios configuration method, device and storage medium
CN108845802A (en) * 2018-05-15 2018-11-20 天津大学 Unmanned plane cluster formation interactive simulation verifies system and implementation method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
FENG: "Unity学习笔记(十):代码动态加载Prefab预设体", 《HTTPS://GAMEINSTITUTE.QQ.COM/COMMUNITY/DETAIL/117975》 *
泰斗社区: "关于资源加载的时间消耗", 《HTTPS://MP.WEIXIN.QQ.COM/S/OJQCTOGCOFCVZ-OGAKF42G》 *

Similar Documents

Publication Publication Date Title
Anderson et al. Studying lean-kanban approach using software process simulation
US20050125401A1 (en) Wizard for usage in real-time aggregation and scoring in an information handling system
US9098497B1 (en) Methods and systems for building a search service application
CN109885310A (en) A kind of method and device reducing mobile phone games Shader module EMS memory occupation
US20080059563A1 (en) Methods and Systems for Automated Data Processing
CN111126019A (en) Report generation method and device based on mode customization and electronic equipment
CN108427709B (en) Multi-source mass data processing system and method
KR102187322B1 (en) System for business rule management
CN110517018A (en) A kind of any jump method of node based on activiti workflow and device
US10901984B2 (en) Enhanced batch updates on records and related records system and method
US8539479B2 (en) System and method for application function consolidation
CN110888628A (en) Method, device, equipment and storage medium for generating control tool
CN110457312A (en) Acquisition method, device, equipment and the readable storage medium storing program for executing of diversiform data
CN110489242A (en) Distributed data calculation method, device, terminal device and storage medium
CN111984882A (en) Data processing method, system and equipment
KR102217937B1 (en) System for business rule management
CN112989775A (en) Report generation method and system
CN115130959B (en) Method, system, terminal and storage medium for generating spare part BOM
CN109876453A (en) A kind of default body optimization method and device
KR102150909B1 (en) System for business rule management
KR102187321B1 (en) System for business rule management
KR102164607B1 (en) System for business rule management
KR102150910B1 (en) System for business rule management
KR102150911B1 (en) System for business rule management
CN110221952B (en) Service data processing method and device and service data processing system

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190614