CN106844096A - The treating method and apparatus of program code - Google Patents

The treating method and apparatus of program code Download PDF

Info

Publication number
CN106844096A
CN106844096A CN201611228769.4A CN201611228769A CN106844096A CN 106844096 A CN106844096 A CN 106844096A CN 201611228769 A CN201611228769 A CN 201611228769A CN 106844096 A CN106844096 A CN 106844096A
Authority
CN
China
Prior art keywords
code file
compiling
code
master server
uploaded
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
CN201611228769.4A
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 58 Information Technology Co Ltd
Original Assignee
Beijing 58 Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing 58 Information Technology Co Ltd filed Critical Beijing 58 Information Technology Co Ltd
Priority to CN201611228769.4A priority Critical patent/CN106844096A/en
Publication of CN106844096A publication Critical patent/CN106844096A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1464Management of the backup or restore process for networked environments
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

The present invention provides a kind for the treatment of method and apparatus of program code, and the method includes:Obtain source code file;The code file after treatment is compiled is compiled to the program code in source code file;Whether there is mistake in code file after detection compiling;If not existing, the code file after compiling is uploaded to master server.The treating method and apparatus of the program code that the present invention is provided, are managed collectively and have been detected so that the code file stability reached the standard grade is stronger, and error rate is lower, improves the stability of network service by source code file.

Description

The treating method and apparatus of program code
Technical field
The present invention relates to computer realm, more particularly to a kind for the treatment of method and apparatus of program code.
Background technology
With the development of network technology, comprehensive and stability requirement more and more higher of the user to network service.Network Service develops new source code especially by code development personnel, reaches the standard grade to server to realize after compiling detection.For Ensure the stability of network service, the management of program code is more and more important.
After existing program code is through exploitation, translation and compiling environment is voluntarily built by research staff, after generation compiling file, directly Reached the standard grade, be there is no the control measures of program code.Translation and compiling environment is voluntarily built to research staff in the presence of the compiling file reached the standard grade Rely on than more serious problem.
The content of the invention
The present invention provides a kind of picture detection method and device, is used to solve existing violation picture detection method in the presence of inspection Survey slow-footed problem.
One aspect of the present invention provides a kind of processing method of program code, including:
Obtain source code file;
The code file after treatment is compiled is compiled to the program code in the source code file;
Detect in the code file after the compiling with the presence or absence of mistake;
If not existing, the code file after the compiling is uploaded to master server.
The treatment of program code as described above, the code file by after the compiling be uploaded to master server it Before, methods described also includes:
Detect whether the code file after the compiling is consistent with the backup code file in the master server;
Then the code file by after the compiling is uploaded to master server, including:
When the backup code file in the code file after the compiling with the master server is inconsistent, by the volume Code file after translating is uploaded to master server.
The treatment of program code as described above, methods described also includes:
The code file after compiling is uploaded and completed, then controlled from server according in the master server Code file after compiling is updated.
The treatment of program code as described above, the code file by after the compiling is uploaded to master server, wraps Include:
According to the form of the code file after the compiling, the code file after the compiling is uploaded to and the form Stored under the predetermined directory of corresponding master server.
The treatment of program code as described above, methods described also includes:
Detect whether there is the code file failure after being compiled described in first from server update;
If in the presence of outputting alarm information;The warning information is used to indicate described first to fail from server update.
A kind of picture detection means provided in an embodiment of the present invention is described below, the apparatus and method are corresponded, are used to The picture detection method in above-described embodiment is realized, with identical technical characteristic and technique effect, the present invention no longer goes to live in the household of one's in-laws on getting married to this State.
Another aspect of the present invention provides a kind of processing unit of program code, including:
Acquisition module, for obtaining source code file;
Collector, for being compiled the code after treatment is compiled to the program code in the source code file File;
Code detection module, for detecting in the code file after the compiling with the presence or absence of mistake;
Upper wire module, during in the code file after the compiling in the absence of mistake, by the code after the compiling Files passe is to master server.
The processing unit of program code as described above, also includes:
Version detection module, for detecting the backup code text in the code file after the compiling and the master server Whether part is consistent;
The upper wire module is used for, the backup code file in the code file after the compiling and the master server When inconsistent, the code file after the compiling is uploaded to master server.
The processing unit of program code as described above, also includes:
Monitoring module, uploads for the code file when the compiling after and completes, then control from server according to the master The code file after the compiling in server is updated.
The processing unit of program code as described above, the upper wire module is specifically for according to the generation after the compiling The form of code file, the code file after the compiling is uploaded under the predetermined directory of master server corresponding with the form Stored.
The processing unit of program code as described above, the monitoring module is additionally operable to:
Detect whether there is the code file failure after being compiled described in first from server update;
If in the presence of outputting alarm information;The warning information is used to indicate described first to fail from server update.
The treating method and apparatus of the program code that the present invention is provided, after source code file is obtained, to source code file In program code using unified compiling mode be compiled treatment compiled after code file, then to compiling after Code file carries out error detection, it is determined that the code file after compiling is uploaded into master server during in the absence of mistake.Pass through Source code file is managed collectively and has been detected so that the code file stability reached the standard grade is stronger, and error rate is lower, improved The stability of network service.
Brief description of the drawings
Technical scheme in order to illustrate more clearly the embodiments of the present invention, below will be to that will use needed for embodiment description Accompanying drawing be briefly described, it should be apparent that, drawings in the following description are some embodiments of the present invention, for ability For the those of ordinary skill of domain, without having to pay creative labor, can also obtain other according to these accompanying drawings Accompanying drawing.
The schematic flow sheet of the processing method embodiment one of the program code that Fig. 1 is provided for the present invention;
The schematic flow sheet of the processing method embodiment two of the program code that Fig. 2 is provided for the present invention;
The structural representation of the processing unit embodiment one of the program code that Fig. 3 is provided for the present invention;
The structural representation of the processing unit embodiment two of the program code that Fig. 4 is provided for the present invention.
Specific embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is A part of embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art The every other embodiment obtained under the premise of creative work is not made, belongs to the scope of protection of the invention.
On the one hand the present invention provides a kind of processing method of program code, the place of the program code that Fig. 1 is provided for the present invention The schematic flow sheet of embodiment of the method one is managed, the executive agent of the method is the processing unit of program code, and the device can lead to The mode for crossing software or hardware realizes, can be directly integrated in Website server that the present invention is not limited this.As shown in figure 1, The method includes:
S101, acquisition source code file;
S102, to the program code in source code file be compiled treatment compiled after code file;
Whether there is mistake in code file after S103, detection compiling;If it is not, then performing S104;
S104, the code file after compiling is uploaded to master server.
Specifically, in S101, the mode for obtaining source code file specifically thinks research staff's active upload source code text Part, source code file is specially front-end code file, is separated by by front-end code file and back-end code file, can improve net The stability of network service.
Specifically, in S102, after the source code file for receiving research staff's upload, source code file can be sent Into unified compiler test machine, the program code in source code file is compiled by unified compiler test machine is processed Code file after to compiling.It is compiled by using unified compiler test machine, research staff can be avoided according to local Development environment is voluntarily built compiling platform and is compiled, and the source code of caused different editions is carried out using different compiling platforms The problem of compiling.
Specifically, in S103, after the code file after being compiled, the code file after compiling is sent to unification Testing service device in, carried out in the code file after detection compiling with the presence or absence of mistake by unified testing service device.Example Property, version and listed files in testing service device according to code file are shown, and selection needs the version tested Tested.Specifically, passing through when the detection inerrancy of testing service device is then regarded as detection, can also be that testing service device will Testing result is presented to user, when receiving the detection of user input by after signal, it is believed that the code file detection after compiling Pass through.
Specifically, in S104, when in the code file after detecting compiling in the absence of mistake, by the code text after compiling Part is uploaded to master server, that is, reach the standard grade.Master server it is exemplary can be carry out network service or provide other application service Server.By having carried out error detection, and unified compiling management before reaching the standard grade so that the code file stabilization reached the standard grade Property is stronger, and error rate is lower.
The processing method of the program code that the present invention is provided, after source code file is obtained, to the journey in source code file Sequence code is compiled the code file after treatment is compiled using unified compiling mode, then to the code text after compiling Part carries out error detection, it is determined that the code file after compiling is uploaded into master server during in the absence of mistake.By to source generation Code file is managed collectively and has been detected so that the code file stability reached the standard grade is stronger, and error rate is lower, improves network The stability of service.
Further, with reference to embodiment illustrated in fig. 1, the processing method embodiment of the program code that Fig. 2 is provided for the present invention Two schematic flow sheet, as shown in Fig. 2 the method includes:
S201, acquisition source code file;
S202, to the program code in source code file be compiled treatment compiled after code file;
Whether there is mistake in code file after S203, detection compiling;If it is not, then performing S204;
Whether the code file after S204, detection compiling is consistent with the backup code file in master server;If it is not, then holding Row S205;
S205, the code file after compiling is uploaded to master server.
Specifically, S201, S202, S203, S205 respectively with embodiment illustrated in fig. 1 in S101, S102, S103, S104 Identical, the present invention is repeated no more to this.
Specifically, in S204, before the code file after by compiling is uploaded to master server, after compiling need to be detected Whether code file is consistent with the backup code file in master server, standby in code file after compiling and master server When part code file is consistent, then the problem of the source code version error of research staff's upload, code after compiling are there may be When backup code file in file and master server is inconsistent, then ensure that the compiling file reached the standard grade is the compiling text of redaction Part.The step of by increasing version detection, further increase the stability of network service.
Optionally, on the basis of any of the above-described embodiment, the processing method of program code also includes:
Code file after compiling is uploaded and completed, then control the code after the compiling from server in master server File is updated.
Specifically, when detect compiling after code file master server upload after the completion of, control from server according to The code file after compiling in master server is updated.It is exemplary, master server with use content distribution from server Network (Content Delivery Network, abbreviation CDN) framework.By using CDN frameworks, will be from server disposition in phase Away from different physical locations farther out, by the load balancing of central platform, the work(module such as content distribution, scheduling so that no Required content can be nearby obtained with the user of physical locations, network congestion is reduced, user's access response speed and hit is improved Rate.
Optionally, on the basis of any of the above-described embodiment, the code file after compiling is uploaded to the step of master server Suddenly, specifically include:
According to the form of the code file after compiling, the code file after compiling is uploaded to main service corresponding with form Stored under the predetermined directory of device.
Specifically, being further to improve network clothes during the code file after by compiling is uploaded to master server The stability of business, can increase version management and resource management.Exemplary, can be according to the form of the code file after compiling, will Code file after compiling is stored under being uploaded to the predetermined directory of master server corresponding with form.Code text after compiling The form of part is including css, html, js and img etc..Configure different in view of different master servers, can be according to the generation after compiling The difference of the form of code file, the code file after compiling is stored in different master servers.By by different-format File is stored in different master servers, can improve flowing of access, bandwidth and the access speed of master server.
During master server is especially stored in, the code file after compiling is uploaded to the default mesh of master server Under record, predetermined directory can be generated according to the type of the code file after compiling, research and development department, project name, research and development time etc..Show Example property, storage catalogue can be "/financial business portion/platform (m/pc/app)/static file type/entry name/".By for Code file agreement storage catalogue after compiling, can facilitate research staff to determine the version of the code file after compiling, to code File is safeguarded and version management.
Optionally, on the basis of any of the above-described embodiment, the processing method of program code also includes:
Detect whether there is the first code file failure from after server update compiling;
If in the presence of outputting alarm information;Warning information is used to indicate first to fail from server update.
Specifically, when being respectively updated in the code file after according to master server more newly compiled from server, needing inspection Survey with the presence or absence of the first code file failure from after server update compiling, if in the presence of can be by pop-up window, short message Etc. mode to user's outputting alarm information;Warning information is used to indicate first to fail from server update.
A kind of processing unit of program code that another aspect of the present invention is also provided, the device can be by software/hardware reality Existing, the present invention is not limited this.The apparatus and method embodiment is corresponded, and is used to realize the program generation in above-described embodiment The processing method of code, with identical technical characteristic and technique effect, the embodiment of the present invention is repeated no more to this.
The structural representation of the processing unit embodiment one of the program code that Fig. 3 is provided for the present invention.As shown in figure 3, should Device includes:
Acquisition module 301, for obtaining source code file;
Collector 302, for being compiled the code after treatment is compiled to the program code in source code file File;
Code detection module 303, for whether there is mistake in the code file after detection compiling;
Upper wire module 304, during in the code file after compiling in the absence of mistake, by the code file after compiling Reach master server.
Further, on the basis of embodiment illustrated in fig. 3, the processing unit of the program code that Fig. 4 is provided for the present invention The structural representation of embodiment two.As shown in figure 4, the processing unit of program code also includes:
Version detection module 3031, be with the backup code file in master server for the code file after detection compiling It is no consistent;
Upper wire module 304 is used for, when the backup code file in the code file after compiling and master server is inconsistent, Code file after compiling is uploaded to master server.
Exemplary, the processing unit of program code also includes:
Monitoring module, uploads for code file after compiling and completes, then control from server according in master server Compiling after code file be updated.
Exemplary, upper wire module 304 is specifically for according to the form of the code file after compiling, by the generation after compiling Stored under code files passe to the predetermined directory of master server corresponding with form.
Exemplary, monitoring module is additionally operable to:
Detect whether there is the first code file failure from after server update compiling;
If in the presence of outputting alarm information;Warning information is used to indicate first to fail from server update.
In several embodiments provided by the present invention, it should be understood that disclosed system, apparatus and method, can be with Realize by another way.In addition, several embodiments provided by the present invention can be in whole or in part be bound to each other to form New embodiment, and these new embodiments, still fall within the scope of the invention.
Finally it should be noted that:Various embodiments above is merely illustrative of the technical solution of the present invention, rather than its limitations;To the greatest extent Pipe has been described in detail with reference to foregoing embodiments to the present invention, it will be understood by those within the art that:Its according to The technical scheme described in foregoing embodiments can so be modified, or which part or all technical characteristic are entered Row equivalent;And these modifications or replacement, the essence of appropriate technical solution is departed from various embodiments of the present invention technology The scope of scheme.

Claims (10)

1. a kind of processing method of program code, it is characterised in that including:
Obtain source code file;
The code file after treatment is compiled is compiled to the program code in the source code file;
Detect in the code file after the compiling with the presence or absence of mistake;
If not existing, the code file after the compiling is uploaded to master server.
2. method according to claim 1, it is characterised in that the code file by after the compiling is uploaded to main clothes Before business device, methods described also includes:
Detect whether the code file after the compiling is consistent with the backup code file in the master server;
Then the code file by after the compiling is uploaded to master server, including:
When the backup code file in the code file after the compiling with the master server is inconsistent, after the compiling Code file be uploaded to master server.
3. method according to claim 1 and 2, it is characterised in that methods described also includes:
The code file after compiling is uploaded and completed, then control the compiling in the master server from server Code file afterwards is updated.
4. method according to claim 1 and 2, it is characterised in that the code file by after the compiling is uploaded to Master server, including:
According to the form of the code file after the compiling, the code file after the compiling is uploaded to corresponding with the form Master server predetermined directory under stored.
5. method according to claim 3, it is characterised in that methods described also includes:
Detect whether there is the code file failure after being compiled described in first from server update;
If in the presence of outputting alarm information;The warning information is used to indicate described first to fail from server update.
6. a kind of processing unit of program code, it is characterised in that including:
Acquisition module, for obtaining source code file;
Collector, for being compiled the code text after treatment is compiled to the program code in the source code file Part;
Code detection module, for detecting in the code file after the compiling with the presence or absence of mistake;
Upper wire module, during in the code file after the compiling in the absence of mistake, by the code file after the compiling It is uploaded to master server.
7. device according to claim 6, it is characterised in that also include:
Version detection module, for detecting that the code file after the compiling is with the backup code file in the master server It is no consistent;
The upper wire module is used for, and the code file after the compiling differs with the backup code file in the master server During cause, the code file after the compiling is uploaded to master server.
8. the device according to claim 6 or 7, it is characterised in that also include:
Monitoring module, uploads for the code file when the compiling after and completes, then control from server according to the main service The code file after the compiling in device is updated.
9. the device according to claim 6 or 7, it is characterised in that the upper wire module is specifically for according to the compiling The form of code file afterwards, the default of master server corresponding with the form is uploaded to by the code file after the compiling Stored under catalogue.
10. device according to claim 8, it is characterised in that the monitoring module is additionally operable to:
Detect whether there is the code file failure after being compiled described in first from server update;
If in the presence of outputting alarm information;The warning information is used to indicate described first to fail from server update.
CN201611228769.4A 2016-12-27 2016-12-27 The treating method and apparatus of program code Pending CN106844096A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611228769.4A CN106844096A (en) 2016-12-27 2016-12-27 The treating method and apparatus of program code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611228769.4A CN106844096A (en) 2016-12-27 2016-12-27 The treating method and apparatus of program code

Publications (1)

Publication Number Publication Date
CN106844096A true CN106844096A (en) 2017-06-13

Family

ID=59113260

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611228769.4A Pending CN106844096A (en) 2016-12-27 2016-12-27 The treating method and apparatus of program code

Country Status (1)

Country Link
CN (1) CN106844096A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107463422A (en) * 2017-07-20 2017-12-12 阿里巴巴集团控股有限公司 Code dispositions method and device, electronic equipment
CN109814874A (en) * 2019-02-20 2019-05-28 湖南国科微电子股份有限公司 A kind of compiling result output control method, system and application
CN109960656A (en) * 2019-03-22 2019-07-02 北京三快在线科技有限公司 Detection method, device and the electronic equipment of program
CN110704060A (en) * 2018-07-10 2020-01-17 金邦达有限公司 Method and system for processing smart card codes
CN113094040A (en) * 2021-03-08 2021-07-09 南京唯优信息技术有限公司 Applet compiling method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150378694A1 (en) * 2014-06-26 2015-12-31 Oracle International Corporation Optimistically Assuming Types in a Dynamically Typed Language
CN105653287A (en) * 2015-12-31 2016-06-08 北京元心科技有限公司 Automatic program version issuing method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150378694A1 (en) * 2014-06-26 2015-12-31 Oracle International Corporation Optimistically Assuming Types in a Dynamically Typed Language
CN105653287A (en) * 2015-12-31 2016-06-08 北京元心科技有限公司 Automatic program version issuing method and device

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107463422A (en) * 2017-07-20 2017-12-12 阿里巴巴集团控股有限公司 Code dispositions method and device, electronic equipment
CN110704060A (en) * 2018-07-10 2020-01-17 金邦达有限公司 Method and system for processing smart card codes
CN109814874A (en) * 2019-02-20 2019-05-28 湖南国科微电子股份有限公司 A kind of compiling result output control method, system and application
CN109960656A (en) * 2019-03-22 2019-07-02 北京三快在线科技有限公司 Detection method, device and the electronic equipment of program
CN109960656B (en) * 2019-03-22 2023-05-30 北京三快在线科技有限公司 Program detection method and device and electronic equipment
CN113094040A (en) * 2021-03-08 2021-07-09 南京唯优信息技术有限公司 Applet compiling method and device

Similar Documents

Publication Publication Date Title
CN106844096A (en) The treating method and apparatus of program code
JP6909285B2 (en) Systems, methods, and computer programs for fault detection and location within the grid
CN107423048B (en) Data collection method, device, medium and computing equipment
US9612936B2 (en) Correlation of source code with system dump information
US10956313B2 (en) Application testing for security vulnerabilities
US20170123965A1 (en) Automated test generation for multi-interface enterprise virtualization management environment
CN101526916B (en) Method and system for using page-based object flow verification in regression test
US20180052663A1 (en) System, method, and recording medium for validating computer documentation
CN107168841A (en) The remote test method and device of a kind of mobile device
US11656959B2 (en) Disaster recovery region recommendation system and method
Kirbas et al. The relationship between evolutionary coupling and defects in large industrial software
US9916223B2 (en) Automatically complete a specific software task using hidden tags
CN109901985B (en) Distributed test apparatus and method, storage medium, and electronic device
CN103095530A (en) Method and system for sensitive information monitoring and leakage prevention based on front-end gateway
CN109039787A (en) log processing method, device and big data cluster
US20180307574A1 (en) Automated test generation for multi-interface and multi-platform enterprise virtualization management environment
CN113014445B (en) Operation and maintenance method, device and platform for server and electronic equipment
CN104809057A (en) Application test system, application test method and storage medium
CN110297776A (en) Examining report generation, method of reseptance, device, equipment and storage medium
CN107341141B (en) Form management method, device, medium and computing equipment
CN114338684B (en) Energy management system and method
CN102156650B (en) Method and device capable of implementing automatic analysis of patch
CN109816453A (en) A kind of detection method and device for promoting resource link
CN109885472A (en) Test and management method and system and computer readable storage medium
CN105117312B (en) Self-service computer troubleshooting system

Legal Events

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

Application publication date: 20170613