CN116107657B - Application storage method, device and equipment based on qiankun and computer storage medium - Google Patents

Application storage method, device and equipment based on qiankun and computer storage medium Download PDF

Info

Publication number
CN116107657B
CN116107657B CN202310001582.4A CN202310001582A CN116107657B CN 116107657 B CN116107657 B CN 116107657B CN 202310001582 A CN202310001582 A CN 202310001582A CN 116107657 B CN116107657 B CN 116107657B
Authority
CN
China
Prior art keywords
application
sub
file
qiankun
local storage
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.)
Active
Application number
CN202310001582.4A
Other languages
Chinese (zh)
Other versions
CN116107657A (en
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.)
Guangzhou Xuanwu Wireless Technology Co Ltd
Original Assignee
Guangzhou Xuanwu Wireless 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 Guangzhou Xuanwu Wireless Technology Co Ltd filed Critical Guangzhou Xuanwu Wireless Technology Co Ltd
Priority to CN202310001582.4A priority Critical patent/CN116107657B/en
Publication of CN116107657A publication Critical patent/CN116107657A/en
Application granted granted Critical
Publication of CN116107657B publication Critical patent/CN116107657B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44557Code layout in executable memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44552Conflict resolution, i.e. enabling coexistence of conflicting executables
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Document Processing Apparatus (AREA)

Abstract

The application provides an application storage method, device and equipment based on qiankun and a computer storage medium, wherein the application storage method based on qiankun comprises the following steps: acquiring a micro front end frame with a qiankun, wherein the qiankun micro front end frame is provided with a qiankun interface; registering a plurality of sub-applications in a main application by utilizing a qiankun interface, wherein each sub-application comprises a name, an access address, a mounting node in the main application and an access path; loading at least one sub-application in a main application by utilizing a qiankun interface to obtain a sandbox and a resource file of each sub-application, wherein the resource file comprises a code file for rewriting a local storage object of the sub-application; for each sub-application, running a resource file in a sandbox to rewrite the local storage object of the sub-application, by running each resource file in each sandbox to rewrite its local storage object with the name of the sub-application, respectively, to ensure that the key of the local storage object of each sub-application is unique to avoid storage conflicts across multiple sub-applications.

Description

