CN114860364A - Data processing method and device - Google Patents

Data processing method and device Download PDF

Info

Publication number
CN114860364A
CN114860364A CN202210473097.2A CN202210473097A CN114860364A CN 114860364 A CN114860364 A CN 114860364A CN 202210473097 A CN202210473097 A CN 202210473097A CN 114860364 A CN114860364 A CN 114860364A
Authority
CN
China
Prior art keywords
sub
application
base
target data
global state
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
CN202210473097.2A
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.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing 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 Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN202210473097.2A priority Critical patent/CN114860364A/en
Publication of CN114860364A publication Critical patent/CN114860364A/en
Pending legal-status Critical Current

Links

Images

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/451Execution arrangements for user interfaces
    • 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
    • G06F9/44563Sharing

Landscapes

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

Abstract

The present disclosure provides a data processing method and apparatus, wherein a base includes a plug-in web sub-application, and the sub-application shares a global state warehouse of the base, and the method includes: responding to an activation instruction of a sub-application, and confirming whether the sub-application is a sub-application of a current base or not; and if the sub-application belongs to the sub-application of the current base, the sub-application acquires corresponding target data in the global state warehouse, and page rendering of the sub-application is carried out based on the target data. The data processing method enables all sub-applications embedded in the same base to share the global state warehouse, data management is uniform and convenient, when one sub-application is switched to another sub-application, data of the original sub-application cannot be lost, and changes of state data caused by interaction among the sub-applications can be cached.

Description

Data processing method and device
Technical Field
The present disclosure relates to the field of computers, and in particular, to a data processing method and apparatus.
Background
With the advent of the internet era, most of life contents and work contents of people are transferred from off-line to on-line, and the web application becomes a mainstream tool in work and life of people due to the advantages of cross-platform, easy access and the like. And because each web application runs independently, the development and maintenance pressure brought by the web application increases day by day, and the plug-in web application has come by day based on the advantages of distributed development and strong portability, and the development and maintenance pressure can be effectively reduced.
When the pluggable web application is used, when a user switches operation among different pluggable web applications, the problem of data loss caused by application inactivation can be caused, the use is inconvenient, and the user experience is poor. The prior art fails to effectively address this problem.
Disclosure of Invention
The present disclosure provides a data processing method and apparatus, so as to at least solve the above technical problems in the prior art.
According to a first aspect of the present disclosure, a data processing method is provided, where a base includes a pluggable web sub-application, and the sub-application shares a global state repository of the base:
responding to an activation instruction of the sub-application, and confirming whether the sub-application is a sub-application of a current base or not;
and if the sub-application belongs to the sub-application of the current base, the sub-application acquires corresponding target data in the global state warehouse, and page rendering of the sub-application is carried out based on the target data.
In an embodiment, the method further comprises:
and creating the global state warehouse based on the operation of the base, wherein the sub-application synchronously caches the target data corresponding to the sub-application in the global state warehouse.
In one embodiment, the sub-applications share a global state repository of the base, including:
and under the condition that the sub-application is inactivated at the first moment, target data corresponding to the sub-application in the global state warehouse is reserved.
In an embodiment, the rendering the page of the sub-application based on the target data includes:
and responding to an activation instruction of the sub-application at a second moment, acquiring target data corresponding to the sub-application in the global state warehouse, and performing page rendering based on the target data corresponding to the sub-application so as to restore the sub-application to the page state at the first moment.
In an embodiment, the method further comprises:
monitoring target data in the global state warehouse;
and when the target data are changed, storing the target data in the global state warehouse to a nonvolatile memory to obtain persistent data.
In an embodiment, the method further comprises: in the case where the susceptor exits operation at the third moment,
responding to an operation instruction of the base at a fourth moment, and operating the base;
and the base responds to an activation instruction of the sub-application and covers the persistent data in the nonvolatile memory into a global state warehouse created by the base, so that the sub-application can acquire corresponding target data for page rendering.
In one embodiment, the method further comprises:
creating a global scope based on the base operation, wherein the global scope provides an operation environment for the activated sub-application;
declaring a scheduler in the global scope, by which the child application running in the global scope obtains authorization to modify the target data within the global state repository.
In an embodiment, the method further comprises:
and responding to the first activation instruction of the sub-applications, creating application identifications of the sub-applications in the global state warehouse, wherein the sub-applications are used for storing corresponding target data according to the corresponding application identifications.
In one embodiment, the sub-application stores its corresponding target data in each level of nodes of the application node tree corresponding to the sub-application;
correspondingly, the application identification mark is marked at the root node of the application node tree.
According to a second aspect of the present disclosure, there is provided a data processing apparatus, a base comprising pluggable web sub-applications, the sub-applications sharing a global state repository of the base, the apparatus comprising:
the response module is used for responding to an activation instruction of the sub-application and confirming whether the sub-application is a sub-application of the current base or not; a data acquisition module to: and if the sub-application belongs to the sub-application of the current base, the sub-application acquires corresponding target data in the global state warehouse, and page rendering of the sub-application is carried out based on the target data.
According to a third aspect of the present disclosure, there is provided an electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the methods of the present disclosure.
According to a fourth aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of the present disclosure.
In the data processing method, a base comprises pluggable web sub-applications, the sub-applications share a global state warehouse of the base, and when the sub-applications are confirmed to be the sub-applications of the current base in response to a received activation instruction of the sub-applications, the sub-applications acquire corresponding target data stored in the global state warehouse and perform page rendering. According to the data processing method, after the originally independent sub-applications are embedded into the base, the sub-applications can share the global state warehouse, data management is unified and convenient, when one sub-application in the base is switched to another sub-application in the base, the data of the original sub-application cannot be lost, and the change of the state data caused by the interaction behavior among the sub-applications can be cached.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The above and other objects, features and advantages of exemplary embodiments of the present disclosure will become readily apparent from the following detailed description read in conjunction with the accompanying drawings. Several embodiments of the present disclosure are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which:
in the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
FIG. 1 is a flow chart illustrating an implementation of a data processing method according to an embodiment of the present disclosure;
FIG. 2 shows a first schematic diagram of an implementation interaction of a data processing method according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram illustrating an implementation of a data processing method according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram illustrating a target data storage structure in the data processing method according to the embodiment of the disclosure;
FIG. 5 shows a second schematic diagram of an implementation interaction of the data processing method according to the embodiment of the present disclosure;
FIG. 6 shows a third schematic diagram of an implementation interaction of the data processing method according to the embodiment of the present disclosure;
FIG. 7 is a schematic diagram of a data processing apparatus according to an embodiment of the present disclosure;
fig. 8 shows a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
In order to make the objects, features and advantages of the present disclosure more apparent and understandable, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure, and it is apparent that the described embodiments are only a part of the embodiments of the present disclosure, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
Referring to fig. 1, an embodiment of the present disclosure provides a data processing method, including: the base comprises pluggable web sub-applications, and all the sub-applications share the global state warehouse of the base;
s101, responding to an activation instruction of the sub-application, and confirming whether the sub-application is the sub-application of the current base or not;
s102, if the sub-application belongs to the sub-application of the current base, the sub-application obtains corresponding target data in the global state warehouse, and page rendering of the sub-application is carried out based on the target data.
In the data processing method of the present disclosure, the relationship between the base and the sub-application is: the base defines an application domain in which all sub-applications embedded in the base run. A plurality of plug-in web sub-applications can be embedded into the base, the sub-applications share the global state warehouse of the base, and target data of each sub-application is stored in the global state warehouse; the global state warehouse is a global state warehouse which is corresponding to the base and used for storing the target data, and the target data can be stored in the global state warehouse by the base and the sub-applications in the base. And the base responds to the received activation instruction for the sub-application, and under the condition that the sub-application is confirmed to belong to the current base, the sub-application acquires corresponding target data stored in the global state warehouse and performs page rendering. If the sub-application is activated for the first time in the base, the acquired target data is initialization data of the sub-application, and the sub-application performs page rendering according to the initialization data to display an initialization page. If the sub-application is not activated for the first time in the base, the target data acquired by the sub-application may not be the initialization data, and the page displayed after rendering by the sub-application is not the initialization page. The target data in the embodiments of the present disclosure may be state data of the sub-application.
In the embodiment of the present disclosure, regardless of whether the sub-application is developed based on vue, exact, regular or other frameworks, the base may interface with the sub-application after the sub-application is embedded, and provide a unified application domain (i.e., a global scope described below) for the sub-application to run.
In an implementation manner, referring to fig. 2, before receiving the activation instruction of the sub-application, the data processing method further includes: and based on the operation of the base, creating a global state warehouse, and synchronously caching target data corresponding to the sub-application in the global state warehouse by the sub-application.
In a specific application, a premise of running the sub-application by a user is that a base starts to run first, and a global state warehouse is created based on the running of the base, wherein the global state warehouse can be created in a cache resource of a browser. The global state warehouse caches the target data of each sub-application in the base operation process, and when the base is inactivated, the global state warehouse of the base is cleared, so that the resources of the electronic equipment cannot be occupied.
In an implementation manner, referring to fig. 2, the data processing method according to the embodiment of the present disclosure further includes: and responding to a first activation instruction of the sub-application, and creating an application identifier of the sub-application in the global state warehouse, wherein the application identifier is used for storing target data of the corresponding sub-application. After the sub-applications are activated, in the running process, the target data of the sub-applications are synchronously cached to the corresponding application identifiers in the global state warehouse.
Referring to fig. 3, in the embodiment of the present disclosure, when a sub-application is first activated in a base, an application identifier of the activated sub-application is created in a global state repository, so as to store target data of a corresponding sub-application under the application identifier, and for reasons such as that a user switches between different sub-applications, after the sub-application is inactivated, and when the sub-application is activated again, corresponding target data can be quickly obtained according to the application identifier, so as to perform page rendering. The application switching may be in a route hopping manner, or in other manners.
Referring to fig. 3, in the embodiment of the present disclosure, the application identifiers correspond to the sub-applications one to one, so that the activated sub-applications can quickly obtain corresponding target data according to the corresponding application identifiers, and a specific form of the application identifiers is not limited. In an exemplary embodiment, the application identification may take the application name. App1, App2, and App3 are names of three sub-applications, respectively, and may be used as application identifiers of the corresponding sub-applications, respectively. In other exemplary embodiments, the application identifier may also use an application name + a timestamp as the application identifier of the different application, and the timestamp may be the time when the sub-application is first activated in the base, so the timestamp has uniqueness. For example, App1+20210321 … 08, App2+20210321 … 26, App3+20210321 … 40 may each be identified as an application for a corresponding sub-application. In a specific embodiment, the sub-applications include "sports" and "music", and the corresponding application identifiers may be sport and music. If a timestamp is added as an application identifier, the first activation time of the sub-application "sports" is 31 minutes at 14 hours at 2 months, 2 days and 2022 years, 2 months and 2 days, and the first activation time of the sub-application "music" is 50 minutes at 14 hours at 2 months, 2 days and 2022 years, then the corresponding application identifiers may be sport +202202021431 and music +202202021450, respectively. Of course, the time of the time stamp may be specific to seconds.
In one embodiment, the child application stores the target data in the form of an application node tree, and accordingly, the application identifier may be marked at the root node of the application node tree of the child application. Referring to fig. 4, an application identification "App 1" is marked at the root node.
Regarding the application node tree, referring to fig. 4, each level of nodes of the application node tree stores the target data corresponding to the node. And the nodes at all levels correspond to display interfaces at different levels in the sub application page. For example, when the child application is a video application, the application labeled at the root node is identified as "video +20210321 … 08" and the primary nodes have: the system comprises a home page interface, a subscription interface and a search interface, wherein a second-level node under a first-level node 'home page interface' comprises: the hot topic interface, the most frequently accessed interface, the newly added video interface, and the three-level nodes under the "newly added video interface" of the second-level node are also as follows: a video playing interface, a comment interface, a recommended video interface, etc. The sub-application comprises at least one level one node, and the operation of one node enters the next level node.
When the sub-application is activated, the sub-application can quickly search the corresponding application node tree according to the application identification, and the sub-application acquires the required target data from the corresponding node of the node tree and performs page rendering according to the target data. For example, when the sub-application needs to display the "most frequent access interface", the sub-application obtains the corresponding target data from the "most frequent access interface" of the second level node of the node tree, and performs page rendering.
Correspondingly, when the sub-application stores the target data, the sub-application also stores the target data in the form of nodes, and the target data of each interface is stored in the corresponding node of the interface. Taking the first-level node "search interface" as an example, when a user searches, and inputs a keyword in a search box, target data containing the keyword is cached to the corresponding node "search interface" in the application node tree of the target application in the global state repository.
In one embodiment, the sub-applications share a global state repository of bases, comprising: and under the condition that the sub-application is inactivated at the first moment, the target data corresponding to the sub-application in the global state warehouse is reserved.
In one embodiment, the method further comprises: and responding to the activation instruction of the sub-application at the second moment, acquiring target data corresponding to the sub-application in the global state warehouse, and performing page rendering based on the target data corresponding to the sub-application so as to restore the page state of the sub-application at the first moment.
At a first time, when the user is switched from the sub-application App1 to the sub-application App2, App2 is activated, App1 is deactivated, and target data corresponding to App1 in the global state repository is retained. At a second time, when the user switches back to App1 and App1 is activated again, App1 can obtain its corresponding target data from the global state repository and perform page rendering, see fig. 3. In this way, the target data of the inactivated sub-application is not lost, and the page content displayed before inactivation can be displayed when the sub-application is reactivated.
For example, the current page of App1 is a login page, after the user fills in an account and a password on the login page of App1, at the time of not clicking login, the user switches to App2, App2 is activated and App1 is deactivated, if the user switches back to App1 again and App1 is activated again, the status page of App1 can still display the login page before App1 is deactivated, that is, the account and the password that the user has filled in before App1 is deactivated are still displayed in the login page, and the user does not need to re-input when the user wants to continue logging in App 1.
In an implementation manner, referring to fig. 2, fig. 3, fig. 5, and fig. 6, the data processing method according to the embodiment of the present disclosure further includes: monitoring target data of each sub-application in the global state warehouse; and when the target data are changed, storing the target data in the global state warehouse to a nonvolatile memory to obtain persistent data.
In the embodiment of the disclosure, the target data in the global state warehouse is stored in the nonvolatile memory to obtain the persistent data, and the target data is persistent, so that the data loss caused by the fact that the global state warehouse is cleared or the data in the global state warehouse is emptied under the condition that the base is inactivated due to operations such as quitting the operation of the base, refreshing the base and the like can be avoided. Target data persistence may be the automatic saving of all target data to non-volatile memory at regular intervals. In the above embodiment, when the target data in the global state repository changes, the target data in the global state repository may be saved to the nonvolatile memory. Of course, the trigger condition for the persistence of the target data is not limited to the above-described embodiment.
In other exemplary embodiments, the states of the base and the sub-application may be monitored, and when the sub-application or the base is inactivated, the target data in the global state repository before the inactivation time is saved to the nonvolatile memory, so as to obtain the persistent data, where the nonvolatile memory may be a local memory of a device on which the browser is running.
In an implementation manner, referring to fig. 5, the data processing method according to the embodiment of the present disclosure further includes: under the condition that the base quits operation at the third moment, responding to an operation instruction of the base at the fourth moment, and operating the base; and the base responds to the activation instruction of the sub-application, and covers the persistent data in the nonvolatile memory into a global state warehouse created by the base, so that the sub-application can acquire corresponding target data to perform page rendering.
In the embodiment of the disclosure, at the third time, when the user closes the base, the base exits from running, both the base and the sub-application embedded in the base are inactivated, and at the fourth time, when the user opens the base again, the base is reactivated, the base acquires the persistent data from the local nonvolatile memory, the persistent data is covered to the global state repository, the activated sub-application can acquire the corresponding target data from the global state repository, and since the target data in the global state repository is synchronously updated to the latest page state of the sub-application before the deactivation of the sub-application, the page content displayed by the sub-application after the page rendering is also displayed before the deactivation of the sub-application.
Referring to fig. 3, the data processing method according to the embodiment of the present disclosure further includes: creating a global scope based on the base operation, wherein the global scope provides an operation environment for the activated sub-application; a scheduler is declared in the global scope, through which the child applications running in the global scope obtain authorization to modify the target data within the global state repository.
In the embodiment of the disclosure, referring to fig. 3, based on the operation of the base, a global scope is created in the base, the activated sub-application is operated in the global scope, when the global scope is created, a scheduler is declared in the global scope, the sub-application operated in the global scope can take the scheduler and manage the global state warehouse through the scheduler, and when the state of the sub-application changes, the corresponding target data in the global state warehouse is modified in time. All the sub-applications running in the global scope manage the global state warehouse through the scheduler, and based on the same rule, when the state changes, each sub-application can modify all the target data related to the global state warehouse: for example, when switching to App2 through App1, since App1 interacts with App2, App1 changes from active state to inactive state, and App2 changes from inactive state to active state, for this interaction, the state data of App1 is modified, and the state data of App2 involved in the interaction is also modified. The situation that the states cannot be managed in a unified mode when each sub-application manages the corresponding state warehouse is avoided. In fig. 3, the sub-application App1 running in the global scope is in an activated state, other sub-applications are in an inactivated state, and when the sub-application App1 is activated, corresponding target data is acquired from the global state repository. During the running process of the sub-application App1, the target data is stored under the corresponding application identifier in the global state warehouse through the scheduler.
The data processing method according to the embodiment of the present disclosure is described below with reference to specific application scenarios.
Application scenario one
When a user first activates a sub-application on an electronic device, as shown in FIG. 2, the user starts the base, the base starts running, the base creates a global scope, and a scheduler is declared in the global scope, and the base creates a global state repository. And when the sub-application is activated for the first time in the base, the base creates an application identifier of the sub-application in the global state warehouse, and during the running process of the sub-application, target data generated by the sub-application is synchronously stored under the corresponding application identifier in the global state warehouse. And in the base operation process, monitoring the global state warehouse in the whole process, and when the target data in the global state warehouse changes, storing the target data in the global state warehouse to a local nonvolatile memory to make the target data persistent to obtain persistent data.
Application scenario two
Referring to FIG. 5, when the user opens the base again after closing the base, the base is activated again, the base creates the global scope and declares a scheduler in the global scope, and the base creates the global state repository. The reactivated base retrieves the persisted data from the local that was backed up when it was last in the activated state, and overlays it to the global state repository. And clicking one sub-application by the user, activating the sub-application, and acquiring corresponding target data from the global state warehouse to render a page when the sub-application is activated. And if the sub-application is not activated for the first time, the target data acquired by the sub-application is the target data stored in the global state warehouse when the sub-application is in the activated state last time, and the sub-application performs page rendering according to the target data to display the page displayed before the deactivation moment of the sub-application. And in the running process of the sub-application, target data generated by the sub-application is synchronously stored in the global state warehouse, and in the running process of the base, the global state warehouse is monitored in the whole process and the target data is persisted.
Application scenario three
When the base is not inactivated, but only the sub-application is reactivated, the base does not need to acquire the persistent data from the local nonvolatile memory to cover the global state warehouse, and the reactivated sub-application acquires the corresponding target data from the global state warehouse of the base to perform page rendering.
Application scenario four
Target data in the global state warehouse can be shared among sub-applications under the same base, the target data of each sub-application is in a common state, and each sub-application can adjust the target data in the global state warehouse. For example, when the App1 logs in an application by inputting an account and a password, and the account and the password are stored in the global state repository under the application identifier corresponding to the App1, and when the App1 is switched to the App2, the App2 can obtain the account and the password stored in the App1 from the global state repository, then the user logs in the App2 in at least two ways: the first mode is as follows: prompting the user at an App2 login interface to 'whether to login with the account number and password'; or the second mode: when the system confirms that App2 and App1 are located on the same base, App2 is automatically logged in directly by the account number and the password.
Embodiments of the present disclosure may implement functionality similar to single sign-on.
Referring to fig. 7, an embodiment of the present disclosure provides a data processing apparatus, where a base includes a pluggable web sub-application, and the sub-application shares a global state repository of the base, and the apparatus includes: the response module is used for responding to the activation instruction of the sub-application and confirming whether the sub-application is the sub-application of the current base or not; a data acquisition module to: and if the sub-application belongs to the sub-application of the current base, the sub-application acquires corresponding target data in the global state warehouse, and page rendering of the sub-application is performed based on the target data.
According to the data processing device, after the originally independent sub-applications are embedded into the base, the sub-applications can share the global state warehouse, data management is uniform and convenient, when one sub-application in the base is switched to another sub-application in the base, the data of the original sub-application cannot be lost, and the change of the state data caused by the interaction behavior among the sub-applications can be cached.
In an implementation manner, the data processing apparatus further includes a creating module, where the creating module is configured to create a global state warehouse based on the operation of the base, and the sub-application synchronously caches target data corresponding to the sub-application in the global state warehouse.
In one embodiment, the sub-applications share a global state repository of the base, comprising: and under the condition that the sub-application is inactivated at the first moment, the target data corresponding to the sub-application in the global state warehouse is reserved.
In one embodiment, the response module performs page rendering of the sub-application based on the target data, including: the response module responds to the activation instruction of the sub-application at the second moment, obtains target data corresponding to the sub-application in the global state warehouse, and performs page rendering based on the target data corresponding to the sub-application, so that the sub-application is recovered to the page state at the first moment.
In an implementation manner, the data processing device further comprises a persistence module, wherein the persistence module is used for monitoring target data in the global state warehouse; and when the target data are changed, storing the target data in the global state warehouse to a nonvolatile memory to obtain persistent data.
In one embodiment, the response module is further configured to: under the condition that the base quits operation at the third moment, responding to an operation instruction of the base at the fourth moment, and operating the base; and the base responds to the activation instruction of the sub-application, and covers the persistent data in the nonvolatile memory into a global state warehouse created by the base, so that the sub-application can acquire corresponding target data to perform page rendering.
In one embodiment, the creation module is further configured to: creating a global scope based on the base operation, wherein the global scope provides an operation environment for the activated sub-application; a scheduler is declared in the global scope, through which the child applications running in the global scope obtain authorization to modify the target data within the global state repository.
In one embodiment, the response module is further configured to: and responding to the first activation instruction of the sub-applications, creating application identifications of the sub-applications in the global state warehouse, wherein the sub-applications are used for storing corresponding target data according to the respective corresponding application identifications.
In one implementation, a sub-application stores its corresponding target data in each level of nodes of an application node tree corresponding to the sub-application; correspondingly, the application identification mark is marked at the root node of the application node tree.
The data processing apparatus in the embodiment of the present disclosure can implement the method in the above embodiment, and the above description on the embodiment of the data processing apparatus is similar to the description on the embodiment of the foregoing method, and has similar beneficial effects to the foregoing embodiment of the method, and therefore, the description is not repeated. For technical details that have not been disclosed yet in the description of the embodiments of the data processing apparatus of the present disclosure, please refer to the description of the foregoing method embodiments of the present disclosure for understanding, and therefore, for brevity, will not be described again.
The present disclosure also provides an electronic device and a readable storage medium according to an embodiment of the present disclosure.
FIG. 8 illustrates a schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 8, the apparatus 800 includes a computing unit 801 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)802 or a computer program loaded from a storage unit 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The calculation unit 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
A number of components in the device 800 are connected to the I/O interface 805, including: an input unit 806, such as a keyboard, a mouse, or the like; an output unit 807 such as various types of displays, speakers, and the like; a storage unit 808, such as a magnetic disk, optical disk, or the like; and a communication unit 809 such as a network card, modem, wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
Computing unit 801 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and the like. The calculation unit 801 executes the respective methods and processes described above, such as the data processing method. For example, in some embodiments, the data processing method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program can be loaded and/or installed onto device 800 via ROM 802 and/or communications unit 809. When loaded into RAM 803 and executed by the computing unit 801, a computer program may perform one or more steps of the data processing method described above. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the data processing method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server with a combined blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and the present disclosure is not limited herein.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present disclosure, "a plurality" means two or more unless specifically limited otherwise.
The above description is only for the specific embodiments of the present disclosure, but the scope of the present disclosure is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present disclosure, and all the changes or substitutions should be covered within the scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims (10)

