Data processing method and device, readable storage medium and electronic equipment

By setting multiple sub-source sets to be compiled in parallel as a whole in the Gradle build tool, the compilation difficulties caused by circular dependencies are resolved, and efficient compilation of multiple sub-source sets is achieved.

CN115857943BActive Publication Date: 2026-03-17YONYOU NETWORK TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-02
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

In the Gradle build tool, circular dependencies between multiple sub-source sets prevent developers from compiling multiple sub-source sets individually.

Method used

The circular dependency problem is solved by treating multiple sub-source sets that depend on the same main source set as a whole and compiling them in parallel using an array model.

Benefits of technology

It enables the separate compilation of multiple sub-source sets, improving compilation efficiency and speed, and simplifying the compilation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115857943B_ABST
    Figure CN115857943B_ABST
Patent Text Reader

Abstract

The application provides a data processing method and device, a readable storage medium and an electronic device. The data processing method comprises the following steps: determining a plurality of sub-source sets in a main source set, and determining an output path of each sub-source set in the plurality of sub-source sets; performing parallel compilation on the plurality of sub-source sets through an array model; and outputting the plurality of sub-source sets after parallel compilation according to the output path.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing, and more specifically, to a data processing method, apparatus, readable storage medium, and electronic device. Background Technology

[0002] In related technologies, Gradle (an open-source build tool) has a main source set, which includes other source sets of other functional nodes. These other source sets only have a one-way dependency on the main source set. Therefore, due to the interdependencies between the various source sets, developers cannot compile each source set individually when they want to compile it. Summary of the Invention

[0003] The present invention aims to at least solve the technical problems existing in the prior art or related art.

[0004] Therefore, a first aspect of the present invention provides a data processing method.

[0005] A second aspect of the present invention provides a data processing apparatus.

[0006] A third aspect of the present invention provides a data processing apparatus.

[0007] A fourth aspect of the present invention provides a readable storage medium.

[0008] A fifth aspect of the present invention provides an electronic device.

[0009] In view of this, the first aspect of the present invention proposes a data processing method, the processing method comprising: determining multiple sub-source sets in a main source set, and determining the output path of each sub-source set in the multiple sub-source sets; performing parallel compilation of the multiple sub-source sets through an array model; and outputting the multiple sub-source sets after parallel compilation according to the output path.

[0010] In the technical solution of this invention, Gradle (an open-source build tool) has multiple sub-source sets that depend on a main source set. Therefore, there is a circular dependency problem between the multiple sub-source sets, which makes it impossible for developers to compile the multiple sub-source sets individually. In this application, by setting the multiple sub-source sets that depend on the same main source set as a whole, the multiple sub-source sets can be compiled in parallel through an array model, thus solving the problem of not being able to compile multiple sub-source sets.

[0011] In the above technical solution, specifically, the main source set can be the source set generated by the developer when creating a new build type in Gradle (an open-source build tool), and the sub-source sets can be multiple properties set for the build type. The system first determines multiple sub-source sets that depend on the same main source set and needs to be compiled, and determines the output path of each sub-source set in the multiple sub-source sets that need to be compiled, so that after the system has compiled multiple sub-source sets, the multiple compiled sub-source sets can be output as fixed files according to the determined output paths.

[0012] In the above technical solution, outputting multiple compiled sub-source sets into fixed files according to a determined output path can include file formats such as jar (Java Archive) files and class (bytecode) files.

[0013] In any of the above technical solutions, after determining the output path of each sub-source set, multiple sub-source sets are treated as a whole and input into the array model so that the array model can compile multiple sub-source sets in parallel. By compiling the sub-source sets in parallel through the array model, that is, compiling multiple sub-source sets in sequence, the problem that it is impossible to compile sub-source sets individually in open source build tools is solved, and the scenario of compiling source sets in open source build tools is enhanced.

[0014] In the above technical solutions, the array model can be the ECJ compiler (Eclipse Compile Java, Eclipse compiler).

[0015] The data processing method provided by the present invention may also have the following additional technical features:

[0016] In any of the above technical solutions, parallel compilation of multiple sub-source sets using an array model specifically includes: performing compilation scanning on multiple sub-source sets using an array model to obtain directory information for multiple sub-source sets; generating compilation information corresponding to the directory information based on one of the multiple directory information; using the compilation information to compile the sub-source set to which the directory information corresponding to the compilation information belongs; and after compiling one sub-source set from the multiple sub-source sets, compiling the other sub-source sets to be compiled sequentially.

[0017] In the above technical solution, the directory information can be attribute information, construction information, etc., included in the sub-source sets. The array model performs a single compilation scan on multiple sub-source sets, and the scanned target information is used by the array model to generate compilation information. For example, if a developer needs to compile n sub-source sets that depend on the same main source set, after inputting the n sub-source sets into the array model, the array model performs a single scan on the n sub-source sets. This avoids the problem of needing to perform n scans on n sets when compiling a collection, reducing the number of scans and simplifying the compilation process for multiple sub-source sets.

