CN106843820B - Code processing method and device - Google Patents

Code processing method and device Download PDF

Info

Publication number
CN106843820B
CN106843820B CN201510883743.2A CN201510883743A CN106843820B CN 106843820 B CN106843820 B CN 106843820B CN 201510883743 A CN201510883743 A CN 201510883743A CN 106843820 B CN106843820 B CN 106843820B
Authority
CN
China
Prior art keywords
module
current service
code
dependency information
order
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510883743.2A
Other languages
Chinese (zh)
Other versions
CN106843820A (en
Inventor
李旭东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201510883743.2A priority Critical patent/CN106843820B/en
Publication of CN106843820A publication Critical patent/CN106843820A/en
Application granted granted Critical
Publication of CN106843820B publication Critical patent/CN106843820B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/447Target code generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural
    • G06F9/4484Executing subprograms

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application discloses a method and a device for processing codes. The code processing method comprises the following steps: acquiring a module code corresponding to a module contained in the current service; extracting dependency information contained in the module code; and determining the order of each module in the current service according to the dependency information, and combining the module codes according to the order of the modules to obtain a code file corresponding to the current service. By the method and the device, the problem that in the prior art, the finally obtained source code file is not compact enough due to the fact that the introduced code dependence framework can increase the length of the source code file obtained by combination can be solved.

Description

Code processing method and device
Technical Field
The present application relates to the field of software development, and in particular, to a code processing method and apparatus.
Background
In the process of software development, it has become a common means to obtain a source code file related to a certain service by merging a plurality of existing source code modules for implementing a certain function.
In the prior art, in the process of implementing merging of a plurality of source code modules, in order to solve the problem of dependency of each source code module, a code dependency framework may be generally introduced, so that each module in a source code file obtained by final merging solves the problem of module dependency through the code dependency framework.
In the prior art, the length of the source code file obtained by merging is increased due to the introduced code dependency framework, so that the finally obtained source code file is not compact enough.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method and an apparatus for code processing, so as to solve the problem in the prior art that a source code file obtained by merging is not compact enough because an introduced code dependent framework increases the length of the source code file.
In order to solve the above technical problem, the method and apparatus for processing code provided in the embodiments of the present application are implemented as follows:
a method of code processing, comprising:
acquiring a module code corresponding to a module contained in the current service;
extracting dependency information contained in the module code;
and determining the order of each module in the current service according to the dependency information, and combining the module codes according to the order of the modules to obtain a code file corresponding to the current service.
An apparatus for code processing, comprising:
the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a module code corresponding to a module contained in the current service;
an extraction unit configured to extract dependency information included in the module code;
and the determining unit is used for determining the sequence of each module in the current service according to the dependency information, and combining the module codes according to the sequence of the modules to obtain a code file corresponding to the current service.
According to the technical scheme provided by the embodiment of the application, after the module code corresponding to the module included in the current service is acquired, the dependency information included in the module code is extracted, the order of each module in the current service is determined according to the dependency information, and finally the module codes are combined according to the order to obtain the code file corresponding to the current service. In the process, the problem of dependence of each module is solved by introducing a specific code dependence framework is avoided, so that the finally combined code file is more simplified.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without any creative effort.
FIG. 1 is a flow chart of a code processing method provided in an embodiment of the present application;
FIG. 2 is a flowchart of a method for determining an order of modules according to dependency information in an embodiment of the present application;
FIG. 3 is a flowchart of a method for determining an order of modules according to dependency information in an embodiment of the present application;
fig. 4 is a block diagram of a code processing apparatus according to an embodiment of the present application.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is a flowchart of a code processing method in an embodiment of the present application. In this embodiment, the code processing method includes the following steps:
s110: and acquiring a module code corresponding to a module contained in the current service.
The current service is a service which is currently required to be realized by a software developer, and the current service may comprise a plurality of pre-planned modules, and a dependency relationship may exist among the modules. Before a certain service needs to be implemented, a software developer can specify modules included in the current service. For example, for the current service X, the modules included therein may be { a, b, c, d, e }, and then the module codes corresponding to the modules may be obtained according to the modules, respectively.
In this embodiment of the present application, before obtaining a module code corresponding to a module included in a current service, the method further includes:
adding dependency information corresponding to the dependency relationship in the module code of each module according to the dependency relationship among the modules; and mapping and storing the module code of each module and the module identifier of the module.
As mentioned above, there may be dependency relationships between modules, and these dependency relationships may be implemented by adding corresponding dependency information to the module code of each module. Such as:
/*global extend*/
// dependent extension
function ajax(settings){
}
In the above exemplary module code, the module "ajax" may then be dependent on the module "extended" by the dependency information "/" global extended/".
According to the method, corresponding dependency information is added to the module codes of the modules with dependency relationship, and different module identification IDs (such as 'ajax' and 'extended') are given to the divided modules, so that the module codes of each module correspond to the module identifications of the module one by one. And finally, mapping the module codes added with the dependency information with the module identification ID of each module respectively, and storing the module codes into a source code database.
As described above, in this embodiment, the step S110 specifically includes:
and receiving a module identification which is input by a user and corresponds to a module contained in the current service.
And inquiring a module code corresponding to the module contained in the current service according to the module identifier.
The user can be a software developer, and the system receives the module identification corresponding to each module included in the current service, which is input by the software developer according to the requirement of the current service. And then, the system queries the source code database according to the received module identification to obtain the prestored module code corresponding to each module. Such as: the inputted module identification comprises: "ajax" and "extended", the system queries the module code mapped with the module id "ajax" and "extended".
S120: and extracting the dependency information contained in the module code.
Specifically, the embodiment of the present application may scan module codes by editing a corresponding Regular Expression (RE) for extracting dependency information to obtain the dependency information.
For example, if the module included in the current service X is { a, b, c, d, e }, the dependency information included in the module code of the module a can be obtained by scanning the module code corresponding to the module: "/" global a/", the dependency information contained in the module code of module b is: "/" global c/", the dependency information contained in the module code of module d is: "/" global b/", the dependency information contained in the module code of module e is: "/" global c/"; then, the dependency relationship corresponding to the dependency information is as follows:
a depends on b, b depends on c, d depends on b, e depends on c.
S130: and determining the sequence of each module in the current service according to the dependency information list, and combining the module codes according to the sequence to obtain a code file corresponding to the current service.
In an embodiment of the present application, after the step S120 and before the step S130, the method further includes:
s140: and determining a dependency information list corresponding to the current service according to the extracted dependency information. And the dependency information list is used for sequencing all modules of the current service according to a certain sequence according to the extracted dependency relationship.
Continuing with the above example, if the current service X includes modules { a, b, c, d, e }, and extracting the dependency information in the codes of the modules, the following dependency relationships can be obtained: a depends on b, b depends on c, d depends on b, e depends on c. Then, the module order in the dependency information list can be obtained as follows: [ a, b, c ], [ d, b ], [ e, c ], then, by combining the module sequences, the module sequence in the dependency information list is obtained as follows: [ a, b, c, d, b, e, c ].
Fig. 2 is a flowchart of a method of determining an order of modules in a current service according to the dependency information in an embodiment of the present application. Based on the above steps, the step S130 specifically includes:
s1301: and judging whether redundant module identifications exist in the dependency information list.
Following the above example, the order of the modules in the dependency information list is obtained as: [ a, b, c, d, b, e, c ], it can be seen that there are redundant module identifications in the dependency information list: b. c, that is, a module identification can only appear once in the dependency information list.
S1302: and if so, deleting the redundant module identification.
In the above example, redundant modules are identified: b. c, deleting, wherein the module sequence in the deleted dependency information list is as follows: [ a, d, b, e, c ].
S1303: and performing reverse order arrangement on the sequence of the module identifications in the dependency information list in which the redundant module identifications are deleted, and determining the sequence of the module identifications after the reverse order arrangement as the sequence of each module in the current service.
In the above example, since the dependent module code in the code file generated by the final merging needs to be placed at the front position in the code file, this embodiment may sequentially: [ a, d, b, e, c ] is arranged in a reverse order, and the sequence of the module identifiers after the reverse order arrangement is as follows: [ c, e, b, d, a ] is determined as the order of the modules in the current service.
Finally, the module codes obtained by query can be combined according to the sequence of each module in the current service, so as to obtain a code file corresponding to the current service.
For example, if the module code of module a is:
/*global b*/
// dependent on b
function a(settings){
}
If the module code of module b is:
/*global c*/
// dependent on c
function b(settings){
}
If the module code of module c is:
function c(settings){
}
if the module code of module d is:
/*global b*/
// dependent on b
function d(settings){
}
If the module code of module e is:
/*global c*/
// dependent on c
function e(settings){
}
Combining the codes of the modules according to the sequence of the modules in the current service, and obtaining a final code file, wherein the final code file is as follows:
function c(settings){
}
/*global c*/
// dependent on c
function e(settings){
}
/*global c*/
// dependent on c
function b(settings){
}
/*global b*/
// dependent on b
function d(settings){
}
/*global b*/
// dependent on b
function a(settings){
}
It is worth mentioning that the order of the modules in the current service is not unique, and the order between the modules with no interdependence relationship may be reversed, for example: in [ c, e, b, d, a ], the order of a and e may be interchanged. In addition, in an actual application, there may be a module that does not have any dependency relationship with other modules (the module code of the module does not contain dependency information either), and in the process of finally merging the code files, the module code without dependency relationship may be inserted into any position in the code files obtained by final merging.
In another embodiment of the present application, without the step S140, the step of determining the order of each module in the current service according to the dependency information in the step S130 specifically includes, as shown in fig. 3:
s1304: and determining a first module identification of the depended module and a second module identification of the dependent module according to the dependency information.
Continuing with the above example, if the current service X includes modules { a, b, c, d, e }, and extracting the dependency information in the codes of the modules, the following dependency relationships can be obtained: a depends on b, b depends on c, d depends on b, e depends on c. Wherein the depended module comprises: b. c, the dependency module comprises: a. b, d, e.
S1305: and judging whether the first module identification or the second module identification exists in a preset sequence table.
In this embodiment, the system sets an order table in advance, so as to sequentially insert the determined module identifiers having the dependency relationship into the order table.
S1306: and if the first module identification exists but the second module identification does not exist, placing the second module identification behind the first module identification.
S1307: and if the second module identification exists but the first module identification does not exist, placing the first module identification in front of the second module identification.
Through the above steps 1306 and 1307, the module id in the above sequence table is inserted in the following order:
initially, the order table is empty, the depended module in "a depends on b" is b, the dependent module is a, and then the order table is obtained by inserting the depended module before and the dependent module after the depended module:
[b、a];
subsequently, for "b depends on c", the depended module is c, the dependent module is b, and by judging that b already exists in the above-mentioned order table (which is the case according to step S1307), the module c is inserted before the module b, and the order table is obtained:
[c、b、a];
for "d depends on b", the depended module is b, the dependent module is d, and by judging that b already exists in the order table (which is the case in step S1306), the module d is inserted after the module b to obtain the order table:
[c、b、d、a];
for "e depends on c", the depended module is c, the dependent module is e, and by judging that c already exists in the above-mentioned order table (which is the case in step S1306), the module e is inserted after the module c to obtain the order table:
[c、e、b、d、a]。
so far, the sequence of the module identifiers in the final sequence table can be determined as the sequence of each module corresponding to the current service according to the above process. And then, combining the module codes according to the sequence of the module identifiers contained in the sequence table to obtain a code file corresponding to the current service.
In this embodiment of the application, in order to make a code file obtained by final merging more compact, the method further includes:
and determining and deleting the annotation information contained in the combined module code. The annotation information includes, but is not limited to: comments for describing dependencies, etc., such as: "/dependent extended".
Corresponding to the method flow, the embodiment of the application also provides a device for processing the code. The apparatus may be implemented by software, or by hardware, or by a combination of hardware and software. Taking a software implementation as an example, the logical device is formed by reading a corresponding computer program instruction into a memory through a Central Processing Unit (CPU) of a server to run.
Fig. 4 is a block diagram of a device for processing code according to an embodiment of the present application. The functions of the units in the device are similar to the functions of the steps in the method, so that the device can refer to the details of the embodiment of the method. The device includes:
an obtaining unit 401, configured to obtain a module code corresponding to a module included in a current service;
an extracting unit 402, configured to extract dependency information included in the module code;
a determining unit 403, configured to determine an order of each module in the current service according to the dependency information, and merge the module codes according to the order of the modules to obtain a code file corresponding to the current service.
As shown in fig. 4, in the embodiment of the present application, the apparatus further includes:
the storage unit is used for adding dependency information corresponding to the dependency relationship in the module codes of the modules according to the dependency relationship among the modules; mapping and storing the module code of each module and the module identifier of the module;
then, the obtaining unit 401 is specifically configured to:
receiving a module identification which is input by a user and corresponds to a module contained in the current service;
and inquiring a module code corresponding to the module contained in the current service according to the module identifier.
As shown in fig. 4, in the embodiment of the present application, the apparatus further includes:
the list generating unit is used for determining a dependency information list corresponding to the current service according to the extracted dependency information;
then, the determining unit 403 specifically includes:
the first judgment unit is used for judging whether redundant module identifiers exist in the dependency information list or not;
a deleting unit, configured to delete redundant module identifiers if the redundant module identifiers exist in the dependency information list;
and the order determining unit is used for carrying out reverse order arrangement on the order of the module identifications in the dependency information list for deleting the redundant module identifications, and determining the order of the module identifications after the reverse order arrangement as the order of each module in the current service.
As shown in the apparatus of fig. 4, in the embodiment of the present application, the determining unit 403 specifically includes:
the dependency determining unit is used for determining a first module identifier of the depended module and a second module identifier of the dependent module according to the dependency information;
a second judging unit, configured to judge whether the first module identifier or the second module identifier exists in a preset order table;
a sorting unit, configured to place the second module identifier behind the first module identifier when the first module identifier exists but the second module identifier does not exist in the sorted list; when the second module identification exists but the first module identification does not exist in the sequence table, placing the first module identification in front of the second module identification; and merging the module codes according to the sequence of the module identifiers contained in the sequence table to obtain a code file corresponding to the current service.
As shown in fig. 4, in the embodiment of the present application, the apparatus further includes:
and the comment deleting unit is used for determining and deleting the comment information contained in the combined module code.
According to the technical scheme provided by the embodiment of the application, after the module code corresponding to the module included in the current service is acquired, the dependency information included in the module code is extracted, the order of each module in the current service is determined according to the dependency information, and finally the module code is combined according to the order to obtain the code file corresponding to the current service. In the process, the problem of dependence of each module is solved by introducing a specific code dependence framework is avoided, so that the finally combined code file is more simplified.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams 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, embedded processor, 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, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that 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 an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A code processing method, comprising:
acquiring module codes corresponding to modules included in the current service, wherein dependency information corresponding to dependency relationships among the modules is added in the module codes;
extracting dependency information contained in the module code;
determining the order of each module in the current service according to the dependency information, and combining the module codes according to the order of the modules to obtain a code file corresponding to the current service;
determining the order of each module in the current service according to the dependency information, specifically comprising:
determining a first module identification of the depended module and a second module identification of the dependent module according to the dependency information;
judging whether the first module identification or the second module identification exists in a preset sequence table;
if the first module identification exists but the second module identification does not exist, placing the second module identification behind the first module identification;
and if the second module identification exists but the first module identification does not exist, placing the first module identification in front of the second module identification.
2. The method of claim 1, wherein prior to obtaining a module code corresponding to a module included in the current service, the method further comprises:
adding dependency information corresponding to the dependency relationship in the module code of each module according to the dependency relationship among the modules;
mapping and storing the module code of each module and the module identifier of the module;
then, acquiring a module code corresponding to a module included in the current service specifically includes:
receiving a module identification which is input by a user and corresponds to a module contained in the current service;
and inquiring a module code corresponding to the module contained in the current service according to the module identifier.
3. The method of claim 1, wherein after extracting the dependency information included in the module code, and before determining an order of modules in the current service according to the dependency information, the method further comprises:
determining a dependency information list corresponding to the current service according to the extracted dependency information;
then, determining the order of each module in the current service according to the dependency information list, specifically including:
judging whether redundant module identifications exist in the dependency information list;
if so, deleting the redundant module identification;
and performing reverse order arrangement on the sequence of the module identifications in the dependency information list in which the redundant module identifications are deleted, and determining the sequence of the module identifications after the reverse order arrangement as the sequence of each module in the current service.
4. The method according to claim 1, wherein merging the module codes according to the order of the modules to obtain a code file corresponding to the current service specifically comprises:
and merging the module codes according to the sequence of the module identifiers contained in the sequence table to obtain a code file corresponding to the current service.
5. The method of claim 1, wherein after combining the module codes according to the order of the modules and before obtaining a code file corresponding to the current service, the method comprises:
and determining and deleting the annotation information contained in the combined module code.
6. A code processing apparatus, comprising:
the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a module code corresponding to a module contained in the current service, and the module code is added with dependency information corresponding to the dependency relationship among the modules;
an extraction unit configured to extract dependency information included in the module code;
a determining unit, configured to determine an order of each module in a current service according to the dependency information, and merge the module codes according to the order of the modules to obtain a code file corresponding to the current service;
the determining unit specifically includes:
the dependency determining unit is used for determining a first module identifier of the depended module and a second module identifier of the dependent module according to the dependency information;
a second judging unit, configured to judge whether the first module identifier or the second module identifier exists in a preset order table;
a sorting unit, configured to place the second module identifier behind the first module identifier when the first module identifier exists but the second module identifier does not exist in the sorted list; and when the second module identification exists but the first module identification does not exist in the sequence table, placing the first module identification before the second module identification.
7. The apparatus of claim 6, wherein the apparatus further comprises:
the storage unit is used for adding dependency information corresponding to the dependency relationship in the module codes of the modules according to the dependency relationship among the modules; mapping and storing the module code of each module and the module identifier of the module;
then, the obtaining unit is specifically configured to:
receiving a module identification which is input by a user and corresponds to a module contained in the current service;
and inquiring a module code corresponding to the module contained in the current service according to the module identifier.
8. The apparatus of claim 6, wherein the apparatus further comprises:
the list generating unit is used for determining a dependency information list corresponding to the current service according to the extracted dependency information;
then, the determining unit specifically includes:
the first judgment unit is used for judging whether redundant module identifiers exist in the dependency information list or not;
a deleting unit, configured to delete redundant module identifiers if the redundant module identifiers exist in the dependency information list;
and the order determining unit is used for carrying out reverse order arrangement on the order of the module identifications in the dependency information list for deleting the redundant module identifications, and determining the order of the module identifications after the reverse order arrangement as the order of each module in the current service.
9. The apparatus of claim 6, wherein the sorting unit is configured to merge the module codes according to an order of the module identifiers included in the sorting table to obtain a code file corresponding to the current service.
10. The apparatus of claim 6, wherein the apparatus comprises:
and the comment deleting unit is used for determining and deleting the comment information contained in the combined module code.
CN201510883743.2A 2015-12-04 2015-12-04 Code processing method and device Active CN106843820B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510883743.2A CN106843820B (en) 2015-12-04 2015-12-04 Code processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510883743.2A CN106843820B (en) 2015-12-04 2015-12-04 Code processing method and device

Publications (2)

Publication Number Publication Date
CN106843820A CN106843820A (en) 2017-06-13
CN106843820B true CN106843820B (en) 2020-08-04

Family

ID=59148985

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510883743.2A Active CN106843820B (en) 2015-12-04 2015-12-04 Code processing method and device

Country Status (1)

Country Link
CN (1) CN106843820B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110554867B (en) * 2018-05-30 2023-03-28 阿里巴巴集团控股有限公司 Application processing method and device
CN109388403B (en) * 2018-09-26 2022-04-05 广州视源电子科技股份有限公司 Dependency injection method, device, equipment and storage medium
CN109582347B (en) * 2018-10-15 2024-04-02 平安科技(深圳)有限公司 Method and device for acquiring front-end codes
CN110442399B (en) * 2019-08-09 2022-08-16 广州小鹏汽车科技有限公司 Method and device for executing read Native service of application, storage medium and terminal equipment
CN112114871B (en) * 2020-09-28 2023-09-05 北京奇艺世纪科技有限公司 Code sharing method, device, server, terminal and medium
CN112486470A (en) * 2020-12-15 2021-03-12 恩亿科(北京)数据科技有限公司 Method and system for automatically adjusting file window sequence based on file dependency relationship
CN115543277A (en) * 2021-06-30 2022-12-30 中兴通讯股份有限公司 Code integration verification method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103699377A (en) * 2013-12-04 2014-04-02 国家电网公司 Reconstruction combination method for program codes
US8949809B2 (en) * 2012-03-01 2015-02-03 International Business Machines Corporation Automatic pipeline parallelization of sequential code
CN104991773A (en) * 2015-06-30 2015-10-21 小米科技有限责任公司 Program generation method and apparatus

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8479185B2 (en) * 2010-12-09 2013-07-02 Oracle International Corporation Method and system for utilizing parallelism across loops

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8949809B2 (en) * 2012-03-01 2015-02-03 International Business Machines Corporation Automatic pipeline parallelization of sequential code
CN103699377A (en) * 2013-12-04 2014-04-02 国家电网公司 Reconstruction combination method for program codes
CN104991773A (en) * 2015-06-30 2015-10-21 小米科技有限责任公司 Program generation method and apparatus

Also Published As

Publication number Publication date
CN106843820A (en) 2017-06-13

Similar Documents

Publication Publication Date Title
CN106843820B (en) Code processing method and device
CN106897342B (en) Data verification method and equipment
CN111414166B (en) Code generation method, device, equipment and storage medium
CN108021590B (en) Target object attribute determining method, attribute updating method and device
CN106933823B (en) Data synchronization method and device
CN110704418A (en) Block chain information query method, device and equipment
CN110888922B (en) Method and device for creating target table during data synchronization
CN106648839B (en) Data processing method and device
CN113656503A (en) Data synchronization method, device and system and computer readable storage medium
CN112905441A (en) Test case generation method, test method, device and equipment
CN108874379B (en) Page processing method and device
JPWO2015097789A1 (en) Query generation method and query generation apparatus
CN106878365B (en) data synchronization method and device
CN113518187B (en) Video editing method and device
CN105843809B (en) Data processing method and device
CN109343891B (en) Data processing system, method and device
CN110019357B (en) Database query script generation method and device
CN111984595B (en) File processing method and device and storage medium
CN109068286B (en) Information analysis method, medium and equipment
CN111125087B (en) Data storage method and device
CN109561126B (en) Data synchronization method and device, storage medium and processor
CN116431118A (en) Report development method and device
US20150347402A1 (en) System and method for enabling a client system to generate file system operations on a file system data set using a virtual namespace
CN108121733B (en) Data query method and device
CN106547785B (en) Method and system for acquiring information in knowledge base

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20200923

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman, British Islands

Patentee after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman, British Islands

Patentee before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200923

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman, British Islands

Patentee after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Patentee before: Alibaba Group Holding Ltd.

TR01 Transfer of patent right