1. A method of data processing, comprising: the base comprises a pluggable web sub-application, and the sub-application shares a global state warehouse of the base:
responding to an activation instruction of a sub-application, and confirming whether the sub-application is a sub-application of a current base or not;
and if the sub-application belongs to the sub-application of the current base, the sub-application acquires corresponding target data in the global state warehouse, and page rendering of the sub-application is carried out based on the target data.
2. The method of claim 1, further comprising:
and creating the global state warehouse based on the operation of the base, wherein the sub-application synchronously caches the target data corresponding to the sub-application in the global state warehouse.
3. The method of claim 2, the sub-applications sharing a global state store of the base, further comprising:
and under the condition that the sub-application is inactivated at the first moment, target data corresponding to the sub-application in the global state warehouse is reserved.
4. The method of claim 3, the rendering of pages of the sub-application based on the target data, comprising:
and responding to an activation instruction of the sub-application at a second moment, acquiring target data corresponding to the sub-application in the global state warehouse, and performing page rendering based on the target data corresponding to the sub-application so as to restore the sub-application to the page state at the first moment.
5. The method of claim 1, further comprising:
monitoring target data in the global state warehouse;
and when the target data are changed, storing the target data in the global state warehouse to a nonvolatile memory to obtain persistent data.
6. The method of claim 5, further comprising: in the case where the susceptor exits operation at the third moment,
responding to an operation instruction of the base at a fourth moment, and operating the base;
and the base responds to an activation instruction of the sub-application and covers the persistent data in the nonvolatile memory into a global state warehouse created by the base, so that the sub-application can acquire corresponding target data for page rendering.
7. The method of claim 1, further comprising:
creating a global scope based on the base operation, wherein the global scope provides an operation environment for the activated sub-application;
declaring a scheduler in the global scope, by which the child application running in the global scope obtains authorization to modify the target data within the global state repository.
8. The method of claim 1, further comprising:
and responding to the first activation instruction of the sub-applications, creating application identifiers of the sub-applications in the global state warehouse, and storing corresponding target data by the sub-applications according to the respective corresponding application identifiers.
9. The method of claim 8, the sub-applications storing their corresponding target data in nodes at levels of an application node tree to which the sub-applications correspond;
correspondingly, the application identification mark is marked at the root node of the application node tree.
10. A data processing apparatus containing pluggable web sub-applications in a base, the sub-applications sharing a global state repository of the base, the apparatus comprising:
the response module is used for responding to an activation instruction of the sub-application and confirming whether the sub-application is a sub-application of the current base or not;
a data acquisition module to: and if the sub-application belongs to the sub-application of the current base, the sub-application acquires corresponding target data in the global state warehouse, and page rendering of the sub-application is carried out based on the target data.
CN202210473097.2A 2022-04-29 2022-04-29 Data processing method and device Pending CN114860364A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210473097.2A CN114860364A (en) 2022-04-29 2022-04-29 Data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210473097.2A CN114860364A (en) 2022-04-29 2022-04-29 Data processing method and device

