CN110413282B - Redundant resource processing method, device, equipment and storage medium - Google Patents

Redundant resource processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN110413282B
CN110413282B CN201910707937.5A CN201910707937A CN110413282B CN 110413282 B CN110413282 B CN 110413282B CN 201910707937 A CN201910707937 A CN 201910707937A CN 110413282 B CN110413282 B CN 110413282B
Authority
CN
China
Prior art keywords
resource
resources
redundant
processing
logic codes
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
CN201910707937.5A
Other languages
Chinese (zh)
Other versions
CN110413282A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910707937.5A priority Critical patent/CN110413282B/en
Publication of CN110413282A publication Critical patent/CN110413282A/en
Application granted granted Critical
Publication of CN110413282B publication Critical patent/CN110413282B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/443Optimisation
    • G06F8/4434Reducing the memory space required by the program code
    • G06F8/4435Detection or removal of dead or redundant code

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Stored Programmes (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application discloses a redundant resource processing method, a device, equipment and a storage medium, wherein the method comprises the following steps: acquiring UI resources on a user interface UI; when the UI resource is not referred to by other UI resources and UI logic codes according to the reference relation among the UI resources and the UI logic codes, the UI resource is determined to be a redundant resource, and the redundant resource is deleted. After the UI resource is determined to be unreferenced by other UI resources and UI logic codes, the UI resource is determined to have no relation with other UI resources and is not endowed with any practical purpose by the UI logic codes, so that the UI resource is determined to be a redundant resource without any practical function on the UI, the resource quantity of the UI can be reduced on the premise that the practical function of the UI is not influenced after the redundant resource is deleted, and the time and the memory required for opening the UI subsequently are reduced.

Description

Redundant resource processing method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of user interface development technologies, and in particular, to a method, an apparatus, a device, and a storage medium for processing redundant resources.
Background
For User Interfaces (UIs), developers typically need to develop the UIs using a UI editor (e.g., a FairyGUI).
However, omission or negligence in the UI development process may cause some redundant resources to exist on the UI developed, and these redundant resources may increase the amount of resources of the UI, resulting in an increase in time required for opening the UI later and in memory required. Here, the redundant resource refers to a redundant resource without any actual function on the UI, and for example, the redundant resource may include a UI component without an actual function, a UI picture, and the like.
Disclosure of Invention
The embodiment of the application provides a redundant resource processing method, device, equipment and storage medium, which can automatically delete redundant resources on a UI and reduce the time and memory required by opening the UI later.
In view of this, a first aspect of the present application provides a redundant resource processing method, including:
acquiring UI resources on a user interface UI;
and when the UI resources are not referred to by other UI resources and UI logic codes according to the reference relation among the UI resources and the UI logic codes, determining the UI resources as redundant resources, and deleting the redundant resources.
A second aspect of the present application provides a redundant resource processing apparatus, including:
an acquisition unit configured to acquire UI resources on a user interface UI;
and the processing unit is used for determining the UI resource as a redundant resource and deleting the redundant resource when the UI resource is determined not to be referenced by other UI resources and UI logic codes according to the reference relation among the UI resources and the UI logic codes.
A third aspect of the present application provides an apparatus comprising a processor and a memory:
the memory is used for storing a computer program;
the processor is configured to execute the redundant resource processing method according to the first aspect according to the computer program.
A fourth aspect of the present application provides a computer readable storage medium for storing a computer program for executing the redundant resource processing method described in the first aspect above.
A fifth aspect of the present application provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the redundant resource processing method of the first aspect described above.
From the above technical solutions, the embodiments of the present application have the following advantages:
In the redundant resource processing method provided by the embodiment of the application, after the UI resources on the UI are acquired, whether the UI resources are referenced by other UI resources and UI logic codes is determined according to the reference relation among the UI resources and the UI logic codes. When it is determined that the UI resource is not referred to by other UI resources and UI logic code, the UI resource is determined as a redundant resource, and deletion processing is performed on the redundant resource. Wherein, after the UI resource is determined not to be referenced by other UI resources and UI logic codes, the UI resource can be determined not only to have no relation with other UI resources, but also to have no practical purpose given by the UI logic codes, therefore, the UI resource can be determined to be a redundant resource without any practical function on the UI, after the redundant resource is deleted, the practical function of the UI can not be influenced, the resource quantity of the UI can be reduced, and the time and the memory required for opening the UI later can be reduced.
Drawings
Fig. 1 is a schematic diagram of an application scenario of a redundant resource processing method provided in an embodiment of the present application;
fig. 2 is a schematic diagram of another application scenario of the redundant resource processing method provided in the embodiment of the present application;
FIG. 3 is a flowchart of a redundant resource processing method according to an embodiment of the present application;
FIG. 4 is a flowchart of a redundant resource processing method according to an embodiment of the present application;
fig. 5 is a schematic diagram of a UI provided in an embodiment of the present application;
fig. 6 is a schematic structural diagram of a redundant resource processing device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of another redundant resource processing apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a terminal device according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will clearly and completely describe the technical solution in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The terms "first," "second," "third," "fourth" and the like in the description and in the claims of this application and in the above-described figures, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In the related art, for a UI developed, a developer manually queries a redundant resource on the UI in a UI editor, so that the developer manually deletes the redundant resource. Because the manual processing process of the redundant resources consumes longer time and is easy to miss the redundant resources in the query process, the manual processing process of the redundant resources not only causes the waste of human resources, but also easily causes the increase of time and memory required for opening the UI later due to incomplete deletion of the redundant resources.
Aiming at the technical problems in the background technology and the related technology, the embodiment of the application provides a redundant resource processing method, which can not only delete the redundant resources on the UI, reduce the time and the memory required by the subsequent opening of the UI, but also automatically identify and delete the redundant resources, avoid the waste of manpower resources, and can also completely identify the redundant resources on the UI, thereby avoiding incomplete deletion of the redundant resources caused by omission of the redundant resources in the query process.
Specifically, in the redundant resource processing method provided by the embodiment of the present application, UI resources on a user interface UI are obtained; judging whether the UI resource is referenced by other UI resources and UI logic codes according to the reference relation among the UI resources and the UI logic codes; and if the UI resource is not referred to by other UI resources and UI logic codes, determining the UI resource as a redundant resource, and deleting the redundant resource.
In the method for processing the redundant resources provided by the embodiment of the application, after the obtained UI resource is determined not to be referenced by other UI resources and UI logic codes, the UI resource can be determined to have no relation with other UI resources, and the UI resource is not endowed with any practical use by the UI logic codes, so that the UI resource can be determined to be the redundant resource without any practical function on the UI, the practical function of the UI can not be influenced after the deletion processing is performed on the redundant resource, the resource quantity of the UI can be reduced, and the time and the memory required for opening the UI later can be reduced. In addition, the identification process of the redundant resources and the deletion processing process of the redundant resources are automatically executed, manual participation is not needed, and waste of human resources is avoided. In addition, the identification process of the redundant resources can cover all UI resources on the UI, so that the redundant resources on the UI can be completely identified, and incomplete deletion of the redundant resources caused by omission of the redundant resources in the query process is avoided.
It should be understood that the redundant resource processing method provided in the embodiments of the present application may be applied to a data processing device, such as a terminal device, a server, and the like; the terminal equipment can be a smart phone, a computer, a Personal digital assistant (Personal DigitalAssitant, PDA), a tablet Personal computer and the like; the server can be an application server or a Web server, and can be an independent server or a cluster server in actual deployment.
If the method for processing the redundant resources provided in the embodiment of the present application is executed by the terminal device, the terminal device may directly perform the process of identifying and deleting the redundant resources according to the UI and the UI related information (for example, the UI related information may include a reference relationship between UI resources, a UI logic code, and the like) in the local storage space. Therefore, the terminal equipment executes the redundant resource processing method, the identification and deletion processing of the redundant resources can be periodically performed, and the identification and deletion processing of the redundant resources can be further performed in real time, so that the redundant resources can be timely found and deleted, and the time and the memory required for opening the UI due to the existence of the redundant resources on the UI are prevented from being increased. If the method for processing the redundant resources is executed by the server, the server firstly performs identification and deletion processing of the redundant resources according to the UI uploaded by the terminal equipment and the UI related information, and then sends the processed UI to the terminal equipment so that the terminal equipment updates the local UI of the terminal equipment according to the received processed UI.
In order to facilitate understanding of the technical solution provided in the embodiments of the present application, an application scenario to which the redundant resource processing method provided in the embodiments of the present application is applicable is described in the following by taking, as an example, application of the redundant resource processing method provided in the embodiments of the present application to a terminal device in conjunction with fig. 1. Fig. 1 is a schematic diagram of an application scenario of a redundant resource processing method according to an embodiment of the present application.
As shown in fig. 1, the application scenario includes: a terminal device 101 and a user 102; the terminal device 101 is configured to display a UI to the user 102; the terminal device 101 is further configured to perform the redundant resource processing method provided in the embodiment of the present application.
The terminal device 101 acquires the UI resource on the UI first, and then determines whether the UI resource is referenced by other UI resources and UI logic codes according to the reference relationship between the UI resources and the UI logic codes. And when the UI resource is not referred to by other UI resources and UI logic codes, determining the UI resource as a redundant resource, and deleting the redundant resource. So that the terminal device 101 can display the processed UI so that the user 102 can view the processed UI.
It should be understood that, in practical application, the method for processing redundant resources provided in the embodiments of the present application may also be applied to a server, and refer to fig. 2, which is another application scenario schematic diagram of the method for processing redundant resources provided in the embodiments of the present application. As shown in fig. 2, the server 201 can perform redundant resource processing according to the UI and the UI related information transmitted by the terminal device 202, and transmit the processed UI to the terminal device 202, so that the terminal device 202 can update the local UI according to the processed UI, and display the updated local UI to the user 203. The server 201 performs redundant resource processing according to the UI and the UI related information, which may specifically be: the server 201 acquires the UI resources on the UI first, and then determines whether the UI resources are referenced by other UI resources and UI logic codes according to the reference relationship between the UI resources and the UI logic codes. When the UI resource is determined not to be referenced by other UI resources and UI logic codes, the UI resource is determined to be a redundant resource, and the redundant resource is deleted so as to obtain a processed UI.
It should be understood that the application scenarios shown in fig. 1 and fig. 2 are only examples, and in practical applications, the redundant resource processing method provided in the embodiments of the present application may also be applied to other application scenarios where redundant resources need to be processed, and the redundant resource processing method provided in the embodiments of the present application is not limited in any way.
The redundant resource processing method provided by the application is described below through an embodiment.
Method embodiment one
Referring to fig. 3, a flowchart of a redundant resource processing method according to an embodiment of the present application is provided.
The redundant resource processing method provided by the embodiment of the application comprises the following steps of S301-S302:
s301: UI resources on the user interface UI are acquired.
UI resources refer to resources used to compose a user interface. For example, the UI resource may include at least one of a UI component and a UI picture.
In the embodiment of the present application, different types of UI resources may adopt different acquisition manners, and are described below with reference to two examples.
As a first example, when the UI resource includes a UI component, S301 may specifically be: and retrieving the attribute file corresponding to the UI to acquire the UI component on the UI.
Wherein, the UI components have a one-to-one correspondence with the property files, that is, each UI component corresponds to one property file; further, the property file is used to record property information of the corresponding UI component. The attribute information may include at least one attribute. For example, the attribute information may include at least one of location information, shape information, reference relationship information between components and other UI resources, and the like.
It should be noted that the embodiments of the present application are not limited to a specific implementation manner of the attribute file, and for example, the attribute file may be an extensible markup language (Extensible Markup Language, XML) file.
As a second example, when the UI resource includes a UI picture, S301 may specifically be: and acquiring the UI picture from the UI package.
Wherein the UI package is for recording individual UI resources on the at least one UI. For example, one UI package may be used to record individual UI resources on a first user interface and individual UI resources on a second user interface.
It should be noted that, the embodiments of the present application are not limited to specific implementations of the UI package, and for example, the UI package may be a folder.
It should be further noted that, in one possible implementation manner, the UI package may further include: and attribute files corresponding to the UI components.
S302: when the UI resource is not referred to by other UI resources and UI logic codes according to the reference relation among the UI resources and the UI logic codes, the UI resource is determined to be a redundant resource, and the redundant resource is deleted.
In the embodiment of the present application, references may be made between different UI resources, which specifically are: references can be made between UI resources of the same type, e.g., references can be made between different UI components; moreover, references can also be made between different types of UI resources, for example, between UI components and UI pictures. In addition, the reference relation between UI resources is used for recording the reference information between different resources; moreover, embodiments of the present application are not limited to specific implementations of reference relationships between UI resources. For example, the reference relationships between different components may be recorded using a property file; the reference relationship between the UI component and the UI picture may be recorded by using a UI table or by using a property file.
In the embodiment of the application, the UI logic code can endow corresponding purposes for the UI resources by referring to the UI resources. For example, UI logic code may assign corresponding uses to UI components and/or UI pictures when using the UI components and/or UI pictures.
In addition, in order to facilitate understanding and explanation of S302, description will be made below in connection with three embodiments of S302.
In a first embodiment, S302 may specifically include steps S302A1-S302A4:
s302A1: judging whether the UI resource is referenced by other UI resources and UI logic codes according to the reference relation among the UI resources and the UI logic codes, if so, executing step S302A2; if not, steps S302A3-S302A4 are performed.
In the embodiment of the application, if the UI resource is referred to by other UI resources, it indicates that the other UI resources on the UI use the UI resource, so that the function of the UI resource on the UI is not isolated, and thus, it may be determined that the UI resource is a non-redundant resource. If the UI resource is referenced by the UI logic code, it means that the UI resource is used in the UI logic code such that the UI resource has the purpose given by the UI logic code, and thus, it can be determined that the UI resource is a non-redundant resource. If the UI resource is neither referenced by other UI resources nor by UI logic code, it indicates that the UI resource is orphaned in function on the UI, and the UI logic code does not make any use of the UI resource, so that the UI resource is optional on the UI, and thus, it can be determined that the UI resource is a redundant resource.
In the embodiment of the present application, the execution order between the execution of the action "determine whether the UI resource is referenced by another UI resource" and the execution of the action "determine whether the UI resource is referenced by UI logic code" is not limited, and the former may be executed before the latter, the latter may be executed before the former, or both may be executed simultaneously.
S302A2: the UI resource is determined to be a non-redundant resource.
In the embodiment of the application, when the UI resource is determined to be a non-redundant resource, the UI resource is indicated to be an indispensable resource on the UI, and at this time, no processing is required for the UI resource.
S302A3: the UI resource is determined to be a redundant resource.
In the embodiment of the present application, when the UI resource is determined to be a redundant resource, it indicates that the UI resource is a deletable resource on the UI, and at this time, deletion processing may be performed on the UI resource.
S302A4: and deleting the redundant resource.
In the embodiment of the application, after the UI resource is determined to be a redundant resource, the UI resource may be directly deleted, so that the UI resource is no longer included on the UI.
In addition, in some application scenarios, in order to better perform the processing of the redundant resource, the deletion processing may be performed on the redundant resource by the specific processing object, and thus, the present application further provides a specific embodiment of S302A4, where S302A4 may specifically include steps S302a41-S302a42:
S302a41: and determining the UI package to which the redundant resource belongs.
In this embodiment of the present application, different UI resources may belong to different UI packages or may belong to the same UI package, and different UI packages may correspond to different processing objects or may correspond to the same processing object, so, to be able to determine a processing object corresponding to a redundant resource, a UI package to which the redundant resource belongs may be determined first, so that a processing object responsible for processing the redundant resource can be determined according to the UI package later.
In addition, in the embodiment of the present application, the UI packet to which the redundant resource belongs may be determined in various manners, and an embodiment of S302a41 will be described below as an example.
As an embodiment, S302a41 may specifically be: and determining the UI package to which the redundant resource belongs according to the identification of the redundant resource.
The identification of the redundant resource can uniquely mark the redundant resource; moreover, embodiments of the present application are not limited to the representation of the identification of the redundant resources, for example, the identification of the redundant resources may be a name, a number, a symbol, or the like.
In the above embodiment, after determining that the UI resource is a redundant resource, a UI packet to which the redundant resource belongs needs to be determined according to the identifier of the redundant resource, so that a target object responsible for processing the redundant resource can be determined according to the UI packet later.
In addition, in the embodiment of the present application, for different types of redundant resources, different implementations may be adopted in step S302a41, and for convenience of understanding and explanation, the following description is made with reference to two examples.
As a first example, when the redundant resource includes a UI component, S302a41 may specifically be: firstly, obtaining an attribute file of a redundant resource; then, from the property file, a UI package to which the redundant resource belongs is determined.
In the first example, since the UI package may include the attribute file corresponding to the UI component, and the UI component has a one-to-one correspondence with the attribute file, when determining the UI package to which the UI component belongs, the attribute file corresponding to the UI component may be acquired first, so as to determine the UI package to which the UI component belongs according to the attribute file corresponding to the UI component.
When the UI package is a folder, the property file corresponding to the UI component is stored under the UI package folder to which the UI component belongs.
Note that, the relevant content of the attribute file refers to the relevant content of the "attribute file" recorded in step S301.
It should be further noted that, in some application scenarios, when the correspondence between the UI component and the property file is recorded by means of the identifier of the UI component, that is, the identifier of the UI component and the property file have a one-to-one correspondence, S302a41 may specifically be: firstly, obtaining an attribute file of a redundant resource according to the identification of the redundant resource; then, from the property file, a UI package to which the redundant resource belongs is determined.
As a second example, when the redundant resource includes a UI picture, S302a41 may specifically be: and determining the UI included in the UI picture according to the identification of the UI picture.
In the second example, since the UI package may include the UI picture, when determining the UI package to which the UI picture belongs, the UI package to which the UI picture belongs may be determined directly from the identification of the UI picture.
When the UI package is a folder, the UI picture is stored under the UI package folder to which the UI picture belongs.
S302a42: and obtaining a target object according to the UI package and the corresponding relation between the UI package and the processing object so as to delete the redundant resource by the target object.
In the embodiment of the present application, the correspondence between the UI package and the processing object is used to record the correspondence between the UI package and the processing object responsible for processing the UI package, and the embodiment of the present application does not limit the correspondence between the UI package and the processing object. For example, the UI packages and the processing objects may have a one-to-one correspondence, a one-to-many correspondence, or a many-to-one correspondence.
In addition, the embodiment of the present application is not limited to the specific implementation manner of the processing object, for example, if step S302a42 is performed on the terminal device (or the server), the processing object may be any other processing module on the terminal device (or the server) capable of processing the redundant resource; the processing object may be any other processing device (e.g., a terminal device, a server, etc.) capable of processing the redundant resource; the processing object may also be a user (e.g., a UI developer, a UI tester, etc.) that is able to process the redundant resource.
Based on this, for different processing objects, step S302a42 may employ different embodiments, and is described below in conjunction with three examples.
As a first example, when step S302a42 is performed in an execution module of the terminal device (or the server), and the target object is the first processing module, then step S302a42 may specifically be: in a terminal device (or a server), an execution module obtains a target object as a first processing module according to the UI package and the corresponding relation between the UI package and the processing object; the execution module sends the redundant resource to the first processing module for deletion processing of the redundant resource by the first processing module.
As a second example, when step S302a42 is performed on the first device and the target object is the second device, then step S302a42 may specifically be: the first device obtains a target object as a second device according to the UI package and the corresponding relation between the UI package and the processing object; the first device sends the redundant resource to the second device for deletion processing of the redundant resource by the second device.
As a third example, when step S302a42 is performed on the first device and the target object is the first developer, then step S302a42 may specifically be: the first device obtains a target object as a first developer according to the UI package and the corresponding relation between the UI package and the processing object; the first device displays the redundant resource to the first developer in a particular manner for deletion processing of the redundant resource by the first developer.
The specific embodiment of step S302a42 is described above by taking three examples as an example, however, in the embodiment of the present application, step S302a42 may also be another embodiment, and will be described in sequence below.
In some application scenarios, in order to improve the processing efficiency of the redundant resources, deletion processing may be performed on at least one redundant resource in the UI package at the same time, and thus, the present application further provides an embodiment of step S302a42, where step S302a42 specifically includes: and generating a resource processing list according to at least one redundant resource in the UI package, and sending the resource processing list to the target object so that the target object can delete the redundant resource according to the resource processing list.
The resource processing list is used for recording at least one redundant resource in the UI package, and the resource processing list and the target object have a corresponding relation.
It should be noted that, in the embodiment of the present application, the correspondence between the resource processing list and the target object is not limited, and the resource processing list and the target object may be in one-to-one correspondence, one-to-many, or many-to-one.
In order to facilitate understanding and explanation of the above-described embodiment of S302a42, description is made below in connection with an example.
As an example, when N redundant resources exist in the UI packet and m+.n, S302a42 may specifically be: firstly, M redundant resources in a UI packet are acquired; generating a resource processing list according to M redundant resources in the UI packet so as to enable the resource processing list to record the M redundant resources; and then the resource processing list is sent to the target object, so that the target object can delete the redundant resources according to the resource processing list.
In the above examples, the embodiment of the present application is not limited to the value of M, and M may be preset or may be set according to the actual application scenario.
In the first embodiment of step S302, the reference relationship between UI resources and the UI logic code are utilized to screen the UI resources to obtain redundant resources that are not referenced by other UI resources and the UI logic code, and delete the redundant resources, so that deleting the redundant resources without affecting the actual function of the UI can reduce the amount of resources of the UI, thereby reducing the time and the memory required for opening the UI later.
In addition, in order to improve the processing efficiency of the redundant resources, the redundant resources may be deleted according to the resource type, and the processing procedure may be: when the redundant resources comprise the 1 st type of redundant resources to the T type of redundant resources, deleting the 1 st type of redundant resources; based on the processing result, deleting the 2 nd type redundant resource; based on the processing result, deleting the 3 rd type redundant resources; … … (and so on); and based on the processing result after the T-1 type redundant resource is deleted, the T type redundant resource is deleted. Therefore, the deleting process of each type of redundant resource is executed based on the processing results of other types of redundant resources before the current type, so that the deleting process of the current type of redundant resource can delete the original current type of redundant resource on the UI, and can delete the current type of redundant resource newly generated after the deleting process of the other types of redundant resource before the current type, thereby improving the efficiency of deleting the current type of redundant resource and further improving the processing efficiency of the redundant resource. Based on this, the present application provides a second embodiment of step S302, and, for convenience of understanding and explanation of the embodiment, a process procedure including two types of UI resources is described below as an example.
As a second embodiment of S302, when the UI resources include the first type UI resource and the second type UI resource, S302 may specifically include S302B1 to S302B2:
S302B1: when the first type UI resource is not referred to by other UI resources and UI logic codes according to the reference relation among the UI resources and the UI logic codes, the first type UI resource is determined to be a redundant resource, and the redundant resource is deleted.
The first type of UI resource may be any type of UI resource, e.g., the first type of UI resource may be a UI component.
It should be noted that, the step S302B1 may be implemented by any one of the embodiments provided in the first embodiment of the step S302, and only the "UI resource (i.e., the UI resource obtained in the step S301)" in any one of the embodiments provided in the first embodiment of the step S302 needs to be replaced by the "first type UI resource", and for details of the technology, please refer to the relevant content of the first embodiment of the step S302, and for brevity, description thereof is omitted herein.
S302B2: and when the second type UI resource is not referred to by other UI resources and UI logic codes according to the reference relation among the UI resources and the UI logic codes, determining the second type UI resource as a redundant resource, and deleting the redundant resource.
The second type of UI resource may be any other type of UI resource among the UI resources other than the first type of UI resource, for example, when the first type of UI resource is a UI component, the second type of UI resource may be a UI picture.
It should be noted that, the step S302B2 may be implemented by any one of the embodiments provided in the first embodiment of the step S302, and only the "UI resource (i.e., the UI resource obtained in the step S301)" in any one of the embodiments provided in the first embodiment of the step S302 needs to be replaced by the "second type UI resource", and the technical details thereof refer to the relevant content of the first embodiment of the step S302, which is not described herein for brevity.
The second embodiment of step S302 is described above by taking the example that the UI resources include the first type UI resource and the second type UI resource. However, in the embodiment of the present application, the UI resource may include at least one type of UI resource, and the processing procedure of the UI resource is similar to that provided in the foregoing embodiment, and will not be described herein for brevity.
In the second embodiment of step S302, by performing the deletion processing on the redundant resources according to the resource types, the deletion processing process of each type of redundant resources not only can perform the deletion processing on the original current type of redundant resources on the UI, but also can perform the deletion processing on the current type of redundant resources newly generated after the deletion processing on the other types of redundant resources before the current type, so that the efficiency of the deletion processing on the current type of redundant resources is improved, thereby improving the processing efficiency of the redundant resources.
In addition, in some application scenarios, since some UI resources without actual functions have special purposes, so that these UI resources with special purposes cannot be deleted, in order to be able to protect these UI resources with special purposes from being deleted, these UI resources with special purposes may be added to a resource whitelist, so that these UI resources with special purposes are protected by using the resource whitelist. Thus, based on the first and second embodiments of step S302 described above, the present application further provides a third embodiment of step S302, where S302 may specifically be: and when the UI resource is determined not to be referenced by other UI resources and UI logic codes according to the reference relation among the UI resources, the UI logic codes and the resource white list, and the UI resource is not in the resource white list, determining that the UI resource is a redundant resource.
Wherein the resource whitelist is used to record non-redundant resources. That is, if the UI resource is recorded in the resource whitelist, it is determined that the UI resource is certainly not a redundant resource.
In order to facilitate understanding and explanation of the third embodiment of step S302, the following description will be made in connection with each execution action.
In particular implementations, the third embodiment of S302 specifically includes steps S302C1-S302C4:
S302C1: judging whether the UI resources meet preset conditions according to the reference relation among the UI resources, the UI logic codes and the resource white list, and if yes, executing step S302C2; if not, go to steps S302C3-S302C4.
Wherein, satisfying the preset condition means satisfying at least one of the following three conditions, and the three conditions include: UI resources are referenced by other UI resources, UI resources are referenced by UI logic code, and UI resources are in a resource whitelist.
In the embodiment of the present application, if the UI resource is in the resource white list, it indicates that the UI resource is a resource protected by the resource white list, so that the UI resource cannot be determined as a redundant resource, and thus, it may be determined that the UI resource is a non-redundant resource.
In the embodiment of the present application, the technical details of the action "determine whether the UI resource is referred to by other UI resources and UI logic codes" is performed, and reference is made to step S302A1 in the first embodiment of S302.
In the embodiment of the present application, the execution order between the first execution action of "determining whether the UI resource is in the resource whitelist", the second execution action of "determining whether the UI resource is referenced by other UI resources", and the third execution action of "determining whether the UI resource is referenced by UI logic code" is not limited. For example, the first execution action, the second execution action, and the third execution action may be executed sequentially, or the second execution action, the first execution action, and the third execution action may be executed sequentially, … … (may be executed sequentially in other execution orders); further, at least one of the first execution action, the second execution action, and the third execution action may be executed at the same time.
S302C2: the UI resource is determined to be a non-redundant resource.
S302C3: the UI resource is determined to be a redundant resource.
S302C4: and deleting the redundant resource.
It should be noted that steps S302C2-S302C4 are the same as steps S302A2-S302A4 in the first embodiment of S302, and reference is made to steps S302A2-S302A4 for technical details.
In the third embodiment of step S302 provided above, by adding the action of "determining whether the UI resource is on the resource whitelist", the resource whitelist can protect the UI resource with special use, and avoid deleting the UI resource with special use as the redundant resource, so as to better realize deleting the redundant resource without affecting the actual function of the UI.
In addition, in order to ensure that the resource white list can better protect UI resources with special purposes, the resource white list can be updated according to undeleted redundant resources. Based on this, another embodiment of the method for processing a redundant resource provided in the present application may further include step S303 in addition to steps S301 and S302, and step S303 is specifically: and acquiring undeleted redundant resources, and adding the undeleted redundant resources to a resource white list.
The embodiment of the present application does not limit the manner of obtaining the undeleted redundant resources, and for convenience of understanding and explanation, the following description is made with reference to two examples.
As a first example, the acquisition procedure of the undeleted redundant resource is specifically: judging whether the redundant resource is on the UI, if so, determining that the redundant resource is undeleted, and taking the redundant resource as the undeleted redundant resource; if not, determining that the redundant resource is deleted.
In the first example, if after a preset time after the execution of the action "delete processing of redundant resources" is completed, it is determined whether the redundant resources are on the UI. When the redundant resource is on the UI, determining that the redundant resource is not deleted, and taking the redundant resource as the undeleted redundant resource; when the redundant resource is not on the UI, then it is determined that the redundant resource has been deleted.
As a second example, when the target object is used to perform the action of "delete processing of redundant resources", the acquisition procedure of undeleted redundant resources is specifically: and after receiving a non-redundant resource list comprising non-deleted redundant resources, which is sent by the target object, acquiring the non-deleted redundant resources according to the non-redundant resource list, and adding the non-deleted redundant resources to the resource white list.
Note that, for the technical details of the "target object" in the second example, please refer to the content related to the "target object" in the above-mentioned step S302a 42.
In another embodiment of the method for processing the redundant resources, the method for updating the resource whitelist by using undeleted redundant resources enables the resource whitelist to provide protection for the UI resources with special purposes more accurately, so that deleting the UI resources with special purposes as the redundant resources is better avoided, and deleting of the redundant resources is better achieved on the premise that actual functions of the UI are not affected.
In addition, in some application scenarios, the deletion of some redundant resources can lead to the creation of some new redundant resources (e.g., some UI resources referenced by the redundant resources may become redundant resources when the redundant resources are deleted). Thus, in order to delete redundant resources on the UI as much as possible, the loop processing of the redundant resources can be performed on the UI. Therefore, based on any one of the embodiments of the method for processing a redundant resource provided above, the present application further provides another embodiment of the method for processing a redundant resource, where the method for processing a redundant resource includes, in addition to the steps S301 to S302 or the steps S301 to S303, the step S304: and when the number of the redundant resources exceeds the preset number threshold, continuing to execute the action of acquiring the UI resources on the user interface UI.
The preset number of thresholds may be preset, and may be set according to an application scenario. For example, the preset number threshold may be set to 0 or other value.
In this embodiment, after deleting the redundant resources, it is first determined whether the number of the redundant resources exceeds a preset number threshold, if yes, the number of the redundant resources on the UI is larger, and the processing procedure of the redundant resources still needs to be executed again on the UI; if not, the number of redundant resources on the UI is small (even none), and the small redundant resources can be ignored, so that the processing procedure of the redundant resources is not needed to be executed again on the UI.
In still another embodiment of the above-mentioned method for processing redundant resources, by performing a redundant resource processing procedure on the UI in a cyclic manner, new redundant resources generated by deleting the redundant resources can be deleted, so that the redundant resources are deleted as much as possible without affecting the actual functions of the UI, thereby reducing the amount of resources of the UI, and further reducing the time and the memory required for opening the UI subsequently.
In any implementation manner of the redundant resource processing method provided in the first embodiment of the method, after the UI resource on the UI is acquired, it is determined whether the UI resource is referenced by other UI resources and UI logic codes according to the reference relationship between the UI resources and the UI logic codes. When it is determined that the UI resource is not referred to by other UI resources and UI logic code, the UI resource is determined as a redundant resource, and deletion processing is performed on the redundant resource. Wherein, after the UI resource is determined not to be referenced by other UI resources and UI logic codes, the UI resource can be determined not only to have no relation with other UI resources, but also to have no practical purpose given by the UI logic codes, therefore, the UI resource can be determined to be a redundant resource without any practical function on the UI, after the redundant resource is deleted, the practical function of the UI can not be influenced, the resource quantity of the UI can be reduced, and the time and the memory required for opening the UI later can be reduced.
It should be noted that, the redundant resource processing method provided in the foregoing method embodiment may be executed on a terminal device, or may be executed on a server, or may be executed on another data processing device, which is not specifically limited in this application.
In order to facilitate further understanding of the redundant resource processing method provided in the embodiments of the present application, a second method embodiment will be described in detail with reference to fig. 4 and fig. 5.
Method embodiment II
The second embodiment of the method is an improvement based on the first embodiment of the method, and for brevity, the content of the second embodiment of the method is the same as that of the first embodiment of the method, and the technical details of the same portion will not be described herein again, and reference is made to the related content in the first embodiment of the method.
Referring to fig. 4, the flowchart of the redundant resource processing method provided in the embodiment of the present application is shown; referring to fig. 5, a schematic UI provided in an embodiment of the present application is shown.
The redundant resource processing method provided by the embodiment of the application comprises the following steps of S401-S415:
s401: and acquiring each UI component on the UI by retrieving each attribute file corresponding to the UI.
The source of the UI is not limited in the embodiments of the present application, and for example, the UI may be from a game system, and in this case, the UI may be a game interface as shown in fig. 5.
The type of UI component is not limited in the embodiments of the present application, and UI component may refer to any component that can be controlled or used. For example, on the UI shown in fig. 5, the "detailed information" component 501, the "add friends" component 502, the "space" component 503, the "return" component 504, … … (other UI components in fig. 5 are not listed here one by one for brevity) that can be controlled or used are UI components.
Since a plurality of UIs may be included in one game system, when redundant resource processing is performed on the entire game system, redundant resource processing may be performed simultaneously on a plurality of UIs (even on all UIs). As an example, when the game system includes X UIs, and y+.x, then S401 may specifically be: and acquiring each UI component on the UI by retrieving each attribute file corresponding to Y UIs in the game system.
It should be further noted that, since the same redundant resource processing means may be adopted for each UI in the game system in the embodiment of the present application, for ease of understanding and explanation, the following description will be made with the UI shown in fig. 5 as an example.
It should also be noted that, in the embodiment of the present application, the attribute file has a one-to-one correspondence with the UI components, and the attribute file is used to record the color, shape, location of the corresponding UI component, a reference relationship with other UI components, a reference relationship with the UI picture, and the like.
S402: traversing each UI component, screening out each UI component meeting the first screening condition, and storing each screened UI component into a first list. Wherein the first screening conditions include: the UI component is not referenced in the properties file of other UI components, and the UI component is not in the component whitelist.
As an example, the "detailed information" component 501, the "add friends" component 502, the "space" component 503, the "return" component 504, … … (other UI components on the UI shown in fig. 5) are included on the UI shown in fig. 5, and assuming that the "add friends" component 502, the "space" component 503, and the "return" component 504 each satisfy the first filtering condition, S402 may specifically be: traversing all UI components on the UI shown in FIG. 5, screening out all UI components meeting the first screening condition, obtaining an "Add friends" component 502, a "space" component 503 and a "return" component 504, and storing the screened "Add friends" component 502, the "space" component 503 and the "return" component 504 into a first list.
It should be noted that the component whitelist is used for recording non-redundant components; and the component white list can protect each non-redundant component recorded in the component white list and avoid deleting the non-redundant component recorded in the component white list.
In the embodiment of the present application, the execution order between the execution of the action "determine whether the UI component is in the component whitelist" and the execution of the action "determine whether the UI component is referenced in the property file of the other UI component" is not limited, and the former may be executed before the latter, the latter may be executed before the former, or both may be executed simultaneously.
In this embodiment, the selected UI components may be stored in the first list, or the identifiers of the selected UI components may be stored in the first list. Wherein the identification of the UI component is used to uniquely identify the UI component.
S403: traversing all UI components in the first list, screening out all UI components meeting the second screening condition as all redundant components, and storing all the redundant components in the second list. Wherein the second screening conditions include: the UI component is not used in the UI logic code and the UI component is not used in the UI table.
As an example, based on the content illustrated in step S402, and assuming that the "space" component 503 and the "return" component 504 both satisfy the second filtering condition, S403 may specifically be: traversing the 'Add friends' component 502, the 'space' component 503 and the 'return' component 504, screening out all UI components meeting the second screening conditions, and obtaining the 'space' component 503 and the 'return' component 504; the "space" component 503 and the "return" component 504 are both redundant components, and both the "space" component 503 and the "return" component 504 are stored into the second list.
It should be noted that the UI table is used to record the correspondence between the UI components and the UI pictures.
In the embodiment of the present application, the execution order between the execution of the action "determine whether the UI component is used in the UI logic code" and the execution of the action "determine whether the UI component is used in the UI table" is not limited, and the former may be executed before the latter, the latter may be executed before the former, or both may be executed simultaneously.
In this embodiment, each redundant component may be stored in the second list, or the identifier of each redundant component may be stored in the second list.
S404: traversing each redundant component in the second list, acquiring the attribute files of each redundant component, and determining the UI package to which each redundant component belongs according to the attribute files of each redundant component.
S405: and according to the UI package of each redundant component, inquiring by utilizing the corresponding relation between the UI package and the processing object, and determining the processing object corresponding to each redundant component.
S406: generating redundant component orders corresponding to all the processing objects according to all the redundant components and the processing objects corresponding to all the redundant components, and sending the redundant component orders corresponding to all the processing objects so that all the processing objects acquire all the useless components according to the received redundant component orders and delete all the useless components.
It should be noted that, in this embodiment, the redundant components corresponding to each processing object may be sent to each processing object in a preset manner; the preset mode can be preset, and particularly can be set according to application scenes. For example, the preset manner may be an application program interface (ApplicationProgramming Interface, API) interface of a quick development collaboration platform (Tencent Agile Product Development, TAPD) for communication; in addition, the preset mode can be other interfaces capable of realizing order sending.
The useless component is a redundant component confirmed by the processing object. In some application scenarios, some UI components (e.g., the "space" component 503 in fig. 5) on the UI do not have any actual functions at the present time, but these UI components may need to remain in order to be given to these UI components actual functions in the UI development process later, at which time, in order to be able to protect these UI components that will be given actual functions in the future from being deleted, the received redundant components may be validated by the processing object to take these UI components that will be given actual functions in the future as useful components, avoiding deletion processing of these UI components that will be given actual functions in the future.
S407: judging whether the total number of redundant components in the second list exceeds a first number threshold, if so, executing step S401; if not, step S408 is performed.
It should be noted that the first number threshold may be preset, and may be especially set according to an application scenario. For example, the first number threshold may be preset to 0.
S408: traversing each UI picture in each UI package and storing each UI picture in a third list.
The presentation form of the UI picture is not limited in the embodiment of the present application, specifically: the UI picture may be any image capable of providing information on the UI, for example, the UI picture may be the user avatar 505 on the UI shown in fig. 5, the chat background image 506, or any other image capable of providing information.
In this embodiment, the UI picture may be stored in the third list, or the identifier of the UI picture may be stored in the third list. Wherein the identification of the UI picture is used to uniquely and definitively mark the UI picture.
S409: traversing all UI pictures in the third list, screening out all UI pictures meeting the third screening condition, and storing all the screened UI pictures in the fourth list. Wherein the third screening conditions include: the UI picture is not referenced in the properties file of the UI component and the UI picture is not in the picture whitelist.
It should be noted that the picture white list is used for recording non-redundant pictures; and the picture white list can protect each non-redundant picture recorded in the picture white list and avoid deleting the non-redundant picture recorded in the picture white list.
In the embodiment of the present application, the execution order between the execution of the action "determine whether the UI picture is in the picture white list" and the execution of the action "determine whether the UI picture is referenced in the property file of the UI component" is not limited, and the former may be executed before the latter, the latter may be executed before the former, or both may be executed simultaneously.
In this embodiment, the selected UI pictures may be stored in the fourth list, or the identifiers of the selected UI pictures may be stored in the fourth list.
S410: traversing all UI pictures in the fourth list, screening out all UI pictures meeting the fourth screening condition, taking the UI pictures as all redundant pictures, and storing all the redundant pictures into a fifth list. Wherein the fourth screening conditions include: the UI pictures are not used in the UI logic code, and the UI pictures are not used in the UI table.
In this embodiment, each redundant picture may be stored in the fifth list, or the identifier of each redundant picture may be stored in the fifth list.
In the embodiment of the present application, the execution order between the execution of the action "determine whether the UI picture is used in the UI logic code" and the execution of the action "determine whether the UI picture is used in the UI table" is not limited, and the former may be executed before the latter, the latter may be executed before the former, or both may be executed simultaneously.
S411: and traversing each redundant picture in the fifth list, and determining the UI package to which each redundant picture belongs.
S412: and according to the UI packages to which each redundant picture belongs, inquiring by utilizing the corresponding relation between the UI packages and the processing objects, and determining the processing objects corresponding to each redundant picture.
S413: generating redundant picture orders corresponding to all the processing objects according to all the redundant pictures and the processing objects corresponding to all the redundant pictures, and sending the redundant picture orders corresponding to all the processing objects, so that all the processing objects acquire all the useless pictures according to the received redundant picture orders, and deleting all the useless pictures.
It should be noted that, in this embodiment, redundant pictures corresponding to each processing object may be sent to each processing object in a preset manner; the preset mode can be preset, and particularly can be set according to application scenes. For example, the preset manner may be an API interface of the signaled TAPD; in addition, the preset mode can be other interfaces capable of realizing order sending.
The unnecessary picture is a redundant picture confirmed by the processing object. In some application scenarios, some UI pictures on the UI do not have any actual functions at the present moment, but these UI pictures may need to be kept so as to be given to these UI picture actual functions in the UI development process later, at this time, in order to be able to protect these UI pictures that will be given actual functions in the future from being deleted, the received redundant pictures may be subjected to confirmation of the unnecessary pictures by the processing object so as to take these UI pictures that will be given actual functions in the future as useful pictures, avoiding deletion processing of these UI pictures that will be given actual functions in the future.
S414: judging whether the total number of the redundant pictures in the fifth list exceeds a second number threshold, if so, executing step S408; if not, step S415 is performed.
It should be noted that the second number threshold may be preset, and may be especially set according to an application scenario. For example, the second number threshold may be preset to 0.
S415: and ending the processing procedure of the redundant resources.
It should be noted that, in practical application, the steps S401 to S415 may extend through the whole game development period, so that the steps S401 to S415 may be repeatedly executed in the whole game development period, so as to achieve automatic identification and deletion of the redundant resources on the UI in the whole game development period.
The redundant resource processing method provided in the second embodiment of the present invention can automatically identify and delete redundant resources on the UI in the whole game development period, so that redundant resources on each UI included in the game can be deleted in the whole game development period, so as to improve efficiency when each UI of the game is opened subsequently, and reduce memory consumption when each UI of the game is opened subsequently.
Based on the redundant resource processing method provided by the method embodiment, the application also provides a corresponding redundant resource processing device, so that the redundant resource processing method provided by the method embodiment is practically applied and realized.
Device embodiment
It should be noted that, the technical details of the redundant resource processing apparatus provided in this embodiment may refer to the redundant resource processing method provided in the foregoing method embodiment.
Referring to fig. 6, the schematic structural diagram of a redundant resource processing apparatus according to an embodiment of the present application is shown.
The redundant resource processing apparatus 600 provided in the embodiment of the present application includes:
an acquiring unit 601, configured to acquire UI resources on a user interface UI;
and a processing unit 602, configured to determine, when it is determined that the UI resource is not referred to by other UI resources and UI logic codes according to the reference relationship between UI resources and the UI logic codes, that the UI resource is a redundant resource, and perform deletion processing on the redundant resource.
Optionally, on the basis of the redundant resource processing apparatus 600 shown in fig. 6, the processing unit 602 is specifically configured to:
when the UI resources comprise first-type UI resources and second-type UI resources, and when the first-type UI resources are determined not to be referred to by other UI resources and UI logic codes according to the reference relation among the UI resources and the UI logic codes, determining the first-type UI resources as redundant resources, and deleting the redundant resources;
And when the second type UI resource is determined not to be referenced by other UI resources and UI logic codes according to the reference relation among the UI resources and the UI logic codes, determining the second type UI resource as a redundant resource, and deleting the redundant resource.
Optionally, on the basis of the redundant resource processing apparatus 600 shown in fig. 6, the processing unit 602 is specifically configured to:
when the UI resources are not referred to by other UI resources and UI logic codes according to the reference relation among the UI resources and the UI logic codes, the UI resources are determined to be redundant resources;
determining a UI packet to which the redundant resource belongs;
and obtaining a target object according to the UI package and the corresponding relation between the UI package and the processing object so as to delete the redundant resource by the target object.
Optionally, on the basis of the redundant resource processing apparatus 600 shown in fig. 6, the processing unit 602 is specifically configured to:
when the redundant resource comprises a UI component, acquiring a property file of the redundant resource;
and determining the UI package to which the redundant resource belongs according to the attribute file.
Optionally, on the basis of the redundant resource processing apparatus 600 shown in fig. 6, the processing unit 602 is specifically configured to:
And generating a resource processing list according to at least one redundant resource in the UI package, and sending the resource processing list to the target object so that the target object can delete the redundant resource according to the resource processing list.
Optionally, on the basis of the redundant resource processing apparatus 600 shown in fig. 6, the processing unit 602 is specifically configured to:
when the UI resources are determined not to be referenced by other UI resources and UI logic codes according to the reference relation among the UI resources, the UI logic codes and the resource white list, and the UI resources are not in the resource white list, determining the UI resources to be redundant resources; wherein the resource whitelist is used for recording non-redundant resources.
Optionally, on the basis of the redundant resource processing apparatus 600 shown in fig. 6, referring to fig. 7, fig. 7 is a schematic structural diagram of another redundant resource processing apparatus provided in an embodiment of the present application, as shown in fig. 7, where the redundant resource processing apparatus 700 further includes:
and an updating unit 701, configured to acquire an undeleted redundant resource, and add the undeleted redundant resource to the resource whitelist.
In the redundant resource processing apparatus provided in the above-described apparatus embodiment, after the UI resource on the UI is acquired, it is determined whether the UI resource is referenced by other UI resources and UI logic codes according to the reference relationship between the UI resources and the UI logic codes. When it is determined that the UI resource is not referred to by other UI resources and UI logic code, the UI resource is determined as a redundant resource, and deletion processing is performed on the redundant resource. Wherein, after the UI resource is determined not to be referenced by other UI resources and UI logic codes, the UI resource can be determined not only to have no relation with other UI resources, but also to have no practical purpose given by the UI logic codes, therefore, the UI resource can be determined to be a redundant resource without any practical function on the UI, after the redundant resource is deleted, the practical function of the UI can not be influenced, the resource quantity of the UI can be reduced, and the time and the memory required for opening the UI later can be reduced.
The embodiment of the application also provides a terminal device and a server for processing the redundant resource, and the terminal device and the server for processing the redundant resource provided by the embodiment of the application are introduced from the perspective of hardware materialization.
Referring to fig. 8, a schematic structural diagram of a terminal device is provided in an embodiment of the present application. For convenience of explanation, only those portions relevant to the embodiments of the present application are shown, and specific technical details are not disclosed, refer to the method portions of the embodiments of the present application. The terminal can be any terminal equipment including a mobile phone, a tablet personal computer, a personal digital assistant (English full name: personal DigitalAssistant, english abbreviation: PDA), a sales terminal (English full name: point of sales, english abbreviation: POS), a vehicle-mounted computer and the like, taking the tablet personal computer as an example:
fig. 8 is a block diagram illustrating a part of a structure of a tablet computer related to a terminal provided in an embodiment of the present application. Referring to fig. 8, the tablet computer includes: radio Frequency (RF) circuit 810, memory 820, input unit 830, display unit 840, sensor 850, audio circuit 860, wireless fidelity (wireless fidelity, wiFi) module 870, processor 880, and power supply 890. Those skilled in the art will appreciate that the tablet configuration shown in fig. 8 is not limiting of the tablet and may include more or fewer components than shown, or certain components may be combined, or a different arrangement of components.
The memory 820 may be used to store software programs and modules, and the processor 880 performs various functional applications and data processing of the tablet computer by running the software programs and modules stored in the memory 820. The memory 820 may mainly include a storage program area that may store an operating system, application programs required for at least one function (such as a sound playing function, an image playing function, etc.), and a storage data area; the storage data area may store data created according to the use of the tablet, such as audio data, phonebooks, etc. In addition, memory 820 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
The processor 880 is a control center of the tablet computer, connects various parts of the entire tablet computer using various interfaces and lines, and performs various functions of the tablet computer and processes data by running or executing software programs and/or modules stored in the memory 820, and calling data stored in the memory 820. In the alternative, processor 880 may include one or more processing units; preferably, the processor 880 may integrate an application processor that primarily handles operating systems, user interfaces, applications, etc., with a modem processor that primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 880.
In the embodiment of the present application, the processor 880 included in the terminal further has the following functions:
acquiring UI resources on a user interface UI;
and when the UI resources are not referred to by other UI resources and UI logic codes according to the reference relation among the UI resources and the UI logic codes, determining the UI resources as redundant resources, and deleting the redundant resources.
Optionally, the processor 880 is further configured to perform steps of any implementation manner of the redundant resource processing method provided in the embodiments of the present application.
The present embodiment also provides a server, and fig. 9 is a schematic structural diagram of a server provided in the present embodiment, where the server 900 may have a relatively large difference due to configuration or performance, and may include one or more central processing units (central processing units, CPU) 922 (e.g., one or more processors) and a memory 932, and one or more storage media 930 (e.g., one or more mass storage devices) storing application programs 942 or data 944. Wherein the memory 932 and the storage medium 930 may be transitory or persistent. The program stored in the storage medium 930 may include one or more modules (not shown), each of which may include a series of instruction operations on a server. Still further, the central processor 922 may be arranged to communicate with a storage medium 930 to execute a series of instruction operations in the storage medium 930 on the server 900.
The server 900 may also include one or more power supplies 926, one or more wired or wireless network interfaces 950, one or more input/output interfaces 958, and/or one or more operating systems 941, such as Windows Server, mac OS XTM, unixTM, linuxTM, freeBSDTM, etc.
The steps performed by the server in the above embodiments may be based on the server structure shown in fig. 9.
Wherein, CPU 922 is configured to perform the steps of:
acquiring UI resources on a user interface UI;
and when the UI resources are not referred to by other UI resources and UI logic codes according to the reference relation among the UI resources and the UI logic codes, determining the UI resources as redundant resources, and deleting the redundant resources.
Optionally, CPU 922 may also be used to perform the steps of any implementation of the redundant resource processing method in embodiments of the present application.
The embodiments of the present application further provide a computer readable storage medium storing a computer program for executing any one of the foregoing redundant resource processing methods according to the foregoing embodiments.
The embodiments also provide a computer program product comprising instructions which, when executed on a computer, cause the computer to perform any one of the methods of processing redundant resources described in the foregoing embodiments.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: u disk, mobile hard disk, read-Only Memory (ROM), random access Memory (RandomAccess Memory, RAM), magnetic disk or optical disk, etc. various media for storing computer program.
The above embodiments are merely for illustrating the technical solution of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the corresponding technical solutions.

Claims (11)

1. A method for processing redundant resources, comprising:
acquiring UI resources on a user interface UI;
when the UI resources are not referred to by other UI resources and UI logic codes according to the reference relation among the UI resources and the UI logic codes, the UI resources are determined to be redundant resources; the redundant resources include UI components;
acquiring an attribute file of the redundant resource; the UI component and the attribute file have a mapping relation, and the attribute file is used for recording attribute information of the corresponding UI component, wherein the attribute information comprises reference relation information before the component;
determining a UI package to which the redundant resource belongs according to the attribute file;
And obtaining a target object according to the UI package and the corresponding relation between the UI package and the processing object so as to automatically delete the redundant resource according to the resource type by the target object.
2. The method of claim 1, wherein when it is determined that the UI resource is not referred to by other UI resources and UI logic code according to the reference relationship between UI resources and the UI logic code, determining that the UI resource is a redundant resource comprises:
when the UI resources are determined not to be referenced by other UI resources and UI logic codes according to the reference relation among the UI resources, the UI logic codes and the resource white list, and the UI resources are not in the resource white list, determining the UI resources to be redundant resources; wherein the resource whitelist is used for recording non-redundant resources.
3. The method according to claim 2, wherein the method further comprises:
and acquiring undeleted redundant resources, and adding the undeleted redundant resources to the resource white list.
4. The method according to claim 1, wherein when the UI resource includes a first type UI resource and a second type UI resource, when it is determined that the UI resource is not referred to by other UI resources and UI logic codes according to a reference relationship between UI resources and UI logic codes, determining that the UI resource is a redundant resource specifically includes:
When the first type UI resource is determined not to be referenced by other UI resources and UI logic codes according to the reference relation among the UI resources and the UI logic codes, determining the first type UI resource as a redundant resource;
and when the second type UI resource is determined not to be referenced by other UI resources and UI logic codes according to the reference relation among the UI resources and the UI logic codes, determining the second type UI resource as a redundant resource.
5. The method according to claim 1, wherein obtaining a target object according to the UI package and the correspondence between the UI package and the processing object, so that the target object performs automatic deletion processing on the redundant resource according to a resource type, includes:
and generating a resource processing list according to at least one redundant resource in the UI package, and sending the resource processing list to the target object so that the target object can automatically delete the redundant resource according to the type of the resource displayed by the resource processing list.
6. A redundant resource processing apparatus, comprising:
an acquisition unit configured to acquire UI resources on a user interface UI;
A processing unit, configured to determine that the UI resource is a redundant resource when it is determined that the UI resource is not referred to by other UI resources and UI logic codes according to a reference relationship between UI resources and the UI logic codes; the redundant resources include UI components;
the processing unit is specifically configured to:
acquiring an attribute file of the redundant resource; the UI component and the attribute file have a mapping relation, and the attribute file is used for recording attribute information of the corresponding UI component, wherein the attribute information comprises reference relation information before the component;
determining a UI package to which the redundant resource belongs according to the attribute file;
and obtaining a target object according to the UI package and the corresponding relation between the UI package and the processing object so as to automatically delete the redundant resource according to the resource type by the target object.
7. The apparatus according to claim 6, wherein the processing unit is specifically configured to:
and generating a resource processing list according to at least one redundant resource in the UI package, and sending the resource processing list to the target object so that the target object can delete the redundant resource according to the resource processing list.
8. The apparatus according to claim 6, wherein the processing unit is specifically configured to:
when the UI resources are determined not to be referenced by other UI resources and UI logic codes according to the reference relation among the UI resources, the UI logic codes and the resource white list, and the UI resources are not in the resource white list, determining the UI resources to be redundant resources; wherein the resource whitelist is used for recording non-redundant resources.
9. The apparatus of claim 8, wherein the apparatus further comprises:
and the updating unit is used for acquiring the undeleted redundant resources and adding the undeleted redundant resources to the resource white list.
10. An apparatus comprising a processor and a memory:
the memory is used for storing a computer program;
the processor is configured to perform the method of any of claims 1-5 according to the computer program.
11. A computer readable storage medium, characterized in that the computer readable storage medium is for storing a computer program for executing the method of any one of claims 1-5.
CN201910707937.5A 2019-08-01 2019-08-01 Redundant resource processing method, device, equipment and storage medium Active CN110413282B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910707937.5A CN110413282B (en) 2019-08-01 2019-08-01 Redundant resource processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910707937.5A CN110413282B (en) 2019-08-01 2019-08-01 Redundant resource processing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110413282A CN110413282A (en) 2019-11-05
CN110413282B true CN110413282B (en) 2024-01-30

Family

ID=68365174

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910707937.5A Active CN110413282B (en) 2019-08-01 2019-08-01 Redundant resource processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110413282B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111045684A (en) * 2019-12-18 2020-04-21 深圳前海环融联易信息科技服务有限公司 CSS code redundancy detection optimization method, device and equipment and storage medium
CN111045698A (en) * 2019-12-24 2020-04-21 五八有限公司 Redundant picture deleting method and device, electronic equipment and storage medium
CN112379891B (en) * 2020-10-09 2023-12-29 广州博冠信息科技有限公司 Data processing method and device
CN112637002B (en) * 2020-12-04 2022-10-11 北京金山云网络技术有限公司 Test resource deleting method and device, storage medium and electronic equipment
CN113220304A (en) * 2021-05-25 2021-08-06 中国工商银行股份有限公司 Method and device for detecting redundancy class, electronic equipment and readable storage medium
CN113467781B (en) * 2021-06-30 2023-02-21 建信金融科技有限责任公司 Method, device and equipment for determining redundant file

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090172669A1 (en) * 2007-12-28 2009-07-02 International Business Machines Corporation Use of redundancy groups in runtime computer management of business applications
CN103970516A (en) * 2013-01-30 2014-08-06 腾讯科技(深圳)有限公司 Superfluous picture deletion method and device
CN105511934A (en) * 2015-12-08 2016-04-20 贵阳朗玛信息技术股份有限公司 Resource processing method and device in application program development
CN108089893A (en) * 2017-12-14 2018-05-29 网易(杭州)网络有限公司 Definite method, apparatus, terminal device and the storage medium of redundant resource
CN108536463A (en) * 2018-04-09 2018-09-14 深圳市腾讯网络信息技术有限公司 Obtain method, apparatus, equipment and the computer readable storage medium of resource packet
CN108984207A (en) * 2018-06-14 2018-12-11 珠海金山网络游戏科技有限公司 A kind of method of installation kit invalid resource file detection
CN109344277A (en) * 2018-08-31 2019-02-15 网易传媒科技(北京)有限公司 Image processing method, device, medium and calculating equipment
CN109491699A (en) * 2018-10-26 2019-03-19 网易(杭州)网络有限公司 Resource inspection method, device, equipment and the storage medium of application program
CN109799970A (en) * 2018-12-06 2019-05-24 珠海西山居移动游戏科技有限公司 A kind of quoting resource relationship generation method and system
CN109918076A (en) * 2017-12-13 2019-06-21 北京嘀嘀无限科技发展有限公司 Code file processing method, system, computer equipment and readable storage medium storing program for executing
CN110019038A (en) * 2018-04-12 2019-07-16 平安普惠企业管理有限公司 File reference analysis method, apparatus, equipment and computer readable storage medium
CN110069458A (en) * 2019-04-25 2019-07-30 努比亚技术有限公司 Method, equipment and the storage medium of invalid resource in a kind of deletion Android system

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090172669A1 (en) * 2007-12-28 2009-07-02 International Business Machines Corporation Use of redundancy groups in runtime computer management of business applications
CN103970516A (en) * 2013-01-30 2014-08-06 腾讯科技(深圳)有限公司 Superfluous picture deletion method and device
CN105511934A (en) * 2015-12-08 2016-04-20 贵阳朗玛信息技术股份有限公司 Resource processing method and device in application program development
CN109918076A (en) * 2017-12-13 2019-06-21 北京嘀嘀无限科技发展有限公司 Code file processing method, system, computer equipment and readable storage medium storing program for executing
CN108089893A (en) * 2017-12-14 2018-05-29 网易(杭州)网络有限公司 Definite method, apparatus, terminal device and the storage medium of redundant resource
CN108536463A (en) * 2018-04-09 2018-09-14 深圳市腾讯网络信息技术有限公司 Obtain method, apparatus, equipment and the computer readable storage medium of resource packet
CN110019038A (en) * 2018-04-12 2019-07-16 平安普惠企业管理有限公司 File reference analysis method, apparatus, equipment and computer readable storage medium
CN108984207A (en) * 2018-06-14 2018-12-11 珠海金山网络游戏科技有限公司 A kind of method of installation kit invalid resource file detection
CN109344277A (en) * 2018-08-31 2019-02-15 网易传媒科技(北京)有限公司 Image processing method, device, medium and calculating equipment
CN109491699A (en) * 2018-10-26 2019-03-19 网易(杭州)网络有限公司 Resource inspection method, device, equipment and the storage medium of application program
CN109799970A (en) * 2018-12-06 2019-05-24 珠海西山居移动游戏科技有限公司 A kind of quoting resource relationship generation method and system
CN110069458A (en) * 2019-04-25 2019-07-30 努比亚技术有限公司 Method, equipment and the storage medium of invalid resource in a kind of deletion Android system

Also Published As

Publication number Publication date
CN110413282A (en) 2019-11-05

Similar Documents

Publication Publication Date Title
CN110413282B (en) Redundant resource processing method, device, equipment and storage medium
CN105677250B (en) The update method and updating device of object data in object storage system
CN104104971B (en) A kind of video file processing method and system
CN105760199B (en) A kind of application resource loading method and its equipment
WO2015043512A1 (en) Picture management method and device
CN109359091B (en) File management method, device, terminal and computer readable storage medium
KR20190116479A (en) Application program processing methods, devices, and storage media
CN111190962B (en) File synchronization method and device and local terminal
US20140237024A1 (en) Network communication devices and file tracking methods thereof
CN111680008A (en) Log processing method and system, readable storage medium and intelligent device
US20150215399A1 (en) Terminal and server performing data synchronization
US20180018363A1 (en) Time series data processing method and apparatus
CN111258680A (en) Resource loading method and device, storage medium and electronic device
CN105893471B (en) Data processing method and electronic equipment
CN112860953A (en) Data importing method, device, equipment and storage medium of graph database
CN111367869A (en) Mirror image file processing method and device, storage medium and electronic equipment
CN111782728A (en) Data synchronization method, device, electronic equipment and medium
CN103092988A (en) Realizing method of directly managing mobile phone media resources on desktop
CN117130697B (en) Method and device for fixing application on taskbar
CN110875960A (en) Address book updating method, server and terminal
CN105472628B (en) Extend the method and device of WLAN ID numbers
CN107422991B (en) Storage strategy management system
CN102662995B (en) A kind of method that quick position mobile phone application data upgrades
CN103970860B (en) Method, device and system for processing data
CN115484560A (en) Intelligent short message processing method and device, electronic equipment and 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