Application storage method, device and equipment based on qiankun and computer storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a system storage method, apparatus, device, and computer storage medium based on qiankun.
Background
The micro front end combines a plurality of independently developed and independently deployed sub-applications through the qiankun interface to form a main application, however, when the plurality of sub-applications are combined, the plurality of sub-applications share a storage space, so that local storage addresses of the plurality of sub-applications are in conflict, and the plurality of sub-applications are in mutual coverage, therefore, in order to avoid the conflict of the local storage addresses of the plurality of sub-applications, at present, only identification rules are mainly set for each sub-application, and then codes of the local storage interfaces of each sub-application are updated according to the uniform identification rules, but the codes of the storage interfaces of all the sub-applications are required to be updated, so that the workload is high; moreover, the code formats of the storage interfaces of different sub-applications are different, so that the difficulty of updating the codes of the storage interfaces of all the sub-applications is increased.
Disclosure of Invention
Based on this, an object of the present application is to provide an application storage method, apparatus, device and computer storage medium based on qiankun, which can solve the problem that local storage addresses of sub-applications collide without updating the interfaces of the local storage of all sub-applications.
The technical scheme adopted by the application comprises the following specific contents:
the application storage method based on the qiankun comprises the following steps:
s1: acquiring a qiankun micro front end frame, wherein the qiankun micro front end frame is provided with a qiankun interface;
s2: registering a plurality of sub-applications in a main application by utilizing the qankun interface, wherein each sub-application comprises a name, an access address, a mounting node in the main application and an access path;
s3: loading at least one sub-application in the main application by utilizing the qiankun interface to obtain a sandbox and a resource file of each sub-application, wherein the resource file comprises a code file for rewriting a local storage object of the sub-application;
s4: and running a resource file in the sandbox for each sub-application to rewrite the local storage object of the sub-application.
Further, step S3 includes:
s31: obtaining an html file of the sub-application by using a getTemplate method of the qiankun interface;
s32: and analyzing the html file to obtain the resource file of the sub-application, wherein the resource file is a JS file.
Further, step S32 includes:
s321: acquiring a code file which is used for processing the local storage of the sub-application in the html file;
s322: and wrapping the code file by using the script tag to obtain the resource file.
Further, in step S32, the JS file is a JS code file or a JS path file, and when the JS file is the JS path file, step S3 further includes step S33, and S33 is:
s33: and the qiankun interface requests the JS path file by using a fetch method or an ajax method to obtain the JS code file corresponding to the JS path file.
Further, step S4 includes:
s41: acquiring a window proxy object of each sub-application in a sandbox of the sub-application, wherein the window object of the main application comprises a plurality of window proxy objects, and the window proxy object comprises the local storage object;
s42: and for each sub-application, running the JS code file in the sandbox by using the window proxy object to rewrite the local storage object.
Further, in step S42, rewriting the local storage object includes:
s421: rewriting and calling a setting item setItem (key, value) of a local storage interface object of the sub-application, wherein the key comprises a sub-application name-use and a sub-application name-token;
s422: the retrieval item getItem (value) of the local storage interface object of the sub-application is overwritten and invoked.
The application also provides an application storage device based on the qiankun, which comprises:
the acquisition module is used for acquiring a qiankun micro front end frame, wherein the qiankun micro front end frame is provided with a qiankun interface;
the registration module is used for registering a plurality of sub-applications in the main application by utilizing the qankun interface, and each sub-application comprises a name, an access address, a mounting node in the main application and an access path;
the loading module is used for loading at least one sub-application in the main application by utilizing the qankun interface to obtain a sandbox and a resource file of each sub-application, wherein the resource file comprises a code file for rewriting a local storage object of the sub-application;
and the rewriting module is used for running a resource file in the sandbox for each sub-application so as to rewrite the local storage object of the sub-application.
Further, the loading module includes:
the first acquisition unit is used for acquiring the html file and the sandbox of the sub-application by using a getTemplate method of the qiankun interface;
an analysis unit: and the method is used for analyzing the html file to obtain the resource file of the sub-application, wherein the resource file is a JS file.
The application also provides an application storage device based on the qiankun, which comprises:
a processor;
a memory for storing a computer program for execution by the processor;
the application storage method based on the qiankun is realized when the processor executes the computer program.
The application also provides a computer readable storage medium having stored thereon a computer program which when executed implements the qiankun-based application storage method of the application.
Compared with the prior art, the application has the beneficial effects that:
according to the application storage method based on the qiankun, when the main application loads a plurality of sub-applications through the qiankun interface, a sandbox and a resource file of each sub-application can be obtained, then each resource file is respectively operated in each sandbox so as to rewrite a local storage interface of the sub-application, isolation of the plurality of sub-applications during storage can be realized without changing all codes of the plurality of sub-applications during storage, and storage address conflict of the plurality of sub-applications can be avoided.
For a better understanding and implementation, the present application is described in detail below with reference to the drawings.
Drawings
FIG. 1 is a flow chart of a qiankun-based application storage method according to an embodiment of the present application;
FIG. 2 is a block diagram of an application storage device based on qiankun according to an embodiment of the present application;
wherein, the reference numerals of each drawing are as follows:
1. an acquisition module; 2. a registration module; 3. loading a module; 31. a first acquisition unit; 32. an analysis unit; 4. a rewriting module; 41. a second acquisition unit; 42. and a rewriting unit.
Detailed Description
It should be understood that the described embodiments are merely some, but not all embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the application, are intended to be within the scope of the embodiments of the present application.
The terminology used in the embodiments of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of embodiments of the application. As used in this application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more of the associated listed items.
When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the application as detailed in the accompanying claims. In the description of the present application, it should be understood that the terms "first," "second," "third," and the like are used merely to distinguish between similar objects and are not necessarily used to describe a particular order or sequence, nor should they be construed to indicate or imply relative importance. The specific meaning of the above terms in the present application can be understood by those of ordinary skill in the art according to the specific circumstances.
Furthermore, in the description of the present application, unless otherwise indicated, "a plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship.
It is to be understood that the embodiments of the application are not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be made without departing from the scope thereof. The scope of embodiments of the application is limited only by the appended claims.
Referring to fig. 1, the present embodiment provides a qiankun-based application storage method, including:
s1: a micro front end framework with a qiankun is obtained, wherein the qiankun micro front end framework has a qiankun interface.
S2: registering a plurality of sub-applications in a main application by utilizing the qankun interface, wherein each sub-application comprises a name, an access address, an installation node in the main application and an access path.
S3: and loading at least one sub-application in the main application by utilizing the qiankun interface to obtain a sandbox and a resource file of each sub-application, wherein the resource file comprises a code file for rewriting a local storage object of the sub-application.
In this embodiment, when at least one of the sub-applications is loaded in the main application by using the qiankun interface, a plurality of sandboxes may be generated, and the sandboxes and the sub-applications are in one-to-one correspondence, and the sandboxes may be used to isolate the sub-applications, so as to limit feedback of the influence of the resource file operation of the sub-applications to the sub-applications; when at least one sub-application is loaded in the main application by utilizing the qiankun interface, firstly, an html file of the sub-application can be obtained by utilizing a getTemplate method of the qiankun interface, then, the html file is analyzed to obtain the resource file of the sub-application, the resource file is a JS file, and the content of the resource file can be managed through the html file so as to process a locally stored code file, so that the JS file contains a code file for rewriting the local storage object.
In this embodiment, parsing the html file includes: (1) Acquiring a code file which is used for processing the local storage of the sub-application in the html file; (2) And wrapping the code file by using the script tag to obtain the resource file.
In this embodiment, the JS file is a JS code file or a JS path file, and when the JS file is the JS path file, the JS code file needs to be obtained through the JS path file, specifically: and the qiankun interface requests the JS path file by using a fetch method or an ajax method to obtain the JS code file corresponding to the JS path file.
S4: and running a resource file in the sandbox for each sub-application to rewrite the local storage object of the sub-application.
In this embodiment, step S4 is implemented by the following steps:
(1) And acquiring a window proxy object of each sub application in a sandbox of the sub application, wherein the window object of the main application comprises a plurality of window proxy objects, and the window proxy object comprises the local storage object.
(2) And for each sub-application, running the JS code file in the sandbox by using the window proxy object to rewrite the local storage object.
In this embodiment, the local storage object includes a set item (key, value) and a fetch item getItem (value), where: setting an item setItem (value) and an acquisition item getItem (value) as API methods of the local storage interface, respectively; the function of the set item setItem (value) is to store, using the key as a key, the value of the value into the local storage object; the fetch item getItem (value) is a stored value mapped by taking a key as a key and reading the key in the local storage object.
In this embodiment, rewriting the local storage object includes:
(1) Rewriting and calling a setting item setItem (key, value) of a local storage interface object of the sub-application, wherein the key comprises a sub-application name-use and a sub-application name-token, specifically, when the setting item setItem (key, value) of the local storage object is used, the original setting item setItem (key, value) is cached first, and then the key of the setting item setItem (key, value) is modified into a sub-application name_user and a sub-application name_token; and finally, calling a setting item setItem before rewriting by using the window proxy object, wherein the sub-application can automatically store specific information into the local storage object, and the key value is a corresponding position.
(2) The method includes the steps that rewriting and calling are conducted on an acquisition item getItem (value) of a local storage interface object of the sub-application, specifically, when an acquisition item getItem (value) of the local storage object is used, an original acquisition item getItem (value) is cached first, and then keys of an acquisition item getItem (value) are modified to be a sub-application name_user and a sub-application name_token; finally, the window proxy object is used to call the acquisition item getItem (value) before overwriting, and at this time, the sub-application can automatically return the data stored in the local storage object with the key value as the corresponding position.
S5: for each of the sub-applications, storing the sub-application with the local storage object.
The application storage method based on the qiankun provided by the embodiment can realize the registration and loading of a plurality of sub-applications on the main application by utilizing the qiankun interface of the qiankun micro front end framework so as to meet the requirements of independent development and independent deployment of the plurality of sub-applications; when a plurality of sub-applications are loaded by using the qiankun interface, the html file of each sub-application can be processed to obtain a resource file containing a code file for rewriting the local storage object of the sub-application, so that the local storage objects of the plurality of sub-applications are rewritten, the keys of the local storage object of each sub-application are ensured to be unique, and the storage conflict of the plurality of sub-applications is avoided; in addition, the sandboxes are adopted to respectively run the resource files of the plurality of sub-applications, so that the isolation of the plurality of sub-applications can be realized, and the influence of the running of the plurality of sub-applications on the main application is avoided.
Referring to fig. 2, the application storage method based on qiankun provided in this embodiment further provides an application storage device based on qiankun, including:
the acquisition module 1 is used for acquiring a frame with a qiankun micro front end, wherein the qiankun micro front end frame is provided with a qiankun interface;
a registration module 2, configured to register a plurality of sub-applications in a main application by using the qiankun interface, where each sub-application includes a name, an access address, a mount node in the main application, and an access path;
the loading module 3 is configured to load at least one of the sub-applications in the main application by using the qiankun interface, so as to obtain a sandbox and a resource file of each of the sub-applications, where the resource file includes a code file for rewriting a local storage object of the sub-application;
and the rewriting module 4 is used for running a resource file in the sandbox for each sub-application so as to rewrite the local storage object of the sub-application.
In this embodiment, the loading module 3 includes a first obtaining unit 31 and an analyzing unit 32, where the first obtaining unit 31 is configured to obtain an html file and a sandbox of the sub-application by using a getTemplate method of the qiankun interface; the parsing unit 32 is configured to parse the html file to obtain the resource file of the sub-application, where the resource file is a JS file.
In this embodiment, the parsing unit 32 is configured to parse the html file, and obtain the resource file of the sub-application is implemented by the following steps: (1) Acquiring a code file which is used for processing the local storage of the sub-application in the html file; (2) And wrapping the code file by using the script tag to obtain the resource file. Moreover, when the JS file is the JS path file, the parsing unit 32 further obtains the JS code file through the JS path file, specifically: the parsing unit 32 requests the JS path file through the qiankun interface by using a fetch method or an ajax method, so as to obtain the JS code file corresponding to the JS path file.
In this embodiment, the rewrite module 4 includes a second obtaining unit 41 and a rewrite unit 42, where the second obtaining unit 41 is configured to obtain a window proxy object of each of the sub-applications in a sandbox thereof, and the window object of the main application includes a plurality of the window proxy objects, and the window proxy object includes the local storage object; for each of the sub-applications, the rewrite unit 42 runs the JS code file in the sandbox using the window proxy object to rewrite the local storage object.
Also, the overwriting unit 42 performs storage overwriting on the local storage object including overwriting and calling a setting item setItem (value) of the local storage interface object of the sub-application, and overwriting and calling an acquisition item getItem (value) of the local storage interface object of the sub-application, wherein: (1) When using the setting item setItem (key, value) of the local storage object, firstly caching the original setting item setItem (key, value), and then modifying the key of the setting item setItem (key, value) into a sub-application name_user and a sub-application name_token; finally, the window proxy object is utilized to call a setting item setItem before rewriting, and at the moment, the sub-application can automatically store specific information into the local storage object, wherein the key value is a corresponding position; (2) When the acquired item getItem (value) of the local storage object is used, the original acquired item getItem (value) is cached first, and then the key of the acquired item getItem (value) is modified into a sub-application name_user and a sub-application name_token; finally, the window proxy object is used to call the acquisition item getItem (value) before overwriting, and at this time, the sub-application can automatically return the data stored in the local storage object with the key value as the corresponding position.
Based on the application storage method based on qiankun provided in the present embodiment, the present embodiment further provides an application storage device based on qiankun, where the application storage device based on qiankun may be a terminal device such as a server, a desktop computing device or a mobile computing device (for example, a laptop computing device, a handheld computing device, a tablet computer, a netbook, or the like), and the method includes:
a processor;
a memory for storing a computer program for execution by the processor;
the application storage method based on the qiankun according to the embodiment is implemented when the processor executes the computer program.
Based on the application storage method based on the qiankun provided in the present embodiment, the present embodiment further provides a computer readable storage medium, on which a computer program is stored, where the computer program is executed to implement the application storage method based on the qiankun described in the present embodiment.
The present application may take the form of a computer program product embodied on one or more storage media (including, but not limited to, magnetic disk storage, CD-ROM, optical storage, etc.) having program code embodied therein. Computer-usable storage media include both permanent and non-permanent, removable and non-removable media, and information storage may be implemented by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to: phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, may be used to store information that may be accessed by the computing device.
The foregoing examples have shown only the preferred embodiments of the application, which are described in more detail and are not to be construed as limiting the scope of the application. It should be noted that modifications and improvements can be made by those skilled in the art without departing from the spirit of the application, and the application is intended to encompass such modifications and improvements.

