Methods and apparatus for publishing dynamic projects, storage media and electronic devices

By verifying and executing compilation instructions, dynamic projects are compiled and packaged to generate business packages, solving the problem of Flutter's lack of a complete engineering process and achieving efficient dynamic business deployment.

CN115794116BActive Publication Date: 2026-11-17HAIER YOUJIA INTELLIGENT TECH (BEIJING) CO LTD +2
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211606707.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-13
Publication Date
2026-11-17
Estimated Expiration
2042-12-13

AI Technical Summary

Technical Problem

Currently, Flutter is still in the development stage and lacks a complete engineering process covering compilation, packaging, and deployment, which causes enterprises to have concerns when using it.

Method used

A method and apparatus for publishing dynamic projects are provided. By verifying the storage path in the compilation instructions, the dynamic project is compiled and packaged to generate a business package, and then published to the target server after passing the test.

Benefits of technology

It implements a complete dynamic business code compilation, packaging, and deployment process, which solves the concerns of enterprises when using Flutter and improves deployment efficiency and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115794116B_ABST
    Figure CN115794116B_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, storage medium, and electronic device for publishing dynamic projects, relating to the field of smart home technology. The method for publishing dynamic projects includes: upon receiving a compilation instruction, verifying whether a first parameter contained in the compilation instruction is correct, wherein the first parameter is used to indicate the storage path of the dynamic project obtained based on a target framework; if the first parameter is determined to be correct, compiling the dynamic project according to the compilation instruction; packaging the compiled dynamic project to obtain a dynamic service package corresponding to the compiled dynamic project; sending the dynamic service package to a first object for testing, and publishing the dynamic service package to a target server upon receiving a successful test result from the first object.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of smart home technology, and more specifically, to a method and apparatus for publishing dynamic projects, a storage medium, and an electronic device. Background Technology

[0002] Flutter's cross-platform technology has earned a good reputation in the industry since its launch, with its advantages in "consistency across multiple platforms" and "rendering performance" being difficult for other cross-platform solutions to match. Although Flutter is still in the development stage, many large internet companies cannot unhesitatingly integrate it across their entire app ecosystem, with the main concerns being package size and dynamism. Dynamism means a shorter deployment path, significantly reduced original package size, resulting in higher user download intentions, and a more robust online quality maintenance system.

[0003] To rapidly deploy Flutter's dynamic features across business applications, a complete engineering process is essential, encompassing compilation, packaging, and deployment. Flutter previously offered a Code Push solution, which involves downloading and replacing Flutter build artifacts in the app's installation directory to achieve dynamic functionality. However, this solution's performance is unsatisfactory and poses security risks. Furthermore, its limitations are significant; it doesn't effectively support hybrid Native-Flutter apps and cannot handle customized business operations such as canary releases.

[0004] Currently, Flutter is still in the development stage and lacks a complete engineering process that covers compilation, packaging, and deployment. This has led to concerns among many enterprises when using it, and no effective solution has yet been proposed. Summary of the Invention

[0005] This invention provides a method and apparatus for publishing dynamic projects, a storage medium, and an electronic device to at least address the issue that, in the prior art, Flutter is still in the development stage and lacks a complete engineering process covering compilation, packaging, and publishing, which leads to concerns among many enterprises when using it.

[0006] According to one embodiment of the present invention, a method for publishing a dynamic project is provided, comprising: upon receiving a compilation instruction, verifying whether a first parameter contained in the compilation instruction is correct, wherein the first parameter is used to indicate the storage path of the dynamic project obtained based on a target framework; if the first parameter is determined to be correct, compiling the dynamic project according to the compilation instruction; packaging the compiled dynamic project to obtain a dynamic business package corresponding to the compiled dynamic project; sending the dynamic business package to a first object for testing, and publishing the dynamic business package to a target server if the test result fed back by the first object is successful.

[0007] In an exemplary embodiment, compiling the dynamic project according to the compilation instructions includes: obtaining the dynamic project according to the storage path indicated by the first parameter; adding dependency files and configuration files to the dynamic project according to the compilation instructions, wherein the dependency files are used to indicate the dependencies used by the dynamic project, and the configuration files are used to configure at least the files that need to be compiled in the dynamic project; and compiling the dynamic project according to the dependency files and the configuration files.

[0008] In one exemplary embodiment, packaging the compiled dynamic project to obtain a dynamic business package corresponding to the compiled dynamic project includes: determining a second storage path for the dynamic business package based on the compilation instructions; determining whether the configuration file of the dynamic project contains a preset key field, wherein the preset key field is used to indicate preset key information of the dynamic project; if it is determined that the configuration file contains the preset key field, packaging the compiled dynamic project according to the configuration file and the second storage path to obtain the dynamic business package.

[0009] In an exemplary embodiment, determining the second storage path of the dynamic service package according to the compilation instructions includes: determining whether there is a second parameter in the compilation instructions, wherein the second parameter is used to indicate the storage path of the dynamic service package; if the second parameter exists in the compilation instructions, determining the storage path indicated by the second parameter as the second storage path; if the second parameter does not exist in the compilation instructions, determining the storage path indicated by the first parameter as the second storage path.

[0010] In an exemplary embodiment, packaging the compiled dynamic project according to the configuration file and the second storage path to obtain the dynamic business package includes: obtaining the project name of the dynamic project from the configuration file, wherein the preset key field includes the project name; traversing all code files of the dynamic project and searching for a preset annotation field in all code files, wherein the preset annotation field is used to identify the dynamic project; packaging the compiled dynamic project according to the project name and the preset annotation field, and storing the obtained dynamic business package according to the second storage path, wherein the index of the dynamic business package is the preset annotation field, and the name of the dynamic business package is the project name.

[0011] In an exemplary embodiment, after publishing the dynamic service package to the target server, the method further includes: embedding the dynamic service package into the target application to obtain the embedded dynamic service package; and controlling the target application to call the embedded dynamic service package when the target application experiences a preset abnormal state.

[0012] In an exemplary embodiment, after sending the dynamic service package to a first object for testing, the method further includes: if the test result reported by the first object is a failure, receiving a test report sent by the first object, wherein the test report is used to indicate the problems existing in the dynamic project; and sending the test report to a second object to instruct the second object to adjust the dynamic project according to the test report.

[0013] According to another embodiment of the present invention, a dynamic project publishing apparatus is also provided, comprising: a verification module, configured to verify whether a first parameter contained in a compilation instruction is correct upon receiving a compilation instruction, wherein the first parameter is used to indicate the storage path of the dynamic project obtained based on a target framework; a compilation module, configured to compile the dynamic project according to the compilation instruction if the first parameter is determined to be correct; a packaging module, configured to package the compiled dynamic project to obtain a dynamic business package corresponding to the compiled dynamic project; and a publishing module, configured to send the dynamic business package to a first object for testing, and publish the dynamic business package to a target server if the test result fed back by the first object is successful.

[0014] According to another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is configured to execute the above-described dynamic project publishing method at runtime.

[0015] According to another aspect of the present invention, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-described dynamic project publishing method through the computer program.

[0016] In this embodiment, upon receiving a compilation instruction, the storage path carried in the compilation instruction is verified to be correct. If correct, the dynamic project is compiled according to the compilation instruction. Then, the compiled dynamic project is packaged to obtain a dynamic business package. The dynamic business package is sent to a first object for testing. If the test passes, the dynamic business package is published to the target server. By adopting the above technical solution, the problem that in the prior art, Flutter is still in the development stage and lacks a complete engineering process covering compilation, packaging, and publishing, which leads to concerns for many enterprises when using it, is solved. The solution provides a complete Flutter dynamic overall solution based on self-developed technology, completing the entire process of dynamic business code compilation, packaging, and publishing. Attached Figure Description

[0017] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a schematic diagram of the hardware environment for an optional method of publishing dynamic projects according to an embodiment of this application;

[0020] Figure 2 This is a flowchart of an optional method for publishing dynamic projects according to an embodiment of the present invention;

[0021] Figure 3 This is a flowchart illustrating the compilation and packaging process of an optional dynamic project publishing method according to an embodiment of the present invention;

[0022] Figure 4 This is a flowchart of an optional dynamic project publishing method according to an embodiment of the present invention;

[0023] Figure 5 This is a structural block diagram of an optional dynamic project publishing device according to an embodiment of the present invention. Detailed Implementation

[0024] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0025] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0026] According to one aspect of the embodiments of this application, a method for publishing dynamic projects is provided. This method for publishing dynamic projects is widely applicable to whole-house intelligent digital control application scenarios such as smart homes, smart home ecosystems, and intelligence house ecosystems. Optionally, in this embodiment, the above-mentioned method for publishing dynamic projects can be applied to, for example... Figure 1 The hardware environment shown consists of terminal device 102 and server 104. For example... Figure 1 As shown, server 104 is connected to terminal device 102 via a network and can be used to provide services (such as application services) to the terminal or clients installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data processing services for server 104.

[0027] The aforementioned network may include, but is not limited to, at least one of the following: wired network, wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network, metropolitan area network, local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity), Bluetooth. Terminal device 102 may not be limited to PC, mobile phone, tablet computer, smart air conditioner, smart range hood, refrigerator, smart oven, smart stove, smart washing machine, smart water heater, smart washing equipment, smart dishwasher, smart projector, smart TV, smart clothes rack, smart curtains, smart audio-visual equipment, smart socket, smart speaker, smart speaker box, smart fresh air equipment, smart kitchen and bathroom equipment, smart bathroom equipment, smart robot vacuum cleaner, smart window cleaning robot, smart mopping robot, smart air purifier, smart steam oven, smart microwave oven, smart water heater, smart air purifier, smart water dispenser, smart door lock, etc.

[0028] This embodiment provides a method for publishing dynamic projects, applied to the aforementioned computer system. Figure 2 This is a flowchart of an optional method for publishing a dynamic project according to an embodiment of the present invention, the process including the following steps:

[0029] Step S202: Upon receiving a compilation instruction, verify whether the first parameter contained in the compilation instruction is correct, wherein the first parameter is used to indicate the storage path of the dynamic project obtained based on the target framework.

[0030] It should be noted that the compilation and packaging process for dynamic projects can be completed using pre-written compilation scripts. By fixing a series of commands in the script, the compilation and packaging of dynamic projects can be completed automatically by running the script.

[0031] It should be noted that the first parameter mentioned above can be understood as the input parameter of the compilation script.

[0032] Step S204: If the first parameter is determined to be correct, compile the dynamic project according to the compilation instructions;

[0033] It should be noted that if the first parameter is correct, it can be understood that the input parameter exists and the dynamic project can be found according to the path. If the first parameter is incorrect, it can be understood that the input parameter does not exist or the dynamic project cannot be found through the path information corresponding to the input parameter.

[0034] Step S206: Package the compiled dynamic project to obtain the dynamic business package corresponding to the compiled dynamic project;

[0035] Step S208: Send the dynamic service package to the first object for testing, and if the test result is successful upon receiving feedback from the first object, publish the dynamic service package to the target server.

[0036] It should be noted that the target server mentioned above can be understood as a company's private server, or it can be other servers; this application does not impose any restrictions on this.

[0037] It should be noted that a successful test result can be understood as the number of bugs in the dynamic business package being less than a preset threshold or the dynamic business package being able to run normally after the first object is tested. This application does not impose any restrictions on this.

[0038] In this embodiment, upon receiving a compilation instruction, the storage path carried in the compilation instruction is verified to be correct. If correct, the dynamic project is compiled according to the compilation instruction. Then, the compiled dynamic project is packaged to obtain a dynamic business package. The dynamic business package is sent to a first object for testing. If the test passes, the dynamic business package is published to the target server. By adopting the above technical solution, the problem that in the prior art, Flutter is still in the development stage and lacks a complete engineering process covering compilation, packaging, and publishing, which leads to concerns for many enterprises when using it, is solved. The solution provides a complete Flutter dynamic overall solution based on self-developed technology, completing the entire process of dynamic business code compilation, packaging, and publishing.

[0039] Optionally, step S204: compiling the dynamic project according to the compilation instructions includes: obtaining the dynamic project according to the storage path indicated by the first parameter; adding dependency files and configuration files to the dynamic project according to the compilation instructions, wherein the dependency files are used to indicate the dependencies used by the dynamic project, and the configuration files are used to configure at least the files that need to be compiled in the dynamic project; and compiling the dynamic project according to the dependency files and the configuration files.

[0040] The dependency files included in the dynamic project itself may not contain complete dependencies, and may not include the dependencies required when compiling the dynamic project. Therefore, we use a script to add dependency files to the dynamic project to complete the dependencies required for compilation; and we add a configuration file to the dynamic project to determine which files need to be compiled based on the configuration file; after adding the dependency files and configuration file, we compile the dynamic project.

[0041] Optionally, step S206 is performed: packaging the compiled dynamic project to obtain a dynamic business package corresponding to the compiled dynamic project, including: determining the second storage path of the dynamic business package according to the compilation instructions; determining whether the configuration file of the dynamic project contains a preset key field, wherein the preset key field is used to indicate preset key information of the dynamic project; if it is determined that the configuration file contains the preset key field, packaging the compiled dynamic project according to the configuration file and the second storage path to obtain the dynamic business package.

[0042] The process of packaging the compiled dynamic project includes: first, determining the second storage path of the packaged dynamic business package according to the compilation instructions; then, parsing the compiled dynamic project to determine whether the configuration file contains all the preset key fields; if so, packaging the compiled dynamic project according to the configuration file and the second storage path to obtain the dynamic business package, which is stored in the second storage path.

[0043] It should be noted that the aforementioned preset key fields include the project name, and may also include other key information of the dynamic project; this application does not impose any restrictions on this.

[0044] Optionally, the above determination step of determining the second storage path of the dynamic service package according to the compilation instructions includes: determining whether there is a second parameter in the compilation instructions, wherein the second parameter is used to indicate the storage path of the dynamic service package; if the second parameter exists in the compilation instructions, determining the storage path indicated by the second parameter as the second storage path; if the second parameter does not exist in the compilation instructions, determining the storage path indicated by the first parameter as the second storage path.

[0045] The process of determining the second storage path of the dynamic business package according to the compilation instructions includes: first, determining whether there is a second parameter in the compilation instructions, that is, determining whether there is an input parameter used to indicate the storage path of the packaged dynamic business package; if the second parameter exists, the storage path indicated by the second parameter is determined as the second storage path; if the second parameter does not exist, the storage path indicated by the first parameter is determined as the second storage path.

[0046] Optionally, the above packaging step, which packages the compiled dynamic project according to the configuration file and the second storage path to obtain the dynamic business package, includes: obtaining the project name of the dynamic project from the configuration file, wherein the preset key field includes the project name; traversing all code files of the dynamic project and searching for a preset annotation field in all code files, wherein the preset annotation field is used to identify the dynamic project; packaging the compiled dynamic project according to the project name and the preset annotation field, and storing the obtained dynamic business package according to the second storage path, wherein the index of the dynamic business package is the preset annotation field, and the name of the dynamic business package is the project name.

[0047] The above packaging steps include: first, obtaining the project name of the dynamic project from the configuration file; then, traversing and scanning all code files of the dynamic project to determine whether there are code files with preset annotation fields, so as to determine whether the "dynamic project" is "dynamic"; if it exists, then packaging the compiled dynamic project according to the project name and the preset annotation field, and storing the resulting dynamic business package according to the second storage path, wherein the key of the dynamic business package is the value corresponding to the preset annotation field, and the name of the dynamic business package is the project name.

[0048] It should be noted that the code files can be identified by the file extensions of all files. The file extension of the code files can be ".dart", and this application does not impose any restrictions on this.

[0049] Optionally, after performing step S208 above: publishing the dynamic service package to the target server, the method further includes: embedding the dynamic service package into the target application to obtain the embedded dynamic service package; and controlling the target application to call the embedded dynamic service package when the target application encounters a preset abnormal state.

[0050] When releasing a new version, the app pre-installs the necessary dynamic services to ensure that if any errors or anomalies occur on the page while running the updated dynamic services, such as abnormal data interaction with the private server, the app will automatically enter the built-in dynamic service package when the user exits and re-enters the page, thus minimizing interference with the user experience.

[0051] It should be noted that the aforementioned preset abnormal states can be such as the unified publishing platform service crash, network request interruption, or other abnormal states, and this application does not impose any restrictions on them.

[0052] In an exemplary embodiment, after performing step S208 above: sending the dynamic service package to the first object for testing, the method further includes: if the test result reported by the first object is a failure, receiving a test report sent by the first object, wherein the test report is used to indicate the problems existing in the dynamic project; sending the test report to the second object to instruct the second object to adjust the dynamic project according to the test report.

[0053] If the first object reports a failure in its test of the dynamic business package, it can be understood that the dynamic project has too many bugs or that the dynamic project cannot run normally in the test environment. The first object will then provide a test report based on the test results. This test report will be forwarded to the second object, which can then make targeted adjustments based on the issues pointed out in the test report to fix the dynamic project.

