Dependency Configuration Method and Apparatus, Electronic Device, and Storage Medium
By receiving task requests, determining the dependency type and version, loading the source code file to the classpath, it solves the problem that the dependency package version cannot be flexibly switched in the big data cluster, realizing storage space optimization and business scenario adaptability, and reducing user technical thresholds.
Patent Information
- Application Number
- CN202210197731.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-02
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2042-03-02
AI Technical Summary
In big data scenarios, the existing technology cannot flexibly switch the dependency package version in the big data cluster, resulting in excessive storage space and difficult to maintain, and cannot meet the dependency needs of different users.
It provides a dependency configuration method and device. By receiving task requests, it determines the type and version of the dependency, loads the corresponding source code file to the classpath, and supports standardized dependencies downloaded from the warehouse, custom dependencies obtained from the cloud or database, and uses the compiler to generate binary files to realize dependency configuration in different languages.
It realizes flexible switching and version management of dependency packages, reduces storage space usage, adapts to the needs of different business scenarios, reduces user technical thresholds, and improves task execution efficiency.
Smart Images

Figure CN114860300B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technologies, and in particular, to a dependency configuration method and apparatus, an electronic device, and a storage medium. Background Art
[0002] In some big data scenarios, the dependency packages on which big data tasks depend are all set in a big data cluster. When different users need to configure different dependency packages, they need to adapt to the single dependency package in the single big data cluster, and cannot flexibly switch versions. Moreover, if the method of compiling and packaging the business source code file package is adopted, frequent compilation and deployment are required, resulting in the source code file package occupying too much storage space and being difficult to maintain.
[0003] Therefore, a dependency configuration apparatus that can meet the dependency requirements of different scenarios and occupies a small space is needed. Summary of the Invention
[0004] Embodiments of the present disclosure disclose a dependency configuration method and apparatus, an electronic device, and a storage medium.
[0005] In a first aspect of the embodiments of the present disclosure, a dependency configuration method is provided, which is applied to a platform. The method includes: receiving a task request for a target dependency; where the task request at least includes: configuration parameters; determining the type and version of the target dependency according to the configuration parameters; obtaining a source code file corresponding to the type and version according to the type and version of the target dependency; where the type of the target dependency at least includes: standardized dependency and custom dependency; loading the source code file of the target dependency into the class path and executing the task request.
[0006] Optionally, the obtaining a source code file corresponding to the type and version according to the type and version of the target dependency includes: determining whether the dependency type of the target dependency belongs to a standardized dependency according to the type and version of the target dependency; when the target dependency belongs to a standardized dependency, downloading a source code file corresponding to the type and version from a first repository of the standardized dependency.
[0007] Optionally, the obtaining a source code file corresponding to the type and version according to the type and version of the target dependency package includes: determining whether the dependency type of the target dependency package belongs to a first type of custom dependency according to the type and version of the target dependency package; when the target dependency belongs to a first type of custom dependency, downloading a source code file corresponding to the type and version from the cloud.
[0008] Optionally, obtaining the source code file corresponding to the type and version according to the type and version of the target dependency includes: determining whether the dependency type of the target dependency belongs to the second type of custom dependency according to the type and version of the target dependency package; when the target dependency belongs to the second type of custom dependency, calling the source code corresponding to the type and version from the database; and obtaining the source code file corresponding to the type and version according to the source code.
[0009] Optionally, obtaining the source code file corresponding to the type and version according to the source code includes: calling a compiler corresponding to the language type according to the language type of the source code; compiling the source code by using the compiler to obtain a binary file; and packaging the binary file to obtain the source code file corresponding to the type and version.
[0010] A second aspect of the present disclosure provides a dependency configuration method, which is applied to a terminal. The method includes: sending a configuration task request for a target dependency to a platform; where the task request at least includes: configuration parameters, and the configuration parameters are used for the platform to determine the type and version of the target dependency according to the configuration parameters; obtaining the source code file corresponding to the type and version according to the type and version of the target dependency; where the type of the target dependency at least includes: standardized dependency and custom dependency; loading the source code file of the target dependency into the class path; and receiving a dependency configuration result.
[0011] Optionally, the method further includes: generating a source code file for the first type of custom dependency; and uploading the source code file to the platform; where the source code file is used for the platform to upload to the cloud.
[0012] Optionally, the method further includes: generating the source code for the second type of custom dependency; and uploading the source code to the platform; where the source code is used for the platform to store the source code in the database.
[0013] Optionally, if the dependency configuration result indicates an error in the source code file of the target dependency, uploading the source code file and / or the source code of the target dependency to the platform.
[0014] The third aspect of the present disclosure provides a dependency configuration device, the device comprising: a first receiving module, configured to receive a task request for a target dependency; wherein, the task request at least includes: configuration parameters; a first determination module, configured to determine the type and version of the target dependency according to the configuration parameters; a second determination module, configured to obtain a source code file corresponding to the type and version according to the type and version of the target dependency; wherein, the type of the target dependency at least includes: standardized dependency and custom dependency; a loading module, configured to load the source code file of the target dependency to the classpath and execute the task request.
[0015] Optionally, the second determination module is further configured to: determine whether the dependency type of the target dependency belongs to a standardized dependency according to the type and version of the target dependency; when the target dependency belongs to a standardized dependency, download a source code file corresponding to the type and version from a first repository of the standardized dependency.
[0016] Optionally, the second determination module is further configured to: determine whether the dependency type of the target dependency package belongs to a first type of custom dependency according to the type and version of the target dependency package; when the target dependency belongs to a first type of custom dependency, download a source code file corresponding to the type and version from the cloud.
[0017] Optionally, the second determination module is further configured to: determine whether the dependency type of the target dependency belongs to a second type of custom dependency according to the type and version of the target dependency package; when the target dependency belongs to a second type of custom dependency, call a source code corresponding to the type and version from a database; and obtain a source code file corresponding to the type and version according to the source code.
[0018] Optionally, the second determination module is further configured to: call a compiler corresponding to the language type of the source code according to the language type of the source code; compile the source code by using the compiler to obtain a binary file; and package the binary file to obtain a source code file corresponding to the type and version.
[0019] In a fourth aspect of the embodiments of the present disclosure, a dependency configuration device is provided. The device includes: a first sending module, configured to send a configuration task request for a target dependency to a platform; wherein, the task request at least includes: configuration parameters, and the configuration parameters are used for the platform to determine the type and version of the target dependency according to the configuration parameters; obtaining a source code file corresponding to the type and version according to the type and version of the target dependency; wherein, the type of the target dependency at least includes: standardized dependency and custom dependency; loading the source code file of the target dependency into the class path; a second receiving module, configured to receive a dependency configuration result.
[0020] Optionally, the device further includes: a first generating module, configured to generate a source code file of a first type of dependency of the custom dependency; a first uploading module, configured to upload the source code file to the platform; wherein, the source code file is used for the platform to upload to the cloud.
[0021] Optionally, the device further includes: a second generating module, configured to generate source code of a second type of dependency of the custom dependency; a second uploading module, configured to upload the source code to the platform; wherein, the source code is used for the platform to store the source code in a database.
[0022] Optionally, the device further includes: a third uploading module, configured to upload the source code file and / or the source code of the target dependency to the platform if the dependency configuration result indicates an error in the source code file of the target dependency.
[0023] In a fifth aspect of the embodiments of the present disclosure, an electronic device is provided, including: a memory for storing processor-executable instructions; a processor, connected to the memory; wherein, the processor is configured to execute the dependency configuration method provided in the first aspect or the second aspect as described above.
[0024] In a sixth aspect of the embodiments of the present disclosure, a non-transitory computer-readable storage medium is provided, characterized in that computer-executable instructions are stored in the computer-readable storage medium, and when the computer-executable instructions are executed by a processor, the dependency configuration method provided in the first aspect or the second aspect as described above is implemented.
[0025] The dependency configuration method provided by the embodiments of the present disclosure is applied to a platform and includes: receiving a task request for a target dependency; wherein, the task request at least includes: configuration parameters; determining the type and version of the target dependency according to the configuration parameters; obtaining a source code file corresponding to the type and version according to the type and version of the target dependency; wherein, the type of the target dependency at least includes: standardized dependency and custom dependency; loading the source code file of the target dependency into the class path and executing the task request; thus, compared with the existing method that requires different users to use a single dependency in a single big data cluster and cannot flexibly switch versions, it can realize the switching of the type and version of the dependency package according to the change of the configuration parameters and can meet the requirements of different business scenarios.
[0026] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The accompanying drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present invention and used together with the specification to explain the principles of the present invention.
[0028] Figure 1 is a flowchart of a dependency configuration method shown in an exemplary embodiment of the present disclosure;
[0029] Figure 2 is a flowchart of a dependency configuration method shown in an exemplary embodiment of the present disclosure;
[0030] Figure 3 is a flowchart of a dependency configuration method shown in an exemplary embodiment of the present disclosure;
[0031] Figure 4 is a flowchart of a dependency configuration method shown in an exemplary embodiment of the present disclosure;
[0032] Figure 5 is a flowchart of a dependency configuration method shown in an exemplary embodiment of the present disclosure;
[0033] Figure 6 is a flowchart of a dependency configuration method shown in an exemplary embodiment of the present disclosure;
[0034] Figure 7 is a flowchart of a dependency configuration method shown in an exemplary embodiment of the present disclosure;
[0035] Figure 8 is a flowchart of a dependency configuration method shown in an exemplary embodiment of the present disclosure;
[0036] Figure 9It is a schematic flowchart of a dependency configuration method shown in an exemplary embodiment of the present disclosure;
[0037] Figure 10 It is a schematic flowchart of a dependency configuration method shown in an exemplary embodiment of the present disclosure;
[0038] Figure 11 It is a schematic flowchart of a dependency configuration method shown in an exemplary embodiment of the present disclosure;
[0039] Figure 12 It is a schematic flowchart of a dependency configuration method shown in an exemplary embodiment of the present disclosure;
[0040] Figure 13 It is a schematic operation diagram of a dependency configuration method shown in an exemplary embodiment of the present disclosure;
[0041] Figure 14 It is a schematic operation diagram of a dependency configuration method shown in an exemplary embodiment of the present disclosure;
[0042] Figure 15 It is a schematic operation diagram of a dependency configuration method shown in an exemplary embodiment of the present disclosure;
[0043] Figure 16 It is a schematic structural diagram of a dependency configuration device shown in an exemplary embodiment of the present disclosure;
[0044] Figure 17 It is a schematic structural diagram of a dependency configuration device shown in an exemplary embodiment of the present disclosure;
[0045] Figure 18 It is a schematic structural diagram of a dependency configuration device shown in an exemplary embodiment of the present disclosure. Detailed Description of the Invention
[0046] Here, the exemplary embodiments will be described in detail, and the examples are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended application documents.
[0047] In the embodiments of the present disclosure, in combination with Figure 1 as shown, applied to a platform, the method includes:
[0048] Step S101, receiving a task request for a target dependency; wherein, the task request at least includes: configuration parameters;
[0049] Step S102, determining the type and version of the target dependency according to the configuration parameters;
[0050] Step S103: Obtain the source code file corresponding to the type and version of the target dependency; wherein, the type of the target dependency includes at least: standardized dependency and custom dependency.
[0051] Step S104: Load the source code file of the target dependency into the class path and execute the task request.
[0052] In the embodiments of the present disclosure, in combination with Figure 10 As shown, the custom dependency includes at least: the first type of dependency and the second type of dependency; wherein, the first type of dependency relies on the user to write source code at the terminal to obtain a source code file, and upload the source code file to the platform, and then the platform uploads it to the cloud storage; the second type of dependency relies on the user to write source code at the terminal to obtain the source code in text form, and upload the source code to the platform, and then the platform stores it in the database for storage.
[0053] In the embodiments of the present disclosure, since the source code file occupies more space than the source code in text form, the platform uploads the source code file to the cloud, and the platform stores the source code in text form in the database.
[0054] In the embodiments of the present disclosure, regarding steps S101 and S102, regarding the configuration parameters, it includes the parameter combination of the type and version of the target dependency set by the terminal.
[0055] In the embodiments of the present disclosure, the user can select the type and version of the target dependency required on the page displayed by the terminal, including but not limited to any one of the following:
[0056] Any version among versions V1, V2, V3, ···, Vn of the standardized dependency;
[0057] Any version among versions V1, V2, V3, ···, Vn of the first type of dependency of the custom dependency;
[0058] Any version among versions V1, V2, V3, ···, Vn of the second type of dependency of the custom dependency.
[0059] In the embodiments of the present disclosure, n is a natural number or a decimal, such as 3 or 3.1, which is determined according to the version marking method, including but not limited to:
[0060] Natural number marking version, such as V1, ···, Vn, where n is a natural number;
[0061] Combined marking of natural numbers and decimals, such as Vn, Vn.1, ··· Vn.m; where n and m are natural numbers;
[0062] Decimal notations, such as Vn.1, ··· Vn.m; where n and m are natural numbers.
[0063] In the embodiments of the present disclosure, only by setting configuration parameters on the terminal, it is possible to switch and select any desired type and version of the target dependency.
[0064] In the embodiments of the present disclosure, the standardized dependencies at least include one of the following:
[0065] Maven dependencies;
[0066] Gradle dependencies.
[0067] In the embodiments of the present disclosure, regarding step S103, after the platform receives a task request for a target dependency and determines the type and version of the target dependency, the platform will select a method for obtaining the source code file of the target dependency according to the type of the target dependency, and obtain the source code file corresponding to the type and version of the target dependency, including but not limited to:
[0068] For standardized dependencies, the platform will obtain the source code file from a first repository that can obtain the source code file of the standardized dependency; here, the first repository refers to the Maven or Gradle central repository;
[0069] For custom dependencies, the platform can obtain the source code file from the cloud;
[0070] For custom dependencies, the platform can obtain the source code in text form from a database and generate a source code file.
[0071] In the embodiments of the present disclosure, regarding step S104, after the platform obtains the source code file, it will load the source code file of the target dependency into the class path and execute the task request.
[0072] In the embodiments of the present disclosure, the class path means that for a task thread set within the platform, when executing a task request, the task request is executed according to the class path.
[0073] In the embodiments of the present disclosure, the tasks include but are not limited to: application installation tasks; audio playback tasks; computing tasks; timing tasks and other tasks that can be set by a computer.
[0074] In the embodiments of the present disclosure, for tasks of standardized dependencies, by adding a plugin setexecution.packages attribute configuration, it is possible to support the execution of Sql / Jar mode tasks.
[0075] In the embodiments of the present disclosure, regarding the source code of custom dependencies, the languages used include but are not limited to one of the following:
[0076] Java language;
[0077] Scala language;
[0078] Python language;
[0079] C or C++ language.
[0080] In the embodiments of the present disclosure, for the second type of dependencies regarding custom dependencies, different languages can be compiled into binary files by a compiler and assembled into a common source code file, which is convenient to be loaded into the class path to execute tasks.
[0081] In the embodiments of the present disclosure, since the type and version of the target dependency can be switched by adjusting configuration parameters, in the big data scenario, different types of dependencies can be provided and tasks can be executed, and thus the requirements of different business scenarios can be adapted.
[0082] In the embodiments of the present disclosure, as shown in Figure 2 Step S103, obtaining the source code file corresponding to the type and version according to the type and version of the target dependency includes:
[0083] Step S1031, determining whether the dependency type of the target dependency belongs to a standardized dependency according to the type and version of the target dependency;
[0084] Step S1032, when the target dependency belongs to a standardized dependency, downloading the source code file corresponding to the type and version from the first repository of the standardized dependency.
[0085] In the embodiments of the present disclosure, the standardized dependencies at least include Maven dependencies and Gradle dependencies.
[0086] In the embodiments of the present disclosure, the first repository includes but is not limited to: Maven Central Repository and Gradle Central Repository. The first repository stores multiple versions of standardized dependencies.
[0087] In the embodiments of the present disclosure, for standardized dependencies, when it is determined that the dependency type of the target dependency belongs to a standardized dependency, since the first repository stores multiple versions of standardized dependencies, the source code file corresponding to the type and version can be downloaded from the first repository.
[0088] In the embodiments of the present disclosure, for the Maven dependencies of standardized dependencies, the execution of standardized dependency tasks can be supported by adding a new maven dependency item, that is, setting the execution.packages attribute.
[0089] In the embodiments of the present disclosure, a new maven dependency item is dynamically downloaded through the Util component.
[0090] In the embodiments of the present disclosure, a task of adding a Maven dependency item to support the mode of SQL query statements and / or the Jar code mode is added. Here, regarding the mode of SQL query statements, the code of the added Maven dependency item is queried through SQL statements; regarding the Jar code mode, the code of the added Maven dependency item is queried through the code.
[0091] In the embodiments of the present disclosure, for standardized dependencies, the platform can download the source code files of the standardized dependencies from the first repository, load them into the classpath, and execute the task request. In this way, it is possible to download the corresponding source code files according to the dependency type in the configuration parameters being a standardized dependency, which can meet the scenario requirements of needing to configure multiple versions of standardized dependencies.
[0092] In the embodiments of the present disclosure, in combination with Figure 3 as shown, step S103, obtaining the source code file corresponding to the type and version according to the type and version of the target dependency includes:
[0093] Step S1033, determining whether the dependency type of the target dependency package belongs to the first type of dependency of custom dependencies according to the type and version of the target dependency package;
[0094] Step S1034, when the target dependency belongs to the first type of dependency of custom dependencies, downloading the source code file corresponding to the type and version from the cloud.
[0095] In the embodiments of the present disclosure, the first type of dependency includes, but is not limited to: Jar dependency, which means that the user edits the source code on the terminal, generates the source code file, and stores it on the terminal.
[0096] In the embodiments of the present disclosure, after generating the source code file on the terminal, the source code file is uploaded to the platform, and the platform then uploads the source code file to the cloud for storage, and stores the mapping relationship corresponding to the source code file in the database.
[0097] In the embodiments of the present disclosure, the mapping relationship indicates the storage addresses of different versions of the source code file in the cloud. When the platform needs to download the source code file from the cloud, the platform sends the storage address of the source code file in the cloud to the cloud client of the platform, and the cloud client downloads the source code file from the cloud.
[0098] In the embodiments of the present disclosure, when it is determined that the target dependency belongs to the first type of dependency of custom dependencies, it can be directly downloaded from the cloud.
[0099] In the embodiments of the present disclosure, for the source code files of the first type of dependencies, the terminal used by the user is configured with a corresponding language editing environment, and the user edits the source code in the language editing environment, including but not limited to:
[0100] Editing Python source code in a Python language environment application;
[0101] Editing Java source code in a Java language environment application;
[0102] Editing Scala source code in a Scala language environment application;
[0103] Editing C source code in a C language environment application;
[0104] Editing C++ source code in a C++ language environment application.
[0105] In the embodiments of the present disclosure, the ways of opening the source code files stored in the cloud to multiple users include but are not limited to one of the following:
[0106] Open to all users for free;
[0107] Open to paid users;
[0108] Open to specified users for free.
[0109] In the embodiments of the present disclosure, the users to whom the first type of source code files are open have the download permission, and can download the source code files of the first type of dependencies from the cloud through the platform.
[0110] In the embodiments of the present disclosure, since the storage space required for the source code files is larger than that of the source code text, when uploading to the cloud, only the mapping relationship is stored in the database, which can reduce the space occupation of the database and facilitate the platform to download the source code files of the first type of dependencies from the cloud. In this way, it is possible to download the corresponding source code files according to the dependency type in the configuration parameters for the first type of dependencies that are custom dependencies, and it can meet the scenario requirements for the first type of dependencies that need to configure multiple versions of custom dependencies.
[0111] In the embodiments of the present disclosure, as shown in Figure 4 Step S103, obtaining the source code file corresponding to the type and version according to the type and version of the target dependency includes:
[0112] Step S1035, determining whether the dependency type of the target dependency belongs to the second type of dependencies that are custom dependencies according to the type and version of the target dependency package;
[0113] Step S1036, when the target dependency is a second - type dependency belonging to a custom dependency, call the source code corresponding to the type and version from the database;
[0114] Step S1037, obtain the source - code file corresponding to the type and version according to the source code.
[0115] In the embodiments of the present disclosure, the source - code editing of the second - type dependency is in the Web IDE coding mode. Specifically, the terminal does not need to configure the language environment, and the source code can be edited on the web page to obtain the source code in text form, and the source code is uploaded to the platform, and then the platform stores the source code in the database.
[0116] In the embodiments of the present disclosure, the platform stores the source code in the database in text form.
[0117] In one embodiment, the source code stored in the database can be a text with the suffix of txt.
[0118] In the embodiments of the present disclosure, regarding step S1036, when the target dependency is a second - type dependency belonging to a custom dependency, the platform calls the source code corresponding to the type and version from the database.
[0119] In the embodiments of the present disclosure, regarding step S1037, the platform compiles the source code of different languages such as Java, Scala, Python, C, or C++ into class binary files through an Adapter compiler.
[0120] In the embodiments of the present disclosure, the platform generates a source - code file according to the class binary file and loads the source - code file into the class path for task request execution.
[0121] In the embodiments of the present disclosure, when the user needs the source - code file of the second - type dependency of the custom dependency, only need to modify the configuration parameters at the terminal, and then the platform can call the source code of the corresponding type and version from the database, compile and generate the source - code file, and load the source - code file into the class path.
[0122] In the embodiments of the present disclosure, after the platform loads the source - code file into the class path, it executes the task request.
[0123] In the embodiments of the present disclosure, since the source code in text form occupies less storage space, the platform stores it in the database for easy retrieval. And in the face of the second - type dependency and the requirements for source - code files of different languages and different versions, the platform can retrieve the text - form source code of the second - type dependency in the database and use the compiler to generate the source - code file. In this way, the dependency requirements of users for different languages and different versions can be met.
[0124] In the embodiments of the present disclosure, in combination with Figure 5 As shown, step S1037, obtaining the source code file corresponding to the type and version according to the source code includes:
[0125] Step S10371, according to the language type of the source code, call the compiler corresponding to the language type;
[0126] Step S10372, use the compiler to compile the source code to obtain a binary file;
[0127] Step S10373, package the binary file to obtain the source code file corresponding to the type and version.
[0128] In the embodiments of the present disclosure, regarding step S10371, if the language type of the source code is Java language, then call the compiler corresponding to the Java language: Java Adopter, which can also be called Java adapter.
[0129] In the embodiments of the present disclosure, if the language type of the source code is Scala language, then call the compiler corresponding to the Scala language: Scala Adopter, which can also be called Scala adapter.
[0130] In the embodiments of the present disclosure, if the language type of the source code is Python language, then call the compiler corresponding to the Python language: Python Adopter, which can also be called Python adapter.
[0131] In the embodiments of the present disclosure, if the language type of the source code is C language, then call the compiler corresponding to the C language: C Adopter, which can also be called C adapter.
[0132] In the embodiments of the present disclosure, if the language type of the source code is C++ language, then call the compiler corresponding to the C++ language: C++ Adopter, which can also be called C++ adapter.
[0133] In the embodiments of the present disclosure, regarding step S10372, use the compiler to compile the source code, and convert the source code into a Class binary file, so that the source codes of different languages can all be applicable to the same platform.
[0134] In the embodiments of the present disclosure, the platform can read the Class binary file and package it to obtain the source code file, that is, the Jar package.
[0135] In the embodiments of the present disclosure, since the compiler of the platform can compile the source code of different languages into readable Class binary files, and then generate source code files, thus, custom dependencies of different languages can be realized, and they can also be loaded into the class path of the platform, and then task requests can be executed.
[0136] In the embodiments of the present disclosure, the platform can implement the dependency configuration of the source code of different languages to meet the needs of users using different languages.
[0137] In the embodiments of the present disclosure, as shown in Figure 6 A dependency configuration method is applied to a terminal. The method includes:
[0138] Step S201, sending a configuration task request for a target dependency to the platform; wherein, the task request at least includes: configuration parameters, and the configuration parameters are used for the platform to determine the type and version of the target dependency according to the configuration parameters; according to the type and version of the target dependency, obtaining a source code file corresponding to the type and version; wherein, the type of the target dependency at least includes: standardized dependency and custom dependency; loading the source code file of the target dependency into the class path;
[0139] Step S202, receiving a dependency configuration result.
[0140] In the embodiments of the present disclosure, for standardized dependencies, the user uploads a task execution request through the terminal, and after receiving the task execution request, the platform downloads the source code file from the first repository.
[0141] In the embodiments of the present disclosure, for custom dependencies, the user uploads a task execution request through the terminal, and after receiving the task request, the platform will download the source code file in the cloud or call the source code in text form from the database to obtain the source code file.
[0142] In the embodiments of the present disclosure, only by modifying the configuration parameters at the terminal to determine the required type and version of the target dependency, the platform can download the corresponding source code file and load the corresponding source code file into the class path.
[0143] In the embodiments of the present disclosure, after the platform loads the corresponding source code file into the class path, it executes the task request.
[0144] In the embodiments of the present disclosure, the terminal receives the dependency configuration result sent by the platform. Here, the dependency configuration result regarding step S202 indicates whether there is an error in the source code file, including but not limited to: the content of the source code file is empty; the source code content in the source code file is incorrect.
[0145] In the embodiments of the present disclosure, since the type and version of the target dependency can be switched by adjusting the configuration parameters, in the big data scenario, the provision of different types of dependencies and the execution of tasks can be achieved, and thus the requirements of different business scenarios can be met.
[0146] In the embodiments of the present disclosure, in combination with Figure 7 as shown, the method further includes:
[0147] Step S203, generating a source code file for the first type of dependency of the custom dependency;
[0148] Step S204, uploading the source code file to the platform; wherein, the source code file is used for the platform to upload to the cloud.
[0149] In the embodiments of the present disclosure, regarding step S203, the first type of dependency includes but is not limited to: Jar dependency. The user edits the source code on the terminal, generates the source code file and stores it on the terminal.
[0150] In the embodiments of the present disclosure, after the source code file is generated on the terminal, the source code file is uploaded to the platform, and the platform then uploads the source code file to the cloud for storage, and stores the mapping relationship corresponding to the source code file in the database.
[0151] In the embodiments of the present disclosure, when it is determined that the target dependency belongs to the first type of dependency of the custom dependency, it can be directly downloaded from the cloud.
[0152] In the embodiments of the present disclosure, regarding the source code file of the first type of dependency, the terminal used by the user is configured with a corresponding language editing environment, and the user edits the source code in the language editing environment, including but not limited to:
[0153] Editing Python language source code in the Python language environment application;
[0154] Editing Java language source code in the Java language environment application;
[0155] Editing Scala language source code in the Scala language environment application;
[0156] Editing C language source code in the C language environment application;
[0157] Editing C++ language source code in the C++ language environment application.
[0158] In the embodiments of the present disclosure, the ways of opening the source code file stored in the cloud to multiple users include but are not limited to one of the following:
[0159] Open to all users for free;
[0160] Open to paid users;
[0161] Open to specified users for free.
[0162] In the embodiments of the present disclosure, the users to whom the first type of source code files are open have download permissions, and can download the source code files on which the first type depends from the cloud through the platform.
[0163] In the embodiments of the present disclosure, since the storage space required for the source code files is larger than that of the source code text, when uploading to the cloud, only the mapping relationship is stored in the database, which can reduce the space occupied by the database and facilitate the platform to download the source code files on which the first type depends from the cloud. In this way, it is possible to download the corresponding source code files according to the dependency type in the configuration parameters for the first type of custom dependencies, which can meet the scenario requirements for the first type of custom dependencies that need to configure multiple versions.
[0164] In the embodiments of the present disclosure, as shown in combination with Figure 8 the method further includes:
[0165] Step S205, generating the source code of the second type of dependencies for the custom dependencies;
[0166] Step S206, uploading the source code to the platform; wherein, the source code is used for the platform to store the source code in the database.
[0167] In the embodiments of the present disclosure, regarding step S205, the source code editing of the second type of dependencies is in the Web IDE coding mode. Specifically, the terminal does not need to configure the language environment, and the source code can be edited on the web page to obtain the source code in text form, and then the source code is uploaded to the platform, and the platform stores the source code in the database.
[0168] In the embodiments of the present disclosure, the platform stores the source code in the database in text form.
[0169] In one embodiment, the source code stored in the database can be a text with the suffix.txt.
[0170] In the embodiments of the present disclosure, when the user needs the source code file of the second type of dependencies for the custom dependencies, only need to modify the configuration parameters on the terminal, and then can call the source code of the corresponding type and version from the database through the platform, and compile and generate the source code file, and load the source code file into the class path.
[0171] In the embodiments of the present disclosure, since the source code in text form occupies a small storage space, the platform stores it in the database for easy retrieval. And in the face of the second type of dependency and the requirements for source code files in different languages and different versions, the platform can retrieve the source code in text form of the second type of dependency in the database and use the compiler to generate the source code file. In this way, the dependency requirements of users for different languages and different versions can be met.
[0172] In the embodiments of the present disclosure, in combination with Figure 9 as shown, the method further includes:
[0173] Step S207, if the dependency configuration result indicates that the source code file of the target dependency is incorrect, upload the source code file and / or the source code of the target dependency to the platform.
[0174] In the embodiments of the present disclosure, regarding step S207, if the source code file is incorrect, a dependency configuration result will be received, indicating that the source code file is empty or the file content is incorrect. For the first type of dependency, the terminal will upload the source code file to the platform. For the second type of dependency, the terminal will upload the source code to the platform.
[0175] In the embodiments of the present disclosure, since the terminal can receive the dependency configuration result returned by the platform and upload the source code and / or the source code file according to the dependency configuration result, in this way, the monitoring and improvement of the source code file error problem can be improved, and the success rate of executing the task request can be increased.
[0176] Now, in combination with the above embodiments, the following examples are provided:
[0177] Example 1: A dependency configuration method.
[0178] With the development of business, the requirements are becoming more and more complex. Especially in the big data scenario, a large number of third-party dependency packages are required, which are difficult for users to maintain.
[0179] In production, it is usually necessary to pre-set the dependency package to the submission machine and load the dependency package into the class path classpath; or compile and package the dependency into the business Jar package, that is, the source code file package during development.
[0180] There are several disadvantages:
[0181] 1. For different third-party library dependency packages, there are dependency conflict problems, which are difficult to solve. But usually only a few conflict-free parts need to be used.
[0182] 2. In traditional big data scenarios, the dependency packages that big data tasks rely on are all set in the big data cluster. Different users have to adapt to a single big data cluster, and it is impossible to flexibly switch versions. At the same time, the way of compiling and packaging into business Jar packages requires frequent compilation and deployment, and the Jar will be very large and difficult to maintain. In the big data scenarios in the data platform, it is necessary to deal with different business scenarios, and different user needs must use different versions of dependencies. The big data cluster adapts to different users, and users do not need to compile, package, and deploy. The flexibility is significantly enhanced and the configuration is significantly simplified.
[0183] 3. Users need to configure the development environment and be familiar with at least one development language, which requires a certain technical threshold.
[0184] 4. User business logic is difficult to reuse and can only be communicated offline, which often leads to reinventing the wheel.
[0185] Existing solutions: In production, it is usually necessary to save the dependency packages in advance to the submission machine and load the dependency packages into the classpath; or compile and package the dependencies into the business Jar package during development.
[0186] In the disclosed embodiment, the innovation is:
[0187] 1. For official Maven dependencies, set execution.packages property configuration is added, and Sql / Jar mode tasks are supported.
[0188] 2. For custom dependencies, it provides both Jar mode and Web IDE coding mode, and supports multiple syntaxes such as Java, Scala, and Python. When configuring tasks, they can be mixed and used; users can enable business lines and flexibly reuse through simple permission configuration.
[0189] 3. During the scheduling runtime, the Adapter adapter is used to compile dependencies with different syntaxes into class binary files and assemble them into a common Jar package for use, without adjusting the standard submission process.
[0190] The advantages are:
[0191] 1. Effectively solve dependency package conflicts and plug-in configuration.
[0192] 2. Provide a variety of dependency configuration methods and freely set dependency versions to meet the needs of different scenarios.
[0193] 3. Provide three modes: Maven dependency configuration, Jar dependency, and online coding. Full links are connected for easy reuse.
[0194] 4. There is no need to configure the development environment, support online IDE programming, and mixed development in multiple modes, which reduces the user's usage threshold.
[0195] Regarding the implementation of multiple dependency configuration methods, combined with Figure 10 As shown, there are the following methods:
[0196] 1. Task dependencies are divided into two types: standardized dependencies and custom dependencies. Among them, standardized dependencies refer to dependencies that can be directly downloaded from the Maven and Gradle central repositories; custom dependencies specifically refer to non-standardized dependencies required for user business development, usually divided into two methods: custom Jar and Web IDE online programming.
[0197] 2. Standardized dependencies are supported by adding the set execution.packages attribute, and at the same time, the Sql / Jar mode tasks are supported. During the task execution, they are dynamically downloaded through the Util component.
[0198] 3. In custom dependencies, Jar dependencies are uploaded through the page, the files are saved to the OBS cloud object storage, and the mapping relationship is saved in the database; for Web IDE dependencies, users are allowed to write code logic online without configuring the offline development environment. At the same time, the code is readable, editable, and has good reusability.
[0199] 4. For dependencies in the Web IDE format, during the process of task submission and execution, different Adapter adapters will be called according to the language type to compile the code into class binary files, and finally packaged into Jar files. They are processed in the same way as Jar dependencies.
[0200] 5. Several dependency methods support multiple versions and can be dynamically switched according to needs.
[0201] Combined with Figure 11 、 Figure 12 The architecture diagram shown, and Figure 13 、 Figure 14 And Figure 15 The dependency configuration diagram, the execution process is as follows:
[0202] Applied to the terminal, in step S301, the user selects to create or modify online code on the page and saves it;
[0203] Step S302, the user requests to upload the code;
[0204] Step S303, after the platform receives the user's request, it stores the code in the database. Both creation and modification will automatically create a tag once, and at the same time, the code will be written to the cloud disk, and the cloud merchant address will be updated to the corresponding version.
[0205] Step S304, the code in the above steps is used in the user task;
[0206] Step S305, the user submits a task request.
[0207] Applied to the platform:
[0208] Step S401, the platform receives the task request submitted by the user and downloads the code to the platform;
[0209] Step S402, the code is compiled and packaged into a Jar, i.e., the source code file, using a compiler and loaded into the classpath for use by the task;
[0210] Step S403, after the task is submitted, the platform will automatically delete the code and the corresponding Jar.
[0211] In the embodiments of the present disclosure, specifically in combination with Figure 11 the architecture diagram shown, the following steps are included:
[0212] Step 1, the user edits the code online and / or uploads a Jar package to the terminal;
[0213] Step 2, the terminal requests to upload the code or Jar package to the platform;
[0214] Step 3.1, store different versions in the database;
[0215] In the embodiments of the present disclosure, regarding Figure 11 Step 3.1 of, storing different versions in the database indicates at least one of the following:
[0216] Store the source code of different versions in the database;
[0217] Store the mapping relationship of the source code files of different versions in the database.
[0218] Step 3.2, the platform cloud client stores the source code file, i.e., the Jar package, in the cloud;
[0219] Step 3.3, the cloud returns the storage address of the source code file of the Jar package to the platform;
[0220] Step 3.4, the platform stores the storage address in the database;
[0221] Step 4, the user uses the code or Jar package in the task;
[0222] Step 5, submit a task request to the platform;
[0223] Step 6.1, for Jar dependencies, i.e., the first type of dependencies, obtain the address stored in the cloud according to the dependency type and version;
[0224] Step 6.2, the cloud client of the platform requests to download the Jar package from the cloud according to the storage address;
[0225] Step 6.3, download the Jar package to the platform;
[0226] Or in Step 6.4, for Web IDE dependencies, i.e., the second type of dependencies, obtain the online code, i.e., the source code in text form, from the database;
[0227] Step 6.5, pass the code to the compiler;
[0228] Step 6.6, the compiler compiles and packages;
[0229] Or in Step 6.7, for standardized dependencies, parse the configuration statements of the dependency configuration, i.e., parse the SET statements;
[0230] Step 6.8, request to download the Jar package from the first repository;
[0231] Step 6.9, download the Jar to the platform;
[0232] Step 7, load the Jar package to the classpath;
[0233] Step 8, delete after use.
[0234] In the embodiments of the present disclosure, regarding Figure 12 the architecture diagram, which is another schematic diagram of the above steps, the workpiece, representing the source code and / or source code files, is divided into the steps of creating the workpiece and using the workpiece.
[0235] In the embodiments of the present disclosure, when creating the workpiece, for the second type of dependencies, upload the workpiece, i.e., the source code, to the database; for the first type of dependencies, the cloud stores the storage address of the workpiece, i.e., the source code file in the cloud, in the database.
[0236] In the embodiments of the present disclosure, when using the workpiece, for the first type of dependencies, i.e., Jar dependencies, the steps include:
[0237] The submission task module of the platform according to the dependency type and version;
[0238] Obtain the cloud storage address from the database;
[0239] The database returns the cloud storage address to the server of the platform;
[0240] The server requests to download the Jar package from the cloud according to the storage address;
[0241] Download the Jar package from the cloud;
[0242] Load the Jar package to the classpath;
[0243] After the task is submitted, delete all Jar packages.
[0244] In an embodiment of the present disclosure, when using a workpiece, for the second type of dependency, i.e., Web IDE dependency, the steps include:
[0245] The task submission module of the platform obtains the online code content, i.e., the source code, from the database;
[0246] The database returns the online code content to the server;
[0247] Compile and package the source code to obtain a Jar package;
[0248] Load the Jar package into the classpath;
[0249] After the task is submitted, delete all Jar packages.
[0250] In an embodiment of the present disclosure, when using a workpiece, for the standardized dependency, the steps include: submitting a task;
[0251] Parse the dependency configuration statement, i.e., the Set statement;
[0252] The Maven utility class requests to download the Jar package from the first repository;
[0253] Download the Jar package to the server;
[0254] Load the Jar package into the classpath;
[0255] After the task is submitted, delete all Jar packages.
[0256] In an embodiment of the present disclosure, as shown in Figure 16 a dependency configuration device 500 is provided, and the device 500 includes:
[0257] A first receiving module 501, configured to receive a task request for a target dependency; wherein, the task request at least includes: configuration parameters;
[0258] A first determining module 502, configured to determine the type and version of the target dependency according to the configuration parameters;
[0259] A second determining module 503, configured to obtain a source code file corresponding to the type and version according to the type and version of the target dependency; wherein, the type of the target dependency at least includes: standardized dependency and custom dependency;
[0260] A loading module 504, configured to load the source code file of the target dependency into the classpath and execute the task request.
[0261] In an embodiment of the present disclosure, the second determining module 503 is further configured to:
[0262] To determine whether the dependency type of the target dependency belongs to a standardized dependency according to the type and version of the target dependency;
[0263] When the target dependency belongs to a standardized dependency, download the source code file corresponding to the type and version from the first repository of the standardized dependency.
[0264] In the embodiment of the present disclosure, the second determination module 503 is further configured to:
[0265] To determine whether the dependency type of the target dependency package belongs to the first type of custom dependency according to the type and version of the target dependency package;
[0266] When the target dependency belongs to the first type of custom dependency, download the source code file corresponding to the type and version from the cloud.
[0267] In the embodiment of the present disclosure, the second determination module 503 is further configured to:
[0268] To determine whether the dependency type of the target dependency belongs to the second type of custom dependency according to the type and version of the target dependency package;
[0269] When the target dependency belongs to the second type of custom dependency, call the source code corresponding to the type and version from the database;
[0270] Obtain the source code file corresponding to the type and version according to the source code.
[0271] In the embodiment of the present disclosure, the second determination module 503 is further configured to:
[0272] To call a compiler corresponding to the language type according to the language type of the source code;
[0273] Use the compiler to compile the source code to obtain a binary file;
[0274] Package the binary file to obtain the source code file corresponding to the type and version.
[0275] In the embodiment of the present disclosure, in combination with Figure 17 as shown, a dependency configuration device 600 is provided, and the device includes:
[0276] The first sending module 601 is configured to send a configuration task request for a target dependency to the platform; wherein, the task request at least includes: configuration parameters, and the configuration parameters are used for the platform to determine the type and version of the target dependency according to the configuration parameters; according to the type and version of the target dependency, obtaining a source code file corresponding to the type and version; wherein, the type of the target dependency at least includes: standardized dependency and custom dependency; loading the source code file of the target dependency into the class path;
[0277] The second receiving module 602 is configured to receive a dependency configuration result.
[0278] In the embodiments of the present disclosure, in combination with Figure 18 as shown, the device 600 further includes:
[0279] The first generating module 603 is configured to generate a source code file of a first type of dependency of the custom dependency;
[0280] The first uploading module 604 is configured to upload the source code file to the platform; wherein, the source code file is used for the platform to upload to the cloud.
[0281] In the embodiments of the present disclosure, in combination with Figure 18 as shown, the device 600 further includes:
[0282] The second generating module 605 is configured to generate the source code of a second type of dependency of the custom dependency;
[0283] The second uploading module 606 is configured to upload the source code to the platform; wherein, the source code is used for the platform to store the source code in a database.
[0284] In the embodiments of the present disclosure, in combination with Figure 18 as shown, the device 600 further includes:
[0285] The third uploading module 607 is configured to, if the dependency configuration result indicates that the source code file of the target dependency is incorrect, upload the source code file and / or the source code of the target dependency to the platform.
[0286] The embodiments of the present disclosure provide an electronic device, including:
[0287] A memory for storing processor-executable instructions;
[0288] A processor, connected to the memory;
[0289] Wherein, the processor is configured to execute the dependency configuration method provided by any of the foregoing technical solutions.
[0290] The processor may include various types of storage media, which are non-transitory computer storage media and can continue to store the information thereon after the electronic device loses power.
[0291] The processor can be connected to the memory through a bus or the like, and is used to read the executable program stored on the memory. For example, it can execute the method described in the foregoing one or more technical solutions.
[0292] An embodiment of the present disclosure provides a structure of an electronic device. The electronic device includes a processing component, which further includes one or more processors, and memory resources represented by a memory, for storing instructions executable by the processing component, such as application programs. The application programs stored in the memory may include one or more modules each corresponding to a set of instructions. In addition, the processing component is configured to execute instructions to perform any method of the above method applied to the electronic device, for example, the method described in the foregoing one or more technical solutions.
[0293] The electronic device may further include a power supply component configured to perform power management of the electronic device, a wired or wireless network interface configured to connect the electronic device to a network, and an input / output (I / O) interface. The electronic device can operate based on an operating system stored in the memory, such as Windows Server TM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or the like.
[0294] An embodiment of the present disclosure provides a non-transitory computer-readable storage medium. When the instructions in the storage medium are executed by a processor of a computer, the computer can execute the live data processing method described in the foregoing one or more technical solutions.
[0295] Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common general knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and examples are only illustrative, and the true scope and spirit of the present disclosure are pointed out by the appended application documents.
[0296] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended application documents.
Claims
1. A dependency configuration method, characterized in that Applied to a platform, the method includes: Receiving a task request for a target dependency; wherein, the task request includes at least: configuration parameters; the target dependency includes: a dependency package on which a big data task depends. Determining the type and version of the target dependency according to the configuration parameters. Obtaining a source code file corresponding to the type and version according to the type and version of the target dependency; wherein, the type of the target dependency includes at least: standardized dependency and custom dependency; wherein, the custom dependency includes at least: a first type of dependency, relying on the user to write source code on the terminal to obtain a source code file, and uploading the source code file to the platform, and then the platform uploads it to cloud storage; a second type of dependency, the terminal does not need to configure a language environment, relying on the user to write source code on the terminal to obtain a source code in text form, and uploading the source code to the platform, and then the platform stores it in a database; for the source code file of the first type of dependency, the terminal used by the user is configured with a corresponding language editing environment. Loading the source code file of the target dependency into the class path and executing the task request; wherein, the class path refers to a task thread set within the platform; when executing the task request, execute the task request according to the class path.
2. The dependency configuration method according to claim 1, wherein The obtaining a source code file corresponding to the type and version according to the type and version of the target dependency includes: Determining whether the dependency type of the target dependency belongs to a standardized dependency according to the type and version of the target dependency. When the target dependency belongs to a standardized dependency, downloading a source code file corresponding to the type and version from a first repository of the standardized dependency.
3. The dependency configuration method according to claim 1, wherein The obtaining a source code file corresponding to the type and version according to the type and version of the target dependency includes: Determining whether the dependency type of the target dependency belongs to the first type of custom dependency according to the type and version of the target dependency. When the target dependency belongs to the first type of custom dependency, downloading a source code file corresponding to the type and version from the cloud.
4. The dependency configuration method according to claim 1, characterized in that, The obtaining a source code file corresponding to the type and version according to the type and version of the target dependency includes: Determining whether the dependency type of the target dependency belongs to the second type of custom dependency according to the type and version of the target dependency. When the target dependency belongs to the second type of custom dependency, calling the source code corresponding to the type and version from the database. Obtaining a source code file corresponding to the type and version according to the source code.
5. The dependency configuration method according to claim 4, characterized in that The obtaining a source code file corresponding to the type and version according to the source code includes: Calling a compiler corresponding to the language type according to the language type of the source code. Compiling the source code using the compiler to obtain a binary file. Packaging the binary file to obtain a source code file corresponding to the type and version.
6. A dependency configuration method, characterized in that, Applied to a terminal, the method includes: Send a configuration task request dependent on the target to the platform; wherein, the task request at least includes: configuration parameters, and the configuration parameters are used for the platform to determine the type and version of the target dependency according to the configuration parameters; the target dependency includes: a dependency package on which a big data task depends; obtaining a source code file corresponding to the type and version according to the type and version of the target dependency; wherein, the type of the target dependency at least includes: standardized dependency and custom dependency; loading the source code file of the target dependency to the class path; the custom dependency at least includes: a first type of dependency, which relies on the user to write source code at the terminal to obtain a source code file, and upload the source code file to the platform, and then the platform uploads it to cloud storage; a second type of dependency, the terminal does not need to configure the language environment, relies on the user to write source code at the terminal to obtain the source code in text form, and upload the source code to the platform, and then the platform stores it in the database; for the source code file of the first type of dependency, the terminal used by the user is configured with a corresponding language editing environment; the class path refers to the task thread set within the platform; when executing the task request, execute the task request according to the class path; Receive the dependency configuration result.
7. The dependency configuration method according to claim 6, wherein The method further includes: Generate the source code file of the first type of dependency of the custom dependency. Upload the source code file to the platform; wherein, the source code file is used for the platform to upload to the cloud.
8. The dependency configuration method according to claim 6, characterized in that The method further includes: Generate the source code of the second type of dependency of the custom dependency. Upload the source code to the platform; wherein, the source code is used for the platform to store the source code in the database.
9. The dependency configuration method according to claim 6, characterized in that, The method further includes: If the dependency configuration result indicates that the source code file of the target dependency is incorrect, upload the source code file and / or the source code of the target dependency to the platform.
10. A dependency configuration device, characterized in that, The apparatus includes: A first receiving module, configured to receive a task request dependent on the target; wherein, the task request at least includes: configuration parameters; the target dependency includes: a dependency package on which a big data task depends; A first determining module, configured to determine the type and version of the target dependency according to the configuration parameters; A second determining module, configured to obtain a source code file corresponding to the type and version according to the type and version of the target dependency; wherein, the type of the target dependency at least includes: standardized dependency and custom dependency; wherein, the custom dependency at least includes: a first type of dependency, which relies on the user to write source code at the terminal to obtain a source code file, and upload the source code file to the platform, and then the platform uploads it to cloud storage; a second type of dependency, the terminal does not need to configure the language environment, relies on the user to write source code at the terminal to obtain the source code in text form, and upload the source code to the platform, and then the platform stores it in the database; for the source code file of the first type of dependency, the terminal used by the user is configured with a corresponding language editing environment; A loading module, configured to load the source code file on which the target dependency depends into the class path and execute the task request; wherein, the class path refers to the task threads set within the platform; when executing the task request, execute the task request according to the class path.
11. The dependency configuration device according to claim 10, characterized in that, The second determination module is further configured to: Determine whether the dependency type of the target dependency belongs to a standardized dependency according to the type and version of the target dependency; When the target dependency belongs to a standardized dependency, download the source code file corresponding to the type and version from the first repository of the standardized dependency.
12. The dependency configuration device according to claim 10, wherein The second determination module is further configured to: Determine whether the dependency type of the target dependency belongs to the first type of custom dependency according to the type and version of the target dependency; When the target dependency belongs to the first type of custom dependency, download the source code file corresponding to the type and version from the cloud.
13. The dependency configuration device according to claim 10, characterized in that The second determination module is further configured to: Determine whether the dependency type of the target dependency belongs to the second type of custom dependency according to the type and version of the target dependency; When the target dependency belongs to the second type of custom dependency, call the source code corresponding to the type and version from the database; Obtain the source code file corresponding to the type and version according to the source code.
14. The dependency configuration device according to claim 13, wherein The second determination module is further configured to: Call a compiler corresponding to the language type according to the language type of the source code; Compile the source code by using the compiler to obtain a binary file; Package the binary file to obtain the source code file corresponding to the type and version.
15. A configuration-dependent device, characterized in that, The apparatus includes: A first sending module, configured to send a configuration task request of a target dependency to the platform; wherein, the task request at least includes: configuration parameters, and the configuration parameters are used for the platform to determine the type and version of the target dependency according to the configuration parameters; obtain the source code file corresponding to the type and version according to the type and version of the target dependency; the target dependency includes: a dependency package on which a big data task depends; wherein, the type of the target dependency at least includes: a standardized dependency and a custom dependency; load the source code file of the target dependency into the class path; the custom dependency at least includes: the first type of dependency, which relies on the user to write source code on the terminal to obtain the source code file, and upload the source code file to the platform, and then the platform uploads it to the cloud for storage; the second type of dependency, the terminal does not need to configure the language environment, relies on the user to write source code on the terminal to obtain the source code in text form, and upload the source code to the platform, and then the platform stores it in the database for storage; for the source code file of the first type of dependency, the terminal used by the user is configured with a corresponding language editing environment; the class path refers to the task threads set within the platform; when executing the task request, execute the task request according to the class path; A second receiving module, configured to receive a dependency configuration result.
16. The dependency configuration device according to claim 15, characterized in that The apparatus further includes: A first generation module for generating source code files of a first type of dependency of the custom dependency; A first upload module for uploading the source code files to a platform; wherein the source code files are used by the platform to upload to the cloud.
17. The dependency configuration device according to claim 15, wherein The apparatus further includes: A second generation module for generating source code of a second type of dependency of the custom dependency; A second upload module for uploading the source code to a platform; wherein the source code is used by the platform to store the source code in a database.
18. The dependency configuration device according to claim 15, wherein The apparatus further includes: A third upload module for uploading the source code file and / or the source code of the target dependency to the platform if the dependency configuration result indicates that the source code file of the target dependency is incorrect.
19. An electronic device, characterized in that, Comprising: A memory for storing processor-executable instructions; A processor connected to the memory; Wherein the processor is configured to execute the dependency configuration method provided in any one of claims 1 to 5 or 6 to 9.
20. A non-transitory computer-readable storage medium, characterized in that, Computer-executable instructions are stored in the computer-readable storage medium, and when the computer-executable instructions are executed by a processor, the dependency configuration method provided in any one of claims 1 to 5 or 6 to 9 is implemented.
Citation Information
Patent Citations
Big data service component management method, computer device and storage medium
CN114003312A