CN114546436A - Micro front-end service updating method and device, electronic equipment and storage medium - Google Patents

Micro front-end service updating method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114546436A
CN114546436A CN202111563732.8A CN202111563732A CN114546436A CN 114546436 A CN114546436 A CN 114546436A CN 202111563732 A CN202111563732 A CN 202111563732A CN 114546436 A CN114546436 A CN 114546436A
Authority
CN
China
Prior art keywords
service
sub
target file
file
updated
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111563732.8A
Other languages
Chinese (zh)
Inventor
冯淼森
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202111563732.8A priority Critical patent/CN114546436A/en
Publication of CN114546436A publication Critical patent/CN114546436A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

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

Abstract

The present disclosure relates to a method and an apparatus for updating a micro front-end service, an electronic device and a storage medium, including: responding to a development instruction of the sub-service, acquiring a target file, wherein the target file is a target file of the latest version of a main service to which the sub-service belongs, and the sub-service and the main service are services based on a micro front-end framework; acquiring configuration information of the sub-service, starting a webpage server of the sub-service according to the configuration information, and writing the configuration information into a target file to obtain an updated target file; and reading the updated target file, and starting the webpage server of the updated main service, wherein the updated main service comprises the sub-items. Therefore, after a development instruction is received, the target file of the main service can be automatically configured, a developer only needs to concentrate on development configuration and business development of the sub-service in the micro front-end application, and the micro front-end service can be automatically updated, so that the efficiency of local integrated development of the micro front-end is improved.

Description