[0018] In any of the above technical solutions, the compilation information can be information used for compilation work, such as functions and structures, when compiling the sub-source set. The array model obtains multiple directory information by scanning multiple sub-source sets for compilation, which corresponds one-to-one with the multiple sub-source sets. The system first generates compilation information corresponding to one of the directory information based on one of the directory information. Then, the array model can use the compilation information to compile one of the multiple sub-source sets. The directory information corresponding to the sub-source set is the same as the directory information corresponding to the compilation information. After compiling one sub-source set, the array model compiles the other multiple sub-source sets in sequence, thereby realizing the individual compilation of the sub-source sets.

[0019] In any of the above technical solutions, after compiling one of the multiple sub-source sets, the processing method further includes: storing the compilation information in memory; and determining that the compilation information in memory is shared information.

[0020] In the above technical solution, the system sets the generated compilation information as shared information and stores it in memory, so that the compilation information generated by the system based on the directory information can be reused, thereby realizing the sharing of compilation information and improving the compilation speed.

[0021] In the above technical solution, for example, multiple sub-source sets are sub-source set A, sub-source set B and sub-source set C. The system generates compilation information corresponding to sub-source set A according to the directory information corresponding to sub-source set A. The system sets the compilation information as shared information. Then the array model can use the shared information to compile sub-source set B and sub-source set C, thereby realizing the sharing of compilation information.

[0022] In the above technical solution, the shared information can also be used by the array model during the next compilation of the sub-source set after the current compilation is completed.

[0023] In any of the above technical solutions, the other sub-source sets to be compiled are compiled sequentially, specifically including: when the directory information of the sub-source sets to be compiled is the same as the directory information corresponding to the shared information, the shared information is called to compile the sub-source sets to be compiled in parallel.

[0024] In the above technical solution, after the array model finishes compiling one of the multiple sub-source sets, the system identifies the compilation information of the compiled sub-source set as shared information and stores it in memory. At this time, the directory information corresponding to the next uncompiled sub-source set can be determined. If the directory information is the same as the directory information corresponding to the already compiled sub-source set, then the shared information stored in memory can be used to compile the uncompiled sub-source set to improve the compilation speed of the sub-source set.

[0025] In the above technical solution, for example, multiple sub-source sets are sub-source set A, sub-source set B, and sub-source set C. The system generates compilation information corresponding to sub-source set A based on the directory information corresponding to sub-source set A. The system sets this compilation information as shared information. Since the directory information corresponding to sub-source set B is the same as the directory information corresponding to sub-source set A, it is not necessary to generate compilation information based on the directory information corresponding to sub-source set B. The array model can directly call the shared information in memory to compile sub-source set B, thereby simplifying the steps of compiling multiple sub-source sets by the array model and improving the compilation speed.

[0026] In any of the above technical solutions, determining the output path of each of the multiple sub-source sets specifically includes: receiving an output directory, which includes correspondence information between multiple sub-source sets and output paths; and determining the output path of the sub-source set based on the correspondence information.

[0027] In the above technical solution, the output directory can include the correspondence information between each sub-source set and the output path, so that the system can directly determine the output path of each sub-source set based on this correspondence information, thereby realizing the management of the output path of each sub-source set. The correspondence information between each sub-source set and the output path can be set by the developers according to actual needs.

[0028] In the above technical solution, for example, the output directory may also contain directory information and output path correspondence information for each sub-source set, so that the output path corresponding to each sub-source set can be determined after the array model performs compilation scanning on multiple sub-source sets.

[0029] In any of the above technical solutions, before parallel compilation of multiple sub-source sets through the array model, the processing method further includes: performing set processing on the multiple sub-source sets, and inputting the set-processed multiple sub-source sets into the array model.

[0030] In any of the above technical solutions, set processing in this application sets multiple sub-source sets that depend on the same main source set as a whole that is not dependent on the main source set. This allows multiple sub-source sets that are disconnected from each other to be input into the array model, so that the array model can compile multiple sub-source sets. This solves the problem that sub-source sets cannot be compiled individually in open source build tools.

[0031] A second aspect of the present invention provides a data processing apparatus, comprising: a first processing module for determining multiple sub-source sets in a main source set and determining an output path for each sub-source set in the multiple sub-source sets; a second processing module for performing parallel compilation of the multiple sub-source sets using an array model; and an output module for outputting the multiple sub-source sets after parallel compilation according to the output path.

[0032] In the technical solution of this invention, Gradle (an open-source build tool) has multiple sub-source sets that depend on a main source set. Therefore, there is a circular dependency problem between the multiple sub-source sets, which makes it impossible for developers to compile the multiple sub-source sets individually. In this application, by setting the multiple sub-source sets that depend on the same main source set as a whole, the multiple sub-source sets can be compiled in parallel through an array model, thus solving the problem of not being able to compile multiple sub-source sets.

[0033] In the above technical solution, specifically, the main source set can be the source set generated by the developer when creating a new build type in Gradle (an open-source build tool), and the sub-source sets can be multiple properties set for the build type. The system first determines multiple sub-source sets that depend on the same main source set and needs to be compiled, and determines the output path of each sub-source set in the multiple sub-source sets that need to be compiled, so that after the system has compiled multiple sub-source sets, the multiple compiled sub-source sets can be output as fixed files according to the determined output paths.

[0034] In the above technical solution, outputting multiple compiled sub-source sets into fixed files according to a determined output path can include file formats such as jar (Java Archive) files and class (bytecode) files.

[0035] In any of the above technical solutions, after determining the output path of each sub-source set, multiple sub-source sets are treated as a whole and input into the array model so that the array model can compile multiple sub-source sets in parallel. By compiling the sub-source sets in parallel through the array model, that is, compiling multiple sub-source sets in sequence, the problem that it is impossible to compile sub-source sets individually in open source build tools is solved, and the scenario of compiling source sets in open source build tools is enhanced.

[0036] In the above technical solutions, the array model can be the ECJ compiler (Eclipse Compile Java, Eclipse compiler).

[0037] The data processing apparatus provided by the present invention may further have the following additional technical features:

[0038] In any of the above technical solutions, the second processing module is specifically used to: perform compilation scanning on multiple sub-source sets through an array model to obtain directory information of multiple sub-source sets; generate compilation information corresponding to the directory information based on one of the multiple directory information, and use the compilation information to compile the sub-source set to which the directory information corresponding to the compilation information belongs; after compiling one sub-source set in the multiple sub-source sets, compile the other sub-source sets to be compiled in sequence.

[0039] In the above technical solution, the directory information can be attribute information, construction information, etc., included in the sub-source sets. The array model performs a single compilation scan on multiple sub-source sets, and the scanned target information is used by the array model to generate compilation information. For example, if a developer needs to compile n sub-source sets that depend on the same main source set, after inputting the n sub-source sets into the array model, the array model performs a single scan on the n sub-source sets. This avoids the problem of needing to perform n scans on n sets when compiling a collection, reducing the number of scans and simplifying the compilation process for multiple sub-source sets.

[0040] In any of the above technical solutions, the compilation information can be information used for compilation work, such as functions and structures, when compiling the sub-source set. The array model obtains multiple directory information by scanning multiple sub-source sets for compilation, which corresponds one-to-one with the multiple sub-source sets. The system first generates compilation information corresponding to one of the directory information based on one of the directory information. Then, the array model can use the compilation information to compile one of the multiple sub-source sets. The directory information corresponding to the sub-source set is the same as the directory information corresponding to the compilation information. After compiling one sub-source set, the array model compiles the other multiple sub-source sets in sequence, thereby realizing the individual compilation of the sub-source sets.

[0041] In any of the above technical solutions, the second processing module is further configured to: store the compilation information in memory; and determine that the compilation information in memory is shared information.

[0042] In the above technical solution, the system sets the generated compilation information as shared information and stores it in memory, so that the compilation information generated by the system based on the directory information can be reused, thereby realizing the sharing of compilation information and improving the compilation speed.

[0043] In the above technical solution, for example, multiple sub-source sets are sub-source set A, sub-source set B and sub-source set C. The system generates compilation information corresponding to sub-source set A according to the directory information corresponding to sub-source set A. The system sets the compilation information as shared information. Then the array model can use the shared information to compile sub-source set B and sub-source set C, thereby realizing the sharing of compilation information.

[0044] In the above technical solution, the shared information can also be used by the array model during the next compilation of the sub-source set after the current compilation is completed.

[0045] In any of the above technical solutions, the second processing module is further configured to: when the directory information of the sub-source set to be compiled is the same as the directory information corresponding to the shared information, call the shared information to perform parallel compilation of the sub-source set to be compiled.

[0046] In the above technical solution, after the array model finishes compiling one of the multiple sub-source sets, the system identifies the compilation information of the compiled sub-source set as shared information and stores it in memory. At this time, the directory information corresponding to the next uncompiled sub-source set can be determined. If the directory information is the same as the directory information corresponding to the already compiled sub-source set, then the shared information stored in memory can be used to compile the uncompiled sub-source set to improve the compilation speed of the sub-source set.

[0047] In the above technical solution, for example, multiple sub-source sets are sub-source set A, sub-source set B, and sub-source set C. The system generates compilation information corresponding to sub-source set A based on the directory information corresponding to sub-source set A. The system sets this compilation information as shared information. Since the directory information corresponding to sub-source set B is the same as the directory information corresponding to sub-source set A, it is not necessary to generate compilation information based on the directory information corresponding to sub-source set B. The array model can directly call the shared information in memory to compile sub-source set B, thereby simplifying the steps of compiling multiple sub-source sets by the array model and improving the compilation speed.

[0048] In any of the above technical solutions, the first processing module is specifically used to: receive an output directory, the output directory including correspondence information between multiple sub-source sets and output paths; and determine the output path of the sub-source set based on the correspondence information.

[0049] In the above technical solution, the output directory can include the correspondence information between each sub-source set and the output path, so that the system can directly determine the output path of each sub-source set based on this correspondence information, thereby realizing the management of the output path of each sub-source set. The correspondence information between each sub-source set and the output path can be set by the developers according to actual needs.

[0050] In the above technical solution, for example, the output directory may also contain directory information and output path correspondence information for each sub-source set, so that the output path corresponding to each sub-source set can be determined after the array model performs compilation scanning on multiple sub-source sets.