Claims (6)

1. The application storage method based on the qiankun is characterized by comprising the following steps:
s1: acquiring a qiankun micro front end frame, wherein the qiankun micro front end frame is provided with a qiankun interface;
s2: registering a plurality of sub-applications in a main application by utilizing the qankun interface, wherein each sub-application comprises a name, an access address, a mounting node in the main application and an access path;
s3: loading at least one sub-application in the main application by utilizing the qiankun interface to obtain a sandbox and a resource file of each sub-application, wherein the resource file comprises a code file for rewriting a local storage object of the sub-application;
s4: running a resource file in the sandbox for each of the sub-applications to rewrite local storage objects of the sub-applications; the step S3 specifically comprises the following steps:
s31: obtaining an html file of the sub-application by using a getTemplate method of the qiankun interface;
s32: analyzing the html file to obtain the resource file of the sub-application, wherein the resource file is a JS file;
the step S4 specifically comprises the following steps:
s41: acquiring a window proxy object of each sub-application in a sandbox of the sub-application, wherein the window object of the main application comprises a plurality of window proxy objects, and the window proxy object comprises the local storage object;
s42: for each sub-application, running a JS code file in the sandbox by using the window proxy object to rewrite the local storage object; the JS code file is a code file for rewriting the local storage object in the JS file;
in step S42, rewriting the local storage object includes:
s421: rewriting and calling a setting item setItem (key, value) of a local storage interface object of the sub-application, wherein the key comprises a sub-application name-use and a sub-application name-token;
s422: the retrieval item getItem (value) of the local storage interface object of the sub-application is overwritten and invoked.
2. The qiankun-based application storage method according to claim 1, wherein step S32 comprises:
s321: acquiring a code file which is used for processing the local storage of the sub-application in the html file;
s322: and wrapping the code file by using the script tag to obtain the resource file.
3. The qiankun-based application storage method according to claim 2, wherein in step S32, the JS file is a JS code file or a JS path file, and when the JS file is the JS path file, step S3 further includes step S33, and S33 is:
s33: and the qiankun interface requests the JS path file by using a fetch method or an ajax method to obtain the JS code file corresponding to the JS path file.
4. An application storage device based on qiankun, comprising:
the acquisition module is used for acquiring a qiankun micro front end frame, wherein the qiankun micro front end frame is provided with a qiankun interface;
the registration module is used for registering a plurality of sub-applications in the main application by utilizing the qankun interface, and each sub-application comprises a name, an access address, a mounting node in the main application and an access path;
the loading module is used for loading at least one sub-application in the main application by utilizing the qankun interface to obtain a sandbox and a resource file of each sub-application, wherein the resource file comprises a code file for rewriting a local storage object of the sub-application;
the rewriting module is used for running a resource file in the sandbox for each sub-application so as to rewrite the local storage object of the sub-application;
the loading module comprises:
the first acquisition unit is used for acquiring the html file and the sandbox of the sub-application by using a getTemplate method of the qiankun interface;
an analysis unit: the method comprises the steps of analyzing the html file to obtain the resource file of the sub-application, wherein the resource file is a JS file;
the rewriting module comprises a second obtaining unit and a rewriting unit, wherein the second obtaining unit is used for obtaining a window proxy object of each sub-application in a sandbox of the sub-application, the window object of the main application comprises a plurality of window proxy objects, and the window proxy object comprises the local storage object; for each sub-application, the rewrite unit uses the window proxy object to run the JS code file in the sandbox to rewrite the local storage object;
the rewriting unit rewriting the local storage object includes: rewriting and calling a setting item setItem (key, value) of a local storage interface object of the sub-application, wherein the key comprises a sub-application name-use and a sub-application name-token; the retrieval item getItem (value) of the local storage interface object of the sub-application is overwritten and invoked.
5. An application storage device based on qiankun, comprising:
a processor;
a memory for storing a computer program for execution by the processor;
wherein the processor, when executing the computer program, implements the qiankun-based application storage method of any of claims 1-3.
6. A computer readable storage medium, characterized in that a computer program is stored thereon, which computer program, when executed, implements the qiankun-based application storage method of any of claims 1-3.
CN202310001582.4A 2023-01-03 2023-01-03 Application storage method, device and equipment based on qiankun and computer storage medium Active CN116107657B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310001582.4A CN116107657B (en) 2023-01-03 2023-01-03 Application storage method, device and equipment based on qiankun and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310001582.4A CN116107657B (en) 2023-01-03 2023-01-03 Application storage method, device and equipment based on qiankun and computer storage medium