Micro front-end service updating method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of application testing, and in particular, to a method and an apparatus for updating a micro front-end service, an electronic device, and a storage medium.
Background
The micro front-end application is formed by aggregating a plurality of front-end applications, wherein the front-end applications are independent from each other and do not interfere with each other. For a user, a micro front-end application is a complete application, but a plurality of front-end applications included in the micro front-end application are independent from each other in the development and test processes, and then are combined in a certain way to obtain the micro front-end application.
That is to say, in the development and test process, the micro front-end application is used as a main service, which includes sub-services corresponding to a plurality of front-end applications, and currently, a mainstream micro front-end framework in the front-end development industry can realize technology stack independence between sub-services, and support independent development and independent deployment of sub-services and runtime isolation of sub-services.
However, in the development process, a developer needs to download and start the main service server and the sub-service server locally, if the remote main service code warehouse is updated, the developer cannot sense the update in real time, the update needs to be manually performed, and the developer needs to manually modify the development configuration items of the main service and the sub-service to start the micro front-end development mode. Therefore, the whole process is complicated, the micro front end access development cost is high, the micro front end service is not convenient to update, and the development experience and efficiency are very low.
Disclosure of Invention
The present disclosure provides a micro front end service updating method, device, electronic device, and storage medium, to at least solve the problems of complex overall flow, high cost of micro front end access development, inconvenient micro front end service updating, and very low development experience and efficiency in the related art. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a micro front end service updating method applied to an electronic device, the method including:
responding to a development instruction of a sub-service, and acquiring a target file, wherein the target file is a file of a latest version used for operating a main service to which the sub-service belongs, and the sub-service and the main service are services based on a micro front-end framework;
acquiring configuration information of the sub-service, starting a webpage server of the sub-service according to the configuration information, and writing the configuration information into the target file to obtain an updated target file;
and reading the updated target file, and starting a webpage server of the updated main service, wherein the updated main service comprises the sub-service.
Optionally, the obtaining the target file in response to the development instruction for the sub-service includes:
responding to a development instruction of the sub-service, and acquiring the latest version information of a target file of the main service from a preset database;
judging whether the latest version information is consistent with the version information of the target file of the main service stored locally;
and if the two main services are inconsistent, acquiring the target file of the main service from the preset database, and updating the locally stored target file of the main service.
Optionally, if the latest version information is consistent with the version information of the target file of the main service stored locally, the method further includes:
and acquiring a target file of the main service stored locally.
Optionally, after the obtaining the target file, the method further includes:
acquiring an installation file of a dependent software package from the target file, downloading and installing the dependent software package according to the installation file, wherein the dependent software package is an external target file required by the main service;
the web server for reading the updated target file and starting the updated main service comprises:
and reading the updated target file, calling the dependent software package, and starting the updated webpage server of the main service.
Optionally, the writing the configuration information into the target file to obtain an updated target file includes:
generating a simulation file of the sub-service according to the configuration information;
inquiring whether the target file comprises a simulation file corresponding to the sub-service;
if yes, replacing the simulation file in the target file with the generated simulation file to obtain the updated target file;
and if not, adding the simulation file into the target file to obtain the updated target file.
Optionally, the web server that reads the updated target file and starts the updated main service includes:
reading a simulation file of at least one sub-service included in the updated target file to obtain configuration information of the at least one sub-service;
and starting the webpage server of the updated main service, and registering the at least one sub-service in the updated main service according to the configuration information of the at least one sub-service.
Optionally, the obtaining the configuration information of the sub-service includes:
creating a template file for the sub-service with a scaffold tool in response to the development instruction;
and responding to the editing instruction of the template file, and acquiring the configuration information of the sub-service.
According to a second aspect of the embodiments of the present disclosure, there is provided a micro front-end service update apparatus applied to an electronic device, the apparatus including:
the acquisition unit is configured to execute a development instruction responding to a sub-service, and acquire a target file, wherein the target file is a file of a latest version for running a main service to which the sub-service belongs, and the sub-service and the main service are services based on a micro front end framework;
the updating unit is configured to execute the steps of acquiring the configuration information of the sub-service, starting a webpage server of the sub-service according to the configuration information, and writing the configuration information into the target file to obtain an updated target file;
and the starting unit is configured to read the updated target file and start a webpage server of the updated main service, wherein the updated main service comprises the sub-service.
Optionally, the obtaining unit is configured to perform:
responding to a development instruction of the sub-service, and acquiring the latest version information of a target file of the main service from a preset database;
judging whether the latest version information is consistent with the version information of the target file of the main service stored locally;
and if the two main services are inconsistent, acquiring the target file of the main service from the preset database, and updating the target file of the main service which is locally stored.
Optionally, the obtaining unit is configured to perform:
and if the latest version information is consistent with the version information of the locally stored target file of the main service, acquiring the locally stored target file of the main service.
Optionally, the obtaining unit is configured to perform:
acquiring an installation file of a dependent software package from the target file, downloading and installing the dependent software package according to the installation file, wherein the dependent software package is an external file required by the main service;
the starting unit is configured to execute:
and reading the updated target file, calling the dependent software package, and starting the updated webpage server of the main service.
Optionally, the updating unit is configured to perform:
generating a simulation file of the sub-service according to the configuration information;
inquiring whether the target file comprises a simulation file corresponding to the sub-service;
if yes, replacing the simulation file in the target file with the generated simulation file to obtain the updated target file;
and if not, adding the simulation file into the target file to obtain the updated target file.
Optionally, the updating unit is configured to perform:
reading a simulation file of at least one sub-service included in the updated target file to obtain configuration information of the at least one sub-service;
and starting the webpage server of the updated main service, and registering the at least one sub-service in the updated main service according to the configuration information of the at least one sub-service.
Optionally, the updating unit is configured to perform:
creating a template file for the sub-service with a scaffold tool in response to the development instruction;
and responding to the editing instruction of the template file, and acquiring the configuration information of the sub-service.
According to a third aspect of the embodiments of the present disclosure, there is provided a micro front-end service update electronic device, including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the micro front-end service update method of the first item.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer readable storage medium, wherein instructions that, when executed by a processor of a micro front-end service update electronic device, enable the micro front-end service update electronic device to perform any one of the above-mentioned micro front-end service update methods.
According to a fifth aspect of the embodiments of the present disclosure, there is provided a computer program product comprising a computer program/instructions, which when executed by a processor, implement the micro front-end service updating method of the first item described above.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
the electronic equipment responds to the development instruction of the sub-service to obtain a target file, wherein the target file is a file of the latest version for operating the main service of the sub-service; acquiring configuration information of the sub-service, starting a webpage server of the sub-service according to the configuration information, and writing the configuration information into a target file to obtain an updated target file; and reading the updated target file, and starting the webpage server of the updated main service, wherein the updated main service comprises the sub-items.
That is to say, after receiving the development instruction, the target file of the main service can be automatically configured, so that a developer only needs to concentrate on development configuration and business development of the sub-service in the micro-front-end application, and does not need to care how the code of the main service corresponding to the sub-service is pulled, updated and configured, and the micro-front-end service can be automatically updated, thereby improving the efficiency of local integrated development of the micro-front-end.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a flow diagram illustrating a micro-front end service update method in accordance with an example embodiment.
Fig. 2 is a flowchart illustrating S101 of fig. 1 according to an exemplary embodiment.
Fig. 3 is a flowchart illustrating S102 of fig. 1 according to an example embodiment.
FIG. 4 is a block diagram illustrating a micro-front-end service update apparatus in accordance with an example embodiment.
FIG. 5 is a block diagram illustrating an electronic device for micro-front end service updates, according to an example embodiment.
FIG. 6 is a block diagram illustrating an apparatus for micro-front end service updates according to an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Fig. 1 is a flowchart illustrating a micro front-end service updating method according to an exemplary embodiment, where as shown in fig. 1, the micro front-end service updating method is applied to an electronic device, and specifically includes the following steps.
In step S101, in response to a development instruction for a sub-service, a target file is obtained, where the target file is a file of a latest version for running a main service to which the sub-service belongs, and the sub-service and the main service are both services based on a micro front-end framework.
In the disclosure, the electronic device may run a micro front-end application, the micro front-end application is composed of a plurality of front-end applications aggregated together, wherein the front-end applications are independent from each other and do not interfere with each other, the micro front-end application is used as a main service in a development and test process, the main service includes sub-services corresponding to the plurality of front-end applications, and developers may develop and test the sub-services corresponding to the individual front-end applications.
In this step, the target file is a file of the latest version for running the main service to which the sub-service belongs, and may be a code file or a compiled instruction file, which is not limited specifically. In one implementation, the target file may be directly obtained from the preset database, and in another implementation, the backup of the target file of the main service is stored locally, in which case the target file of the main service stored locally may be compared with the version of the target file in the preset database.
Specifically, as shown in fig. 2, a flowchart of S101 in an implementation manner includes the following steps:
s1011: and responding to the development instruction of the sub-service, and acquiring the latest version information of the target file of the main service from a preset database.
The preset database may be a git database, and the target file of the main service is stored in the git database. A target file of the main service is generally a package json file, and version information of the target file is generally a version field in the package json, and may be a version number composed of numbers, a date of version update, and the like, and is not limited specifically.
S1012: judging whether the latest version information is consistent with the version information of the target file of the main service stored locally, if not, executing S1013; if yes, go to step 1014.
S1013: and acquiring the target file of the main service from a preset database, and updating the target file of the main service stored locally. Therefore, the consistency of the latest version information of the target file is judged, the acquired target file can be ensured to be the latest version, and meanwhile, the target file stored locally can be timely and actively updated.
In one implementation, the target file of the locally stored main service is updated, the locally stored version may be modified according to a difference between the locally stored version and the version in the preset database, or the target file of the locally stored main service may be deleted under the condition that the latest version information is inconsistent with the version information of the target file of the locally stored main service, and then the target file of the locally stored main service is downloaded again from the preset database and backed up.
S1014: and acquiring a target file of the locally stored main service as a target file. Therefore, the number of times and the data volume of data pulling from the preset database can be reduced, and the occupation of system resources is reduced.
Therefore, the backup of the target file of the main service is stored locally, the frequency of acquiring the target file from the preset database can be reduced, the data transmission load is reduced, the efficiency is improved, the latest code of the micro front-end main service can be automatically pulled, the operation flow required by a developer is reduced, and the development efficiency is improved.
In the present disclosure, a micro front end development framework is used between the sub-service and the main service, such as a qiankun (heaven and earth) framework or a single-spa (single page web application) framework, and so on, and then a micro front end development scaffold tool needs to be installed locally in advance, and then a development instruction can be received, where the development instruction may carry a specific command function and a transfer parameter in the micro front end development scaffold tool, for example, a developer may send the development instruction by sequentially inputting the following contents: "ksc service-port 3000-force".
In one implementation, after the target file is obtained, the installation file of the dependent software package may be obtained from the target file, and the dependent software package may be downloaded and installed according to the installation file. The installation file may be a script file, or a general source code file, and is not particularly limited, for example, the installation file may be an npm install, an external file required by a dependent software package as a main service, and is usually in a package json file dependencies and devDependencies field, and the external file may be a code file or a compiled instruction file, and the like.
In this way, since the target file is the latest version of the file for running the main service, the dependent software package is also the latest external file required by the main service, and after the dependent software package is installed, the updated target file can be read, and the web server of the updated micro-front-end main service, that is, the web server for providing the main service, can be started by calling the dependent software package. In other words, automatic updating of the main service can be realized, and the efficiency of local integration development of the micro front end is improved.
In step S102, the configuration information of the sub-service is obtained, the web server of the sub-service is started according to the configuration information, and the configuration information is written into the target file, so as to obtain an updated target file.
In this step, according to the configuration of the developer, the configuration information of the sub-service is determined, wherein the configuration information of the sub-service can be read from a configuration file sub-app.
The configuration information is written into a target file, specifically, the configuration information may be written into a simulation file included in the target file, the simulation file is a mock file, and the configuration file of the sub-service may be located under a root directory of the sub-service in the target file. In the testing process, for some objects which are not easy to construct or to obtain, a corresponding virtual mock file is created, and the mock file is tested, so that the testing of the objects which are not easy to construct or to obtain is realized.
Specifically, the obtaining of the configuration information of the sub-service may include: firstly, responding to a development instruction, and creating a template file of a sub-service by using a scaffold tool; then, in response to an editing instruction for the template file, configuration information of the sub-service is acquired.
The scaffold tool is a tool capable of automatically creating a service template file, information such as a service infrastructure, a service providing specification and convention can be limited in the template file, that is, repeated development work in the same main service can be reduced by configuring sub-services based on the template file created by the scaffold tool, and automation of micro-front-end local integrated development and debugging is further achieved.
As shown in fig. 3, a schematic flow diagram of S102 in an implementation manner includes the following steps:
s1021: and generating a simulation file of the sub-service according to the configuration information.
The simulation file may include information such as a service identifier (project key), a service name, and a service home page url address of a corresponding sub-service, where the service identifier is used to query whether the target file includes the simulation file corresponding to the sub-service, and the query may be performed according to the project key of the sub-service.
S1022: inquiring whether the target file comprises a simulation file corresponding to the sub-service; if yes, executing S1023; if not, then S1024 is performed.
S1023: and replacing the simulation file in the target file with the generated simulation file to obtain an updated target file.
S1024: and adding the simulation file into the target file to obtain an updated target file.
That is, if the same-name sub-service simulation file already exists in the target file, the same-name sub-service simulation file is directly overwritten, and if the same-name sub-service simulation file does not exist in the target file, the simulation file is added to the target file, so that the web server running the sub-service can be started according to the latest simulation file of the sub-service, that is, the web server of the sub-service is the web server for providing the sub-service, and the situation that the web server of the sub-service provides the sub-service of the old version after being started is avoided.
In step S103, the updated target file is read, and the web server of the updated main service is started, where the updated main service includes the sub-service.
In an implementation manner, the reading of the updated target file and the starting of the web server of the updated main service may specifically include:
firstly, reading a simulation file of at least one sub-service included in an updated target file to obtain configuration information of the at least one sub-service; and then, starting the webpage server of the updated main service, and registering at least one sub-service in the updated main service according to the configuration information of at least one sub-service.
The configuration information of the sub-service may include any one or more items of a service identifier, a service name, a service home page url address, and the like of the sub-service. Therefore, by reading the simulation file in the target file, the electronic equipment can start the updated webpage server of the main service without completely constructing or acquiring the data of the main service, and meanwhile, the new sub-service can be automatically registered in the main service, so that the sub-service can be automatically updated in the main service, and the manual operation of developers is reduced.
After the target file is updated, the updated target file can be read, and the updated webpage server of the main service is started. The updated target file comprises the configuration information of the sub-services, so that after the updated target file is read, the configuration information of the sub-services in the simulation file can be analyzed, and the registration sub-services are listed in the micro front-end framework, so that the web server of the micro front-end sub-service is automatically started, and further the sub-services can be further developed and tested.
As can be seen from the above, according to the technical scheme provided by the embodiment of the disclosure, after the development instruction is received, the target file of the main service can be automatically configured, so that a developer only needs to concentrate on development configuration and business development of the sub-service in the micro-front-end application, and does not need to care how the code of the main service corresponding to the sub-service is pulled, updated and configured, and the micro-front-end service can be automatically updated, thereby improving the efficiency of local integrated development of the micro-front-end.
Fig. 4 is a block diagram illustrating a micro-front-end service update apparatus applied to an electronic device according to an exemplary embodiment, the apparatus including:
an obtaining unit 201 configured to execute a development instruction in response to a sub-service, and obtain a target file, where the target file is a file of a latest version for running a main service to which the sub-service belongs, and the sub-service and the main service are both services based on a micro front end framework;
an updating unit 202, configured to execute obtaining configuration information of the sub-service, start a web server of the sub-service according to the configuration information, and write the configuration information into the target file to obtain an updated target file;
a starting unit 203 configured to execute reading the updated target file, and start a web server of an updated main service, where the updated main service includes the sub-service.
In one implementation, the obtaining unit 201 is configured to perform:
responding to a development instruction of the sub-service, and acquiring the latest version information of a target file of the main service from a preset database;
judging whether the latest version information is consistent with the version information of the target file of the main service stored locally;
and if the two main services are inconsistent, acquiring the target file of the main service from the preset database to serve as the target file, and updating the locally stored target file of the main service.
In one implementation, the obtaining unit 201 is configured to perform:
and if the latest version information is consistent with the version information of the locally stored target file of the main service, acquiring the locally stored target file of the main service.
In one implementation, the obtaining unit 201 is configured to perform:
acquiring an installation file of a dependent software package from the target file, downloading and installing the dependent software package according to the installation file, wherein the dependent software package is an external file required by the main service;
the starting unit 203 is configured to perform:
and reading the updated target file, calling the dependent software package, and starting the updated webpage server of the main service.
In one implementation, the updating unit 202 is configured to perform:
generating a simulation file of the sub-service according to the configuration information;
inquiring whether the target file comprises a simulation file corresponding to the sub-service;
if yes, replacing the simulation file in the target file with the generated simulation file to obtain an updated target file;
and if not, adding the simulation file into the target file to obtain an updated target file.
In one implementation, the updating unit 202 is configured to perform:
reading a simulation file of at least one sub-service included in the updated target file to obtain configuration information of the at least one sub-service;
and starting the webpage server of the updated main service, and registering the at least one sub-service in the updated main service according to the configuration information of the at least one sub-service.
In one implementation, the updating unit 202 is configured to perform:
creating a template file for the sub-service with a scaffold tool in response to the development instruction;
and responding to the editing instruction of the template file, and acquiring the configuration information of the sub-service.
As can be seen from the above, according to the technical scheme provided by the embodiment of the disclosure, after the development instruction is received, the target file of the main service can be automatically configured, so that a developer only needs to concentrate on development configuration and business development of the sub-service in the micro-front-end application, and does not need to care how the code of the main service corresponding to the sub-service is pulled, updated and configured, and the micro-front-end service can be automatically updated, thereby improving the efficiency of local integrated development of the micro-front-end.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
FIG. 5 is a block diagram illustrating an electronic device for micro-front end service updates, according to an example embodiment.
In an exemplary embodiment, a computer-readable storage medium comprising instructions, such as a memory comprising instructions, executable by a processor of an electronic device to perform the above-described method is also provided. Alternatively, the computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided which, when run on a computer, causes the computer to implement the above-described method of micro-front-end service updating.
As can be seen from the above, according to the technical scheme provided by the embodiment of the disclosure, after the development instruction is received, the target file of the main service can be automatically configured, so that a developer only needs to concentrate on development configuration and business development of the sub-service in the micro-front-end application, and does not need to care how the code of the main service corresponding to the sub-service is pulled, updated and configured, thereby improving the efficiency of the micro-front-end local integrated development.
FIG. 6 is a block diagram illustrating an apparatus 800 for micro-front end service updates, according to an example embodiment.
For example, the apparatus 800 may be a mobile phone, a computer, a digital broadcast electronic device, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 6, the apparatus 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and a communication component 816.
The processing component 802 generally controls overall operation of the device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operation at the device 800. Examples of such data include instructions for any application or method operating on device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
A power supply component 807 provides power to the various components of the device 800. The power components 807 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the apparatus 800.
The multimedia component 808 includes a screen that provides an output interface between the device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the device 800 is in an operating mode, such as a shooting mode or a video mode. Each of the front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the apparatus 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the device 800. For example, the sensor assembly 814 may detect the open/closed state of the device 800, the relative positioning of components, such as a display and keypad of the apparatus 800, the sensor assembly 814 may also detect a change in position of the apparatus 800 or a component of the apparatus 800, the presence or absence of user contact with the apparatus 800, orientation or acceleration/deceleration of the apparatus 800, and a change in temperature of the apparatus 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate communications between the apparatus 800 and other devices in a wired or wireless manner. The apparatus 800 may access a wireless network based on a communication standard, such as WiFi, an operator network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast associated information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the methods of the first and second aspects.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 804 comprising instructions, executable by the processor 820 of the device 800 to perform the above-described method is also provided. Alternatively, for example, the storage medium may be a non-transitory computer-readable storage medium, such as a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the micro front-end service update method described in the first of the above embodiments.
As can be seen from the above, according to the technical scheme provided by the embodiment of the disclosure, after the development instruction is received, the target file of the main service can be automatically configured, so that a developer only needs to concentrate on development configuration and business development of the sub-service in the micro-front-end application, and does not need to care how the code of the main service corresponding to the sub-service is pulled, updated and configured, and the micro-front-end service can be automatically updated, thereby improving the efficiency of local integrated development of the micro-front-end.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A micro front-end service updating method is applied to electronic equipment, and the method comprises the following steps:
responding to a development instruction of a sub-service, and acquiring a target file, wherein the target file is a file of a latest version used for operating a main service to which the sub-service belongs, and the sub-service and the main service are services based on a micro front-end framework;
acquiring configuration information of the sub-service, starting a webpage server of the sub-service according to the configuration information, and writing the configuration information into the target file to obtain an updated target file;
and reading the updated target file, and starting a webpage server of an updated main service, wherein the updated main service comprises the sub-service.
2. The micro front-end service updating method according to claim 1, wherein the obtaining the target file in response to the development instruction for the sub-service comprises:
responding to a development instruction of the sub-service, and acquiring the latest version information of a target file of the main service from a preset database;
judging whether the latest version information is consistent with the version information of the target file of the main service stored locally;
and if the two main services are inconsistent, acquiring the target file of the main service from the preset database, and updating the locally stored target file of the main service.
3. The micro front-end service updating method according to claim 2, wherein if the latest version information is consistent with the version information of the target file of the main service stored locally, the method further comprises:
and acquiring a target file of the main service stored locally.
4. The micro front-end service update method of claim 1, wherein after the obtaining the target file, the method further comprises:
acquiring an installation file of a dependent software package from the target file, downloading and installing the dependent software package according to the installation file, wherein the dependent software package is an external file required by the main service;
the web server for reading the updated target file and starting the updated main service comprises:
and reading the updated target file, calling the dependent software package, and starting the updated webpage server of the main service.
5. The micro front-end service updating method according to claim 1, wherein the writing the configuration information into the target file to obtain an updated target file comprises:
generating a simulation file of the sub-service according to the configuration information;
inquiring whether the target file comprises a simulation file corresponding to the sub-service;
if yes, replacing the simulation file in the target file with the generated simulation file to obtain the updated target file;
and if not, adding the simulation file into the target file to obtain the updated target file.
6. The micro front-end service updating method according to claim 5, wherein the web server reading the updated target file and starting the updated main service comprises:
reading a simulation file of at least one sub-service included in the updated target file to obtain configuration information of the at least one sub-service;
and starting the webpage server of the updated main service, and registering the at least one sub-service in the updated main service according to the configuration information of the at least one sub-service.
7. The micro front-end service updating method according to claim 1, wherein the obtaining the configuration information of the sub-service comprises:
creating a template file for the sub-service with a scaffold tool in response to the development instruction;
and responding to the editing instruction of the template file, and acquiring the configuration information of the sub-service.
8. A micro front-end service updating device is applied to electronic equipment, and the device comprises:
the acquisition unit is configured to execute a development instruction responding to a sub-service, and acquire a target file, wherein the target file is a file of a latest version for running a main service to which the sub-service belongs, and the sub-service and the main service are services based on a micro front end framework;
the updating unit is configured to execute the steps of acquiring the configuration information of the sub-service, starting a webpage server of the sub-service according to the configuration information, and writing the configuration information into the target file to obtain an updated target file;
and the starting unit is configured to execute reading of the updated target file and start a web server of an updated main service, wherein the updated main service comprises the sub-service.
9. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the micro front-end service update method of any of claims 1 to 7.
10. A computer-readable storage medium having instructions which, when executed by a processor of a micro-front-end services update electronic device, enable the micro-front-end services update electronic device to perform the micro-front-end services update method of any of claims 1-7.
CN202111563732.8A 2021-12-20 2021-12-20 Micro front-end service updating method and device, electronic equipment and storage medium Pending CN114546436A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111563732.8A CN114546436A (en) 2021-12-20 2021-12-20 Micro front-end service updating method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111563732.8A CN114546436A (en) 2021-12-20 2021-12-20 Micro front-end service updating method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114546436A true CN114546436A (en) 2022-05-27