[0054] This embodiment provides an optional method for publishing dynamic projects. Figure 3 This is a flowchart illustrating the compilation and packaging process of an optional dynamic project publishing method according to an embodiment of the present invention, such as... Figure 3 As shown, the specific steps include:

[0055] Step 1: After the business team develops the dynamic page and conducts self-testing, they submit the code to the code server and add a tag.

[0056] Step 2: After receiving the tagging command, the server automatically runs the command-line script to start the compilation process. The command-line script can be: dart run ast2dsl / lib / ast2dsl.dart –input xxx / xxx / --output xxx / xxx / .

[0057] Step 3: Parse command-line arguments.

[0058] Step 4: Verify whether the parameter (equivalent to the first parameter above) is valid. If it is invalid, proceed to step 5; if it is valid, proceed to step 6.

[0059] Step 5: Invalid parameter, print error message, return, and proceed to step 20.

[0060] Step 6: Obtain the root path of the dynamic project (equivalent to the first path information mentioned above) based on the command line parameters.

[0061] Step 7: Execute the script to add the build_runner dependency to the dynamic project.

[0062] Step 8: Add a build.yaml file to the dynamic project to configure the files that need to be compiled.

[0063] Step 9: Execute the compilation command to convert the adrt file into a DSL JSON file and identify external symbols.

[0064] Step 10: Obtain the path of the final packaged zip file (equivalent to the second path information mentioned above).

[0065] Step 11: Begin parsing the dynamic project.

[0066] Step 12: Verify if the YAML file (equivalent to the configuration file mentioned above) is valid. If it is invalid, proceed to step 13; if it is valid, proceed to step 14.

[0067] Step 13: The YAML file is invalid. Print the error message and return to step 20.

[0068] Step 14: Obtain the package name of the dynamic project (equivalent to the project name mentioned above).

[0069] Step 15: Scan all .dart files (equivalent to the code files mentioned above) in the project's lib directory.

[0070] Step 16: Check if there are any files with annotations (equivalent to the preset annotation fields mentioned above). If there are no annotations, proceed to step 17; if there are annotations, proceed to step 18.

[0071] Step 17: No annotation file, print error message, return to step 20.

[0072] Step 18: Generate a configuration file with annotations as keys and fully qualified file names as values.

[0073] Step 19: Save the DSL JSON and package it into a zip file, then return its path.

[0074] Step 20: End.

[0075] It should be noted that the fully qualified name mentioned above can be either the package name (equivalent to the project name mentioned above) or (package name + file path), and this application does not impose any restrictions on it.

[0076] Through the above steps, the engineering solution in Flutter dynamics can accelerate the release cycle. After the developers complete the development of dynamic business, they can package the business code as soon as possible through engineering and submit it to the testers. After the testers respond quickly, if there are no problems, they can release and update the dynamic business as soon as possible.

[0077] Furthermore, this application also proposes another embodiment, which combines the embodiments of this application with Figure 4 To explain, such as Figure 4 As shown, Figure 4 This is a flowchart illustrating an optional, dynamic project deployment method, which includes the following steps:

[0078] Step 1: Begin.

[0079] Step 2: After completing the above compilation and packaging process, a zip package storage path and corresponding tag number will be generated.

[0080] Step 3: Relevant personnel (developers / project team members) locate the dynamic business package that needs to be submitted for testing on the unified release platform.

[0081] Step 4: Select the tag number corresponding to the dynamic project to be tested and the corresponding APP version to be released.

[0082] Step 5: The testers begin the testing process.

[0083] Step 6: Determine if the test passes. If it passes, proceed to Step 7; if it fails, proceed to Step 8.

[0084] Step 7: Publish the dynamic service package. Users can see the published service after launching the APP.

[0085] Step 8: Return to the developers for modification.

[0086] Step 9: End.

[0087] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.

[0088] This embodiment also provides a dynamic project publishing device, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0089] Figure 5 This is a structural block diagram of an optional dynamic project publishing device according to an embodiment of the present invention; as shown below. Figure 5 As shown, it includes:

[0090] The verification module 52 is used to verify whether the first parameter contained in the compilation instruction is correct when a compilation instruction is received, wherein the first parameter is used to indicate the storage path of the dynamic project obtained based on the target framework.

[0091] It should be noted that the compilation and packaging process for dynamic projects can be completed using pre-written compilation scripts. By fixing a series of commands in the script, the compilation and packaging of dynamic projects can be completed automatically by running the script.

[0092] It should be noted that the first parameter mentioned above can be understood as the input parameter of the compilation script.

[0093] Compilation module 54 is used to compile the dynamic project according to the compilation instructions when the first parameter is determined to be correct;

[0094] It should be noted that if the first parameter is correct, it can be understood that the input parameter exists and the dynamic project can be found according to the path. If the first parameter is incorrect, it can be understood that the input parameter does not exist or the dynamic project cannot be found through the path information corresponding to the input parameter.

[0095] The packaging module 56 is used to package the compiled dynamic project to obtain the dynamic business package corresponding to the compiled dynamic project.

[0096] The publishing module 58 is used to send the dynamic service package to the first object for testing, and publish the dynamic service package to the target server if the test result fed back by the first object is successful.

[0097] It should be noted that the aforementioned target server can be understood as a company's private server, or it can be other types of servers; this application does not impose any restrictions on this.

[0098] It should be noted that a successful test result can be understood as the number of bugs in the dynamic business package being less than a preset threshold or the dynamic business package being able to run normally after the first object is tested. This application does not impose any restrictions on this.

[0099] The aforementioned device verifies the correctness of the storage path carried in the compilation instructions upon receipt. If correct, it compiles the dynamic project according to the instructions. The compiled dynamic project is then packaged to obtain a dynamic business package. This dynamic business package is sent to a first object for testing. If the test passes, the dynamic business package is published to the target server. This technical solution addresses the current lack of a complete, engineered process covering compilation, packaging, and publishing in the developmental stage of Flutter, which has caused concerns among many enterprises. It provides a self-developed overall Flutter dynamic solution that completes the entire process of compiling, packaging, and publishing dynamic business code.

[0100] Optionally, the compilation module 54 is further configured to obtain the dynamic project according to the storage path indicated by the first parameter; add dependency files and configuration files to the dynamic project according to the compilation instructions, wherein the dependency files are used to indicate the dependencies used by the dynamic project, and the configuration files are used to configure at least the files that need to be compiled in the dynamic project; and compile the dynamic project according to the dependency files and the configuration files.

[0101] The dependency files included in the dynamic project itself may not contain complete dependencies, and may not include the dependencies required when compiling the dynamic project. Therefore, we use a script to add dependency files to the dynamic project to complete the dependencies required for compilation; and we add a configuration file to the dynamic project to determine which files need to be compiled based on the configuration file; after adding the dependency files and configuration file, we compile the dynamic project.

[0102] Optionally, the packaging module 56 is further configured to determine the second storage path of the dynamic business package according to the compilation instructions; determine whether the configuration file of the dynamic project contains a preset key field, wherein the preset key field is used to indicate preset key information of the dynamic project; if it is determined that the configuration file contains the preset key field, package the compiled dynamic project according to the configuration file and the second storage path to obtain the dynamic business package.

[0103] The process of packaging the compiled dynamic project includes: first, determining the second storage path of the packaged dynamic business package according to the compilation instructions; then, parsing the compiled dynamic project to determine whether the configuration file contains all the preset key fields; if so, packaging the compiled dynamic project according to the configuration file and the second storage path to obtain the dynamic business package, which is stored in the second storage path.

[0104] It should be noted that the aforementioned preset key fields include the project name, and may also include other key information of the dynamic project; this application does not impose any restrictions on this.

[0105] Optionally, the packaging module 56 is further configured to determine whether a second parameter exists in the compilation instruction, wherein the second parameter is used to indicate the storage path of the dynamic business package; if the second parameter exists in the compilation instruction, the storage path indicated by the second parameter is determined as the second storage path; if the second parameter does not exist in the compilation instruction, the storage path indicated by the first parameter is determined as the second storage path.

[0106] The process of determining the second storage path of the dynamic business package according to the compilation instructions includes: first, determining whether there is a second parameter in the compilation instructions, that is, determining whether there is an input parameter used to indicate the storage path of the packaged dynamic business package; if the second parameter exists, the storage path indicated by the second parameter is determined as the second storage path; if the second parameter does not exist, the storage path indicated by the first parameter is determined as the second storage path.