Publications (2)

Publication Number Publication Date
CN116107657A CN116107657A (en) 2023-05-12
CN116107657B true CN116107657B (en) 2023-09-26

Family

ID=86266814

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310001582.4A Active CN116107657B (en) 2023-01-03 2023-01-03 Application storage method, device and equipment based on qiankun and computer storage medium

Country Status (1)

Country Link
CN (1) CN116107657B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103677804A (en) * 2012-09-26 2014-03-26 三星电子株式会社 Method and apparatus for processing applications of mobile terminal
CN114625439A (en) * 2022-03-10 2022-06-14 腾讯音乐娱乐科技(深圳)有限公司 Sub-application operation method based on micro front-end architecture, electronic device and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103677804A (en) * 2012-09-26 2014-03-26 三星电子株式会社 Method and apparatus for processing applications of mobile terminal
CN114625439A (en) * 2022-03-10 2022-06-14 腾讯音乐娱乐科技(深圳)有限公司 Sub-application operation method based on micro front-end architecture, electronic device and storage medium

Also Published As

Publication number Publication date
CN116107657A (en) 2023-05-12

Similar Documents

Publication Publication Date Title
US9928038B2 (en) Dynamically building locale objects or subsections of locale objects based on historical data
US6779187B1 (en) Method and system for dynamic interception of function calls to dynamic link libraries into a windowed operating system
US6876996B2 (en) Method and apparatus for using a shared library mechanism to facilitate sharing of metadata
US8375379B2 (en) Importing language extension resources to support application execution
US7430734B2 (en) Interface invoke mechanism
CN108616599B (en) Method and device for registering and updating application service
CN107885540A (en) A kind of method, apparatus and terminal of loading application programs static resource
CN110007920B (en) Method and device for acquiring code dependency relationship and electronic equipment
US20080071805A1 (en) File indexing framework and symbolic name maintenance framework
US20090031210A1 (en) Optimized page script downloads in a component based architecture
US20090249311A1 (en) Sharing a native module of compiled code using an abstraction module of interpreted code in a virtual machine environment
US6574747B2 (en) Extensible execute in place (XIP) architecture and related methods
CN110362547B (en) Method and device for encoding, analyzing and storing log file
US20180060048A1 (en) Hybrid Deoptimization Mechanism for Class Hierarchy Analysis
WO2023040459A1 (en) Graphics rendering method and apparatus, electronic device, and storage medium
CN111124288A (en) VPD storage management method, device, equipment and readable storage medium
CN113821194A (en) Micro front-end system
CN116107657B (en) Application storage method, device and equipment based on qiankun and computer storage medium
US7401178B1 (en) Expanded memory space in environments including virtual machines
CN115421693A (en) Method and device for realizing micro front-end architecture, computer equipment and storage medium
CN113778564B (en) Method, equipment and storage medium for efficiently executing EVM intelligent contract
CN111638903B (en) Method and device for generating difference information of different software versions
CN116700841B (en) Method and device for calling native API (application program interface)
CN116340904A (en) Application running protection method, device, equipment and storage medium
CN115237489A (en) Page resource loading method and device, electronic equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant