CN109343892A - It is a kind of for detecting the method, apparatus and computer equipment of file - Google Patents

It is a kind of for detecting the method, apparatus and computer equipment of file Download PDF

Info

Publication number
CN109343892A
CN109343892A CN201810983505.2A CN201810983505A CN109343892A CN 109343892 A CN109343892 A CN 109343892A CN 201810983505 A CN201810983505 A CN 201810983505A CN 109343892 A CN109343892 A CN 109343892A
Authority
CN
China
Prior art keywords
file
code
destination
ignore
file destination
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810983505.2A
Other languages
Chinese (zh)
Inventor
崔俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo 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 Qihoo Technology Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201810983505.2A priority Critical patent/CN109343892A/en
Publication of CN109343892A publication Critical patent/CN109343892A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding

Landscapes

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

Abstract

The embodiment of the present application provides a kind of for detecting the method, apparatus and computer equipment of file, and method includes: that the code obtained in local code warehouse ignores file;Ignored in file using preset inspection policies detection code and ignores order with the presence or absence of file destination is corresponding;If it does not exist, then by file destination it is corresponding ignore order and be updated to code ignore in file, form the new code for being ignored to file destination and ignore file;In this way, ignore file before upload code file to code and detect, if code ignore in file there is no file destination is corresponding ignore order when, form the new code for being ignored to file destination and ignore file;File can so be ignored using new code to ignore institute's ignored file destination in need, the quantity of documents of upload is reduced, improve uploading rate;And ensuring to be uploaded to the file in the code storage of distal end is the file really needed, avoids the operation collapse of distal end code storage.

Description

It is a kind of for detecting the method, apparatus and computer equipment of file
Technical field
The present invention relates to technical field of software development more particularly to a kind of for detecting the method, apparatus and calculating of file Machine equipment.
Background technique
It often may require that in project development process and submitted using code release management software git into distal end code storage Code.But in compiled code, since different computer languages can all generate the data packet largely relied in compilation process File, and these data packet Documents Comparisons are big, if these data APMB packages are committed to distal end code together when submitting code Warehouse then will lead to and submit rate slow;If uploading so for a long time, lead to the operation collapse of distal end code storage.
Summary of the invention
In view of the above problems, it proposes on the present invention overcomes the above problem or at least be partially solved in order to provide one kind State the method, apparatus and computer equipment for being used to detect file of problem.
The first aspect of the present invention provides a kind of method for detecting file, which comprises
The code obtained in local code warehouse ignores file;
Ignored in file using the preset inspection policies detection code and ignores life with the presence or absence of file destination is corresponding It enables;If it does not exist, then by the file destination it is corresponding ignore order and be updated to the code ignore in file, formed for pair The new code that the file destination is ignored ignores file.
It is described to be ignored in file using the preset inspection policies detection code with the presence or absence of target text in above scheme Part is corresponding to ignore order, comprising:
Determine the file type of the file destination;
Based on the file type of the file destination, detect whether exist under the code directory in the local code warehouse Corresponding file destination, the if it exists file destination, it is determined that the code ignores in file that there is no the file destinations It is corresponding to ignore order.
In above scheme, the file type of the determination file destination, comprising:
Obtain the extension name of the file destination;
The file type of the file destination is determined based on the extension name of the file destination.
In above scheme, the file type based on the file destination, the code in the local code warehouse Detect whether that there are corresponding file destinations under catalogue, comprising:
The file under the code directory is traversed, to obtain the file type of the file under the code directory;
The file type of the file destination is matched with the file type of the file under the code directory, if energy Successful match, it is determined that there are the corresponding file destinations.
In above scheme, it is described by the file destination it is corresponding ignore order and be updated to the code ignore in file, Include:
By the file destination it is corresponding ignore order and be added to the code ignore in file;
Refresh the code and ignores file.
In above scheme, it is described by the file destination it is corresponding ignore order and be updated to the code ignore in file, After new code of the formation for being ignored to the file destination ignores file, comprising:
Ignore file using the new code to handle the source code file in the local code warehouse, to neglect The file destination in the slightly described source code file;
The code file after the file destination will be ignored to be uploaded in the code storage of distal end.
In above scheme, the file destination includes: to compile the code text based on multiple types computer programming language The dependent file generated respectively when part.
The second aspect of the present invention, provides a kind of for detecting the device of file, and described device includes:
Acquiring unit ignores file for obtaining the code in local code warehouse;
Detection unit is ignored in file for detecting the code using preset inspection policies with the presence or absence of file destination It is corresponding to ignore order;
Updating unit, for the code ignore in file there is no the file destination is corresponding ignore order when, By the file destination it is corresponding ignore order and be updated to the code ignore file, formed for being carried out to the file destination The new code ignored ignores file.
In above scheme, the detection unit includes:
Subelement is determined, for determining the file type of the file destination;
Detection sub-unit, the code mesh for the file type based on the file destination, in the local code warehouse It is detected whether under record there are corresponding file destination, if it exists the file destination, it is determined that the code is ignored in file not Ignore order there are the file destination is corresponding.
In above scheme, the determining subelement is specifically used for:
Obtain the extension name of the file destination;
The file type of the file destination is determined based on the extension name of the file destination.
In above scheme, the detection sub-unit is specifically used for:
The file under the code directory is traversed, to obtain the file type of the file under the code directory;
In ergodic process, by the file type of the file under the file type of the file destination and the code directory It is matched, if energy successful match, it is determined that there are the corresponding file destinations.
In above scheme, the updating unit is specifically used for:
By the file destination it is corresponding ignore order and be added to the code ignore in file;
Refresh the code and ignores file.
In above scheme, described device further include: uploading unit,
For by the file destination it is corresponding ignore order and be updated to the code ignore in file, formed for pair After the new code that the file destination is ignored ignores file, ignore file to the local generation using the new code The source code file in code warehouse is handled, to ignore the file destination in the source code file;
The code file after the file destination will be ignored to be uploaded in the code storage of distal end.
In above scheme, the file destination includes: to compile the code text based on multiple types computer programming language The dependent file generated respectively when part.
The third aspect of the present invention provides a kind of computer readable storage medium, is stored thereon with computer program, the journey The step of any of the above-described the method is realized when sequence is executed by processor.
The third aspect of the present invention provides a kind of for detecting the computer equipment of file, comprising:
At least one processor;And
At least one processor being connect with the processor communication, wherein the memory is stored with can be by the place The program instruction that device executes is managed, the processor calls described program instruction to be able to carry out the step such as any of the above-described the method Suddenly.
The technical solution provided in the embodiment of the present application, has at least the following technical effects or advantages:
The embodiment of the present application provides a kind of for detecting the method, apparatus and computer equipment of file, and method includes: to obtain Code in local code warehouse ignores file;Being ignored in file using the preset inspection policies detection code whether there is File destination is corresponding to ignore order;If it does not exist, then ignore the file destination is corresponding order and be updated to the code Ignore in file, forms the new code for being ignored to the file destination and ignore file;In this way, in upload code text Before part, file is ignored to code and is detected, if code ignore in file there is no file destination is corresponding ignore order when, It then forms the new code for being ignored to file destination and ignores file;So it can ignore file using new code Institute's ignored file destination in need is ignored, the quantity of documents of upload is reduced, improves uploading rate;And it can be true Protecting the file being uploaded in the code storage of distal end is the file really needed, avoids the operation collapse of distal end code storage.
The above description is only an overview of the technical scheme of the present invention, in order to better understand the technical means of the present invention, And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can It is clearer and more comprehensible, the followings are specific embodiments of the present invention.
Detailed description of the invention
By reading the following detailed description of the preferred embodiment, various other advantages and benefits are common for this field Technical staff will become clear.The drawings are only for the purpose of illustrating a preferred embodiment, and is not considered as to the present invention Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 shows according to an embodiment of the invention for detecting the method flow schematic diagram of file;
Fig. 2 shows according to an embodiment of the invention for detecting the apparatus structure schematic diagram of file;
Fig. 3 shows the structural schematic diagram of detection unit according to an embodiment of the invention.
Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure in attached drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure It is fully disclosed to those skilled in the art.
The embodiment of the invention provides a kind of for detecting the method, apparatus and computer equipment of file, existing to solve There is technology when to distal end code storage upload code file, the data APMB package that compiled code file generates can be submitted together To distal end code storage, lead to the technical issues of submitting rate slow and the operation collapse of distal end code storage.
Embodiment one
The present embodiment provides a kind of methods for detecting file, as shown in Figure 1, method includes:
S110, the code obtained in local code warehouse ignore file;
In project development process, it will usually it needs to be compiled code using multiple types computer programming language, A large amount of a plurality of types of data APMB packages, such as obj ect file and history file can be generated so in compilation process.It is this kind of File do not need in the process of development tracking version, therefore to distal end code storage submit code file when, need Such file is neglected and (can be understood as filtering out).Wherein, the type of data APMB package may include binary system Packet, jar packet, python packet and docker packet etc..
It under normal circumstances, is to ignore file gitignore using the code in local code warehouse to carry out code file Ignore, but the rule of ignoring configured in gitignore file sometimes is incomplete, if not to gitignore file into If row detection, cause the effect ignored bad.Therefore in the present embodiment to before the code storage upload code file of distal end, Need to obtain the gitignore file in local code warehouse, can detect to gitignore file.
Here, because being that code file is added in local cache first with git add, then utilize git commit will Code file in local cache is stored into local code warehouse, then utilizes git push by the generation in local code warehouse Code file is uploaded to distal end code storage.
S111 is ignored in file using the preset inspection policies detection code and is neglected with the presence or absence of file destination is corresponding Slightly order;If it does not exist, then by the file destination it is corresponding ignore order and be updated to the code ignore in file.
It gets after code ignores file gitignore file, ignores file using preset inspection policies detection code In ignore order with the presence or absence of file destination is corresponding, if it does not exist, then ignore order more for preset file destination is corresponding Newly ignore in file to code, form new code for being ignored to the file destination and ignore file, with can be to mesh Mark file is ignored.
File destination is file to be ignored, and file destination may include being compiled based on multiple types computer programming language The dependent file generated respectively when code file, for example, utilize java language compilation code file when generate dependent file, benefit The dependent file generated when with C Plus Plus compiled code file.Wherein, inspection policies are arranged in detection script, when need When being detected to gitignore file, will test in script merging local code warehouse in advance.
As a kind of optional embodiment, ignored in file using preset inspection policies detection code with the presence or absence of target File is corresponding to ignore order, comprising:
Determine the file type of file destination;
File type based on file destination detects whether that there are corresponding mesh under the code directory in local code warehouse File is marked, the file destination, illustrates that file destination is not ignored if it exists, it is determined that code, which is ignored, is not present mesh in file File is corresponding ignores order for mark.
Here, as a kind of optional embodiment, the file type of the file destination is determined, comprising:
Obtain the extension name of file destination;
The file type of file destination is determined based on the extension name of file destination.
For example, the file type of file destination is jar packet, then corresponding extension name is just .jar, therefore works as and get When the extension name of file destination, it is correspondingly assured that out the type of file destination.
As a kind of optional embodiment, the file type based on file destination, the code mesh in local code warehouse Detect whether that there are corresponding file destinations under record, comprising:
The file under code directory is traversed, to obtain the file type of the All Files under code directory;
The file type of file destination is matched with the file type of the All Files under code directory, if can match Success, it is determined that there are corresponding file destinations under code directory.
Determine that there are when corresponding file destination, then illustrate that it is literary without configuration target in file that code is ignored under code directory Part is corresponding to ignore order, then then can by file destination it is corresponding ignore order and automatically update to code ignore in file, shape Ignore file at the new code for being ignored to the file destination, can ignore to file destination.Wherein, mesh Mark file is corresponding, and to ignore order be preset.
Here, a kind of file that may include file type of file destination may also include the text of multiple file types Part, can be simultaneously by plurality of target text in order to improve matching efficiency in matching when the type of file destination includes a variety of The file type of part is matched with the file type of the All Files under code directory;Of course for improve matching precision, It can gradually be matched according to preset matching order.
As a kind of optional embodiment, by preset file destination it is corresponding ignore order and be updated to the code ignore In file, comprising:
By file destination it is corresponding ignore order and be added to the code ignore in file;
Refresh code and ignores file.
Here, different types of file destination is corresponding ignores order and is different, and ignoring order is according to file destination Type it is preset.For example generated when file destination is using java language compilation, then corresponding ignore order are as follows:
#--->Java
*.class
#Mobile Tools for Java(J2ME)
.mtj.tmp/
#Package Files#
*.jar
*.war
*.ear
#virtual machine crash logs,see http://www.java.com/en/download/help/ error_hotspot.xml
hs_err_pid*
For example generated when file destination is compiled using C Plus Plus, then corresponding ignore order are as follows:
.obj/
.objs/
callapp_engine/src/proto/*.cc
callapp_engine/src/proto/*.h
callapp_engine/src/proto/*.py
callapp_engine/src/proto/*.pyc
callapp_engine/ut/commercial_promotion/proto/*.pyc
libcallapp_engine.so*
libcallapp_engine*.rpm
.*.swp
test/
backup-rpms/
qconf.log.*
As a kind of optional embodiment, by the file destination it is corresponding ignore order and be updated to code ignore in file Afterwards, comprising:
Ignore file using new code to handle the source code file in local code warehouse, to ignore original generation File destination in code file;
The code file after file destination will be ignored to be uploaded in the code storage of distal end.
Here, ignore efficiency to can be improved, it will be under the file type of the file destination and the code directory After the file type of file is matched, the file of successful match can be stored into preset file, utilize code When ignoring file and ignoring to the code file in local code warehouse, this document folder can be directly neglected.
Can ensure that in this way the code file being uploaded in the code storage of distal end be needed, correct file.
Based on same inventive concept, the application also provides a kind of for ignoring the device of file, detailed in Example two.
Embodiment two
The present embodiment provides a kind of for detecting the device of file, as shown in Fig. 2, device includes: acquiring unit 21, detection Unit 22 and updating unit 23;Wherein,
In project development process, it will usually it needs to be compiled code using multiple types computer programming language, A large amount of a plurality of types of data APMB packages, such as obj ect file and history file can be generated so in compilation process.It is this kind of File do not need in the process of development tracking version, therefore to distal end code storage submit code file when, need Such file is neglected and (can be understood as filtering out).Wherein, the type of data APMB package may include binary system Packet, jar packet, python packet and docker packet etc..
It under normal circumstances, is to ignore file gitignore using the code in local code warehouse to carry out code file Ignore, but the rule of ignoring configured in gitignore file sometimes is incomplete, if not to gitignore file into If row detection, cause the effect ignored bad.Therefore the acquiring unit 21 in the present embodiment is used for distal end code storage Before upload code file, the code obtained in local code warehouse ignores file, can examine to gitignore file It surveys.
Here, because being that code file is added in local cache first with git add, then utilize git commit will Code file in local cache is stored into local code warehouse, then utilizes git push by the generation in local code warehouse Code file is uploaded to distal end code storage.
It gets after code ignores file gitignore file, detection unit 22 is used to examine using preset inspection policies Survey code, which is ignored in file, ignores order with the presence or absence of file destination is corresponding;Updating unit 23 is used to ignore text in the code In part there is no the file destination is corresponding ignore order when, ignore file destination is corresponding order and be updated to the code Ignore in file, form new code for being ignored to the file destination and ignore file, with can to file destination into Row is ignored.
File destination is file to be ignored, and file destination may include a variety of based on the compiling of type computer programming language The dependent file generated respectively when code file, for example, utilize java language compilation code file when generate dependent file, benefit The dependent file generated when with C Plus Plus compiled code file.Wherein, inspection policies are arranged in detection script, when need When being detected to gitignore file, will test in script merging local code warehouse in advance.
As a kind of optional embodiment, referring to Fig. 3, detection unit 21 comprises determining that subelement 31 and detection sub-unit 32;
Determine subelement 31 for determining the file type of the file destination;
Detection sub-unit 32 is used for the file type based on the file destination, the code mesh in the local code warehouse It is detected whether under record there are corresponding file destination, if it exists the file destination, it is determined that the code is ignored in file not Ignore order there are the file destination is corresponding.
As a kind of optional embodiment, determine that subelement 31 is specifically used for:
Obtain the extension name of file destination;
The file type of file destination is determined based on the extension name of file destination.
For example, the file type of file destination is jar packet, then corresponding extension name is just .jar, therefore works as and get When the extension name of file destination, it is correspondingly assured that out the type of file destination.
As a kind of optional embodiment, detection sub-unit 32 is specifically used for:
The file under code directory is traversed, to obtain the file type of the All Files under code directory;
The file type of file destination is matched with the file type of the All Files under code directory, if can match Success, it is determined that there are corresponding file destinations under code directory.
Determine that there are when corresponding file destination, then illustrate that it is literary without configuration target in file that code is ignored under code directory Part is corresponding to ignore order, then updating unit 23 then can by file destination it is corresponding ignore order and automatically update to code ignore In file, forms the new code for being ignored to the file destination and ignore file, can be neglected to file destination Slightly.Wherein, corresponding to ignore order be preset to file destination.
Here, a kind of file that may include file type of file destination may also include the text of multiple file types Part, when the type of file destination includes a variety of, in matching, in order to improve matching efficiency, detection sub-unit 32 can be simultaneously The file type of plurality of target file is matched with the file type of the All Files under code directory;Of course for raising Matching precision can also gradually be matched according to preset matching order.
As a kind of optional embodiment, updating unit 23 is specifically used for:
By file destination it is corresponding ignore order and be added to the code ignore in file;
Refresh code and ignores file.
Here, different types of file destination is corresponding ignores order and is different, and ignoring order is according to file destination Type it is preset.For example generated when file destination is using java language compilation, then corresponding ignore order are as follows:
#--->Java
*.class
#Mobile Tools for Java(J2ME)
.mtj.tmp/
#Package Files#
*.jar
*.war
*.ear
#virtual machine crash logs,see http://www.java.com/en/download/help/ error_hotspot.xml
hs_err_pid*
For example generated when file destination is compiled using C Plus Plus, then corresponding ignore order are as follows:
.obj/
.objs/
callapp_engine/src/proto/*.cc
callapp_engine/src/proto/*.h
callapp_engine/src/proto/*.py
callapp_engine/src/proto/*.pyc
callapp_engine/ut/commercial_promotion/proto/*.pyc
libcallapp_engine.so*
libcallapp_engine*.rpm
.*.swp
test/
backup-rpms/
qconf.log.*
With continued reference to Fig. 2, device further includes uploading unit 24, is specifically used for: the preset file destination is corresponding Ignore order to be updated to after code ignores in file, ignores file to the source code text in local code warehouse using new code Part is handled, to ignore the file destination in source code file;
The code file after file destination will be ignored to be uploaded in the code storage of distal end.
Here, ignore efficiency to can be improved, detection sub-unit 32 by the file type of the file destination with it is described After the file type of file under code directory is matched, the file of successful match can be stored to preset file In, uploading unit 23, can be direct when ignoring file using code and ignoring to the code file in local code warehouse Neglect this document folder.
Can ensure that in this way the code file being uploaded in the code storage of distal end be needed, correct file.
The technical solution provided in the embodiment of the present application, has at least the following technical effects or advantages:
The embodiment of the present application provides a kind of for detecting the method, apparatus and computer equipment of file, and method includes: to obtain Code in local code warehouse ignores file;Being ignored in file using the preset inspection policies detection code whether there is File destination is corresponding to ignore order;If it does not exist, then ignore the file destination is corresponding order and be updated to the code Ignore in file, forms the new code for being ignored to the file destination and ignore file;In this way, in upload code text Before part, file is ignored to code and is detected, if code ignore in file there is no file destination is corresponding ignore order when, It then forms the new code for being ignored to the file destination and ignores file;It can so be ignored using new code File ignores institute's ignored file destination in need, reduces the quantity of documents of upload, improves uploading rate;And it can It is the file really needed to ensure to be uploaded to the file in the code storage of distal end, avoids the operation collapse of distal end code storage.
Algorithm and display are not inherently related to any particular computer, virtual system, or other device provided herein. Various general-purpose systems can also be used together with teachings based herein.As described above, it constructs required by this kind of system Structure be obvious.In addition, the present invention is also not directed to any particular programming language.It should be understood that can use various Programming language realizes summary of the invention described herein, and the description done above to language-specific is to disclose this hair Bright preferred forms.
In the instructions provided here, numerous specific details are set forth.It is to be appreciated, however, that implementation of the invention Example can be practiced without these specific details.In some instances, well known method, structure is not been shown in detail And technology, so as not to obscure the understanding of this specification.
Similarly, it should be understood that in order to simplify the disclosure and help to understand one or more of the various inventive aspects, Above in the description of exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes In example, figure or descriptions thereof.However, the disclosed method should not be interpreted as reflecting the following intention: i.e. required to protect Shield the present invention claims features more more than feature expressly recited in each claim.More precisely, as following Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore, Thus the claims for following specific embodiment are expressly incorporated in the specific embodiment, wherein each claim itself All as a separate embodiment of the present invention.
Those skilled in the art will understand that can be carried out adaptively to the module in the equipment in embodiment Change and they are arranged in one or more devices different from this embodiment.It can be the module or list in embodiment Member or component are combined into a module or unit or component, and furthermore they can be divided into multiple submodule or subelement or Sub-component.Other than such feature and/or at least some of process or unit exclude each other, it can use any Combination is to all features disclosed in this specification (including adjoint claim, abstract and attached drawing) and so disclosed All process or units of what method or apparatus are combined.Unless expressly stated otherwise, this specification is (including adjoint power Benefit require, abstract and attached drawing) disclosed in each feature can carry out generation with an alternative feature that provides the same, equivalent, or similar purpose It replaces.
In addition, it will be appreciated by those of skill in the art that although some embodiments in this include institute in other embodiments Including certain features rather than other feature, but the combination of the feature of different embodiment means in the scope of the present invention Within and form different embodiments.For example, in the following claims, embodiment claimed it is any it One can in any combination mode come using.
Various component embodiments of the invention can be implemented in hardware, or to run on one or more processors Software module realize, or be implemented in a combination thereof.It will be understood by those of skill in the art that can be used in practice Microprocessor or digital signal processor (DSP) realize gateway according to an embodiment of the present invention, proxy server, in system Some or all components some or all functions.The present invention is also implemented as executing side as described herein Some or all device or device programs (for example, computer program and computer program product) of method.It is such It realizes that program of the invention can store on a computer-readable medium, or can have the shape of one or more signal Formula.Such signal can be downloaded from an internet website to obtain, and perhaps be provided on the carrier signal or with any other shape Formula provides.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and ability Field technique personnel can be designed alternative embodiment without departing from the scope of the appended claims.In the claims, Any reference symbol between parentheses should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not Element or step listed in the claims.Word "a" or "an" located in front of the element does not exclude the presence of multiple such Element.The present invention can be by means of including the hardware of several different elements and being come by means of properly programmed computer real It is existing.In the unit claims listing several devices, several in these devices can be through the same hardware branch To embody.The use of word first, second, and third does not indicate any sequence.These words can be explained and be run after fame Claim.
The invention discloses A1, a kind of method for detecting file, which comprises
The code obtained in local code warehouse ignores file;
Ignored in file using the preset inspection policies detection code and ignores life with the presence or absence of file destination is corresponding It enables;If it does not exist, then by the file destination it is corresponding ignore order and be updated to the code ignore in file, formed for pair The new code that the file destination is ignored ignores file.
A2, method as described in a1, the utilization preset inspection policies detection code ignore in file whether deposit Ignore order file destination is corresponding, comprising:
Determine the file type of the file destination;
Based on the file type of the file destination, detect whether exist under the code directory in the local code warehouse Corresponding file destination, the if it exists file destination, it is determined that the code ignores in file that there is no the file destinations It is corresponding to ignore order.
A3, as described in A2 method, the file type of the determination file destination, comprising:
Obtain the extension name of the file destination;
The file type of the file destination is determined based on the extension name of the file destination.
A4, as described in A2 method, the file type based on the file destination, in the local code warehouse Code directory under detect whether that there are corresponding file destinations, comprising:
The file under the code directory is traversed, to obtain the file type of the file under the code directory;
The file type of the file destination is matched with the file type of the file under the code directory, if energy Successful match, it is determined that there are the corresponding file destinations.
A5, method as described in a1, it is described by the file destination it is corresponding ignore order and be updated to the code ignore In file, comprising:
By the file destination it is corresponding ignore order and be added to the code ignore in file;
Refresh the code and ignores file.
A6, method as described in a1, it is described by the file destination it is corresponding ignore order and be updated to the code ignore In file, after new code of the formation for being ignored to the file destination ignores file, comprising:
Ignore file using the new code to handle the source code file in the local code warehouse, to neglect The file destination in the slightly described source code file;
The code file after the file destination will be ignored to be uploaded in the code storage of distal end.
The described in any item methods of A7, such as A1~A6, the file destination include: based on multiple types computer programming language Speech compiles the dependent file generated respectively when the code file.
B8, a kind of for detecting the device of file, described device includes:
Acquiring unit ignores file for obtaining the code in local code warehouse;
Detection unit is ignored in file for detecting the code using preset inspection policies with the presence or absence of file destination It is corresponding to ignore order;
Updating unit, for the code ignore in file there is no the file destination is corresponding ignore order when, By the file destination it is corresponding ignore order and be updated to the code ignore file, formed for being carried out to the file destination The new code ignored ignores file.
B9, the device as described in B8, the detection unit include:
Subelement is determined, for determining the file type of the file destination;
Detection sub-unit, the code mesh for the file type based on the file destination, in the local code warehouse It is detected whether under record there are corresponding file destination, if it exists the file destination, it is determined that the code is ignored in file not Ignore order there are the file destination is corresponding.
B10, the device as described in B9, the determining subelement are specifically used for:
Obtain the extension name of the file destination;
The file type of the file destination is determined based on the extension name of the file destination.
B11, the device as described in B9, the detection sub-unit are specifically used for:
The file under the code directory is traversed, to obtain the file type of the file under the code directory;
In ergodic process, by the file type of the file under the file type of the file destination and the code directory It is matched, if energy successful match, it is determined that there are the corresponding file destinations.
B12, the device as described in B8, the updating unit are specifically used for:
By the file destination it is corresponding ignore order and be added to the code ignore in file;
Refresh the code and ignores file.
B13, the device as described in B8, described device further include: uploading unit,
For by the file destination it is corresponding ignore order and be updated to the code ignore in file, formed for pair After the new code that the file destination is ignored ignores file, ignore file to the local generation using the new code The source code file in code warehouse is handled, to ignore the file destination in the source code file;
The code file after the file destination will be ignored to be uploaded in the code storage of distal end.
The described in any item devices of B14, such as B8~B13, the file destination include: based on multiple types computer programming The dependent file generated respectively when code file described in language compilation.
C15, a kind of computer readable storage medium, are stored thereon with computer program, when which is executed by processor The step of realizing any one of A1 to A7 the method.
It is D16, a kind of for detecting the computer equipment of file, comprising:
At least one processor;And
At least one processor being connect with the processor communication, wherein the memory is stored with can be by the place The program instruction that device executes is managed, the processor calls described program to instruct the step for being able to carry out any one of A1 to A7 the method Suddenly.

Claims (10)

1. a method of for detecting file, which is characterized in that the described method includes:
The code obtained in local code warehouse ignores file;
Ignored in file using the preset inspection policies detection code and ignores order with the presence or absence of file destination is corresponding;If Be not present, then by the file destination it is corresponding ignore order and be updated to the code ignore in file, formed for described The new code that file destination is ignored ignores file.
2. the method as described in claim 1, which is characterized in that described to be ignored using the preset inspection policies detection code Ignore order with the presence or absence of file destination is corresponding in file, comprising:
Determine the file type of the file destination;
Based on the file type of the file destination, detect whether there is correspondence under the code directory in the local code warehouse File destination, the file destination if it exists, it is determined that it is corresponding that the code ignores in file that there is no the file destinations Ignore order.
3. method according to claim 2, which is characterized in that the file type of the determination file destination, comprising:
Obtain the extension name of the file destination;
The file type of the file destination is determined based on the extension name of the file destination.
4. method according to claim 2, which is characterized in that the file type based on the file destination, described Detect whether that there are corresponding file destinations under code directory in local code warehouse, comprising:
The file under the code directory is traversed, to obtain the file type of the file under the code directory;
The file type of the file destination is matched with the file type of the file under the code directory, if can match Success, it is determined that there are the corresponding file destinations.
5. a kind of for detecting the device of file, which is characterized in that described device includes:
Acquiring unit ignores file for obtaining the code in local code warehouse;
Detection unit, it is corresponding with the presence or absence of file destination in file for being ignored using the preset inspection policies detection code Ignore order;
Updating unit, for the code ignore in file there is no the file destination is corresponding ignore order when, by institute State file destination it is corresponding ignore order and be updated to the code ignore file, formed for ignoring to the file destination New code ignore file.
6. device as claimed in claim 5, which is characterized in that the detection unit includes:
Subelement is determined, for determining the file type of the file destination;
Detection sub-unit, for the file type based on the file destination, under the code directory in the local code warehouse It detects whether there are corresponding file destination, if it exists the file destination, it is determined that the code, which is ignored in file, to be not present The file destination is corresponding to ignore order.
7. device as claimed in claim 6, which is characterized in that the determining subelement is specifically used for:
Obtain the extension name of the file destination;
The file type of the file destination is determined based on the extension name of the file destination.
8. device as claimed in claim 6, which is characterized in that the detection sub-unit is specifically used for:
The file under the code directory is traversed, to obtain the file type of the file under the code directory;
In ergodic process, the file type of the file under the file type of the file destination and the code directory is carried out Matching, if energy successful match, it is determined that there are the corresponding file destinations.
9. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is held by processor The step of any one of Claims 1-4 the method is realized when row.
10. a kind of for detecting the computer equipment of file characterized by comprising
At least one processor;And
At least one processor being connect with the processor communication, wherein the memory is stored with can be by the processor The program instruction of execution, the processor call described program instruction to be able to carry out such as any one of Claims 1-4 the method The step of.
CN201810983505.2A 2018-08-27 2018-08-27 It is a kind of for detecting the method, apparatus and computer equipment of file Pending CN109343892A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810983505.2A CN109343892A (en) 2018-08-27 2018-08-27 It is a kind of for detecting the method, apparatus and computer equipment of file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810983505.2A CN109343892A (en) 2018-08-27 2018-08-27 It is a kind of for detecting the method, apparatus and computer equipment of file

Publications (1)

Publication Number Publication Date
CN109343892A true CN109343892A (en) 2019-02-15

Family

ID=65291906

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810983505.2A Pending CN109343892A (en) 2018-08-27 2018-08-27 It is a kind of for detecting the method, apparatus and computer equipment of file

Country Status (1)

Country Link
CN (1) CN109343892A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114398319A (en) * 2021-12-17 2022-04-26 苏州浪潮智能科技有限公司 File traversal method and system with directory ignoring mechanism

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105893502A (en) * 2016-03-29 2016-08-24 广州酷狗计算机科技有限公司 Code synchronization method and device
CN106201861A (en) * 2015-05-07 2016-12-07 阿里巴巴集团控股有限公司 The detection method of a kind of code quality and device
CN106776728A (en) * 2016-11-14 2017-05-31 上海斐讯数据通信技术有限公司 Code check method, system and development platform based on log file analysis
US20170220337A1 (en) * 2016-01-29 2017-08-03 International Business Machines Corporation Verifying source code in disparate source control systems
CN107977218A (en) * 2017-11-23 2018-05-01 武汉斗鱼网络科技有限公司 Code update method, device, electronic equipment and readable storage medium storing program for executing
CN108334333A (en) * 2018-01-05 2018-07-27 武汉斗鱼网络科技有限公司 A kind of source code library update method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106201861A (en) * 2015-05-07 2016-12-07 阿里巴巴集团控股有限公司 The detection method of a kind of code quality and device
US20170220337A1 (en) * 2016-01-29 2017-08-03 International Business Machines Corporation Verifying source code in disparate source control systems
CN105893502A (en) * 2016-03-29 2016-08-24 广州酷狗计算机科技有限公司 Code synchronization method and device
CN106776728A (en) * 2016-11-14 2017-05-31 上海斐讯数据通信技术有限公司 Code check method, system and development platform based on log file analysis
CN107977218A (en) * 2017-11-23 2018-05-01 武汉斗鱼网络科技有限公司 Code update method, device, electronic equipment and readable storage medium storing program for executing
CN108334333A (en) * 2018-01-05 2018-07-27 武汉斗鱼网络科技有限公司 A kind of source code library update method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114398319A (en) * 2021-12-17 2022-04-26 苏州浪潮智能科技有限公司 File traversal method and system with directory ignoring mechanism
CN114398319B (en) * 2021-12-17 2024-01-12 苏州浪潮智能科技有限公司 File traversal method and system with directory neglect mechanism

Similar Documents

Publication Publication Date Title
US8627303B2 (en) Memory optimization of virtual machine code by partitioning extraneous information
US8321856B2 (en) Supplying software updates synchronously
US9823909B1 (en) Program code conversion for cross-platform compatibility
CN103559447B (en) A kind of detection method, checkout gear and detection system based on Virus Sample feature
CN104134039A (en) Virus checking and killing method, virus checking and killing client, virus checking and killing server and virus checking and killing system
CN104036019A (en) Method and device for opening webpage links
CN104572235A (en) Compiling method and device for loadable kernel module
CN104461567A (en) Method and system for releasing software package
US20210182391A1 (en) Detecting Malicious Components Using Commit Histories
CN103761612A (en) Project release method and system
US20240160748A1 (en) Method And System For Data Flow Monitoring To Identify Application Security Vulnerabilities And To Detect And Prevent Attacks
CN109343892A (en) It is a kind of for detecting the method, apparatus and computer equipment of file
CN108460254B (en) Firmware protection method and device
US20220179930A1 (en) Source modification engine
US20230061121A1 (en) Methods concerning ongoing treatment for cancer
CN105528230A (en) Method and device for setting configuration parameters
CN111105289B (en) Method and device for judging cancellation of client order based on aop mode
CN111782239A (en) Software packaging and source code version information acquisition method, device and storage medium
CN104991925A (en) File release based detection method and apparatus
CN109271197A (en) A kind of method, apparatus and computer equipment for detection data packet conflict
CN108681460A (en) A kind of method and electric terminal of upgrading plug-in unit
CN111273944B (en) Method and device for generating program file and uploading program file to code warehouse
US11983265B2 (en) Automated integration of a source modification engine
Rodriguez Static File Path Analysis for Reliable Resource Locating
EP4136525A1 (en) Industrial application package management

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190215