Publications (1)

Publication Number Publication Date
CN114860364A true CN114860364A (en) 2022-08-05

Family

ID=82636346

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210473097.2A Pending CN114860364A (en) 2022-04-29 2022-04-29 Data processing method and device

Country Status (1)

Country Link
CN (1) CN114860364A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102779177A (en) * 2012-06-27 2012-11-14 优视科技有限公司 Back-up method, restoring method and device of browse history of browser
CN112612467A (en) * 2020-12-22 2021-04-06 中国建设银行股份有限公司 Method and device for processing micro front-end architecture based on qiankun
CN113448702A (en) * 2021-06-16 2021-09-28 浪潮软件股份有限公司 Front-end-based micro-service design method
US20220103427A1 (en) * 2020-09-29 2022-03-31 Juniper Networks, Inc. Configuration data migration for distributed micro service-based network applications

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102779177A (en) * 2012-06-27 2012-11-14 优视科技有限公司 Back-up method, restoring method and device of browse history of browser
US20220103427A1 (en) * 2020-09-29 2022-03-31 Juniper Networks, Inc. Configuration data migration for distributed micro service-based network applications
CN112612467A (en) * 2020-12-22 2021-04-06 中国建设银行股份有限公司 Method and device for processing micro front-end architecture based on qiankun
CN113448702A (en) * 2021-06-16 2021-09-28 浪潮软件股份有限公司 Front-end-based micro-service design method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
字节跳动技术团队: "字节跳动的微前端沙盒实践", pages 1 - 8, Retrieved from the Internet <URL:https://www.infoq.cn/article/U9dkjJleg2HP6uqhSOIi?utm_source=related_read&utm_medium=article> *
晒兜斯: "基于 qiankun 的微前端最佳实践(图文并茂)-应用间通信篇", pages 1 - 18, Retrieved from the Internet <URL:https://segmentfault.com/a/1190000022583716> *
雨甫: "Bifrost微前端框架及其在美团闪购中的实践", pages 1 - 14, Retrieved from the Internet <URL:https://tech.meituan.com/2019/12/26/meituan-bifrost.html> *