[0051] In any of the above technical solutions, the data processing device is further used to: perform set processing on multiple sub-source sets, and input the set-processed multiple sub-source sets into the array model.

[0052] In any of the above technical solutions, set processing in this application sets multiple sub-source sets that depend on the same main source set as a whole that is not dependent on the main source set. This allows multiple sub-source sets that are disconnected from each other to be input into the array model, so that the array model can compile multiple sub-source sets. This solves the problem that sub-source sets cannot be compiled individually in open source build tools.

[0053] A third aspect of the present invention provides a data processing apparatus, comprising: a memory storing a program or instructions; and a processor executing the program or instructions stored in the memory to implement the steps of the data processing method proposed in the above-described technical solutions of this application, thus possessing all the beneficial technical effects of the data processing method proposed in the above-described technical solutions of this application, which will not be elaborated further here.

[0054] A fourth aspect of the present invention provides a readable storage medium storing a program or instructions, which, when executed by a processor, implement the steps of a data processing method as described in any of the above technical solutions.

[0055] The readable storage medium provided by this invention stores a program or instructions thereon, which, when executed by a processor, can implement the steps of the data processing method as described in any of the above-described technical solutions. Therefore, the readable storage medium proposed by this invention possesses all the beneficial effects of data processing in any of the above-described technical solutions, which will not be elaborated further here.

[0056] A fifth aspect of the present invention provides an electronic device, comprising: a data processing apparatus as described in any of the above-described technical solutions; and / or a readable storage medium as described in the above-described technical solutions.

[0057] The electronic device provided by the present invention includes the data processing device in any of the above technical solutions. Therefore, it has all the beneficial effects of the target information query device in any of the above technical solutions, which will not be repeated here.

[0058] In any of the above technical solutions, the electronic device provided by the present invention may further include the readable storage medium defined in the above technical solutions. Therefore, the electronic device proposed by the present invention possesses all the beneficial effects of the readable storage medium defined in the above technical solutions, which will not be elaborated further here.

[0059] Additional aspects and advantages of the invention will become apparent in the following description or may be learned by practice of the invention. Attached Figure Description

[0060] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:

[0061] Figure 1 A flowchart illustrating one embodiment of the data processing method of the present invention is shown;

[0062] Figure 2 A second schematic flowchart of a data processing method according to an embodiment of the present invention is shown;

[0063] Figure 3 The third schematic flowchart of the data processing method according to an embodiment of the present invention is shown;

[0064] Figure 4 The fourth flowchart illustrates the data processing method according to an embodiment of the present invention.

[0065] Figure 5 The fifth flowchart illustrates the data processing method according to an embodiment of the present invention;

[0066] Figure 6 This is a sixth schematic flowchart illustrating a data processing method according to an embodiment of the present invention;

[0067] Figure 7 A schematic block diagram of a data processing apparatus according to an embodiment of the present invention is shown;

[0068] Figure 8 A second schematic block diagram of a data processing apparatus according to an embodiment of the present invention is shown;

[0069] Figure 9 A schematic diagram of the data processing method according to an embodiment of the present invention is shown. Detailed Implementation

[0070] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.

[0071] The execution subject of the embodiments provided in this application can be the Gradle system. The subject can be determined according to actual usage needs, and this application does not limit it. In order to more clearly describe the data processing method provided in this application, the following method embodiments use the system as the execution subject of the data processing method for illustrative purposes.

[0072] like Figure 1 As shown, an embodiment of the first aspect of the present invention provides a data processing method, the processing method comprising:

[0073] Step 102: Determine multiple sub-source sets in the main source set, and determine the output path of each sub-source set in the multiple sub-source sets;

[0074] Step 104: Compile multiple sub-source sets in parallel using an array model;

[0075] Step 106: Output the multiple sub-source sets after parallel compilation according to the output path.

[0076] In an embodiment of the present invention, Gradle (an open-source build tool) has multiple sub-source sets that depend on a main source set. Therefore, there is a circular dependency problem between the multiple sub-source sets, which makes it impossible for developers to compile the multiple sub-source sets individually. In this application, by setting the multiple sub-source sets that depend on the same main source set as a whole, the multiple sub-source sets can be compiled in parallel through an array model, thus solving the problem of not being able to compile multiple sub-source sets.

[0077] In the above embodiments, specifically, the main source set can be the source set generated by the developer when creating a new build type in Gradle (an open-source build tool), and the sub-source sets can be multiple properties set for the build type. The system first determines multiple sub-source sets that depend on the same main source set and needs to be compiled, and determines the output path of each sub-source set in the multiple sub-source sets that need to be compiled, so that after the system has compiled multiple sub-source sets, the multiple compiled sub-source sets can be output as fixed files according to the determined output paths.

[0078] In the above embodiments, outputting multiple compiled sub-source sets as fixed files according to a determined output path may include file formats such as jar (Java Archive) files and class (bytecode) files.

[0079] In any of the above embodiments, after determining the output path of each sub-source set, multiple sub-source sets, which are regarded as a whole, are input into the array model so that the array model can compile multiple sub-source sets in parallel. By compiling the sub-source sets in parallel through the array model, that is, compiling multiple sub-source sets in sequence, the problem that sub-source sets cannot be compiled individually in open source build tools is solved, and the scenario of compiling source sets in open source build tools is enhanced.

[0080] In the above embodiments, the array model can be the ECJ compiler (Eclipse Compile Java, Eclipse compiler).

[0081] like Figure 2 As shown, in any of the above embodiments, parallel compilation of multiple subsets of sources is performed using an array model, specifically including:

[0082] Step 202: Determine multiple sub-source sets in the main source set, and determine the output path of each sub-source set in the multiple sub-source sets;

[0083] Step 204: Perform a compilation scan on multiple sub-source sets using an array model to obtain the directory information of multiple sub-source sets;

[0084] Step 206: Generate compilation information corresponding to one of the multiple directory information, and use the compilation information to compile the sub-source set to which the directory information corresponding to the compilation information belongs;

[0085] Step 208: After compiling one of the multiple sub-source sets, compile the other sub-source sets to be compiled in sequence;

[0086] Step 210: Output the multiple sub-source sets after parallel compilation according to the output path.

[0087] In the above embodiments, the directory information can be attribute information, construction information, etc., included in the sub-source sets. The array model performs a single compilation scan on multiple sub-source sets, and uses the scanned target information to generate compilation information. For example, if a developer needs to compile n sub-source sets that depend on the same main source set, after inputting the n sub-source sets into the array model, the array model performs a single scan on the n sub-source sets. This avoids the problem of needing to perform n scans on n sets during compilation, reducing the number of scans and simplifying the compilation process for multiple sub-source sets.

[0088] In any of the above embodiments, the compilation information can be information used for compilation work, such as functions and structures, when compiling the sub-source set. The array model obtains multiple directory information by performing compilation scans on multiple sub-source sets, which correspond one-to-one with the multiple sub-source sets. The system first generates compilation information corresponding to one of the directory information based on one of the directory information, and then the array model can use the compilation information to compile one of the multiple sub-source sets. The directory information corresponding to the sub-source set is the same as the directory information corresponding to the compilation information. After compiling one of the sub-source sets, the array model compiles the other multiple sub-source sets in sequence, thereby realizing the individual compilation of the sub-source sets.

[0089] like Figure 3 As shown, in any of the above embodiments, after compiling one of the multiple sub-source sets, the processing method further includes:

[0090] Step 302: Determine multiple sub-source sets in the main source set, and determine the output path of each sub-source set in the multiple sub-source sets;

[0091] Step 304: Perform a compilation scan on multiple sub-source sets using an array model to obtain the directory information of multiple sub-source sets;

[0092] Step 306: Generate compilation information corresponding to one of the multiple directory information, and use the compilation information to compile the sub-source set to which the directory information corresponding to the compilation information belongs;

[0093] Step 308: After compiling one of the multiple source sets, store the compilation information in memory and determine that the compilation information in memory is shared information;

[0094] Step 310: Compile the other sub-source sets to be compiled in sequence;

[0095] Step 312: Output the multiple sub-source sets after parallel compilation according to the output path.

[0096] In the above embodiments, the system sets the generated compilation information as shared information and stores it in memory so that the compilation information generated by the system based on the directory information can be reused, thereby realizing the sharing of compilation information and improving the compilation speed.

[0097] In the above embodiments, for example, multiple sub-source sets are sub-source set A, sub-source set B and sub-source set C. The system generates compilation information corresponding to sub-source set A according to the directory information corresponding to sub-source set A. The system sets the compilation information as shared information. Then the array model can use the shared information to compile sub-source set B and sub-source set C, thereby realizing the sharing of compilation information.

[0098] In the above embodiments, the shared information can also be used by the array model during the next compilation of the sub-source set after the current compilation is completed.

[0099] like Figure 4 As shown, in any of the above embodiments, the other sub-source sets to be compiled are compiled sequentially, specifically including:

[0100] Step 402: Determine multiple sub-source sets in the main source set, and determine the output path of each sub-source set in the multiple sub-source sets;

[0101] Step 404: Perform a compilation scan on multiple sub-source sets using an array model to obtain the directory information of multiple sub-source sets;

[0102] Step 406: Generate compilation information corresponding to one of the multiple directory information, and use the compilation information to compile the sub-source set to which the directory information corresponding to the compilation information belongs;

[0103] Step 408: After compiling one of the multiple source sets, store the compilation information in memory and determine that the compilation information in memory is shared information;

[0104] Step 410: If the directory information of the sub-source set to be compiled is the same as the directory information corresponding to the shared information, call the shared information to compile the sub-source set to be compiled in parallel.

[0105] Step 412: Output the multiple sub-source sets after parallel compilation according to the output path.

[0106] In the above embodiments, after the array model finishes compiling one of the multiple sub-source sets, the system determines the compilation information of the compiled sub-source set as shared information and stores it in memory. At this time, the directory information corresponding to the next uncompiled sub-source set can be determined. If the directory information is the same as the directory information corresponding to the compiled sub-source set, then the shared information stored in memory can be used to compile the uncompiled sub-source set to improve the compilation speed of the sub-source set.