Family

ID=81669124

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111563732.8A Pending CN114546436A (en) 2021-12-20 2021-12-20 Micro front-end service updating method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114546436A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115766681A (en) * 2022-11-28 2023-03-07 迈普通信技术股份有限公司 Program downloading method, device, medium and equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115766681A (en) * 2022-11-28 2023-03-07 迈普通信技术股份有限公司 Program downloading method, device, medium and equipment

Similar Documents

Publication Publication Date Title
CN107329743B (en) Application page display method and device and storage medium
CN106569800B (en) Front-end interface generation method and device
CN109032606B (en) Native application compiling method and device and terminal
EP2998899A1 (en) Method and apparatus for running application program
US9870239B2 (en) Method and device for running application program
CN110209385B (en) Project creation method and device
CN111273899B (en) Code processing method, device, electronic equipment and storage medium
CN105808305B (en) Static resource loading method and device
CN106201610A (en) Web application accesses the method and device of the primary function of terminal
CN107463372B (en) Data-driven page updating method and device
CN105094830A (en) Method and device for executing target functions
CN110704030A (en) Interface configuration information generation method and device, electronic equipment and storage medium
CN114546436A (en) Micro front-end service updating method and device, electronic equipment and storage medium
CN113010157A (en) Code generation method and device
CN104991857A (en) Method and apparatus for trace debugging
CN105204879A (en) Application updating method and device
CN111221613A (en) Program calling method and device and storage medium
CN111338961B (en) Application debugging method and device, electronic equipment and storage medium
CN109933357B (en) Application program upgrading method and device
CN111597106A (en) Point burying management method and device
CN111767063A (en) Resource updating method, device and equipment for application program
CN111596949B (en) Method and device for developing application program
CN115373763B (en) Plug-in loading method and device, electronic equipment and storage medium
CN114416084B (en) Data processing method and device, electronic equipment and storage medium
CN110659081B (en) File processing method and device for program object and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination