Application processing method and device, equipment and storage medium
By deploying global configuration files and target scripts in the micro front-end architecture, and processing multiple applications in a unified manner, the problems of application transformation difficulty and resource consumption are solved, and more efficient application processing is achieved.
Patent Information
- Application Number
- CN202311471624.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-06
- Publication Date
- 2025-05-06
AI Technical Summary
In application processing based on micro front-end architecture, user customization needs lead to increased difficulty in splitting and transformation of a single application, and dispersing between multiple applications leads to excessive resource consumption.
Deploy the target script by deploying the global configuration file for at least two applications, and run the target script through the preset command line to uniformly process the at least two applications.
It avoids splitting and transformation of individual applications, reduces the difficulty of transformation of applications, and effectively reduces resource consumption, and reduces redundant code, workload and code error rate.
Smart Images

Figure CN119938063A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an application processing method, device, equipment and storage medium. Background Art
[0002] With the rapid development of information technology scenarios such as smart campuses, micro-frontend architecture is becoming increasingly popular. In the application processing based on the micro-frontend architecture, users' needs for applications are gradually becoming customized, which affects the deployment of applications. For example, when multiple applications are deployed, on the one hand, the user's splitting and transformation of a single application may lead to major changes in other applications, increasing the difficulty of application transformation; on the other hand, multiple applications may be relatively scattered, resulting in greater consumption of resources. Summary of the invention
[0003] The present application proposes an application processing method, apparatus, device and storage medium, which can avoid the splitting and transformation of a single application, greatly reducing the difficulty of application transformation; and will not cause the dispersion of at least two applications, effectively reducing resource consumption.
[0004] The technical solution of this application is implemented as follows:
[0005] In a first aspect, an embodiment of the present application provides an application processing method, which may include:
[0006] Deploy global configuration files of at least two applications, where the global configuration files include operation modes, and the operation modes are associated with user requirements;
[0007] According to the global configuration file, determine the target scripts of at least two applications;
[0008] A target script is run through a preset command line to uniformly process at least two applications.
[0009] In a second aspect, an embodiment of the present application provides an application processing device, the device comprising a deployment unit, a determination unit and an operation unit, wherein:
[0010] A deployment unit, configured to deploy global configuration files of at least two applications, the global configuration files including operation modes, and the operation modes are associated with user requirements;
[0011] a determination unit configured to determine target scripts of at least two applications according to a global configuration file;
[0012] The running unit is configured to run the target script through a preset command line to uniformly process at least two applications.
[0013] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising a memory and a processor, wherein:
[0014] a memory configured to store a computer program executable on the processor;
[0015] A processor is configured to execute the method as described in the first aspect when running a computer program.
[0016] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by at least one processor, it implements the method described in the first aspect.
[0017] The embodiments of the present application provide an application processing method, apparatus, device and storage medium, which can deploy global configuration files of at least two applications, the global configuration files include operation modes, and the operation modes are associated with user needs; according to the global configuration files, the target scripts of at least two applications are determined; the target scripts are run through a preset command line to uniformly process at least two applications. In this way, on the one hand, since the operation mode is deployed based on the needs of the user, the splitting and transformation of a single application can be avoided, greatly reducing the difficulty of application transformation; on the other hand, a script (i.e., a target script) for unified operation can be generated based on the global configuration files of at least two applications, and the target script can be run through a command line (i.e., a preset command line), so as not to cause the dispersion of at least two applications, and can effectively reduce redundant code, reduce workload, and reduce code error rate and resource consumption. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a flowchart of an application processing method provided in an embodiment of the present application.
[0019] Figure 2 This is a scenario diagram of a micro-frontend architecture provided in an embodiment of the present application.
[0020] Figure 3 It is a flowchart of another application processing method provided in an embodiment of the present application.
[0021] Figure 4 This is a schematic diagram of a micro-front-end system architecture provided in an embodiment of the present application.
[0022] Figure 5 It is a flowchart of another application processing method provided in an embodiment of the present application.
[0023] Figure 6 It is a schematic diagram of the composition structure of an application processing device provided in an embodiment of the present application.
[0024] Figure 7 It is a schematic diagram of the composition structure of an electronic device provided in an embodiment of the present application.
[0025] Figure 8 It is a schematic diagram of the composition structure of another electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present application.
[0027] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0028] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0029] In the embodiments of the present application, the term "and / or" is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, object A and / or object B may represent three situations: object A exists alone, object A and object B exist at the same time, and object B exists alone.
[0030] In addition, in the embodiments of the present application, “plurality” means two or more than two, unless otherwise clearly and specifically defined.
[0031] The front-end architecture adopted by related technologies in information technology scenarios such as smart campuses is mainly the micro-front-end architecture, which is similar to the micro-service architecture. Both transform applications from a single monolithic application to multiple small sub-applications. The difference between the two is that the micro-service architecture is mainly used for decoupling, which can decouple the dependencies between different applications; while the micro-front-end architecture is mainly used on the browser side, which can disassemble Internet (Web) applications, so that different applications can be independent of each other and aggregated, and finally form a large system with loosely coupled and highly aggregated applications. In the application processing based on the micro-front-end architecture, developers can determine the script according to the sub-configuration files of multiple applications, and run the script through the command line to download dependencies, run applications, and package multiple applications.
[0032] With the rapid development of technology scenarios, campus application functions are becoming more diversified and customized. Different schools may have customized requirements for the same applications, functions, and processes, which leads to some problems in the construction and deployment of applications in different schools.
[0033] For example, when multiple applications are deployed in an aggregated mode, the school will split and transform the application functions based on user needs when implementing them. However, when multiple applications are enabled at the same time, the splitting and transformation of a single application will involve major changes to the technical architecture and other applications, and when making changes, you need to be familiar with other applications to modify their configuration files, which makes application transformation difficult and prone to problems.
[0034] For example, when multiple applications are deployed in independent mode, scripts need to be run through multiple command lines, which results in application dispersion, increased resource consumption, and increased usage, maintenance, and upgrade costs on the user side.
[0035] Based on this, the embodiment of the present application provides an application processing method, which can deploy a global configuration file of at least two applications, the global configuration file includes an operation mode, and the operation mode is associated with the needs of the user; according to the global configuration file, the target script of at least two applications is determined; the target script is run through a preset command line to uniformly process at least two applications. In this way, on the one hand, since the operation mode is deployed based on the needs of the user, the splitting and transformation of a single application can be avoided, greatly reducing the difficulty of application transformation; on the other hand, a script (i.e., a target script) for unified operation can be generated based on the global configuration file of at least two applications, and the target script can be run through a command line (i.e., a preset command line), so as not to cause the dispersion of at least two applications, and can effectively reduce redundant code, reduce workload, and reduce code error rate and resource consumption.
[0036] To facilitate understanding of the technical solutions of the embodiments of the present application, the technical solutions of the present application are described in detail below through specific embodiments. The above related technologies can be combined arbitrarily with the technical solutions of the embodiments of the present application as optional solutions, and they all belong to the protection scope of the embodiments of the present application. The embodiments of the present application include at least part of the following contents.
[0037] In one embodiment of the present application, Figure 1 is a flowchart of an application processing method provided by an embodiment of the present application. Figure 1 As shown, the method may include the following steps.
[0038] S110. Deploy global configuration files of at least two applications, where the global configuration files include operation modes, and the operation modes are associated with user requirements.
[0039] It should be noted that the types of applications will vary in different information technology scenarios.
[0040] For example, in a smart campus scenario, at least two applications may be at least two of home-school interaction, campus security, and interactive classrooms.
[0041] For example, in a smart hospital scenario, at least two applications may be at least two of doctor-patient interaction, convenient registration, and department query.
[0042] It should be understood that each application generally has its own sub-configuration file, and the global configuration file of at least two applications can be understood as the at least two applications as a whole share the same configuration file (ie, the global configuration file).
[0043] It should be noted that, when the operating mode of at least two applications is the aggregation mode, the at least two applications can be considered to be deployed as a whole; when the operating mode of at least two applications is the independent mode, the at least two applications can be considered to be deployed as individuals (i.e., deployed separately).
[0044] It should also be understood that the operating modes of the at least two applications are associated with the needs of the user. It can be understood that the user can determine the operating modes of the at least two applications based on his or her own needs.
[0045] Exemplarily, when the at least two applications provide convenient and unified access and operation and maintenance services to users as a whole, the operation modes of the at least two applications can be deployed as an aggregate mode.
[0046] Exemplarily, when the user requires the at least two applications to be independent of each other to facilitate the splitting and transformation of a single application, the running modes of the at least two applications can be deployed as independent modes.
[0047] Through this method, since the operating mode is deployed based on user needs, the splitting and transformation of a single application can be avoided, greatly reducing the difficulty of application transformation.
[0048] In some embodiments, deploying global configuration files of at least two applications may include: determining user needs, where the user needs represent the overall deployment of at least two applications; or, where the user needs represent the independent deployment of at least two applications; and deploying global configuration files of at least two applications based on the user needs.
[0049] Furthermore, the method may also include: when the user's needs represent the overall deployment of at least two applications, determining the operation mode deployment as the aggregate mode; or when the user's needs represent the independent deployment of at least two applications, determining the operation mode deployment as the independent mode.
[0050] For example, assuming there are three applications, namely, home-school interaction, campus security, and interactive classroom, when user needs indicate that the three applications need to be deployed as a whole, the operating modes of the three applications can be deployed as aggregate mode; when user needs indicate that the three applications need to be deployed independently, the operating modes of the three applications can be deployed as independent modes.
[0051] In some embodiments, the global configuration files of at least two applications may also include at least one of the following: package manager configuration, application port configuration, compilation tool configuration, project name, running application name, public output directory, and application deployment name. In the embodiments of the present application, the functions of the global configuration files of at least two applications may be as follows:
[0052] Package manager: can be used to manage the packaging of at least two applications to ensure that different developers can correctly run the at least two applications.
[0053] Exemplarily, the package manager may be a Node Package Manager (Npm).
[0054] Exemplarily, the package manager may be a Yet Another Resource Negotiator (Yarn) package manager.
[0055] It should be noted that in addition to the Npm package manager and Yarn package manager mentioned above, the package manager may also be other package managers, which is not limited in the embodiments of the present application.
[0056] It should also be noted that deploying the package manager configuration of at least two applications can be understood as selecting a suitable package manager for the at least two applications so as to manage the packaging of the at least two applications.
[0057] Application port: can be used to establish communication connection between at least two applications and other applications. In this case, the at least two applications can share the same application port as a whole. The at least two applications can exchange information with other applications through the application port. For example, the at least two applications can send information to other applications through the application port; for another example, the at least two applications can receive information from other applications through the application port.
[0058] It should be noted that deploying the application port configuration of at least two applications can be understood as selecting a suitable application port for the at least two applications so as to establish a communication connection with other applications.
[0059] Compilation tool: can be used to compile application programs of at least two applications to obtain executable compiled files.
[0060] Exemplarily, the compilation tool may be Webpack or other compilation tools, which is not limited in the embodiments of the present application.
[0061] It should be noted that deploying the compilation tool configuration of at least two applications can be understood as selecting a suitable compilation tool for the at least two applications so as to compile the application programs of the at least two applications.
[0062] Project name: may be called an application packaging name, which may be regarded as an identifier of at least two applications so as to distinguish the at least two applications as a whole from other applications.
[0063] Running application name: can also be regarded as the identification of the at least two applications, and is used to distinguish the at least two applications as a whole from other applications when the at least two applications are running.
[0064] Public output directory: It can also be called the unified package output location name, which can be used to provide routing information for the parent class management application. Through this public output directory, the routing information of at least two applications can be obtained.
[0065] Application deployment name: can also be regarded as an identifier of the at least two applications, and is used to distinguish the at least two applications as a whole from other applications when the at least two applications are deployed.
[0066] It should be noted that in some embodiments, the project name, the running application name, and the application deployment name may all be the same, partially the same, or not the same. Whether the project name, the running application name, and the application deployment name are the same needs to be determined in combination with actual conditions, and the embodiments of this application do not limit this.
[0067] For example, in order to facilitate developers' memory, the project name, running application name, and application deployment name may all be set to be the same.
[0068] Exemplarily, in order to further distinguish the identifiers of at least two applications in different scenarios (such as deploying an application and running an application), the project name, the running application name, and the application deployment name may all be set to be different.
[0069] For example, in order to facilitate the operation of developers, there may be no restriction on whether the project name, running application name, and application deployment name are the same. For example, developers may randomly set the project name, running application name, and application deployment name to be partially the same.
[0070] S120. Determine target scripts of at least two applications according to the global configuration file.
[0071] Illustratively, the target script may be a development script.
[0072] Exemplarily, the target script may be a production script.
[0073] It should be noted that determining the target script of at least two applications can be understood as determining a script (ie, the target script) of the at least two applications as a whole.
[0074] In some embodiments, determining target scripts of at least two applications according to a global configuration file may include: determining configuration parameters of the target script according to the global configuration file; and determining the target script according to the configuration parameters of the target script.
[0075] Exemplarily, when the target script is a development script, the development script may be micro.dev.js. The development script micro.dev.js has a configuration parameter [--mode], which may be determined according to a global configuration file, thereby obtaining development scripts of at least two applications.
[0076] Exemplarily, when the target script is a production script, the production script may be micro.production.js. The production script micro.production.js has a configuration parameter [--mode], which may be determined according to a global configuration file, thereby obtaining production scripts for at least two applications.
[0077] It should be noted that, by determining the configuration parameters of the target script according to the global configuration file, the configuration parameters of the target script matching the global configuration file can be obtained, and when the target script is subsequently obtained based on the configuration parameters of the target script, the target script can be considered as a script of at least two applications. That is, at this time, the target script matches at least two applications.
[0078] S130: Run the target script through a preset command line to uniformly process at least two applications.
[0079] Exemplarily, if the development script is micro.dev.js and its configuration parameter is [--mode], the preset command line is node.microFront / micro.dev.js[--mode]. The development script micro.dev.js can be run through the preset command line, so that at least two applications can be processed uniformly.
[0080] Exemplarily, if the production script is micro.production.js and its configuration parameter is [--mode], the preset command line is node.microFront / micro.production.js[--mode]. The production script micro.production.js can be run through the preset command line, so that at least two applications can be processed uniformly.
[0081] In an embodiment of the present application, the application processing method is applied to a micro-frontend architecture. Among them, the micro-frontend architecture involves multiple micro-frontend applications, each of which can be independent of other applications, that is, each application can work without other applications. On this basis, each application has its own dependencies. In this way, when the operating mode is an aggregation mode, there may be different versions of dependencies between at least two applications, which may cause a large amount of dependency redundancy, resulting in the dependency tree between at least two applications becoming more and more complex.
[0082] Based on this, in some embodiments, when the running mode is the aggregation mode, running the target script through a preset command line may include: if there are different versions of dependencies between at least two applications, extracting a version of the dependency from the different versions of the dependencies as the target dependency.
[0083] In some embodiments, the method may further include: downloading target dependencies.
[0084] It should be noted that when extracting a version of a dependency from dependencies of different versions as a target dependency, the version of the target dependency can be the highest version among all versions, the second highest version among all versions, or other versions among all versions, and the embodiments of the present application are not limited to this.
[0085] Through this method, when the running mode is the aggregation mode, if there are different versions of dependencies between at least two applications, a version of the dependency can be extracted from the different versions of the dependencies as the target dependency by running the target script through a preset command line, thereby avoiding a large amount of dependency redundancy between at least two applications and further simplifying the dependency tree between at least two applications.
[0086] In an embodiment of the present application, when the operation mode is the aggregation mode, at least two applications are deployed as a whole. At this time, it may be difficult to find the routing information of one of the at least two applications, thereby affecting the separate configuration of the one application.
[0087] Based on this, in some embodiments, when the running mode is the aggregation mode, running the target script through the preset command line may include: the global configuration file also includes a common output directory, and the routing information of at least two applications is determined according to the common output directory.
[0088] In some embodiments, the method may further include: extracting routing information of at least two applications respectively.
[0089] It should be noted that, when the global configuration file also includes a public output directory, the public output directory can be used as parent routing information, and the routing information of at least two applications can be used as child routing information. Based on the parent routing information, the routing information of at least two applications can be obtained (i.e., child routing information), so that the public output directory can be used to provide parent class management services for the routing information of at least two applications.
[0090] In some embodiments, determining the routing information of at least two applications according to the common output directory may include: determining the routing information of at least two applications according to the common output directory and the sub-project names of the at least two applications.
[0091] The routing information of at least two applications can be considered as adding the sub-project names of at least two applications after the common output directory. In other words, the routing information of at least two applications can be considered as adding the sub-project names of at least two applications after the parent class routing information. In other words, the sub-project names of at least two applications can be mixed into the parent class management service as nested routes to obtain the routing information of at least two applications.
[0092] For example, suppose there are two applications, the sub-project names of the two applications are recorded as A1 and A2 respectively, and the public output directory is recorded as B. At this time, the routing information of the two applications can be obtained as B+A1 and B+A2 respectively.
[0093] For example, Figure 2 As shown, it is assumed that the project names of at least two applications are smart campus parent applications, and the public output directory is the routing information of the smart campus parent application. It is assumed that there are three applications, and the sub-project names of the three applications are home-school interaction, campus security, and interactive classroom; among them, home-school interaction can include an outbox, homework, notification, and grade delivery, campus security can include electronic fences, student attendance, campus monitoring, and remote class inspections, and interactive classrooms can include interactive answering and micro-campus.
[0094] In the single sign-on module, users enter information into the three option boxes of "Please enter user name", "Please enter password" and "Login". If the information entered is correct, they can click the "Login" box to obtain the routing information of the smart campus parent application (which users usually cannot perceive). Thus, they can enter the visual interface of the smart campus parent application through the routing information of the smart campus parent application.
[0095] In the routing management module, ID 1, ID 2, and ID 3 are the IDs of the sub-project names of the three applications of home-school interaction, campus security, and interactive classroom. After entering the visual interface of the smart campus parent application, you can get the routing information of one of the applications (usually not perceived by the user) by clicking one of the "Home-School Interaction" box, "Campus Security" box, and "Interactive Classroom" box. At this time, the routing information of one of the applications is equivalent to adding the sub-project name of one of the applications after the routing information of the smart campus parent application (i.e., the public output directory). Based on this, you can enter the visual interface of one of the applications through the routing information of the application.
[0096] For example, after entering the visual interface of the parent application of Smart Campus, you can click the "Home-School Interaction" box to get the routing information of the home-school interaction. At this time, the routing information of the home-school interaction is equivalent to adding the name of the sub-project of home-school interaction after the routing information of the parent application of Smart Campus (i.e., the public output directory). Based on this, you can enter the visual interface of home-school interaction through the routing information of home-school interaction, so that users can see the outbox, homework, notifications and grades in the home-school interaction interface.
[0097] Through this method, when the operating mode is the aggregation mode, the routing information of at least two applications can be obtained based on the common output directory, so that the specific locations of the at least two applications can be found based on the routing information of the at least two applications, and then one of the at least two applications can be configured separately.
[0098] Based on the foregoing embodiment, when the operation mode is the aggregation mode, running the target script through a preset command line also includes executing at least one of the following:
[0099] If there are different versions of dependencies between at least two applications, extract one version of the dependency from the different versions of the dependencies as the target dependency, and download the target dependency;
[0100] According to the common output directory, respective routing information of at least two applications is determined, and respective routing information of at least two applications is extracted.
[0101] Through this method, when the running mode is the aggregation mode, the target script is run through the preset command line. On the one hand, when there are different versions of dependencies between at least two applications, one version of the dependency can be extracted from the different versions of the dependencies as the target dependency, thereby avoiding a large amount of dependency redundancy between the at least two applications, and further simplifying the dependency tree between the at least two applications; on the other hand, based on the common output directory, the routing information of the at least two applications can be obtained, thereby the specific location of the at least two applications, so as to configure one of the at least two applications separately.
[0102] In an embodiment of the present application, when the operation mode is the independent mode, after running the target script through the preset command line, if keyword anomalies or other abnormal situations occur in at least two applications, the subsequent use of at least two applications will be affected.
[0103] Based on this, in some embodiments, when the running mode is the independent mode, after running the target script through a preset command line, the method may further include: monitoring the logs of at least two applications through a Shell script.
[0104] It should be noted that monitoring the respective logs of at least two applications through the Shell script may include: monitoring the respective logs of at least two applications based on the application port through the Shell script.
[0105] Through this method, when the running mode is independent mode, after running the target script through the preset command line, the logs of at least two applications can be monitored through the Shell script, so that when keyword anomalies or other abnormal situations occur, corresponding actions or alarm operations can be triggered and notified to email contacts.
[0106] In the related art, when the running mode is independent mode, after running the target script through the preset command line, if the package manager is used to package at least two applications in sequence, the packaging order of the at least two applications is chaotic, which will reduce the packaging efficiency of the at least two applications.
[0107] Based on this, in some embodiments, when the running mode is the independent mode, after running the target script through a preset command line, the method may further include: determining a packaging order of the at least two applications.
[0108] For example, assuming there are two applications, which are respectively recorded as application 1 and application 2, it can be determined that the packaging order of application 1 is first and the packaging order of application 2 is later; or, it can be determined that the packaging order of application 2 is first and the packaging order of application 1 is later.
[0109] In some embodiments, determining the packaging order of the at least two applications may include: determining the packaging order of the at least two applications by using a microservice stack.
[0110] Through this method, when the running mode is independent mode, after running the target script through a preset command line, the packaging order of at least two applications can be determined, so that when the at least two applications are packaged in sequence using a package manager later, the packaging efficiency of the at least two applications can be improved.
[0111] Based on the foregoing embodiment, when the running mode is the independent mode, after running the target script through the preset command line, the method may further include: monitoring the logs of at least two applications through a Shell script; and / or determining the packaging order of at least two applications.
[0112] Through this method, when the running mode is the independent mode, after running the target script through the preset command line, on the one hand, the logs of at least two applications can be monitored through the Shell script, so that corresponding actions or alarm operations can be triggered when keyword exceptions or other abnormal situations occur; on the other hand, the packaging order of at least two applications can be determined, so that when the at least two applications are packaged in sequence using the package manager later, the packaging efficiency of the at least two applications can be improved.
[0113] Based on S120 and S130, when the running mode of at least two applications is an independent mode, after a unified running script (i.e., a target script) is generated based on the global configuration files of the at least two applications, the target script is run through a command line (i.e., a preset command line). This will not cause the at least two applications to be dispersed, and can also obtain the results that originally required a large amount of code or repeated execution to obtain, thereby effectively reducing redundant code, alleviating workload, and reducing code error rate and resource consumption.
[0114] The embodiment of the present application provides an application processing method, which can deploy a global configuration file of at least two applications, the global configuration file includes an operation mode, and the operation mode is associated with the needs of the user; according to the global configuration file, the target script of at least two applications is determined; the target script is run through a preset command line to uniformly process at least two applications. In this way, on the one hand, since the operation mode is deployed based on the needs of the user, the splitting and transformation of a single application can be avoided, greatly reducing the difficulty of application transformation; on the other hand, a script (i.e., a target script) for unified operation can be generated based on the global configuration file of at least two applications, and the target script can be run through a command line (i.e., a preset command line), so as not to cause the dispersion of at least two applications, and can effectively reduce redundant code, reduce workload, and reduce code error rate and resource consumption.
[0115] In the related art, when the running mode is independent mode, at least two applications are deployed separately. When it is determined that at least two applications are running correctly, it is necessary to run the script through multiple command lines, which leads to the dispersion of applications, increased resource consumption, and increased usage, maintenance and upgrade costs on the user side.
[0116] In another embodiment of the present application, based on the application processing method of the aforementioned embodiment, the embodiment of the present application can run the development script through a command line (i.e., a preset command line) when the target script is a development script, regardless of whether the running mode is an aggregation mode or an independent mode, to ensure that at least two applications run correctly, thereby not causing the dispersion of the at least two applications, and can effectively reduce redundant code, reduce development workload, and reduce code error rate and resource consumption.
[0117] Figure 3 FIG. 1 is a flow chart of another application processing method provided in an embodiment of the present application. Figure 3 As shown, when the target script is a development script, running the target script through a preset command line to uniformly process at least two applications may include the following steps:
[0118] S310: Determine whether the operation mode of at least two applications is an aggregation mode.
[0119] If so, it means that the operation mode of at least two applications is the aggregation mode, and S320 is executed; if not, it means that the operation mode of at least two applications is the independent mode, and S330 is executed.
[0120] S320: When the operation mode is the aggregation mode, run the development script through a preset command line to simultaneously determine that at least two applications are running correctly.
[0121] It should be noted that when the operation mode is the aggregation mode, at least two applications are deployed in an integrated manner, so that after running the development script through a preset command line, it can be determined at the same time that at least two applications are running correctly.
[0122] It should also be noted that when the operation mode is the aggregation mode, if at least two applications are found to have problems when running the development script through the preset command line, after troubleshooting and solving the problem, the modified development script is run again through the preset command line. The above steps are repeated until at least two applications are determined to be running correctly.
[0123] S330: When the running mode is the independent mode, run the development script through a preset command line to sequentially determine whether at least two applications run correctly.
[0124] It should be noted that when the running mode is the independent mode, at least two applications are deployed independently, so that after running the development script through the preset command line, it can be determined in turn that at least two applications are running correctly.
[0125] It should also be noted that when the running mode is independent mode, if at least two applications are found to have problems when running the development script through the preset command line, after troubleshooting and solving the problems, the modified development script is run again through the preset command line. The above steps are executed repeatedly until at least two applications are determined to be running correctly.
[0126] It should also be noted that the difference between simultaneously determining that at least two applications are running correctly and sequentially determining that at least two applications are running correctly is that: simultaneously determining that at least two applications are running correctly can be understood as that the at least two applications are running correctly at the same time; sequentially determining that at least two applications are running correctly can be understood as that the at least two applications are running correctly at different times, that is, according to the running order of the at least two applications, first determine that the first application is running correctly, then determine that the second application is running correctly…, and so on, until it is determined that the last application of the at least two applications is running correctly.
[0127] In some embodiments, running a development script through a preset command line may include: determining an Internet Protocol (IP) address of the development script through a preset command line, and then running the development script based on the IP address of the development script.
[0128] In some embodiments, by running the development script through a preset command line, a set of configuration files for at least two applications can be obtained.
[0129] The configuration file set may include at least one of the following: a package manager set configuration, an application port set configuration, a compilation tool set configuration, a project name set, a running application name set, a public output directory set, and an application deployment name set.
[0130] Combine the following Figure 4 The provided micro-frontend system architecture briefly describes the relationship between the global configuration file, the configuration file set, and the respective sub-configuration files of application 1 and application 2 mentioned in the embodiment of the present application, when at least two applications include application 1 and application 2.
[0131] It should be noted that, when the operation mode is the aggregation mode, since application 1 and application 2 are deployed as a whole, the development script is run through the preset command line (i.e., run in a unified portal), and the configuration file set obtained is the configuration file of application 1 and application 2 as a whole. At this time, the configuration file set can be the global configuration file mentioned in the above embodiment, or it can be a configuration file set different from the global configuration file, which is not limited in the embodiment of the present application.
[0132] It should also be noted that, when the operation mode is the aggregation mode, for each sub-configuration file of application 1 and application 2, the sub-configuration file can be distinguished from the global configuration file and the configuration file set.
[0133] The sub-configuration file may include at least one of the following: sub-package manager configuration, sub-application port configuration, sub-compilation tool configuration, sub-project name, sub-running application name, sub-public output directory, and sub-application deployment name.
[0134] Exemplarily, when the operation mode is the aggregation mode, for the application port, the number of application ports in the global configuration file and the configuration file set is one, while application 1 and application 2 in the sub-configuration file each have one application port.
[0135] It should be noted that when the running mode is independent mode, since application 1 and application 2 are independently deployed, the development script is run through the preset command line (i.e., run through the unified entry), and the configuration file set obtained is a set of configuration files of application 1 and application 2. At this time, the configuration file set can be distinguished from the global configuration file mentioned in the above embodiment.
[0136] Exemplarily, when the running mode is the independent mode, for the application port, the number of the application port in the global configuration file is one, while the application 1 and the application 2 in the configuration file set each have one application port.
[0137] It should also be noted that when the operating mode is independent mode, the configuration file set can be a sub-configuration file of application 1 and application 2 respectively, or a configuration file set that is different from the sub-configuration files of application 1 and application 2 respectively. This embodiment of the present application is not limited to this.
[0138] Regarding the meaning of each item in the configuration file set and the sub-configuration file, reference may be made to the meaning of each item in the global configuration file in the aforementioned embodiment, and the embodiment of the present application will not be repeated here.
[0139] The embodiment of the present application provides an application processing method, when the target script is a development script, it can determine whether the operation mode of at least two applications is an aggregation mode; when the operation mode is the aggregation mode, the development script is run through a preset command line to simultaneously determine that at least two applications are running correctly; when the operation mode is an independent mode, the development script is run through a preset command line to sequentially determine that at least two applications are running correctly. In this way, when the target script is a development script, regardless of whether the operation mode is an aggregation mode or an independent mode, the development script can be run through a command line (i.e., a preset command line) to determine that at least two applications are running correctly, thereby not causing the dispersion of the at least two applications, and can effectively reduce redundant code, reduce development workload, and reduce code error rate and resource consumption.
[0140] In the related art, when the running mode is independent mode, at least two applications are deployed separately. When packaging at least two applications, it is necessary to run scripts through multiple command lines, which leads to application dispersion, increased resource consumption, and increased usage, maintenance and upgrade costs on the user side.
[0141] In another embodiment of the present application, based on the application processing method of the aforementioned embodiment, the embodiment of the present application can run the production script through a command line (i.e., a preset command line) when the target script is a production script, regardless of whether the running mode is an aggregation mode or an independent mode, to package at least two applications, thereby not causing the at least two applications to be dispersed, and can effectively reduce redundant code, reduce development workload, and reduce code error rate and resource consumption.
[0142] Figure 5 FIG. 1 is a flow chart of another application processing method provided in an embodiment of the present application. Figure 5 As shown, when the target script is a production script, running the target script through a preset command line to uniformly process at least two applications may include the following steps:
[0143] S510: Determine whether the operation mode of at least two applications is an aggregation mode.
[0144] If so, it means that the operation mode of at least two applications is the aggregation mode, and S520 is executed; if not, it means that the operation mode of at least two applications is the independent mode, and S530 is executed.
[0145] S520: When the operation mode is the aggregation mode, run the production script through a preset command line to package at least two applications at a time.
[0146] It should be noted that when the operation mode is the aggregation mode, at least two applications are deployed in an integrated manner, so that after the production script is run through a preset command line, at least two applications can be packaged at a time.
[0147] It should also be noted that when the operation mode is the aggregation mode, when running the production script through the preset command line, if a problem is found when packaging at least two applications at a time, after troubleshooting and solving the problem, run the modified production script again through the preset command line. The above steps are repeated until at least two applications are successfully packaged at a time.
[0148] S530: When the running mode is the independent mode, run the production script through a preset command line to package at least two applications in sequence.
[0149] It should be noted that when the running mode is the independent mode, at least two applications are deployed independently, so that after the production script is run through the preset command line, the at least two applications can be packaged in sequence.
[0150] It should also be noted that when the operation mode is independent mode, when running the production script through the preset command line, if a problem is found when packaging at least two applications in sequence, after troubleshooting and solving the problem, run the modified production script again through the preset command line. The above steps are repeated until at least two applications are successfully packaged in sequence.
[0151] It should also be noted that the difference between packaging at least two applications at a time and packaging at least two applications sequentially is that packaging at least two applications at a time can be understood as packaging the at least two applications once at the same time; packaging at least two applications sequentially can be understood as packaging the at least two applications multiple times at different times, that is, according to the packaging order of the at least two applications, the first application is packaged first, then the second application is packaged..., and so on, until the last application of the at least two applications is packaged.
[0152] Based on S520 and S530, in some embodiments, the method may further include: after packaging at least two applications at a time, using the target function to customize an application package obtained; or, after packaging at least two applications in sequence, using the target function to customize at least two application packages obtained.
[0153] Exemplarily, the target function may be a hook function.
[0154] It should be noted that the customized processing may be encryption processing or other processing, which is not limited in the embodiments of the present application.
[0155] Exemplarily, when the target function is a hook function, using the target function to perform customized processing on an obtained application package may include: using the hook function to perform encryption processing on the obtained application package.
[0156] In some embodiments, running the production script through a preset command line may include: determining the IP address of the production script through the preset command line, and then running the production script based on the IP address of the production script.
[0157] In the embodiment of the present application, the global configuration file may also include a command for running a target script.
[0158] The target script can be Figure 3 The development script mentioned can also be Figure 5 Mentioned production script.
[0159] In some embodiments, the command for running the target script may be a preset command line.
[0160] The embodiment of the present application provides an application processing method. When the target script is a production script, it can be determined whether the operation mode of at least two applications is an aggregation mode; when the operation mode is the aggregation mode, the production script is run through a preset command line to package at least two applications at a time; when the operation mode is the independent mode, the production script is run through a preset command line to package at least two applications in sequence. In this way, when the target script is a production script, regardless of whether the operation mode is the aggregation mode or the independent mode, the production script can be run through a command line (i.e., a preset command line) to package at least two applications, thereby not causing the dispersion of the at least two applications, and can effectively reduce redundant code, reduce development workload, and reduce code error rate and resource consumption.
[0161] In another embodiment of the present application, based on the application processing method of the aforementioned embodiment, the embodiment of the present application relates to the field of network support technology, and in particular, to an implementation method for sharing a low-redundancy, performance-optimized micro-front-end architecture in multiple application systems, and the micro-front-end architecture in the embodiment of the present application is a micro-front-end architecture that supports loose coupling and optimizes performance.
[0162] The embodiment of the present application provides a solution to simplify the development and deployment of micro-frontends. It can cutover and deploy independent application packages (sequential packaging of at least two applications in independent mode), package custom function aggregation packages (single packaging of at least two applications in aggregation mode), and minimize the operation mode of custom function modules in development. The micro-frontend architecture can solve the following problems:
[0163] (1) A unified configuration file (i.e., a global configuration file) can be used, where the global configuration file may include package manager configuration, application port configuration, compilation tool configuration, project name, running application name, public output directory, and application deployment name.
[0164] (2) According to the configuration file, the development mode script can be unified, and a single command (i.e., preset command line) can be used to run single / multiple micro-applications (the development script is run through the preset command line to ensure that at least two applications run correctly). The operation mode can be divided into custom combined sub-module aggregation operation (i.e., aggregation mode) and custom sub-module independent operation (i.e., independent mode).
[0165] (3) According to the configuration file, the production mode script can be unified, and one command (i.e., the preset command line) can be used to run single / multiple packaging (run the production script through the preset command line to package at least two applications). Unified file location output (i.e., the global configuration file includes a public output directory) can achieve low-coupling independent deployment and low-coupling unified deployment.
[0166] In scenarios such as smart campuses, the embodiments of the present application can develop multiple applications in parallel. According to development, testing, customer needs, etc., different applications need to be developed / packaged multiple times. Through a low-redundancy, simplified micro-front-end development and deployment operation, two operating modes, aggregation mode and independent mode, can be implemented, which effectively reduces redundant code, reduces development workload, reduces error rate, and can select specific module code according to actual needs.
[0167] The technical solution provided in the embodiment of the present application may mainly include the following three parts:
[0168] (1) Public configuration file (i.e. global configuration file)
[0169] For example, in a smart campus scenario, Figure 2 As shown, it generally includes many types of applications such as home-school interaction, campus security, and interactive classrooms.
[0170] During the development process, when you need to package one or more applications, you only need to define the package manager configuration, application port configuration, compilation tool configuration, project name, running application name, public output directory, and application deployment name in the global configuration file micro.config.js in the execution script (i.e., target script).
[0171] The operation mode can be an aggregation mode with a mode configuration value of aggregation; the operation mode can also be an independent mode with a mode configuration value of independent.
[0172] It should be noted that each application file has different dependency locks, and the two package management tools Npm and Yarn can be freely configured to ensure that different developers can run the scripts correctly.
[0173] It should also be noted that, taking the smart campus scenario as an example, in application development, when a single application is used in an interactive classroom or multiple applications such as an interactive classroom and home-school interaction are packaged and run, you can combine the configurations in the Runproject field of the configuration file, including the application startup port (i.e., application port configuration), application package name (i.e., project name), and private Webpack configuration (i.e., compilation tool configuration), and search for the corresponding application based on the configuration to run the application.
[0174] (2) Unified running script (i.e. target script)
[0175] On the one hand, according to the global configuration file, in aggregation mode, that is, the mode configuration value is aggregation, the detailed configuration of each campus application in the Runproject field can be collected, the mixed-in module dependencies can be extracted in turn, the extracted configurations can be managed uniformly, and they can be downloaded uniformly according to the dependency mixing method, and the project name can be mixed into the parent class management service as a nested route.
[0176] On the other hand, according to the global configuration file, in independent mode, that is, the mode configuration value is independent, the configured ports are written to the application in sequence. By monitoring the Shell script log, the microservice uses the stack to download the dependencies and execute the packaging statements in sequence according to the speed of network download dependencies and the hardware running the resources. The access of each project is managed by the port and private route in the global configuration file and uniformly output to the public output directory according to the project name.
[0177] Depending on the running mode, the running script may include:
[0178] i. Run the script in development mode: In the project, micro.dev.js is a script in development mode. Run the command node.microFront / micro.dev.js[--mode] in the project root directory, where mode is the configurable parameter mode value (i.e. configuration parameter).
[0179] ii. Run the script in production mode: In the project, micro.production.js is the script in production mode. Run the command node.microFront / micro.production.js[--mode] in the project root directory, where mode is the configurable parameter mode value (i.e. configuration parameter).
[0180] (3) Unified entrance
[0181] After completing all configuration items for unified script operation, you can run the script in development / production mode through a command line (that is, run the target script through the preset command line) to obtain the results that originally required a large amount of code or repeated execution. This simplifies the process and reduces the workload and error rate of developers.
[0182] In the embodiment of the present application, the micro-frontend architecture reads and writes the global configuration file, extracts and mixes the running module hook functions, customizes the project running script (i.e., the target script), and can run in aggregate mode or independent mode.
[0183] The embodiment of the present application proposes a method for unifying the running entry, unifying the correct running of the application, and unifying the packaging of the application according to the global configuration file. The main technical solutions may include: executing single / multiple applications according to the global configuration file; running the production script through a command line to package the application and output it to a unified location (i.e., a public output directory); in independent mode, running the production script through a command line to package multiple applications in sequence and output them to a unified location (i.e., a public output directory).
[0184] When the application processing method provided in the embodiment of the present application deploys the operating modes of at least two applications based on user needs, the at least two applications can be integrated to provide users with convenient and unified access and operation and maintenance services, and can also be independent of each other to facilitate the splitting and transformation of a single application.
[0185] The technical solution provided in the embodiment of the present application realizes the switching of the two operating modes of aggregation mode and independent mode, and is suitable for large-scale scenarios with clear division of project modules. When handing over the project code, in order to reduce the occurrence of irrelevant errors in redundant code, some sub-module source codes can be given according to demand during delivery. And the micro-front-end architecture in the embodiment of the present application can be uniformly operated and packaged according to the custom application combination; in the development mode, each application is uniformly configured to reduce the blocking process due to the need to be familiar with the different configurations of other applications (such as redundant dependencies) during the development process; in the packaging and deployment link, combined packaging (i.e. single packaging) or multiple applications can be independently packaged (i.e. packaged in sequence) and uniformly managed online, reducing the number of online personnel repeating the same operation to deploy applications, simplifying operations, improving development efficiency, and reducing the error rate of personnel operation.
[0186] The preferred embodiments of the present application are described in detail above in conjunction with the accompanying drawings. However, the present application is not limited to the specific details in the above embodiments. Within the technical concept of the present application, the technical solution of the present application can be subjected to a variety of simple modifications, and these simple modifications all belong to the protection scope of the present application. For example, the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present application will not further explain various possible combinations. For another example, the various different embodiments of the present application can also be arbitrarily combined, as long as they do not violate the idea of the present application, they should also be regarded as the contents disclosed in the present application. For another example, under the premise of no conflict, the various embodiments and / or the technical features in the various embodiments described in the present application can be arbitrarily combined with the prior art, and the technical solution obtained after the combination should also fall within the protection scope of the present application.
[0187] It should also be understood that in the various method embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0188] In yet another embodiment of the present application, based on the same inventive concept as the above embodiment, see Figure 6 , which shows a schematic diagram of the composition structure of the application processing device provided in the embodiment of the present application. Figure 6 As shown, the application processing device 600 may include a deployment unit 610, a determination unit 620 and an operation unit 630, wherein:
[0189] A deployment unit 610 is configured to deploy global configuration files of at least two applications, where the global configuration files include operation modes, and the operation modes are associated with user requirements;
[0190] A determination unit 620 is configured to determine target scripts of at least two applications according to a global configuration file;
[0191] The running unit 630 is configured to run the target script through a preset command line to uniformly process at least two applications.
[0192] In some embodiments, the determination unit 620 is further configured to determine the needs of the user, where the needs of the user represent the overall deployment of at least two applications; or, the needs of the user represent the independent deployment of at least two applications; the deployment unit 610 is further configured to deploy global configuration files of at least two applications according to the needs of the user.
[0193] In some embodiments, the determination unit 620 is further configured to determine that the operation mode is deployed as an aggregate mode when the user's needs represent the overall deployment of at least two applications; or to determine that the operation mode is deployed as an independent mode when the user's needs represent the independent deployment of at least two applications.
[0194] In some embodiments, the global configuration file also includes at least one of the following: package manager configuration, application port configuration, compilation tool configuration, project name, running application name, public output directory, and application deployment name.
[0195] In some embodiments, the target script is a development script; the running unit 630 is further configured to run the development script through a preset command line when the running mode is an aggregation mode, so as to simultaneously determine that at least two applications are running correctly; or, when the running mode is an independent mode, run the development script through a preset command line to sequentially determine that at least two applications are running correctly.
[0196] In some embodiments, the target script is a production script; the running unit 630 is further configured to run the production script through a preset command line to package at least two applications at a time when the running mode is an aggregation mode; or, when the running mode is an independent mode, run the production script through a preset command line to package at least two applications in sequence.
[0197] In some embodiments, Figure 6 As shown, the apparatus 600 may further include a customization unit 640, wherein:
[0198] The customization unit 640 is configured to customize an application package obtained by using the target function after packaging the at least two applications once; or, after packaging the at least two applications in sequence, customize the at least two application packages obtained by using the target function.
[0199] In some embodiments, Figure 6 As shown, the apparatus 600 may further include an extraction unit 650, wherein:
[0200] When the operation mode is the aggregation mode, the extraction unit 650 is configured to extract a version of dependency from the dependencies of different versions as the target dependency if there are dependencies of different versions between at least two applications;
[0201] The determining unit 620 is further configured such that the global configuration file also includes a common output directory, and the respective routing information of at least two applications is determined according to the common output directory.
[0202] In some embodiments, Figure 6 As shown, the apparatus 600 may further include a monitoring unit 660, wherein:
[0203] When the operation mode is the independent mode, the monitoring unit 660 is configured to monitor the logs of at least two applications through a Shell script; and / or,
[0204] The determining unit 620 is further configured to determine a packaging order of at least two applications.
[0205] In some embodiments, the determination unit 620 is further configured to determine configuration parameters of the target script according to the global configuration file; and determine the target script according to the configuration parameters of the target script.
[0206] It can be understood that in this embodiment, a "unit" can be a part of a processor, a part of a program or software, etc., and of course, it can also be a module, or it can be non-modular. Moreover, the components in this embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional module.
[0207] If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0208] Therefore, this embodiment provides a computer storage medium, which stores a computer program. When the computer program is executed by at least one processor, the steps of the method described in any one of the above embodiments are implemented.
[0209] Based on the composition of the above-mentioned application processing device 600 and the computer storage medium, see Figure 7 , which shows a schematic diagram of the composition structure of an electronic device provided by an embodiment of the present application. Figure 7As shown, the electronic device 700 may include: a communication interface 710, a memory 720 and a processor 730; each component is coupled together via a bus system 740. It is understood that the bus system 740 is configured to achieve connection and communication between these components. In addition to the data bus, the bus system 740 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Figure 7 Various buses are labeled as bus system 740. Among them, the communication interface 710 is configured to receive and send signals during the process of sending and receiving information between other external devices or applications;
[0210] A memory 720 configured to store a computer program that can be executed on the processor 730;
[0211] The processor 730 is configured to execute, when running the computer program:
[0212] Deploy global configuration files of at least two applications, where the global configuration files include operation modes, and the operation modes are associated with user requirements;
[0213] According to the global configuration file, determine the target scripts of at least two applications;
[0214] A target script is run through a preset command line to uniformly process at least two applications.
[0215] It can be understood that the memory 720 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DRRAM). The memory 720 of the system and method described in the embodiments of the present application is intended to include but is not limited to these and any other suitable types of memory.
[0216] The processor 730 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 730. The above processor 730 may be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor to be executed, or the hardware and software modules in the decoding processor are combined and executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 720, and the processor 730 reads the information in the memory 720 and completes the steps of the above method in combination with its hardware.
[0217] It is understood that the embodiments described in the present application can be implemented by hardware, software, firmware, middleware, microcode or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in the present application or a combination thereof.
[0218] For software implementation, the technology described in this application can be implemented by a module (e.g., a procedure, a function, etc.) that performs the functions described in this application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0219] Optionally, as another embodiment, the processor 730 is further configured to execute the steps of the method described in any one of the aforementioned embodiments when running the computer program.
[0220] Based on the composition of the above-mentioned application processing device 600 and the computer storage medium, see Figure 8 , which shows a schematic diagram of the composition structure of another electronic device provided by an embodiment of the present application. Figure 8 As shown, the electronic device 700 may include the application processing device 600 described in any one of the aforementioned embodiments.
[0221] In an embodiment of the present application, a global configuration file of at least two applications can be deployed, the global configuration file includes an operation mode, and the operation mode is associated with the needs of the user; according to the global configuration file, the target script of at least two applications is determined; the target script is run through a preset command line to uniformly process at least two applications. In this way, on the one hand, since the operation mode is deployed based on the needs of the user, the splitting and transformation of a single application can be avoided, greatly reducing the difficulty of application transformation; on the other hand, a script (i.e., a target script) for unified operation can be generated based on the global configuration file of at least two applications, and the target script can be run through a command line (i.e., a preset command line), so as not to cause the dispersion of at least two applications, and can effectively reduce redundant code, reduce workload, and reduce code error rate and resource consumption.
[0222] It should be noted that, in this application, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0223] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0224] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0225] The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0226] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0227] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. An application processing method, characterized in that: The method comprises: Deploy global configuration files of at least two applications, wherein the global configuration files include operation modes, and the operation modes are associated with user needs; Determining target scripts of the at least two applications according to the global configuration file; The target script is run through a preset command line to uniformly process the at least two applications.
2. The method according to claim 1, characterized in that The global configuration files for deploying at least two applications include: Determining the needs of the user, wherein the needs of the user represent the overall deployment of the at least two applications; or, the needs of the user represent the independent deployment of the at least two applications; According to the needs of the user, global configuration files of the at least two applications are deployed.
3. The method according to claim 2, characterized in that The method further comprises: In the case where the user's demand represents the overall deployment of the at least two applications, determining that the operation mode is deployed as an aggregate mode; or, In the case where the user's demand indicates that the at least two applications are to be deployed independently, it is determined that the operation mode is deployed as an independent mode.
4. The method according to any one of claims 1 to 3, characterized in that The global configuration file also includes at least one of the following: Package manager configuration, application port configuration, compilation tool configuration, project name, running application name, public output directory, application deployment name.
5. The method according to claim 3, characterized in that: The target script is a development script; The step of running the target script through a preset command line to uniformly process the at least two applications includes: When the operation mode is the aggregation mode, running the development script through the preset command line to simultaneously determine that the at least two applications are running correctly; or, When the operation mode is the independent mode, the development script is run through the preset command line to sequentially determine whether the at least two applications are running correctly.
6. The method according to claim 3, characterized in that: The target script is a production script; The step of running the target script through a preset command line to uniformly process the at least two applications further includes: When the operation mode is the aggregation mode, running the production script through the preset command line to package the at least two applications at a time; or, When the running mode is the independent mode, the production script is run through the preset command line to package the at least two applications in sequence.
7. The method according to claim 6, characterized in that The method further comprises: After packaging the at least two applications once, using the target function to customize an application package obtained; or, After packaging the at least two applications in sequence, the target function is used to perform customized processing on the obtained at least two application packages.
8. The method according to claim 3, characterized in that When the operation mode is the aggregation mode, running the target script through a preset command line further includes executing at least one of the following: If there are dependencies of different versions between the at least two applications, extracting a version of the dependency from the dependencies of different versions as the target dependency; The global configuration file also includes a common output directory, and the routing information of each of the at least two applications is determined according to the common output directory.
9. The method according to claim 3, characterized in that: In the case where the operation mode is the independent mode, after running the target script through the preset command line, the method further includes: Monitoring the logs of the at least two applications through a Shell script; and / or, Determine a packaging order for each of the at least two applications.
10. An application processing device, characterized in that: The device comprises a deployment unit, a determination unit and an operation unit, wherein: The deployment unit is configured to deploy global configuration files of at least two applications, wherein the global configuration files include operation modes, and the operation modes are associated with user requirements; The determining unit is configured to determine target scripts of the at least two applications according to the global configuration file; The running unit is configured to run the target script through a preset command line to uniformly process the at least two applications.
11. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein: The memory is configured to store a computer program that can be executed on the processor; The processor is configured to execute the method according to any one of claims 1 to 9 when running the computer program.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by at least one processor, the method according to any one of claims 1 to 9 is implemented.