[0107] In the above embodiments, for example, the multiple sub-source sets are sub-source set A, sub-source set B, and sub-source set C. The system generates compilation information corresponding to sub-source set A based on the directory information corresponding to sub-source set A. The system sets this compilation information as shared information. Since the directory information corresponding to sub-source set B is the same as the directory information corresponding to sub-source set A, it is not necessary to generate compilation information based on the directory information corresponding to sub-source set B. The array model can directly call the shared information in memory to compile sub-source set B, thereby simplifying the steps of compiling multiple sub-source sets by the array model and improving the compilation speed.

[0108] like Figure 5 As shown, in any of the above embodiments, determining the output path of each of the multiple sub-source sets specifically includes:

[0109] Step 502: Determine multiple sub-source sets within the main source set;

[0110] Step 504: Receive the output directory, which includes information on the correspondence between multiple sub-source sets and output paths;

[0111] Step 506: Determine the output path of the sub-source set based on the corresponding information and determine the output path of each sub-source set in the multiple sub-source sets;

[0112] Step 508: Compile multiple sub-source sets in parallel using an array model;

[0113] Step 510: Output the multiple sub-source sets after parallel compilation according to the output path.

[0114] In the above embodiments, the output directory may include correspondence information between each sub-source set and its output path, enabling the system to directly determine the output path of each sub-source set based on this correspondence information, thereby achieving management of the output path of each sub-source set. The correspondence information between each sub-source set and its output path can be set by the developers according to actual needs.

[0115] In the above embodiments, for example, the output directory may also include the directory information and output path correspondence information corresponding to each sub-source set, so that the output path corresponding to each sub-source set can be determined after the array model performs compilation scanning on multiple sub-source sets.

[0116] like Figure 6 As shown, in any of the above embodiments, before performing parallel compilation of multiple sub-source sets using an array model, the processing method further includes;

[0117] Step 602: Determine multiple sub-source sets in the main source set, and determine the output path of each sub-source set in the multiple sub-source sets;

[0118] Step 604: Perform set processing on multiple sub-source sets, and input the processed multiple sub-source sets into the array model;

[0119] Step 606: Compile multiple sub-source sets in parallel using an array model;

[0120] Step 608: Output the multiple sub-source sets after parallel compilation according to the output path.

[0121] In any of the above embodiments, the set processing in this application sets multiple sub-source sets that depend on the same main source set as a whole that is not dependent on the main source set. This allows multiple sub-source sets that are disconnected from each other to be input into the array model, so that the array model can compile multiple sub-source sets. This solves the problem that sub-source sets cannot be compiled individually in open source build tools.

[0122] like Figure 7 As shown, a second aspect embodiment of the present invention provides a data processing apparatus 700, which includes: a first processing module 702, configured to determine multiple sub-source sets in a main source set and determine the output path of each sub-source set in the multiple sub-source sets; a second processing module 704, configured to perform parallel compilation of the multiple sub-source sets through an array model; and an output module 706, configured to output the multiple sub-source sets after parallel compilation according to the output path.

[0123] In an embodiment of the present invention, Gradle (an open-source build tool) has multiple sub-source sets that depend on a main source set. Therefore, there is a circular dependency problem between the multiple sub-source sets, which makes it impossible for developers to compile the multiple sub-source sets individually. In this application, by setting the multiple sub-source sets that depend on the same main source set as a whole, the multiple sub-source sets can be compiled in parallel through an array model, thus solving the problem of not being able to compile multiple sub-source sets.

[0124] In the above embodiments, specifically, the main source set can be the source set generated by the developer when creating a new build type in Gradle (an open-source build tool), and the sub-source sets can be multiple properties set for the build type. The system first determines multiple sub-source sets that depend on the same main source set and needs to be compiled, and determines the output path of each sub-source set in the multiple sub-source sets that need to be compiled, so that after the system has compiled multiple sub-source sets, the multiple compiled sub-source sets can be output as fixed files according to the determined output paths.

[0125] In the above embodiments, outputting multiple compiled sub-source sets as fixed files according to a determined output path may include file formats such as jar (Java Archive) files and class (bytecode) files.

[0126] In any of the above embodiments, after determining the output path of each sub-source set, multiple sub-source sets, which are regarded as a whole, are input into the array model so that the array model can compile multiple sub-source sets in parallel. By compiling the sub-source sets in parallel through the array model, that is, compiling multiple sub-source sets in sequence, the problem that sub-source sets cannot be compiled individually in open source build tools is solved, and the scenario of compiling source sets in open source build tools is enhanced.

[0127] In the above embodiments, the array model can be the ECJ compiler (Eclipse Compile Java, Eclipse compiler).

[0128] like Figure 9 As shown, Figure 9 A schematic diagram of the data processing method in this application is shown. Figure 9 The diagram shows sub-source sets A, B, and C that depend on the main source set. Sub-source sets A, B, and C can be input into the array model through the source set adapter. The array model can compile sub-source sets A, B, and C, thereby enabling compilation of each sub-source set through the array model and avoiding the problem of not being able to compile multiple sub-source sets that depend on the main source set.

[0129] In the above embodiments, Figure 9The document also shows that after parallel compilation of multiple sub-source sets, outputs A, B, and C are output respectively. Outputs A, B, and C correspond one-to-one with sub-source sets A, B, and C mentioned above. Specifically, the system has determined the output paths of sub-source sets A, B, and C that need to be compiled. After the array model has compiled sub-source sets A, B, and C, it can directly obtain outputs A, B, and C according to the output paths, thereby realizing the output of multiple compiled sub-source sets into fixed files according to the determined output paths.

[0130] In any of the above embodiments, the second processing module is specifically used to: perform compilation scanning on multiple sub-source sets through an array model to obtain directory information of multiple sub-source sets; generate compilation information corresponding to the directory information based on one of the multiple directory information, and use the compilation information to compile the sub-source set to which the directory information corresponding to the compilation information belongs; after compiling one sub-source set in the multiple sub-source sets, compile the other sub-source sets to be compiled in sequence.

[0131] In the above embodiments, the directory information can be attribute information, construction information, etc., included in the sub-source sets. The array model performs a single compilation scan on multiple sub-source sets, and uses the scanned target information to generate compilation information. For example, if a developer needs to compile n sub-source sets that depend on the same main source set, after inputting the n sub-source sets into the array model, the array model performs a single scan on the n sub-source sets. This avoids the problem of needing to perform n scans on n sets during compilation, reducing the number of scans and simplifying the compilation process for multiple sub-source sets.

[0132] In any of the above embodiments, the compilation information can be information used for compilation work, such as functions and structures, when compiling the sub-source set. The array model obtains multiple directory information by performing compilation scans on multiple sub-source sets, which correspond one-to-one with the multiple sub-source sets. The system first generates compilation information corresponding to one of the directory information based on one of the directory information, and then the array model can use the compilation information to compile one of the multiple sub-source sets. The directory information corresponding to the sub-source set is the same as the directory information corresponding to the compilation information. After compiling one of the sub-source sets, the array model compiles the other multiple sub-source sets in sequence, thereby realizing the individual compilation of the sub-source sets.

[0133] In any of the above embodiments, the second processing module is further configured to: store the compilation information in memory; and determine that the compilation information in memory is shared information.

[0134] In the above embodiments, the system sets the generated compilation information as shared information and stores it in memory so that the compilation information generated by the system based on the directory information can be reused, thereby realizing the sharing of compilation information and improving the compilation speed.

[0135] In the above embodiments, for example, multiple sub-source sets are sub-source set A, sub-source set B and sub-source set C. The system generates compilation information corresponding to sub-source set A according to the directory information corresponding to sub-source set A. The system sets the compilation information as shared information. Then the array model can use the shared information to compile sub-source set B and sub-source set C, thereby realizing the sharing of compilation information.

[0136] In the above embodiments, the shared information can also be used by the array model during the next compilation of the sub-source set after the current compilation is completed.

[0137] In any of the above embodiments, the second processing module is further configured to: when the directory information of the sub-source set to be compiled is the same as the directory information corresponding to the shared information, call the shared information to perform parallel compilation of the sub-source set to be compiled.

[0138] In the above embodiments, after the array model finishes compiling one of the multiple sub-source sets, the system determines the compilation information of the compiled sub-source set as shared information and stores it in memory. At this time, the directory information corresponding to the next uncompiled sub-source set can be determined. If the directory information is the same as the directory information corresponding to the compiled sub-source set, then the shared information stored in memory can be used to compile the uncompiled sub-source set to improve the compilation speed of the sub-source set.

[0139] In the above embodiments, for example, the multiple sub-source sets are sub-source set A, sub-source set B, and sub-source set C. The system generates compilation information corresponding to sub-source set A based on the directory information corresponding to sub-source set A. The system sets this compilation information as shared information. Since the directory information corresponding to sub-source set B is the same as the directory information corresponding to sub-source set A, it is not necessary to generate compilation information based on the directory information corresponding to sub-source set B. The array model can directly call the shared information in memory to compile sub-source set B, thereby simplifying the steps of compiling multiple sub-source sets by the array model and improving the compilation speed.

[0140] In any of the above embodiments, the first processing module is specifically used to: receive an output directory, the output directory including correspondence information between multiple sub-source sets and output paths; and determine the output path of the sub-source set based on the correspondence information.

[0141] In the above embodiments, the output directory may include correspondence information between each sub-source set and its output path, enabling the system to directly determine the output path of each sub-source set based on this correspondence information, thereby achieving management of the output path of each sub-source set. The correspondence information between each sub-source set and its output path can be set by the developers according to actual needs.

[0142] In the above embodiments, for example, the output directory may also include the directory information and output path correspondence information corresponding to each sub-source set, so that the output path corresponding to each sub-source set can be determined after the array model performs compilation scanning on multiple sub-source sets.

[0143] In any of the above embodiments, the data processing device is further configured to: perform set processing on multiple sub-source sets, and input the set-processed multiple sub-source sets into an array model.