Similar Documents

Publication Publication Date Title
US20160360006A1 (en) Management of connections within a messaging environment based on the statistical analysis of server responsiveness
CN113391944A (en) Deferred server recovery in a computing system
CN113364877B (en) Data processing method, device, electronic equipment and medium
CN110221910B (en) Method and apparatus for performing MPI jobs
CN113961510B (en) File processing method, device, equipment and storage medium
CN108632354A (en) Physical machine receives pipe method, apparatus and cloud desktop management platform
CN113452617A (en) Dynamic gateway route management method, device and storage medium
CN114816393A (en) Information generation method, device, equipment and storage medium
CN111339187A (en) Data processing method, device, equipment and storage medium based on intelligent contract
US10180914B2 (en) Dynamic domain name service caching
CN117435569A (en) Dynamic capacity expansion method, device, equipment, medium and program product for cache system
CN116545905A (en) Service health detection method and device, electronic equipment and storage medium
US10110502B1 (en) Autonomous host deployment in managed deployment systems
CN114860364A (en) Data processing method and device
CN115550363A (en) Node hierarchical management method and device and electronic equipment
CN111835857B (en) Method and apparatus for accessing data
CN115421859A (en) Dynamic loading method and device of configuration file, computer equipment and storage medium
CN114461950A (en) Global caching method and device, electronic equipment and storage medium
CN114567661A (en) Control method and device for traffic lighting device, electronic equipment and medium
CN113986476A (en) Sensor equipment virtualization method and device, electronic equipment and storage medium
CN110851192B (en) Method and device for responding to degraded switch configuration
CN113868184A (en) Configuration method and system of master-slave architecture cache-based configuration center
CN113448695A (en) Method, device, electronic equipment and medium for realizing process persistence
CN111258954B (en) Data migration method, device, equipment and storage medium
CN112650814B (en) Data storage method, device, equipment and storage medium based on message middleware

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