[0107] Optionally, the packaging module 56 is further configured to obtain the project name of the dynamic project from the configuration file, wherein the preset key field includes the project name; traverse all code files of the dynamic project, search for a preset annotation field in all code files, wherein the preset annotation field is used to identify the dynamic project; package the compiled dynamic project according to the project name and the preset annotation field, and store the resulting dynamic business package according to the second storage path, wherein the index of the dynamic business package is the preset annotation field, and the name of the dynamic business package is the project name.

[0108] The above packaging steps include: first, obtaining the project name of the dynamic project from the configuration file; then, traversing and scanning all code files of the dynamic project to determine whether there are code files with preset annotation fields, so as to determine whether the "dynamic project" is "dynamic"; if it exists, then packaging the compiled dynamic project according to the project name and the preset annotation field, and storing the resulting dynamic business package according to the second storage path, wherein the key of the dynamic business package is the value corresponding to the preset annotation field, and the name of the dynamic business package is the project name.

[0109] It should be noted that the code files can be identified by the file extensions of all files. The file extension of the code files can be ".dart", and this application does not impose any restrictions on this.

[0110] Optionally, the publishing module 58 is further configured to, after publishing the dynamic service package to the target server, embed the dynamic service package into the target application to obtain the embedded dynamic service package; and, in the event of a preset abnormal state in the target application, control the target application to call the embedded dynamic service package.

[0111] When releasing a new version, the app pre-installs the necessary dynamic services to ensure that if any errors or anomalies occur on the page while running the updated dynamic services, such as abnormal data interaction with the private server, the app will automatically enter the built-in dynamic service package when the user exits and re-enters the page, thus minimizing interference with the user experience.

[0112] It should be noted that the aforementioned preset abnormal states can be such as the unified publishing platform service crash, network request interruption, or other abnormal states, and this application does not impose any restrictions on them.

[0113] In an exemplary embodiment, the publishing module 58 is further configured to, after sending the dynamic service package to a first object for testing, receive a test report sent by the first object if the test result reported by the first object is a failure, wherein the test report is used to indicate the problems existing in the dynamic project; and send the test report to a second object to instruct the second object to adjust the dynamic project according to the test report.

[0114] If the first object reports a failure in its test of the dynamic business package, it can be understood that the dynamic project has too many bugs or that the dynamic project cannot run normally in the test environment. The first object will then provide a test report based on the test results. This test report will be forwarded to the second object, which can then make targeted adjustments based on the issues pointed out in the test report to fix the dynamic project.

[0115] Embodiments of the present invention also provide a storage medium comprising a stored program, wherein the program, when executed, performs any of the methods described above.

[0116] Optionally, in this embodiment, the storage medium may be configured to store program code for performing the following steps:

[0117] S1, upon receiving a compilation instruction, verify whether the first parameter contained in the compilation instruction is correct, wherein the first parameter is used to indicate the storage path of the dynamic project obtained based on the target framework;

[0118] S2, if the first parameter is determined to be correct, compile the dynamic project according to the compilation instructions;

[0119] S3, Package the compiled dynamic project to obtain the dynamic business package corresponding to the compiled dynamic project;

[0120] S4, the dynamic service package is sent to the first object for testing, and if the test result is successful upon receiving feedback from the first object, the dynamic service package is published to the target server.

[0121] Embodiments of the present invention also provide an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.

[0122] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0123] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:

[0124] S1, upon receiving a compilation instruction, verify whether the first parameter contained in the compilation instruction is correct, wherein the first parameter is used to indicate the storage path of the dynamic project obtained based on the target framework;

[0125] S2, if the first parameter is determined to be correct, compile the dynamic project according to the compilation instructions;

[0126] S3, Package the compiled dynamic project to obtain the dynamic business package corresponding to the compiled dynamic project;

[0127] S4, the dynamic service package is sent to the first object for testing, and if the test result is successful upon receiving feedback from the first object, the dynamic service package is published to the target server.

[0128] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0129] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.

[0130] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.