[0144] In any of the above embodiments, the set processing in this application sets multiple sub-source sets that depend on the same main source set as a whole that is not dependent on the main source set. This allows multiple sub-source sets that are disconnected from each other to be input into the array model, so that the array model can compile multiple sub-source sets. This solves the problem that sub-source sets cannot be compiled individually in open source build tools.

[0145] like Figure 8 As shown, a third aspect embodiment of the present invention provides a data processing apparatus 800, comprising: a memory 802 storing a program or instructions; and a processor 804 executing the program or instructions stored in the memory 802 to implement the steps of the data processing method proposed in the above embodiments of the present application, thus possessing all the beneficial technical effects of the data processing method proposed in the above embodiments of the present application, which will not be elaborated further here.

[0146] A fourth aspect of the present invention provides a readable storage medium storing a program or instructions that, when executed by a processor, implement the steps of the data processing method as described in any of the above embodiments.

[0147] The readable storage medium provided by this invention stores a program or instructions thereon, which, when executed by a processor, can implement the steps of the data processing method as described in any of the above embodiments. Therefore, the readable storage medium proposed by this invention possesses all the beneficial effects of data processing in any of the above embodiments, which will not be elaborated further here.

[0148] A fifth aspect of the present invention provides an electronic device, comprising: a data processing apparatus according to any of the above embodiments; and / or a readable storage medium according to the above embodiments.

[0149] The electronic device provided by the present invention includes the data processing device in any of the above embodiments. Therefore, it has all the beneficial effects of the target information query device in any of the above embodiments, which will not be repeated here.

[0150] In any of the above embodiments, the electronic device provided by the present invention may further include the readable storage medium defined in the above embodiments. Therefore, the electronic device proposed by the present invention possesses all the beneficial effects of the readable storage medium defined in the above embodiments, which will not be repeated here.

[0151] In the description of this specification, the terms "one embodiment," "some embodiments," "specific embodiment," etc., refer to a specific feature, structure, material, or characteristic described in connection with that embodiment or example, which is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0152] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method of processing data, characterized by, The processing method comprises: determining a plurality of sub-source sets in a main source set, and determining an output path of each of the plurality of sub-source sets; parallel compiling the plurality of sub-source sets through an array model, wherein the array model is an ECJ compiler; outputting the plurality of sub-source sets after parallel compiling according to the output path; the parallel compiling of the plurality of sub-source sets through the array model specifically comprises: compiling scanning of the plurality of sub-source sets through the array model to obtain directory information of the plurality of sub-source sets; generating compiling information corresponding to one of the directory information according to the one of the directory information, and compiling the sub-source set to which the directory information corresponding to the compiling information belongs using the compiling information; after compiling one of the plurality of sub-source sets, sequentially compiling other sub-source sets to be compiled.

2. The data processing method according to claim 1, characterized in that, after compiling one of the plurality of sub-source sets, the processing method further comprises: storing the compiling information to a memory; determining the compiling information in the memory as shared information.

3. The data processing method according to claim 2, characterized in that, the sequentially compiling of other sub-source sets to be compiled specifically comprises: in the case that the directory information of the sub-source set to be compiled is the same as the corresponding directory information of the shared information, calling the shared information to perform the parallel compiling on the sub-source set to be compiled.

4. The data processing method according to claim 1, characterized in that, the determining of the output path of each of the plurality of sub-source sets specifically comprises: receiving an output directory, wherein the output directory comprises corresponding information of the plurality of sub-source sets and the output path; determining the output path of the sub-source set according to the corresponding information.

5. The method of processing data according to any one of claims 1 to 3, wherein, before the parallel compiling of the plurality of sub-source sets through the array model, the processing method further comprises: performing set processing on the plurality of sub-source sets, and inputting the plurality of sub-source sets after the set processing to the array model.

6. A data processing device, characterized by comprising: the processing device comprises: a first processing module configured to determine a plurality of sub-source sets in a main source set, and determine an output path of each of the plurality of sub-source sets; a second processing module configured to perform parallel compiling on the plurality of sub-source sets through an array model, wherein the array model is an ECJ compiler; an output module configured to output the plurality of sub-source sets after parallel compiling according to the output path; the second processing module is specifically configured to: perform compiling scanning on the plurality of sub-source sets through the array model to obtain directory information of the plurality of sub-source sets; generate compiling information corresponding to one of the directory information according to the one of the directory information, and compile the sub-source set to which the directory information corresponding to the compiling information belongs using the compiling information; after compiling one of the plurality of sub-source sets, sequentially compile other sub-source sets to be compiled.

7. A data processing apparatus, characterized by comprising: comprise: a memory and a processor, the memory stores a program, and the processor implements the steps of the data processing method of any one of claims 1 to 5 when executing the program.

8. A readable storage medium, on which a program or instructions are stored, characterized in that, The program or the instructions, when executed by the processor, implement the steps of the data processing method of any one of claims 1 to 5.

9. An electronic device, comprising: comprising: The data processing apparatus of claim 6 or 7; and / or The readable storage medium of claim 8.

Citation Information

Patent Citations

  • Compiling method, compiling device, electronic equipment, storage medium and program product

    CN113031961A