CN114297072A - Code analysis method, system, device, equipment and computer readable storage medium - Google Patents
Code analysis method, system, device, equipment and computer readable storage medium Download PDFInfo
- Publication number
- CN114297072A CN114297072A CN202111643114.4A CN202111643114A CN114297072A CN 114297072 A CN114297072 A CN 114297072A CN 202111643114 A CN202111643114 A CN 202111643114A CN 114297072 A CN114297072 A CN 114297072A
- Authority
- CN
- China
- Prior art keywords
- server
- code
- analysis
- script
- analysis script
- 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
Links
Images
Landscapes
- Information Transfer Between Computers (AREA)
Abstract
The embodiment of the application provides a code analysis method, a code analysis system, a code analysis device, a code analysis equipment and a computer readable storage medium. Acquiring an analysis script sent by a first server; the analysis script comprises an analysis script for analyzing the code stored by the code repository server; verifying the installation environment of the code warehouse server according to the analysis script to obtain a verification result; under the condition that the verification result indicates that the installation environment of the code warehouse server can install the analysis script, analyzing the code according to the analysis script to obtain a first analysis result; and sending the first analysis result to the first server. According to the embodiment of the application, the waste of time can be reduced in the code analysis process, and the code analysis efficiency is improved.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a code analysis method, system, apparatus, device, and computer-readable storage medium.
Background
To simplify the code calling process, most users build a corresponding code repository and then store the code in the code repository.
The most common code repository currently is the GIT repository, where the code is typically stored in an encrypted manner. Since the codes are stored in the GIT warehouse in an encrypted manner, when a user conducts troubleshooting analysis on the codes, the codes stored in the GIT warehouse can only be pulled to a local server, and then the codes are analyzed.
However, since the data size of the code stored in the GIT repository is large, and the local server and the code repository are usually in different network segments, a lot of time is wasted in the process of pulling the code stored in the GIT repository to the local server.
Disclosure of Invention
The embodiment of the application provides a code analysis method, a code analysis system, a code analysis device, a code analysis equipment and a computer readable storage medium, which can reduce the waste of time and improve the efficiency of code analysis in the process of code analysis.
In a first aspect, an embodiment of the present application provides a code analysis method, which is applied to a code repository server, and the code analysis method includes:
acquiring an analysis script sent by a first server; the analysis script comprises an analysis script for analyzing the code stored by the code repository server;
verifying the installation environment of the code warehouse server according to the analysis script to obtain a verification result;
under the condition that the verification result indicates that the installation environment of the code warehouse server can install the analysis script, analyzing the code according to the analysis script to obtain a first analysis result;
and sending the first analysis result to the first server.
In some embodiments, the method further comprises:
under the condition that the verification result indicates that the installation environment of the code warehouse server cannot install the analysis script, screening a second server in the same network segment with the code warehouse server according to a preset condition to obtain a third server meeting the preset condition;
and sending the analysis script to the target server so that the target server analyzes the code pulled from the code warehouse server according to the analysis script, and sending a second analysis result obtained by analysis to the first server.
In some embodiments, the preset conditions include at least one of:
the capacity of the memory is not lower than two channels of 8G × 2;
the frequency of the memory is not less than 3000 MHZ;
the storage hard disk meets the requirements of an independent disk redundant array or a disk array of a distributed parity check independent disk structure;
the network transmission rate with the code warehouse server is not less than 1000 Mbps.
In some embodiments, the pulled code comprises a current version of code stored at the code repository server.
In a second aspect, an embodiment of the present application provides a code analysis method, which is applied to a third server, and the code analysis method includes:
receiving an analysis script sent by a code warehouse server under the condition that the code warehouse server verifies the environment of the code warehouse server and the verification result indicates that the installation environment of the code warehouse server cannot install the analysis script; the analysis script is sent to the code warehouse server by the first server;
analyzing the code pulled by the third server in the code warehouse server according to the analysis script to obtain a second analysis result;
and sending the second analysis result to the first server.
In a third aspect, an embodiment of the present application provides a code analysis system, where the system includes: the code warehouse server is used for acquiring the analysis script sent by the first server; analyzing the codes stored by the code warehouse server according to the analysis script to obtain a first analysis result; sending the first analysis result to a first server;
a first server for sending an analysis script to a code repository server; and receiving a first analysis result sent by the code warehouse server.
In some embodiments, the system further comprises:
the third server is used for receiving the analysis script sent by the code warehouse server; analyzing the code pulled in the code warehouse server according to the script to obtain a second analysis result, and sending the second analysis result to the first server;
the code warehouse server is also used for sending the analysis script to a third server; sending the code to a third server;
the first server is also used for receiving a second analysis result sent by the third server.
In some embodiments, the third server satisfies at least one of:
the code warehouse server is in the same network segment;
the capacity of the memory is not lower than two channels of 8G × 2;
the frequency of the memory is not less than 3000 MHZ;
the network transmission rate of the disk array of the independent disk structure and the code warehouse server, which is used for storing the hard disk and meets the requirements of the independent disk redundant array or the distributed parity check, is not less than 1000 Mbps.
In a fourth aspect, an embodiment of the present application provides a code analysis apparatus, which is applied to a code repository server, and the apparatus includes:
the acquisition module is used for acquiring the analysis script sent by the first server; the analysis script comprises an analysis script for analyzing the code stored by the code repository server;
the verification module is used for verifying the installation environment of the code warehouse server according to the analysis script to obtain a verification result;
the first analysis module is used for analyzing the code according to the analysis script under the condition that the verification result indicates that the installation environment of the code warehouse server can install the analysis script to obtain a first analysis result;
and the first sending module is used for sending the first analysis result to the first server.
In some embodiments, the code analysis apparatus further comprises:
the screening module is used for screening a second server which is in the same network segment with the code warehouse server according to a preset condition under the condition that the verification result indicates that the installation environment of the code warehouse server cannot install the analysis script, so as to obtain a third server meeting the preset condition;
and the third sending module is used for sending the analysis script to the target server so that the target server analyzes the code pulled from the code warehouse server according to the analysis script and sends a second analysis result obtained by analysis to the first server.
In some embodiments, the preset conditions include that the capacity of the memory is not lower than two channels of 8G × 2, the frequency of the memory is not less than 3000MHZ, the storage hard disk satisfies the redundant array of independent disks or the disk array of the independent disk structure of distributed parity check, and the network transmission rate with the code warehouse server is not less than 1000 Mbps.
In a fifth aspect, an embodiment of the present application further provides a code analysis apparatus, which is applied to a third server, and includes:
the receiving module is used for receiving the analysis script sent by the code warehouse server under the condition that the code warehouse server verifies the environment of the code warehouse server and the verification result indicates that the installation environment of the code warehouse server cannot install the analysis script; the analysis script is sent to the code warehouse server by the first server;
the second analysis module is used for analyzing the code pulled by the third server in the code warehouse server according to the analysis script to obtain a second analysis result;
and the second sending module is used for sending the second analysis result to the first server.
In a third aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory storing computer program instructions;
the steps of the code analysis method as in any of the embodiments of the first aspect are implemented when the processor executes the computer program instructions.
In a fourth aspect, the present application provides a computer-readable storage medium, on which computer program instructions are stored, and when executed by a processor, the computer program instructions implement the steps of the code analysis method in any one of the embodiments of the first aspect.
In a fifth aspect, the present application provides a computer program product, and instructions in the computer program product, when executed by a processor of an electronic device, enable the electronic device to perform the code analysis method as in any one of the embodiments of the first aspect.
According to the code analysis method, the code analysis device, the code analysis equipment and the computer readable storage medium, after the code warehouse server obtains the analysis script sent by the first server, whether the installation environment of the code warehouse server can install the analysis script is verified according to the analysis script, and under the condition that the verification result indicates that the code warehouse can install the analysis script, the code warehouse server installs the analysis script and analyzes the codes in the code warehouse server by using the installed analysis script. Since the analysis script is transmitted from the first server to the code repository server and then the code is analyzed in the code repository server, it is possible to avoid a waste of time caused by a large amount of code transmission in the process of transmitting a large amount of code from the code repository server to the first server and then performing code analysis by the first server. The efficiency of code analysis is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments of the present application will be briefly described below, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic structural diagram of a code analysis system according to an embodiment of the present application;
FIG. 2 is a schematic block diagram of another code analysis system provided in an embodiment of the present application;
FIG. 3 is a flow chart illustrating a method for code analysis according to an embodiment of the present application;
FIG. 4 is a schematic flow chart diagram of another code analysis method provided by an embodiment of the present application;
fig. 5 is a schematic structural diagram of a code analysis apparatus according to an embodiment of the present application;
FIG. 6 is a schematic structural diagram of another code analysis apparatus provided in an embodiment of the present application;
fig. 7 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
Features and exemplary embodiments of various aspects of the present application will be described in detail below, and in order to make objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are intended to be illustrative only and are not intended to be limiting. It will be apparent to one skilled in the art that the present application may be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the present application by illustrating examples thereof.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
In order to solve the problems of the prior art, embodiments of the present application provide a code analysis method, system, apparatus, device, and computer-readable storage medium.
The following first describes a code analysis system provided in an embodiment of the present application.
Fig. 1 shows a schematic structural diagram of a code analysis system 10 according to an embodiment of the present application. As shown in fig. 1, the system may include:
a code repository server 101, configured to obtain an analysis script sent by a first server; analyzing the codes stored by the code warehouse server according to the analysis script to obtain a first analysis result; sending the first analysis result to a first server;
a first server 102 for sending an analysis script to a code repository server; and receiving a first analysis result sent by the code warehouse server.
In some embodiments, the code repository server 101 may include a server corresponding to a repository storing code. The first server 102 may comprise a server in a different network segment, and even a different domain, than the code repository server 101 described above. Illustratively, the code repository server 101 may be a cloud server and the first server 102 may be a local server.
In some embodiments, the analysis script may include a user-defined compiled script for analyzing the code. In the code warehouse, the code is stored in a ciphertext form, and before the analysis script analyzes the code, the code needs to be decrypted first to obtain a code plaintext, and then the code plaintext is analyzed.
In some embodiments, the code analyzed by the code repository server 101 according to the analysis script may include the latest version of the code stored in the code repository server 101.
The code repository server 101 stores the codes of the respective versions, and if the stored codes of the respective versions are analyzed, a large amount of time is wasted in the analysis process. And only the latest version of the code is analyzed, the workload of analysis can be reduced.
In some embodiments, the installation environment of the code repository server 101 may not be able to install the analysis script, in which case the code repository server 101 may need to verify the installation environment of the code repository server 101 from the analysis script after receiving the analysis script.
In some embodiments, verifying the installation environment of the code repository server 101 according to the analysis script specifically includes: and acquiring the installation parameters of the analysis script and the installation parameters of the code warehouse server 101, determining whether the installation parameters of the analysis script are matched with the installation parameters of the code warehouse server 101, and if so, passing the verification.
In some embodiments, an embodiment of the present application also provides another code analysis system 20 that may be applied in situations where the installation environment of the code repository server is unable to install analysis scripts.
Fig. 2 is a schematic structural diagram of another code analysis system 20 provided in an embodiment of the present application.
The code analysis system 20 described above as shown in fig. 2 may further include:
a third server 103, which may be configured to receive an analysis script sent by the code repository server; analyzing the code pulled in the code warehouse server according to the script to obtain a second analysis result, and sending the second analysis result to the first server 102;
a code repository server, which may also be used to send the analysis script to the third server 103; sending the code to the third server 103;
the first server may be further configured to receive a second analysis result sent by the third server 103.
In some embodiments, the third server 103 satisfies at least one of:
in the same network segment as the code repository server 101;
the capacity of the memory is not lower than two channels of 8G × 2;
the frequency of the memory is not less than 3000 MHZ;
the network transmission rate of the disk array of the independent disk structure and the code warehouse server, which is used for storing the hard disk and meets the requirements of the independent disk redundant array or the distributed parity check, is not less than 1000 Mbps.
Therefore, the code warehouse server sends the analysis script and the code to a third server which is in the same network segment with the code warehouse server, has the capacity of a memory not lower than 8G x 2 and the frequency of the memory not lower than 3000MHZ, and has the network transmission rate of the disk array of the independent disk structure and the code warehouse server, wherein the storage hard disk of the disk array meets the requirements of the independent disk redundant array or the distributed parity check, and the network transmission rate of the code warehouse server is not lower than 1000 Mbps. The network segment, the memory parameter, the disk parameter and the transmission parameter of the code warehouse server of the third server are set, so that the problem that the time for transmitting the codes is too long due to the limitation of the parameters in the process of transmitting the codes to the third server by the code warehouse server can be solved. Compared with the code transmission to the first server, the code transmission to the third server in the same network segment with the code warehouse server can avoid the problems that the code warehouse server needs to span network segments and has long transmission distance in the process of transmitting the code to the first server. The analysis efficiency of the codes is improved on the whole.
Based on the same inventive concept, the embodiment of the application also provides a code analysis method which is applied to the code warehouse server.
Fig. 3 is a flowchart illustrating a code analysis method according to an embodiment of the present application, where as shown in fig. 3, the method may include:
s310, obtaining an analysis script sent by a first server; the analysis script comprises an analysis script for analyzing the code stored by the code repository server;
s320, verifying the installation environment of the code warehouse server according to the analysis script to obtain a verification result;
s330, under the condition that the verification result indicates that the installation environment of the code warehouse server can install the analysis script, analyzing the code according to the analysis script to obtain a first analysis result;
s340, sending the first analysis result to a first server.
Therefore, after the code warehouse server acquires the analysis script sent by the first server, whether the installation environment of the code warehouse server can install the analysis script is verified according to the analysis script, and when the verification result indicates that the code warehouse can install the analysis script, the code warehouse server installs the analysis script and analyzes the codes in the code warehouse server by using the installed analysis script. Since the analysis script is transmitted from the first server to the code repository server and then the code is analyzed in the code repository server, it is possible to avoid a waste of time caused by a large amount of code transmission in the process of transmitting a large amount of code from the code repository server to the first server and then performing code analysis by the first server. The efficiency of code analysis is improved.
In some embodiments, the pulled code comprises a current version of code stored at the code repository server.
In some embodiments, the above method is described in detail in the above embodiments, and is not described herein again.
In some embodiments, in the case that the verification result indicates that the installation environment of the code repository server is not capable of installing the analysis script, the code analysis method may further include:
screening a second server in the same network segment with the code warehouse server according to preset conditions to obtain a third server meeting the preset conditions;
and sending the analysis script to the target server so that the target server analyzes the code pulled from the code warehouse server according to the analysis script, and sending a second analysis result obtained by analysis to the first server.
In some embodiments, there are often multiple second servers in the same network segment as the code repository server, and the second servers need to be screened according to preset conditions.
In some embodiments, the preset conditions include at least one of: the capacity of the memory is not lower than two channels of 8G × 2; the frequency of the memory is not less than 3000 MHZ; the storage hard disk meets the requirements of an independent disk redundant array or a disk array of a distributed parity check independent disk structure; the network transmission rate with the code warehouse server is not less than 1000 Mbps.
Therefore, the code warehouse server sends the analysis script and the code to a third server which is in the same network segment with the code warehouse server, has the capacity of a memory not lower than 8G x 2 and the frequency of the memory not lower than 3000MHZ, and has the network transmission rate of the disk array of the independent disk structure and the code warehouse server, wherein the storage hard disk of the disk array meets the requirements of the independent disk redundant array or the distributed parity check, and the network transmission rate of the code warehouse server is not lower than 1000 Mbps. The network segment, the memory parameter, the disk parameter and the transmission parameter of the code warehouse server of the third server are set, so that the problem that the time for transmitting the codes is too long due to the limitation of the parameters in the process of transmitting the codes to the third server by the code warehouse server can be solved. Compared with the code transmission to the first server, the code transmission to the third server in the same network segment with the code warehouse server can avoid the problems that the code warehouse server needs to span network segments and has long transmission distance in the process of transmitting the code to the first server. The analysis efficiency of the codes is improved on the whole.
Based on the same inventive concept, an embodiment of the present application also provides another code analysis method, which is applied to a third server.
Fig. 4 is a schematic flowchart of another code analysis method according to an embodiment of the present application.
As shown in fig. 4, the code analysis method may include:
s410, receiving an analysis script sent by the code warehouse server under the condition that the code warehouse server verifies the environment of the code warehouse server and the verification result indicates that the installation environment of the code warehouse server cannot install the analysis script; the analysis script is sent to the code warehouse server by the first server;
s420, analyzing the code pulled by the third server in the code warehouse server according to the analysis script to obtain a second analysis result;
and S430, sending the second analysis result to the first server.
In some embodiments, the data volume of the analysis script and the first analysis result is much smaller than the data volume of the code.
Therefore, the analysis script is sent to the code warehouse server by the first server, then the codes stored in the code warehouse server are analyzed by the code warehouse server according to the analysis script, and after the first analysis result is obtained, the first analysis result is sent to the first server, so that the problem of long transmission time caused by large data volume in the process that the code warehouse server sends a large number of codes to the first server can be avoided on the basis that the first server obtains the first analysis result, and the analysis efficiency of the codes is improved.
Based on the same inventive concept, the embodiment of the present application further provides a code analysis apparatus 500, which is applied to a code repository server.
Fig. 5 is a schematic structural diagram of a code analysis apparatus 500 according to an embodiment of the present application, where the apparatus shown in fig. 5 may include:
an obtaining module 501, configured to obtain an analysis script sent by a first server; the analysis script comprises an analysis script for analyzing the code stored by the code repository server;
the verification module 502 is configured to verify the installation environment of the code repository server according to the analysis script to obtain a verification result;
a first analysis module 503, configured to, in a case that the verification result indicates that the installation environment of the code repository server is capable of installing the analysis script, analyze the code according to the analysis script to obtain a first analysis result;
a first sending module 504, configured to send the first analysis result to the first server.
Therefore, after the code warehouse server acquires the analysis script sent by the first server, whether the installation environment of the code warehouse server can install the analysis script is verified according to the analysis script, and when the verification result indicates that the code warehouse can install the analysis script, the code warehouse server installs the analysis script and analyzes the codes in the code warehouse server by using the installed analysis script. Since the analysis script is transmitted from the first server to the code repository server and then the code is analyzed in the code repository server, it is possible to avoid a waste of time caused by a large amount of code transmission in the process of transmitting a large amount of code from the code repository server to the first server and then performing code analysis by the first server. The efficiency of code analysis is improved.
In some embodiments, the code analysis apparatus may further include:
the screening module can be used for screening a second server which is in the same network segment with the code warehouse server according to a preset condition under the condition that the verification result indicates that the installation environment of the code warehouse server cannot install the analysis script, so as to obtain a third server meeting the preset condition;
the third sending module may be configured to send the analysis script to the target server, so that the target server analyzes the code pulled from the code repository server according to the analysis script, and sends a second analysis result obtained through analysis to the first server.
In some embodiments, the preset condition satisfies at least one of:
the capacity of the memory is not lower than two channels of 8G × 2; the frequency of the memory is not less than 3000 MHZ; the storage hard disk meets the requirements of an independent disk redundant array or a disk array of a distributed parity check independent disk structure; the network transmission rate with the code warehouse server is not less than 1000 Mbps.
Therefore, the code warehouse server sends the analysis script and the code to a third server which is in the same network segment with the code warehouse server, has the capacity of a memory not lower than 8G x 2 and the frequency of the memory not lower than 3000MHZ, and has the network transmission rate of the disk array of the independent disk structure and the code warehouse server, wherein the storage hard disk of the disk array meets the requirements of the independent disk redundant array or the distributed parity check, and the network transmission rate of the code warehouse server is not lower than 1000 Mbps. The network segment, the memory parameter, the disk parameter and the transmission parameter of the code warehouse server of the third server are set, so that the problem that the time for transmitting the codes is too long due to the limitation of the parameters in the process of transmitting the codes to the third server by the code warehouse server can be solved. Compared with the code transmission to the first server, the code transmission to the third server in the same network segment with the code warehouse server can avoid the problems that the code warehouse server needs to span network segments and has long transmission distance in the process of transmitting the code to the first server. The analysis efficiency of the codes is improved on the whole.
Based on the same inventive concept, the embodiment of the application also provides a code analysis device, and the device is applied to a third server.
Fig. 6 is a schematic structural diagram of another code analysis apparatus according to an embodiment of the present application, and as shown in fig. 6, the apparatus may include:
the receiving module 601 is configured to receive an analysis script sent by the code repository server when the code repository server verifies an environment of the code repository server, and a verification result indicates that the installation environment of the code repository server cannot install the analysis script; the analysis script is sent to the code warehouse server by the first server;
the second analysis module 602 is configured to analyze the code pulled by the third server in the code repository server according to the analysis script, so as to obtain a second analysis result;
a second sending module 603, configured to send the second analysis result to the first server.
Therefore, the analysis script is sent to the code warehouse server by the first server, then the codes stored in the code warehouse server are analyzed by the code warehouse server according to the analysis script, and after the first analysis result is obtained, the first analysis result is sent to the first server, so that the problem of long transmission time caused by large data volume in the process that the code warehouse server sends a large number of codes to the first server can be avoided on the basis that the first server obtains the first analysis result, and the analysis efficiency of the codes is improved.
Fig. 7 shows a hardware structure diagram of an electronic device according to an embodiment of the present application.
The electronic device 700 may include a processor 701 and a memory 702 storing computer program instructions.
Specifically, the processor 701 may include a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or may be configured to implement one or more Integrated circuits of the embodiments of the present Application.
The memory may include Read Only Memory (ROM), Random Access Memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical, or other physical/tangible memory storage devices. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software comprising computer-executable instructions and when the software is executed (e.g., by one or more processors), it is operable to perform operations described with reference to the methods according to an aspect of the application.
The processor 701 implements any one of the code analysis methods in the above embodiments by reading and executing computer program instructions stored in the memory 702.
In some examples, electronic device 700 may also include a communication interface 703 and a bus 710. As shown in fig. 7, the processor 701, the memory 702, and the communication interface 703 are connected by a bus 710 to complete mutual communication.
The communication interface 703 may be mainly used for implementing communication between modules, apparatuses, units and/or devices in the embodiment of the present application.
Illustratively, as the payment terminal, the electronic device 700 may be a mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like. As a code scanning terminal, the electronic device 700 may be a Point of sale (POS), a code scanner, or the like.
The electronic device may execute the code analysis method in the embodiment of the present application, thereby implementing the code analysis method and apparatus described in conjunction with fig. 3 to 6.
In addition, in combination with the code analysis method in the foregoing embodiments, the embodiments of the present application may provide a computer-readable storage medium to implement. The computer readable storage medium having stored thereon computer program instructions; the computer program instructions, when executed by a processor, implement any of the code analysis methods in the above embodiments. Examples of computer-readable storage media include non-transitory computer-readable storage media such as portable disks, hard disks, Random Access Memories (RAMs), Read Only Memories (ROMs), erasable programmable read only memories (EPROMs or flash memories), portable compact disk read only memories (CD-ROMs), optical storage devices, magnetic storage devices, and so forth.
It is to be understood that the present application is not limited to the particular arrangements and instrumentality described above and shown in the attached drawings. A detailed description of known methods is omitted herein for the sake of brevity. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present application are not limited to the specific steps described and illustrated, and those skilled in the art can make various changes, modifications, and additions or change the order between the steps after comprehending the spirit of the present application.
The functional blocks shown in the above structural block diagrams may be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it may be, for example, an electronic circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, plug-in, function card, or the like. When implemented in software, the elements of the present application are programs or code segments that may be used to perform the required tasks. The program or code segments may be stored in a machine-readable medium or transmitted by a data signal carried in a carrier wave over a transmission medium or a communication link. A "machine-readable medium" may include any medium that can store or transfer information. Examples of a machine-readable medium include electronic circuits, semiconductor memory devices, ROM, flash memory, Erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, Radio Frequency (RF) links, and so forth. The code segments may be downloaded via computer networks such as the internet, intranet, etc.
It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, the present application is not limited to the order of the above-described steps, that is, the steps may be performed in the order mentioned in the embodiments, may be performed in an order different from the order in the embodiments, or may be performed simultaneously.
Aspects of the present application are described above with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions/acts specified in the flowchart and/or block diagram block or blocks. Such a processor may be, but is not limited to, a general purpose processor, a special purpose processor, an application specific processor, or a field programmable logic circuit. It will also be understood that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware for performing the specified functions or acts, or combinations of special purpose hardware and computer instructions.
As will be apparent to those skilled in the art, for convenience and brevity of description, the specific working processes of the systems, modules and units described above may refer to corresponding processes in the foregoing method embodiments, and are not described herein again. It should be understood that the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the present application, and these modifications or substitutions should be covered within the scope of the present application.
Claims (13)
1. A code analysis method applied to a code repository server, the method comprising:
acquiring an analysis script sent by a first server; the analysis script comprises an analysis script for analyzing the code stored by the code repository server;
verifying the installation environment of the code warehouse server according to the analysis script to obtain a verification result;
under the condition that the verification result indicates that the installation environment of the code warehouse server can install the analysis script, analyzing the code according to the analysis script to obtain a first analysis result;
and sending the first analysis result to the first server.
2. The method of claim 1, further comprising:
under the condition that the verification result indicates that the installation environment of the code warehouse server cannot install the analysis script, screening a second server in the same network segment with the code warehouse server according to a preset condition to obtain a third server meeting the preset condition;
and sending the analysis script to the target server so that the target server analyzes the code pulled from the code warehouse server according to the analysis script, and sending a second analysis result obtained by analysis to the first server.
3. The method of claim 2, wherein the preset condition comprises at least one of:
the capacity of the memory is not lower than two channels of 8G × 2;
the frequency of the memory is not less than 3000 MHZ;
the storage hard disk meets the requirements of an independent disk redundant array or a disk array of a distributed parity check independent disk structure;
and the network transmission rate of the code warehouse server is not less than 1000 Mbps.
4. The method of claim 1 or 2, wherein the pulled code comprises a current version of code stored at the code repository server.
5. A code analysis method applied to a third server, the method comprising:
receiving an analysis script sent by a code warehouse server under the condition that the code warehouse server verifies the environment of the code warehouse server and the verification result indicates that the installation environment of the code warehouse server cannot install the analysis script; the analysis script is sent to the code repository server by a first server;
analyzing the code pulled by the third server in the code warehouse server according to the analysis script to obtain a second analysis result;
and sending the second analysis result to the first server.
6. A code analysis system, the system comprising:
the code warehouse server is used for acquiring the analysis script sent by the first server; analyzing the codes stored by the code warehouse server according to the analysis script to obtain a first analysis result; sending the first analysis result to the first server;
the first server to send the analysis script to the code repository server; and receiving the first analysis result sent by the code warehouse server.
7. The system of claim 6, further comprising:
the third server is used for receiving the analysis script sent by the code warehouse server; analyzing the code pulled in the code warehouse server according to the script to obtain a second analysis result, and sending the second analysis result to the first server;
the code warehouse server is further used for sending the analysis script to the third server; sending the code to the third server;
the first server is further configured to receive the second analysis result sent by the third server.
8. The system of claim 7, wherein the third server satisfies at least one of:
being in the same network segment as the code repository server;
the capacity of the memory is not lower than two channels of 8G × 2;
the frequency of the memory is not less than 3000 MHZ;
the storage hard disk meets the requirements of an independent disk redundant array or a disk array of a distributed parity check independent disk structure;
and the network transmission rate of the server and the code warehouse server is not less than 1000 Mbps.
9. A code analysis apparatus applied to a code repository server, the apparatus comprising:
the acquisition module is used for acquiring the analysis script sent by the first server; the analysis script comprises an analysis script for analyzing the code stored by the code repository server;
the verification module is used for verifying the installation environment of the code warehouse server according to the analysis script to obtain a verification result;
the first analysis module is used for analyzing the code according to the analysis script under the condition that the verification result indicates that the installation environment of the code warehouse server can install the analysis script to obtain a first analysis result;
and the first sending module is used for sending the first analysis result to the first server.
10. A code analysis apparatus applied to a third server, the apparatus comprising:
the system comprises a receiving module, a judging module and a sending module, wherein the receiving module is used for receiving an analysis script sent by a code warehouse server under the condition that the code warehouse server verifies the environment of the code warehouse server and the verification result indicates that the installation environment of the code warehouse server cannot install the analysis script; the analysis script is sent to the code repository server by a first server;
the second analysis module is used for analyzing the code pulled by the third server in the code warehouse server according to the analysis script to obtain a second analysis result;
and the second sending module is used for sending the second analysis result to the first server.
11. An electronic device, characterized in that the device comprises: a processor, and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement the code analysis method of any one of claims 1-5.
12. A computer-readable storage medium having computer program instructions stored thereon which, when executed by a processor, implement the code analysis method of any one of claims 1-5.
13. A computer program product, wherein instructions in the computer program product, when executed by a processor of an electronic device, cause the electronic device to perform the code analysis method of any one of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111643114.4A CN114297072A (en) | 2021-12-29 | 2021-12-29 | Code analysis method, system, device, equipment and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111643114.4A CN114297072A (en) | 2021-12-29 | 2021-12-29 | Code analysis method, system, device, equipment and computer readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114297072A true CN114297072A (en) | 2022-04-08 |
Family
ID=80971563
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111643114.4A Pending CN114297072A (en) | 2021-12-29 | 2021-12-29 | Code analysis method, system, device, equipment and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114297072A (en) |
-
2021
- 2021-12-29 CN CN202111643114.4A patent/CN114297072A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113918376B (en) | Fault detection method, device, equipment and computer readable storage medium | |
US20190278689A1 (en) | System to determine performance based on entropy values | |
CN105988836B (en) | Application recommendation method and device | |
CN111144865B (en) | Information processing method, device, equipment and storage medium | |
CN112948224B (en) | Data processing method, device, terminal and storage medium | |
KR20170121242A (en) | Identity authentication methods, devices and systems | |
CN111953563A (en) | User identification method, device, equipment and computer storage medium | |
CN110955921A (en) | Electronic signature method, device, equipment and storage medium | |
CN111371581A (en) | Method, device, equipment and medium for detecting business abnormity of Internet of things card | |
CN106101125B (en) | Verification processing method, device and system | |
CN113163012A (en) | Internet of things equipment management method and device based on block chain | |
CN114297072A (en) | Code analysis method, system, device, equipment and computer readable storage medium | |
CN108965108B (en) | Message pushing method and related equipment | |
CN109088680B (en) | Far-end antenna state detection method and device, computer storage medium and equipment | |
CN115858320A (en) | Operation log recording method, apparatus, medium and product | |
CN116361835A (en) | Privacy authorization method and device, equipment, medium and product thereof | |
CN112714108B (en) | Method, device and equipment for verifying terminal communication number and computer storage medium | |
CN109658084B (en) | Offline payment method and system | |
CN113128993A (en) | Payment method, payment device, electronic equipment and storage medium | |
CN112287035A (en) | Data loading method, device, equipment and storage medium | |
CN112835781B (en) | Abnormality detection method and device for operation function | |
CN111401490A (en) | Two-dimensional code obtaining method and related device | |
CN117528519B (en) | Method and device for realizing expansion of smart card | |
CN114640715A (en) | Data processing method, device, equipment and computer storage medium | |
CN115242775B (en) | Resource file acquisition method, device, equipment, medium and product |
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 |