[0131] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for publishing dynamic projects, characterized in that, include: Upon receiving a compilation instruction, the system verifies whether the first parameter contained in the compilation instruction is correct, wherein the first parameter is used to indicate the storage path of the dynamic project obtained based on the target framework. If the first parameter is confirmed to be correct, the dynamic project is compiled according to the compilation instructions; The compiled dynamic project is packaged to obtain the dynamic business package corresponding to the compiled dynamic project; The dynamic service package is sent to the first object for testing, and if the test result is successful upon receiving feedback from the first object, the dynamic service package is published to the target server. The process of packaging the compiled dynamic project to obtain a dynamic business package corresponding to the compiled dynamic project includes: determining a second storage path for the dynamic business package based on the compilation instructions; determining whether the configuration file of the dynamic project contains a preset key field, wherein the preset key field is used to indicate preset key information of the dynamic project; if the configuration file contains the preset key field, obtaining the project name of the dynamic project from the configuration file, wherein the preset key field includes the project name; traversing all code files of the dynamic project and searching for a preset annotation field in all code files, wherein the preset annotation field is used to identify the dynamic project; packaging the compiled dynamic project according to the project name and the preset annotation field, and storing the resulting dynamic business package according to the second storage path, wherein the index of the dynamic business package is the preset annotation field, and the name of the dynamic business package is the project name; Determining the second storage path of the dynamic service package according to the compilation instructions includes: Determine whether a second parameter exists in the compilation instructions, wherein the second parameter is used to indicate the storage path of the dynamic service package; If the second parameter exists in the compilation instruction, the storage path indicated by the second parameter shall be determined as the second storage path; If the second parameter is not present in the compilation instructions, the storage path indicated by the first parameter is determined as the second storage path.

2. The method for publishing dynamic projects according to claim 1, characterized in that, Compiling the dynamic project according to the compilation instructions includes: The dynamic project is obtained according to the storage path indicated by the first parameter; According to the compilation instructions, add dependency files and configuration files to the dynamic project, wherein the dependency files are used to indicate the dependencies used by the dynamic project, and the configuration files are used to configure at least the files that need to be compiled in the dynamic project; The dynamic project is compiled based on the dependency files and the configuration file.

3. The method for publishing dynamic projects according to claim 1, characterized in that, After publishing the dynamic service package to the target server, the method further includes: The dynamic service package is embedded into the target application to obtain the embedded dynamic service package; When the target application experiences a preset abnormal state, the target application is controlled to call the built-in dynamic service package.

4. The method for publishing dynamic projects according to claim 1, characterized in that, After sending the dynamic service package to the first object for testing, the method further includes: If the test result received from the first object is a failure, a test report sent by the first object is received, wherein the test report is used to indicate the problems existing in the dynamic project; The test report is sent to a second object to instruct the second object to adjust the dynamic project based on the test report.

5. A device for publishing dynamic projects, characterized in that, include: The verification module is used to verify whether the first parameter contained in the compilation instruction is correct when a compilation instruction is received, wherein the first parameter is used to indicate the storage path of the dynamic project obtained based on the target framework. A compilation module is used to compile the dynamic project according to the compilation instructions if the first parameter is determined to be correct. The packaging module is used to package the compiled dynamic project to obtain the dynamic business package corresponding to the compiled dynamic project. The publishing module is used to send the dynamic service package to the first object for testing, and if the test result is successful upon receiving feedback from the first object, publish the dynamic service package to the target server. The packaging module is further configured to: determine a second storage path for the dynamic business package based on the compilation instructions; determine whether the configuration file of the dynamic project contains a preset key field, wherein the preset key field is used to indicate preset key information of the dynamic project; if the configuration file contains the preset key field, obtain the project name of the dynamic project from the configuration file, wherein the preset key field includes the project name; traverse all code files of the dynamic project and search for a preset annotation field in all code files, wherein the preset annotation field is used to identify the dynamic project; package the compiled dynamic project according to the project name and the preset annotation field, and store the resulting dynamic business package according to the second storage path, wherein the index of the dynamic business package is the preset annotation field, and the name of the dynamic business package is the project name; The packaging module is further configured to determine whether a second parameter exists in the compilation instructions, wherein the second parameter is used to indicate the storage path of the dynamic business package; If the second parameter exists in the compilation instruction, the storage path indicated by the second parameter shall be determined as the second storage path; If the second parameter is not present in the compilation instructions, the storage path indicated by the first parameter is determined as the second storage path.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method described in any one of claims 1 to 4.

7. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 4 through the computer program.

Citation Information

Patent Citations

  • Method and system for automatically packaging and publishing React Native applications

    CN110780917A

  • Project development method and device, computer readable storage medium and electronic equipment

    CN112685035A

  • Project version release management method and device, electronic equipment and computer readable medium

    CN113504939A