CN110659081A - File processing method and device for program object and electronic equipment - Google Patents

File processing method and device for program object and electronic equipment Download PDF

Info

Publication number
CN110659081A
CN110659081A CN201910854143.1A CN201910854143A CN110659081A CN 110659081 A CN110659081 A CN 110659081A CN 201910854143 A CN201910854143 A CN 201910854143A CN 110659081 A CN110659081 A CN 110659081A
Authority
CN
China
Prior art keywords
package
file
target
file package
forbidden
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.)
Granted
Application number
CN201910854143.1A
Other languages
Chinese (zh)
Other versions
CN110659081B (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.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN201910854143.1A priority Critical patent/CN110659081B/en
Publication of CN110659081A publication Critical patent/CN110659081A/en
Application granted granted Critical
Publication of CN110659081B publication Critical patent/CN110659081B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Landscapes

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

Abstract

The present disclosure relates to a file processing method, device, electronic device and storage medium for a program object, and relates to the technical field of computers, wherein the method is applied to the electronic device, and the embodiment of the present disclosure includes: acquiring a function file of a target program object to be started, wherein the function file records information of a target file packet required by starting the target program object; judging whether the forbidden file package exists in the target file package according to the package information of the forbidden file package recorded in the function file and the package information of the target file package; and if the forbidden file package exists in the target file package, excluding the forbidden file package in the target file package, wherein the exclusion operation is used for indicating that the target program object can call other functions in the target file package except for the function corresponding to the forbidden file package. By adopting the file processing method and device, the file processing efficiency can be improved.

Description

File processing method and device for program object and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for processing a file of a program object, an electronic device, and a storage medium.
Background
maven (project object model) can handle the association between program objects, such as one package or a plurality of packages having an association. The association relationship between the program objects requires, for example, loading not only a package included in the program object a but also a package included in the program object B when the program object a is started. In the process that the electronic device starts the program object a based on maven, the electronic device loads a file package corresponding to the program object a, that is, loads a file package included in the program object a and a file package included in the program object B associated with the program object a. Since there may be a functional conflict between the file package included in the program object B and the file package currently used by the program object a, that is, a file package conflict occurs, it is necessary to delete the file package that may cause the functional conflict in the program object B and the file package associated with the file package, that is, perform global association exclusion on the file package.
In the related art, the electronic device may be preset with an exclusion tag, and after the electronic device loads the file package corresponding to the target program object, if a file package conflict occurs, the electronic device may prompt package information of the file package causing the conflict. Then, the designer may configure the exclusion tag according to the package information of the portfolio, and then the electronic device may exclude the portfolio and the portfolio associated with the portfolio through the configured exclusion tag.
However, since other program objects associated with the target program object may include a conflict package that has been deleted before, the electronic device may reload the conflict package when starting the other program objects, and at this time, the electronic device may repeat the above processing procedure only after the package conflict occurs, resulting in low file processing efficiency.
Disclosure of Invention
To overcome the problems in the related art, the present disclosure provides a file processing method and apparatus for a program object, an electronic device, and a storage medium, so as to improve file processing efficiency.
According to a first aspect of the embodiments of the present disclosure, there is provided a file processing method for a program object, the method being applied to an electronic device, including:
acquiring a function file of a target program object to be started, wherein the function file records information of a target file packet required by starting the target program object;
judging whether the forbidden file package exists in the target file package according to the package information of the forbidden file package recorded in the function file and the package information of the target file package;
and if the forbidden file package exists in the target file package, excluding the forbidden file package in the target file package, wherein the exclusion operation is used for indicating that the target program object can call other functions in the target file package except for the function corresponding to the forbidden file package.
Optionally, determining whether the forbidden file package exists in the target file package according to the package information of the forbidden file package and the package information of the target file package recorded in the function file includes:
analyzing and executing the function file;
in the process of executing the function file, if a global exclusion tag exists in the function file, detecting whether package information of a forbidden file package recorded in the global exclusion tag exists in package information of the target file package;
and if the package information of the forbidden file package exists in the package information of the target file package, judging that the forbidden file package exists in the target file package.
Optionally, before whether the package information of the disabled file package recorded in the global exclusion tag exists in the package information of the target file package, the method further includes:
and reading package information of the target file package from the function file of the target program object, wherein the package information of the target file package is used for recording information of the file package called by starting the function of the target file package.
Optionally, the information of the global exclusion tag and the target file package required for starting the target program object is sequentially recorded in the function file of the target program object.
Optionally, excluding the forbidden file package in the target file package includes:
and loading other file packages except the forbidden file package in the target file package.
Optionally, loading other file packages in the target file package except for the disabled file package includes:
adding an exclusion statement for excluding the forbidden file package in loading code for loading the target file package; alternatively, the first and second electrodes may be,
in the loading code for loading the target package of files, an exclusion operation for excluding the disabled package of files is performed.
According to a second aspect of the embodiments of the present disclosure, there is provided a file processing apparatus for a program object, the apparatus being applied to an electronic device, including:
the device comprises an acquisition unit, a storage unit and a processing unit, wherein the acquisition unit is configured to acquire a function file of a target program object to be started, and the function file records information of a target file package required by starting the target program object;
a judging unit configured to acquire package information of a disabled file package recorded in the function file and package information of the target file package, and judge whether the disabled file package exists in the target file package;
and the exclusion unit is configured to acquire a forbidden file package in the target file package when the forbidden file package exists in the target file package, wherein exclusion operation is used for indicating that the target program object can call other functions in the target file package except for the function corresponding to the forbidden file package.
Optionally, the determining unit includes:
an execution subunit configured to parse and execute the function file;
a detecting subunit, configured to, in a process of executing the function file, if a global exclusion tag exists in the function file, detect whether packet information of a disabled file packet recorded in the global exclusion tag exists in packet information of the target file packet;
and the judging subunit is configured to judge that the forbidden file package exists in the target file package if the package information of the forbidden file package exists in the package information of the target file package.
Optionally, the apparatus further comprises:
and the reading subunit is configured to read package information of the target file package from the function file of the target program object, wherein the package information of the target file package is used for recording information of a file package called by starting the function of the target file package.
Optionally, the information of the global exclusion tag and the target file package required for starting the target program object is sequentially recorded in the function file of the target program object.
Optionally, the excluding unit includes:
a loading subunit configured to load other file packages in the target file package except the disabled file package.
Optionally, the loading subunit includes:
an adding subunit configured to add, in the loading code for loading the target package, an exclusion statement for excluding the forbidden package; alternatively, the first and second electrodes may be,
an execution subunit configured to execute, in the loading code for loading the target package of files, an exclusion operation for excluding the disabled package of files.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to: the method steps according to the first aspect are performed.
According to a fourth aspect of embodiments of the present disclosure, there is provided a non-transitory computer readable storage medium having instructions which, when executed by a processor of a mobile terminal, enable the mobile terminal to perform the method steps of the first aspect.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the method of the first aspect described above.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects: the method comprises the steps of obtaining a function file of a target program object to be started, wherein the function file records information of a target file package required by starting the target program object, and then judging whether the target file package contains the forbidden file package or not according to package information of the forbidden file package and package information of the target file package recorded in the function file. And if the target file package has the forbidden file package, excluding the forbidden file package in the target file package, wherein the exclusion operation is used for indicating that the target program object can call other functions in the target file package except for the function corresponding to the forbidden file package. Before the target program object is started, whether the forbidden file package exists in the target file package is detected, and the forbidden file package is eliminated when the forbidden file package exists in the target file package, so that file package collision caused by loading the forbidden file package can be avoided, and the file processing efficiency is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a flowchart illustrating a file processing method for program objects in accordance with an exemplary embodiment.
FIG. 2 is a flowchart illustrating a file processing method for program objects in accordance with an exemplary embodiment.
FIG. 3 is a block diagram illustrating a file processing apparatus for program objects in accordance with an illustrative embodiment.
FIG. 4 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
The embodiment of the disclosure provides a file processing method for a program object, which is applied to an electronic device, and the electronic device may be a device with a file processing function, for example, the electronic device may be a notebook computer, a mobile phone, and the like. The program object is, for example, one file package or a plurality of file packages having an association relationship.
In the embodiment of the disclosure, maven may be installed in the electronic device, and the program object may be one jar package or an installation package composed of a plurality of jar packages. When a designer builds a program object through an electronic device and a maven, if the function of the program object needs to be completed based on another program object, that is, the program object depends on another program object, the electronic device needs to load the other program object. For example, when a designer constructs an installation package of an application program, if a certain function of the installation package can be completed by a jar package with the function, the designer can directly download and store the jar package through the electronic device. Then, the electronic device can make the application program have the corresponding function by calling the jar package, so that the time cost and the development cost required for re-editing the jar package with the function can be saved.
It is well known to those skilled in the art that a program object may have an association relationship with a plurality of file packages, and when the program object is started, the plurality of file packages associated with the program object are loaded simultaneously. Among a plurality of packages loaded at the same time, there may be packages that are not related to the function implementation of the program object or packages that may cause a package conflict.
The function of a package conflict, such as the package N1 that exists in the current program object, is: and when receiving an icon "←" corresponding instruction, sliding the current display page to the left. And the function of the package N1 associated with the program object is: and when receiving an icon "←" corresponding instruction, reducing the playing volume of the current audio. Thus, if the current program object is loading the package N1 associated with that program object, then the electronic device, upon receiving the instruction corresponding to the icon "←", cannot determine which operation to slide the current display page to the left or lower the current playback volume to perform, thereby causing a malfunction in the operation of the target program object.
According to the file processing method for the program object, provided by the embodiment of the disclosure, before the target program object is started, the forbidden file package possibly existing in the target file package can be detected aiming at the target file package required by starting the target program object, and the forbidden file package possibly causing file package collision is eliminated in advance, so that the file processing efficiency can be improved.
FIG. 1 is a flowchart illustrating a file processing method for program objects, as shown in FIG. 1, including the following steps, in accordance with an exemplary embodiment.
Step 101, acquiring a function file of a target program object to be started.
The function file may be a pom file in a maven, or a dependency management tag. The information of the target file package comprises package information of the target file package and association information between the target file packages, wherein the package information can be at least one of the name of the file package, the version number of the file package and a target program object to which the file package belongs.
In implementation, if the target program object needs to be started, the designer may perform a preset operation to enable the electronic device to start the target program object, where the preset operation may be to input a program object identifier of the target program object to be started, and the preset operation may also be to click an icon of the target program object in a program object list to be started.
Before starting the target program object, the electronic device may obtain the function file of the target program object to be started in various ways.
In another possible implementation manner, the electronic device may obtain information of the target file package before starting the target program object, and generate a function file of the target program object. For example, the electronic device may determine information of an object package required to start the object program object by a preset development tool and a name of the object program object, and generate a function file including the information of the object package. Development tools such as IDEA (IntelliJ IDEA, an integrated environment for java language development), Eclipse (integrated development environment). In the related art, any development tool having an information function of determining a target package required for starting a target program object may be applied to the embodiment of the present disclosure, and the embodiment of the present disclosure is not particularly limited.
And step 102, judging whether the forbidden file package exists in the target file package according to the package information of the forbidden file package and the package information of the target file package recorded in the function file.
The function file records package information of a target file package and package information of a forbidden file package. In the embodiment of the present disclosure, the forbidden file package is a file package irrelevant to the function implementation of the target program object, or a file package that may cause a file package conflict. Package information of the forbidden file package is, for example, log4j-over-slf4j, slf4j-log4j 12.
In implementation, the electronic device may search the package information of the disabled portfolio in the package information of the target portfolio, and if the package information of the disabled portfolio is found, the electronic device may determine that the disabled portfolio exists in the target portfolio, and then the electronic device may perform step 103. If the electronic device does not find the package information of the forbidden file package, the electronic device can judge that the forbidden file package does not exist in the target file package and does not perform subsequent processing.
And 103, excluding forbidden file packages in the target file package.
And the exclusion operation is used for indicating that the target program object can call other functions except the function corresponding to the forbidden file package in the target file package.
In implementation, the electronic device may exclude the forbidden file package from the target file package in various ways, and in a possible implementation, in a case that the electronic device has loaded the target file package, the electronic device may search the forbidden file package in the loaded target file package and delete the forbidden file package. In another possible implementation manner, in a case that the electronic device does not load the target package, the electronic device may perform an exclusion operation on the forbidden package in the target package based on the loading code for loading the target package, and a detailed description will be subsequently given.
In the embodiment of the disclosure, the electronic device may obtain a function file of a target program object to be started, where the function file records information of a target file package required for starting the target program object, and then, according to package information of a disabled file package and package information of the target file package recorded in the function file, determine whether the disabled file package exists in the target file package. And if the target file package has the forbidden file package, excluding the forbidden file package in the target file package, wherein the exclusion operation is used for indicating that the target program object can call other functions in the target file package except for the function corresponding to the forbidden file package. Before the target program object is started, whether the forbidden file package exists in the target file package is detected, and the forbidden file package is eliminated when the forbidden file package exists in the target file package, so that file package collision caused by loading the forbidden file package can be avoided, and the file processing efficiency is improved.
In addition, in the related art, the electronic device can prompt the designer to eliminate the conflicting file package after the file package conflict occurs, the designer needs to manually configure the maven native exclusion tag when the file package is eliminated, and the excluded forbidden file package is loaded when other target file packages are loaded. In contrast, the file processing method for the program object provided by the embodiment of the disclosure can automatically detect the forbidden file package which may cause the file package conflict before the target program object is started, and automatically exclude the forbidden file package which may cause the file package conflict. Therefore, the embodiment of the disclosure can not only avoid repeated introduction of the forbidden document package and manual repeated removal after introduction, and improve the document processing efficiency, but also further save the space occupied by the target program object by removing the forbidden document package.
Optionally, a global exclusion tag may be recorded in the function file of the target program object, where the global exclusion tag is a tag having a file package exclusion function, and package information of the disabled file package may be recorded in the global exclusion tag, for example, the package information of the disabled file package may be recorded in the global exclusion tag: the name is foo-bad, the version number is 1.0, and the name of the program object is foo-test. The package information recorded in the global exclusion tag may belong to one disabled file package or a plurality of disabled file packages, and the embodiment of the present disclosure is not particularly limited.
Therefore, by using the information of the forbidden file package and the information of the target file package recorded in the global exclusion tag, the electronic device can determine whether the target file package contains the forbidden file package, as shown in fig. 2, the specific processing procedure includes:
step 201, parsing and executing the function file.
In implementation, the electronic device may analyze the function file by using any file analysis method in the related art, and accordingly, the electronic device may execute the function file by using any file execution method in the related art, which is not specifically limited in the embodiment of the present disclosure.
Step 202, in the process of executing the function file, if the global exclusion tag exists in the function file, detecting whether the package information of the forbidden file package recorded in the global exclusion tag exists in the package information of the target file package.
In implementation, when the global exclusion tag exists in the function file, the electronic device may acquire the package information of the disabled file package recorded in the global exclusion tag during the process of executing the function file, and then the electronic device may acquire the package information of the target file package and detect whether the package information of the disabled file package exists in the package information of the target file package.
In a possible implementation manner, since the package information of the target file package included in the target program object is generally stored in a form of a tree structure in the related art, the electronic device may determine, by recursively traversing the package information of the target file package, whether the package information of the target file package exists in the package information of the target file package, so as to determine whether the target file package exists in the target file package.
If the electronic device detects that the forbidden file package exists in the package information of the target file package, the electronic device may execute step 203; if the electronic device detects that the forbidden portfolio does not exist in the package information of the target portfolio, the electronic device can perform step 204.
For example, for the name foo-bad of the disabled file package, the electronic device may determine whether foo-bad exists in the name of the target file package. If the foo-bad exists in the name of the target file package, the electronic equipment can judge that the disabled file package foo-bad exists in the target file package.
Optionally, the embodiment of the present disclosure provides two implementation manners for acquiring, by an electronic device, package information of a target file package, where the implementation manner is as follows: the electronic device may obtain package information of each object file package after determining the object file package required to start the object program object.
The second method comprises the following steps: the electronic device may read package information of the target package from the function file of the target program object.
And the package information of the target file package is used for recording the information of the file package called by the function of starting the target file package.
In the embodiment of the disclosure, the package information of the target file package is read from the function file of the target program object, so that the electronic device can quickly acquire the package information of all the target file packages required for starting the target program object, and it is convenient to subsequently detect whether the package information of the forbidden file package exists based on the package information of the target file package, so as to determine whether the forbidden file package exists in the target file package, which is beneficial to quickly detecting the forbidden file package and improving the file processing efficiency.
Step 203, judging that the target file package has a forbidden file package.
And step 204, judging that no forbidden file package exists in the target file package, and not performing subsequent processing.
In the embodiment of the disclosure, the electronic device may parse and execute the function file, and in the process of executing the function file, if the global exclusion tag exists in the function file, detect whether the package information of the forbidden file package recorded in the global exclusion tag exists in the package information of the target file package. If the package information of the forbidden file package exists in the package information of the target file package, the electronic equipment can judge that the forbidden file package exists in the target file package. The global exclusion tag of the package information of the forbidden file package is recorded, so that whether the package information of the forbidden file package exists in the package information of the target file package is detected, and the forbidden file package exists in the target file package is determined when the judgment result is yes.
Optionally, the function file of the target program object may sequentially record information of a global exclusion tag and a target file package required for starting the target program, and the global exclusion tag may be stored in any position in the function file.
In the embodiment of the present disclosure, the global exclusion tag can be stored in any position in the function file, and compared with the related art in which the exclusion tag must be placed at the start position in the function file, the file processing method for the program object provided in the embodiment of the present disclosure does not limit the storage position of the global exclusion tag, which is convenient for the layout of the content included in the function file, so that a designer can configure the function file more flexibly.
Optionally, after determining that the forbidden document package exists in the target document package, the electronic device may exclude the forbidden document package in the target document package, where the specific excluding process includes: and loading other file packages in the target file package except the forbidden file package.
In implementation, the electronic device may determine, for each target package to be loaded, whether the target package is a forbidden package in a process of loading the target package, and if the target package is not the forbidden package, the electronic device may load the target package. If the target portfolio is a disabled portfolio, the electronic device may not load the target portfolio.
In the embodiment of the disclosure, in the process of loading the target file package, the electronic device loads other file packages in the target file package except the forbidden file package, so that the forbidden file package causing file package conflict can be prevented from being loaded, and the file processing efficiency is improved.
Optionally, the electronic device may implement loading of the target file package based on a pre-stored loading code, where the loading code is used for loading the target file package. Therefore, the embodiment of the present disclosure provides two ways for loading other file packages in the target file package, except for the forbidden file package, based on the loading code, which are specifically as follows:
in the first mode, an exclusion statement for excluding the forbidden file package is added to the loading code for loading the target file package.
In implementation, an exclusion statement for excluding the portfolio may be stored in the electronic device in advance, the electronic device may fill package information of the forbidden portfolio at a preset position in the exclusion statement, generate the exclusion statement for excluding the forbidden portfolio, and then, the electronic device may add the exclusion statement in a loading code for loading the target portfolio.
In the second mode, in the loading code for loading the target package, an exclusion operation for excluding the disabled package is performed.
In implementation, the electronic device may add an execution statement for executing an exclusion operation in the loading code of the loading target package so that the electronic device executes the exclusion operation for executing the disabled package.
In the embodiment of the disclosure, the electronic device loads other file packages in the target file package except the forbidden file package based on the loading code, and can execute exclusion operation on the forbidden file package in the process of loading the target file package, so that the forbidden file package causing file package conflict is prevented from being loaded, and the file processing efficiency is improved.
FIG. 3 is an apparatus block diagram illustrating a file processing apparatus for program objects in accordance with an illustrative embodiment. Referring to fig. 3, the apparatus includes an acquisition unit 310, a judgment unit 320, and an exclusion unit 330.
An obtaining unit 310 configured to obtain a function file of an object program object to be started, where information of an object file package required for starting the object program object is recorded in the function file;
a determining unit 320 configured to obtain package information of a disabled file package recorded in the function file and package information of the target file package, and determine whether the disabled file package exists in the target file package;
an excluding unit 330, configured to acquire, when the disabled portfolio exists in the target portfolio, a disabled portfolio in the target portfolio, where an excluding operation is used to indicate that the target program object can call another function in the target portfolio except for a function corresponding to the disabled portfolio.
Optionally, the determining unit includes:
an execution subunit configured to parse and execute the function file;
a detecting subunit, configured to, in a process of executing the function file, if a global exclusion tag exists in the function file, detect whether packet information of a disabled file packet recorded in the global exclusion tag exists in packet information of the target file packet;
and the judging subunit is configured to judge that the forbidden file package exists in the target file package if the package information of the forbidden file package exists in the package information of the target file package.
Optionally, the apparatus further comprises:
and the reading subunit is configured to read package information of the target file package from the function file of the target program object, wherein the package information of the target file package is used for recording information of a file package called by starting the function of the target file package.
Optionally, the information of the global exclusion tag and the target file package required for starting the target program object is sequentially recorded in the function file of the target program object.
Optionally, the excluding unit includes:
a loading subunit configured to load other file packages in the target file package except the disabled file package.
Optionally, the loading subunit includes:
an adding subunit configured to add, in the loading code for loading the target package, an exclusion statement for excluding the forbidden package; alternatively, the first and second electrodes may be,
an execution subunit configured to execute, in the loading code for loading the target package of files, an exclusion operation for excluding the disabled package of files.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects: the method comprises the steps of obtaining a function file of a target program object to be started, wherein the function file records information of a target file package required by starting the target program object, and then judging whether the target file package contains the forbidden file package or not according to package information of the forbidden file package and package information of the target file package recorded in the function file. And if the target file package has the forbidden file package, excluding the forbidden file package in the target file package, wherein the exclusion operation is used for indicating that the target program object can call other functions in the target file package except for the function corresponding to the forbidden file package. Before the target program object is started, whether the forbidden file package exists in the target file package is detected, and the forbidden file package is eliminated when the forbidden file package exists in the target file package, so that file package collision caused by loading the forbidden file package can be avoided, and the file processing efficiency is improved.
FIG. 4 is a block diagram illustrating an electronic device for maven global dependency exclusion in accordance with an exemplary embodiment. For example, the electronic device may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 4, the electronic device may include one or more of the following components: processing components 402, memory 404, power components 406, multimedia components 408, audio components 410, input/output (I/O) interfaces 412, sensor components 414, and communication components 416.
The processing component 402 generally controls the overall operation of the electronic device, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 402 may include one or more processors 420 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 402 can include one or more modules that facilitate interaction between the processing component 402 and other components. For example, the processing component 402 can include a multimedia module to facilitate interaction between the multimedia component 408 and the processing component 402.
The memory 404 is configured to store various types of data to support operation at the device. Examples of such data include instructions for any application or method operating on the electronic device, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 404 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 406 provides power to the various components of the electronic device. The power components 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for an electronic device.
The multimedia component 408 includes a screen providing an output interface between the electronic device and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 408 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device is in an operational mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 410 is configured to output and/or input audio signals. For example, the audio component 410 includes a Microphone (MIC) configured to receive external audio signals when the electronic device is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 404 or transmitted via the communication component 416. In some embodiments, audio component 410 also includes a speaker for outputting audio signals.
The I/O interface 412 provides an interface between the processing component 402 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 414 includes one or more sensors for providing various aspects of status assessment for the electronic device. For example, the sensor component 414 can detect an open/closed state of the device, the relative positioning of components, such as a display and keypad of the electronic device, the sensor component 414 can also detect a change in the position of the electronic device or a component of the electronic device, the presence or absence of user contact with the electronic device, orientation or acceleration/deceleration of the electronic device, and a change in the temperature of the electronic device. The sensor assembly 414 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 414 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 416 is configured to facilitate wired or wireless communication between the electronic device and other devices. The electronic device may access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 416 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 416 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 404 comprising instructions, executable by the processor 420 of the electronic device to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects: the method comprises the steps of obtaining a function file of a target program object to be started, wherein the function file records information of a target file package required by starting the target program object, and then judging whether the target file package contains the forbidden file package or not according to package information of the forbidden file package and package information of the target file package recorded in the function file. And if the target file package has the forbidden file package, excluding the forbidden file package in the target file package, wherein the exclusion operation is used for indicating that the target program object can call other functions in the target file package except for the function corresponding to the forbidden file package. Before the target program object is started, whether the forbidden file package exists in the target file package is detected, and the forbidden file package is eliminated when the forbidden file package exists in the target file package, so that file package collision caused by loading the forbidden file package can be avoided, and the file processing efficiency is improved.
In addition, the embodiment of the present disclosure also provides a non-transitory computer readable storage medium, and when executed by a processor of a server, the instructions in the storage medium enable the server to perform the steps of the implementation method for maven global dependency exclusion provided by the embodiment of the present disclosure.
In addition, the embodiment of the present disclosure further provides a computer program product, and when instructions in the computer program product are executed by a processor of a server, the server is enabled to execute the steps of the implementation method for maven global dependency exclusion provided by the embodiment of the present application.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (10)

1. A file processing method for a program object, the method being applied to an electronic device, comprising:
acquiring a function file of a target program object to be started, wherein the function file records information of a target file packet required by starting the target program object;
judging whether the forbidden file package exists in the target file package according to the package information of the forbidden file package recorded in the function file and the package information of the target file package;
and if the forbidden file package exists in the target file package, excluding the forbidden file package in the target file package, wherein the exclusion operation is used for indicating that the target program object can call other functions in the target file package except for the function corresponding to the forbidden file package.
2. The file processing method for the program object according to claim 1, wherein determining whether the disabled file package exists in the target file package according to package information of the disabled file package recorded in the function file and package information of the target file package comprises:
analyzing and executing the function file;
in the process of executing the function file, if a global exclusion tag exists in the function file, detecting whether package information of a forbidden file package recorded in the global exclusion tag exists in package information of the target file package;
and if the package information of the forbidden file package exists in the package information of the target file package, judging that the forbidden file package exists in the target file package.
3. The file processing method for the program object according to claim 2, before detecting whether or not the package information of the disabled portfolio recorded in the global exclusion tag exists in the package information of the target portfolio, the method further comprising:
and reading package information of the target file package from the function file of the target program object, wherein the package information of the target file package is used for recording information of the file package called by starting the function of the target file package.
4. The file processing method for the program object according to claim 2, wherein information of a global exclusion tag and an object file package required for starting the object program object are sequentially recorded in the function file of the object program object.
5. The file processing method for the program object according to claim 1, wherein said excluding the forbidden file package of the target file package comprises:
and loading other file packages except the forbidden file package in the target file package.
6. The file processing method for the program object according to claim 5, wherein said loading the target package of files other than the disabled package of files comprises:
adding an exclusion statement for excluding the forbidden file package in loading code for loading the target file package; alternatively, the first and second electrodes may be,
in the loading code for loading the target package of files, an exclusion operation for excluding the disabled package of files is performed.
7. A file processing apparatus for a program object, the apparatus being applied to an electronic device, comprising:
the device comprises an acquisition unit, a storage unit and a processing unit, wherein the acquisition unit is configured to acquire a function file of a target program object to be started, and the function file records information of a target file package required by starting the target program object;
a judging unit configured to acquire package information of a disabled file package recorded in the function file and package information of the target file package, and judge whether the disabled file package exists in the target file package;
and the exclusion unit is configured to acquire a forbidden file package in the target file package when the forbidden file package exists in the target file package, wherein exclusion operation is used for indicating that the target program object can call other functions in the target file package except for the function corresponding to the forbidden file package.
8. The file processing apparatus for the program object according to claim 7, wherein the judging unit includes:
an execution subunit configured to parse and execute the function file;
a detecting subunit, configured to, in a process of executing the function file, if a global exclusion tag exists in the function file, detect whether packet information of a disabled file packet recorded in the global exclusion tag exists in packet information of the target file packet;
and the judging subunit is configured to judge that the forbidden file package exists in the target file package if the package information of the forbidden file package exists in the package information of the target file package.
9. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to: performing the method steps of any one of claims 1-6.
10. A non-transitory computer readable storage medium having instructions which, when executed by a processor of a mobile terminal, enable the mobile terminal to perform the method steps of any of claims 1-6.
CN201910854143.1A 2019-09-10 2019-09-10 File processing method and device for program object and electronic equipment Active CN110659081B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910854143.1A CN110659081B (en) 2019-09-10 2019-09-10 File processing method and device for program object and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910854143.1A CN110659081B (en) 2019-09-10 2019-09-10 File processing method and device for program object and electronic equipment

Publications (2)

Publication Number Publication Date
CN110659081A true CN110659081A (en) 2020-01-07
CN110659081B CN110659081B (en) 2022-12-27

Family

ID=69036898

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910854143.1A Active CN110659081B (en) 2019-09-10 2019-09-10 File processing method and device for program object and electronic equipment

Country Status (1)

Country Link
CN (1) CN110659081B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1409227A (en) * 2001-09-14 2003-04-09 北京瑞星科技股份有限公司 Method for fully controlling files in computer system
US20080301644A1 (en) * 2007-05-30 2008-12-04 Ulrich Drepper Facilitating availability of object data types at runtime
CN104243604A (en) * 2014-09-28 2014-12-24 北京奇虎科技有限公司 File disabling method and device
CN107368536A (en) * 2017-06-22 2017-11-21 深圳市金立通信设备有限公司 The optimization method and terminal of a kind of installation kit
CN107783766A (en) * 2016-08-25 2018-03-09 腾讯科技(深圳)有限公司 The method and apparatus cleared up the file of application program
CN107832062A (en) * 2017-09-08 2018-03-23 上海壹账通金融科技有限公司 A kind of method for updating program and terminal device
CN109284142A (en) * 2018-08-15 2019-01-29 Oppo广东移动通信有限公司 File preloads method, apparatus, electronic equipment and computer readable storage medium
CN109309725A (en) * 2018-10-25 2019-02-05 深圳市腾讯信息技术有限公司 Using downloading and update method, device, computer equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1409227A (en) * 2001-09-14 2003-04-09 北京瑞星科技股份有限公司 Method for fully controlling files in computer system
US20080301644A1 (en) * 2007-05-30 2008-12-04 Ulrich Drepper Facilitating availability of object data types at runtime
CN104243604A (en) * 2014-09-28 2014-12-24 北京奇虎科技有限公司 File disabling method and device
CN107783766A (en) * 2016-08-25 2018-03-09 腾讯科技(深圳)有限公司 The method and apparatus cleared up the file of application program
CN107368536A (en) * 2017-06-22 2017-11-21 深圳市金立通信设备有限公司 The optimization method and terminal of a kind of installation kit
CN107832062A (en) * 2017-09-08 2018-03-23 上海壹账通金融科技有限公司 A kind of method for updating program and terminal device
CN109284142A (en) * 2018-08-15 2019-01-29 Oppo广东移动通信有限公司 File preloads method, apparatus, electronic equipment and computer readable storage medium
CN109309725A (en) * 2018-10-25 2019-02-05 深圳市腾讯信息技术有限公司 Using downloading and update method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN110659081B (en) 2022-12-27

Similar Documents

Publication Publication Date Title
CN106569800B (en) Front-end interface generation method and device
EP3096224B1 (en) Method and apparatus for processing application installation package
US20180167478A1 (en) Method and apparatus for displaying notification message
CN107463372B (en) Data-driven page updating method and device
CN116069612A (en) Abnormality positioning method and device and electronic equipment
CN111913756B (en) Application program optimizing method, device and system, electronic equipment and storage medium
CN107506496B (en) Defragmentation method, defragmentation device and computer-readable storage medium
CN111580824B (en) Program optimization method, device and storage medium
CN106293683B (en) Project compiling method and device
CN114528037B (en) Application starting method and device, electronic equipment and storage medium
CN106354595B (en) Mobile terminal, hardware component state detection method and device
CN112631695B (en) Data verification method and device, electronic equipment and storage medium
CN110659081B (en) File processing method and device for program object and electronic equipment
CN113536180A (en) Item processing method, item processing device, electronic equipment, storage medium and program product
CN107526683B (en) Method and device for detecting functional redundancy of application program and storage medium
CN111104110A (en) Global style sharing method, global style sharing device and electronic device
CN113934452B (en) Data processing method and device, electronic equipment and storage medium
CN113946346B (en) Data processing method and device, electronic equipment and storage medium
CN114020504B (en) Data processing method and device, electronic equipment and storage medium
CN111596949B (en) Method and device for developing application program
CN114020694B (en) Header file address acquisition method and device, electronic equipment and storage medium
CN114020505B (en) Data processing method and device, electronic equipment and storage medium
CN116126320B (en) Data processing method and device, electronic equipment and storage medium
CN107463414B (en) Application installation method and device
CN112988173A (en) Method, apparatus and medium for processing system partition application

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