Application integration method and device
By analyzing the application's identifier and routing information, loading the application using an iframe method to realize application integration, solving the problem of interaction and function uniformity in the existing technology and improving the user experience.
Patent Information
- Application Number
- CN202210303778.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-24
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2042-03-24
AI Technical Summary
The existing application integration methods cannot effectively achieve interaction and function unification, resulting in cumbersome user operations and affecting the user experience.
By determining the application identifier based on the application's unified resource locator URL, parsing the application type and front-end routing information, loading the application using an iframe method, achieving unified interaction and function, and supporting communication and service provision between the main application and the sub-app.
It realizes the interaction and function of the application, without the need for a new window to open, simplify user operations and improve user experience.
Smart Images

Figure CN114661375B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular, to an application integration method and device. Background Art
[0002] With the development of technology, the content carried by front-end applications is becoming increasingly complex, especially in the industrial field. Since the industry involves many industries and each industry has its own sub-sectors, it is faced with a large number of heterogeneous existing systems. Specifically, the demand for various systems in each industry is also very large. In order to meet the diverse needs of users, this can be achieved through application integration.
[0003] Currently, in traditional application integration, single sign-on (SSO) is generally used to implement application login-free and open the application in a new window. However, this method separates the interaction between applications, resulting in a poor user experience.
[0004] Therefore, the existing application integration methods cannot effectively achieve interaction and functional unification, making user operations cumbersome and thus affecting user experience. Summary of the invention
[0005] The embodiments of the present application provide an application integration method and device to solve the problem that the prior art cannot effectively achieve interaction and functional unification, making user operations cumbersome and thus affecting user experience.
[0006] In a first aspect, an embodiment of the present application provides an application integration method, the method comprising:
[0007] Determine an identifier corresponding to each application according to the acquired uniform resource locator URL corresponding to each application;
[0008] Determine, according to each of the identifiers, the type of each of the applications and the front-end routing information of each of the applications, the types of the applications comprising a first application type and a second application type, the applications of the first application type comprising a main application and a first sub-application, and the applications of the second application type comprising a second sub-application;
[0009] According to the type of each application and the front-end routing information of each application, each application is loaded to obtain a target page;
[0010] The target page is a page integrated by each of the applications, and the integrated main application supports providing services for the first sub-application and / or the second sub-application.
[0011] Optionally, determining the type of each of the applications and the front-end routing information of each of the applications according to each of the identifiers includes:
[0012] For each of the identifiers, perform the following steps:
[0013] Determining the type of the application according to a combination of character strings in the identifier;
[0014] According to the identifier and the corresponding type of the application, the front-end routing information of the application is obtained through routing resolution.
[0015] Optionally, determining the type of the application according to a combination of character strings in the identifier includes:
[0016] If the identifier does not contain a character string for representing a unique identification of an application, determining that the type of the application is a first application type and the application is a main application;
[0017] If the identifier contains a character string for representing a path and an application unique identifier, determining that the type of the application is a first application type and the application is a first sub-application;
[0018] If the identifier contains a character string for representing an application unique identifier and a page number unique identifier, it is determined that the type of the application is a second application type and the application is a second sub-application.
[0019] Optionally, obtaining the front-end routing information of the application through routing resolution according to the identifier and the corresponding type of the application includes:
[0020] If the application is a main application in the first application type, obtaining preset routing information corresponding to the main application according to the identifier, and using the preset routing information as the front-end routing information corresponding to the main application;
[0021] If the application is the first sub-application in the first application type, the application unique identifier and the page number unique identifier corresponding to the first sub-application are parsed according to the identifier, and the application unique identifier and the page number unique identifier corresponding to the first sub-application are used as the front-end routing information corresponding to the first sub-application;
[0022] If the application is the second sub-application in the first application type, the application unique identifier and page number unique identifier corresponding to the second sub-application are parsed according to the identifier, and the application unique identifier and page number unique identifier corresponding to the second sub-application are used as the front-end routing information corresponding to the second sub-application.
[0023] Optionally, loading each application according to the type of each application and the front-end routing information of each application to obtain a target page includes:
[0024] For each of the applications, perform the following steps:
[0025] If the application is the main application, then according to the preset routing information corresponding to the main application, the configuration information corresponding to the main application is obtained, and according to the configuration information corresponding to the main application, the main framework of the main application is loaded; multiple modules in the main application are initialized to support the main application to provide services for the first sub-application and / or the second sub-application, and the application container for storing the first sub-application and / or the second sub-application is initialized; the main page corresponding to the main application is rendered; wherein the multiple modules include an application communication module, a business component module, and a statistical management module;
[0026] If the application is the first sub-application, then according to the application unique identifier and the page number unique identifier corresponding to the first sub-application, obtain the configuration information corresponding to the first sub-application, and according to the configuration information corresponding to the first sub-application, load the static resources corresponding to the first sub-application and initialize the application communication module to support the first sub-application to communicate with the main application; render the first sub-page corresponding to the first sub-application;
[0027] If the application is the second sub-application, then according to the application unique identifier and page number unique identifier corresponding to the second sub-application, obtain the preset log-free URL corresponding to the second sub-application, and load the preset log-free URL. If the log-free URL is successful, mark the login state and render to obtain the second sub-page corresponding to the second sub-application; initialize the application communication module and the statistical dotting module to support the second sub-application to communicate with the main application and the second sub-application to support automatic dotting and on-demand dotting functions;
[0028] The main page, the first sub-page and the second sub-page are integrated on the target page.
[0029] Optionally, loading the main framework of the main application according to the configuration information corresponding to the main application includes:
[0030] Obtaining, through preset configuration information corresponding to the main application, a first static resource required for loading the main application;
[0031] According to the first static resource, load a main frame corresponding to the main application, where the main frame is used to represent a page layout;
[0032] Accordingly, the initialization of multiple modules in the main application includes:
[0033] Matching application program interfaces to the main application, the first sub-application, and the second sub-application to support communication between the main application and the first sub-application and the second sub-application respectively;
[0034] Dynamically load the business component module pre-configured in the main application and enable the functions provided by the business component module through a preset module packager, so as to support the first sub-application and / or the second sub-application to use the functions provided by the business component module in the main application through the application communication module, wherein the functions provided by the business component module at least include a method for opening application content on a page;
[0035] Match the automatic docking and on-demand docking functions for the statistical docking module and enable the automatic docking and on-demand docking functions to support the main application in listening to the statistical docking requests of the second sub-application, and if the statistical docking request is listened to, support the second sub-application to implement automatic docking and on-demand docking functions by obtaining the corresponding software development kit SDK.
[0036] Optionally, loading static resources corresponding to the first sub-application according to configuration information corresponding to the first sub-application includes:
[0037] Determining whether a user of the first sub-application has access rights according to the permission point in the configuration information corresponding to the first sub-application;
[0038] If there is access permission, obtaining a second static resource from the configuration information corresponding to the first sub-application, and loading the second static resource; the second static resource is a static resource corresponding to the first sub-application;
[0039] Accordingly, the initializing the application communication module includes:
[0040] An application program interface is matched between the main application and the first sub-application to support communication between the main application and the first sub-application.
[0041] Optionally, acquiring a preset login-free URL corresponding to the second sub-application according to the application unique identifier and the page number unique identifier corresponding to the second sub-application includes:
[0042] Acquire the public key and the secret key of the second sub-application according to the application unique identifier and the page number unique identifier of the second sub-application;
[0043] According to the public key and the secret key, obtaining a preset login-free URL corresponding to the second sub-application through a preset protocol;
[0044] Accordingly, the initialization of the application communication module and the statistical management module includes:
[0045] Matching application program interfaces for the main application and the second sub-application to support communication between the main application and the second sub-application;
[0046] The automatic dotting and on-demand dotting functions are matched and enabled for the statistical dotting module, so as to support the second sub-application to realize the automatic dotting and on-demand dotting functions by acquiring the corresponding software development kit SDK.
[0047] Optionally, determining the identifier corresponding to each application according to the acquired uniform resource locator URL corresponding to each application includes:
[0048] By accessing the URL corresponding to each of the obtained applications, an identifier corresponding to each of the applications is obtained.
[0049] In a second aspect, an embodiment of the present application provides an application integration device, the device comprising:
[0050] A first processing module, configured to determine an identifier corresponding to each application according to the acquired uniform resource locator URL corresponding to each application;
[0051] A second processing module, configured to determine, according to each of the identifiers, a type of each of the applications and front-end routing information of each of the applications, wherein the types of the applications include a first application type and a second application type, wherein applications of the first application type include a main application and a first sub-application, and applications of the second application type include a second sub-application;
[0052] An integration module, used to load each of the applications according to the type of each of the applications and the front-end routing information of each of the applications to obtain a target page;
[0053] The target page is a page integrated by each of the applications, and the main application on the target page supports providing services for the first sub-application and / or the second sub-application.
[0054] The application integration method and device provided in the embodiment of the present application first determine the identifier corresponding to each application based on the URL corresponding to each application obtained, and then parse the type of each application and the front-end routing information based on the identifier of each application. Since different application types correspond to different loading methods, the corresponding application is loaded by combining the application type and the front-end routing information, and the target page of each application integration is rendered and displayed. During the application loading process, multiple modules provided by the main application are initialized, so that the integrated main application can support providing services for the first sub-application and / or the second sub-application, realizing functional reuse and unified interaction. There is no need to open the pages of each application in a new window, and the operation can be performed on one page, providing users with convenient operations and thus improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0056] Figure 1 A flowchart of an application integration method provided in an embodiment of the present application;
[0057] Figure 2 A schematic diagram of a target page provided in an embodiment of the present application;
[0058] Figure 3 A flowchart of an application integration method provided in yet another embodiment of the present application;
[0059] Figure 4 A schematic diagram of the structure of an application integration device provided in an embodiment of the present application;
[0060] Figure 5 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0061] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0062] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can also include other sequential instances in addition to those illustrated or described. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0063] At present, in traditional application integration, single sign-on is generally used to implement application login-free and open the application in a new window. However, this method separates the interaction between applications, resulting in a poor user experience. Therefore, the existing application integration method cannot effectively achieve interaction and functional unification, making user operations cumbersome, which in turn affects the user experience.
[0064] In order to solve the above problems, the invention concept of this application is: loading applications through iframe, different application types correspond to different loading logic, to achieve application decoupling, at the same time, based on URL routing resolution, obtain front-end routing information through identifiers and load applications according to the front-end routing information, to achieve interaction and functional unification, making user operation convenient, thereby affecting user experience.
[0065] The technical solution of the present application is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0066] Figure 1 This is a flow chart of the application integration method provided in the embodiment of the present application. The method of this embodiment can be executed by a server and applied to industrial scenarios. Figure 1 As shown, the method of this embodiment may include:
[0067] S101. Determine an identifier corresponding to each application according to the acquired uniform resource locator URL corresponding to each application.
[0068] In this embodiment, after the application is registered on the platform, a Uniform Resource Locator (URL) is provided, and the server can obtain the URL and access the URL through a browser to obtain an identifier, such as activeKey.
[0069] Optionally, determining the identifier corresponding to each application according to the acquired uniform resource locator URL corresponding to each application can be achieved by the following steps:
[0070] By accessing the URL corresponding to each of the obtained applications, an identifier corresponding to each of the applications is obtained.
[0071] In this embodiment, the activeKey is obtained by performing routing analysis according to the access URL. For example, if the URL is "https: / / ... / iframe?activeKey=...", the activeKey string is obtained by analysis.
[0072] S102: Determine the type of each application and the front-end routing information of each application according to each identifier.
[0073] The types of applications include a first application type and a second application type, the applications of the first application type include a main application and a first sub-application, and the applications of the second application type include a second sub-application.
[0074] In this embodiment, based on the string in the identifier, it is determined whether the application is of the first application type (such as a first-party application). If it is the first application type, it is further determined whether the application is a main application or a first sub-application (a first-party sub-application); if it is the second application type, the application is a second sub-application (such as a third-party sub-application). By combining the type and the identifier, the front-end routing information of the application is obtained, and based on the front-end routing information, resources can be loaded and modules can be initialized to render the target page.
[0075] S103, loading each application according to the type of each application and the front-end routing information of each application to obtain a target page;
[0076] The target page is a page integrated by each of the applications, and the integrated main application supports providing services for the first sub-application and / or the second sub-application. For example, the main application is the entire framework of a digital factory developed by developer A, the first sub-application can be some applications derived or newly created in the digital factory developed by developer A (such as an Enterprise Resource Planning (ERP) system, a Manufacturing Execution System (MES)), and the second sub-application is an application developed by developer B.
[0077] In this embodiment, different types of applications are loaded in different ways. For example, the main application loading may be loading the main framework, initializing the application, and initializing the application container. The first sub-application loading may be loading static resources, initializing the application communication module preset by the main application, and communicating with the main application on demand. The second sub-application loading may be obtaining a log-free URL, loading the log-free URL, and initializing the application communication module and statistical management module preset by the main application, etc. Therefore, by implementing the above-mentioned application loading and then implementing application integration, there is no need to open each application page in a new window, and multiple windows can be opened on one page, achieving unified interaction and function reuse, while simplifying the user's operation steps, making it easier for the user to view, thereby improving the user experience.
[0078] The application integration method provided in the present application determines the identifier corresponding to each application based on the URL corresponding to each application obtained, and then parses the type of each application and the front-end routing information based on the identifier of each application. Since different application types correspond to different loading methods, the corresponding application is loaded by combining the application type and the front-end routing information, and the target page of each application integration is rendered and displayed. During the application loading process, multiple modules provided by the main application are initialized, so that the integrated main application can support the provision of services for the first sub-application and / or the second sub-application, realizing functional reuse and interaction unification. There is no need to open the pages of each application in a new window, and the operation can be performed on one page, providing users with convenient operations, effectively realizing interaction unification, data interoperability and application integration that meets diverse needs, thereby improving user experience.
[0079] Optionally, determining the type of each application and the front-end routing information of each application according to each identifier may be implemented by the following steps (for each identifier, the following steps are performed):
[0080] Step a1, determining the type of the application according to the combination of the character strings in the identifier;
[0081] Step a2: Obtain the front-end routing information of the application through routing resolution according to the identifier and the corresponding application type.
[0082] In this embodiment, by parsing the string in the identifier, the string combination rule can be determined, and based on the combination rule, the type of the application can be determined. For this type of application, the identifier is used to implement routing parsing to obtain the front-end routing information, and then obtain the configuration resources of the application.
[0083] Optionally, determining the type of each application according to the combination of character strings in each identifier can be achieved by the following steps (for each identifier, perform the following steps):
[0084] Step b1: If the identifier does not contain a character string for representing a unique identification of an application, it is determined that the type of the application is a first application type and the application is a main application.
[0085] Step b2: If the identifier contains a character string for representing a path and an application unique identifier, it is determined that the type of the application is a first application type and the application is a first sub-application.
[0086] Step b3: If the identifier contains a character string for representing an application unique identifier and a page number unique identifier, it is determined that the type of the application is a second application type and the application is a second sub-application.
[0087] In this embodiment, if the identifier contains at least a character string for indicating a path, the type of the application is determined to be a first application type, otherwise, it is determined to be a second application type.
[0088] For example, if activeKey appears in the form of / :appId / :path, it means that the link (i.e., URL) is a sub-application (i.e., the first sub-application). Here, appId represents the unique identifier of the application, and path represents the path. The application needs to be configured with relevant menu information, permission information, application purchase and activation information, etc. in advance.
[0089] If activeKey appears in the form of ${appId}_${pageId}, such as e1cb05ecc58f46fda3d0ac6fa736ea04_1043519, it means that the application is a second-party sub-application. The pageId here indicates the unique identifier of the page number. The application needs to be registered in advance to obtain the application ask (that is, the public key and the secret key), and the application implements the free login interface according to the SSO protocol or the OAuth2.0 protocol (an application / user authorization protocol); it needs to configure relevant menus, permissions and other information, and put it on the application market and then obtain the page URL based on appId+pageId.
[0090] The implementation of this embodiment is based on the scenario where the user has purchased and activated the application.
[0091] Optionally, obtaining the front-end routing information of the application through routing resolution according to the identifier and the corresponding type of the application can be achieved by the following steps (for each application, perform the following steps):
[0092] Step c1: If the application is a main application in the first application type, then according to the identifier, the preset routing information corresponding to the main application is obtained, and the preset routing information is used as the front-end routing information corresponding to the main application.
[0093] Step c2: If the application is the first sub-application in the first application type, parse the application unique identifier and page number unique identifier corresponding to the first sub-application according to the identifier, and use the application unique identifier and page number unique identifier corresponding to the first sub-application as the front-end routing information corresponding to the first sub-application.
[0094] Step c3: If the application is the second sub-application in the first application type, parse the application unique identifier and page number unique identifier corresponding to the second sub-application according to the identifier, and use the application unique identifier and page number unique identifier corresponding to the second sub-application as the front-end routing information corresponding to the second sub-application.
[0095] In this embodiment, for the main application, application loading can be achieved through routing resolution. Before loading the application, it is necessary to first resolve the static resources required for loading the main application. The static resources here include at least public resources, various types of files, etc. Specifically, if the application belongs to the main application, the default route (i.e., the preset routing information) is matched, and then the required static resources are resolved based on the preset routing information. For the first sub-application and the second sub-application, appId and pageId are resolved through routing, and the page is rendered according to appId and pageId.
[0096] Optionally, this embodiment, based on the above embodiment, describes in detail how each application is loaded. According to the type of the application and the front-end routing information of the application, the application is loaded to obtain the target page, which can be achieved by the following steps (for each application, perform the following steps):
[0097] Step d1: If the application is the main application, then according to the preset routing information corresponding to the main application, the configuration information corresponding to the main application is obtained, and according to the configuration information corresponding to the main application, the main framework of the main application is loaded; multiple modules in the main application are initialized to support the main application to provide services for the first sub-application and / or the second sub-application, and the application container for storing the first sub-application and / or the second sub-application is initialized; the main page corresponding to the main application is rendered; wherein the multiple modules include an application communication module, a business component module, and a statistical management module.
[0098] In this embodiment, for the main application, based on the preset routing information, the configuration information required to load the main application can be obtained, and the page loading and rendering of the main application is implemented based on the configuration information to display the main page.
[0099] During the loading process, the application needs to be initialized, that is, to give the module functions in the application to ensure that the module can provide corresponding services normally. The main application initialization process includes application initialization and application container initialization. The application container here is used to store integrated sub-applications, such as the first sub-application and the second sub-application.
[0100] Optionally, according to the configuration information corresponding to the main application, loading the main framework of the main application can be achieved by the following steps:
[0101] Step d11: Obtain the first static resource required to load the main application through the preset configuration information corresponding to the main application.
[0102] Step d12: load the main frame corresponding to the main application according to the first static resource to obtain the main page; the main frame is used to represent the page layout.
[0103] In this embodiment, the loading process of the main application (excluding the application name) can be: loading the main frame: page layout (Layout), which consists of three parts, namely, sidebar-navigation menu, top-toolbar and application container.
[0104] Optionally, the initialization of multiple modules in the main application can be achieved by the following steps:
[0105] Step d13, matching application program interfaces to the main application, the first sub-application, and the second sub-application to support communication between the main application and the first sub-application and the second sub-application respectively;
[0106] Step d14: dynamically load the business component module pre-configured in the main application through a preset module packager and enable the functions provided by the business component module to support the first sub-application and / or the second sub-application to use the functions provided by the business component module in the main application through the application communication module, wherein the functions provided by the business component module at least include a method for opening application content on a page;
[0107] Step d15, match the automatic dotting and on-demand dotting functions for the statistical dotting module and enable the automatic dotting and on-demand dotting functions to support the main application to monitor the statistical dotting requests of the second sub-application, and if the statistical dotting requests are monitored, support the second sub-application to implement automatic dotting and on-demand dotting functions by obtaining the corresponding software development kit SDK.
[0108] Specifically, application initialization: 1. Initialize the application communication module; configure the application interface and enable its functions, that is, realize the communication between the main application and the sub-application (such as the first sub-application and the second sub-application) through the application interface (postmessage), so that the sub-application can call the methods provided by the main application, such as opening Tab, full screen and other common functional operations. 2. Initialize the business component module; configure the business component module to enable its functions, that is, in order to solve the problem of traditional iframe UI asynchronization, the main application presets common business components (through module packagers, such as webpack to achieve dynamic loading); for example, the data selection component, the sub-application can trigger the main application to open the data selection pop-up box through the application communication module, and the user selects the data and returns the result to the sub-application to complete the subsequent business; for another example, the sub-application has content that wants to be opened in the form of pop-up windows, side frames, etc. In the traditional iframe method, the content can only be confined to the sub-application container. In this way, the content can be displayed globally. 3. Initialize the statistical management module; configure the statistical management module and start its function, that is, it is used to monitor the statistical management requests of sub-applications. The sub-applications use the relevant SDK to implement automatic management and on-demand management functions.
[0109] Secondly, the application container is initialized, configured and enabled, that is, the application container is assigned and enabled for storing the integrated first sub-application and the second sub-application.
[0110] Step d2: If the application is the first sub-application, then according to the application unique identifier and page number unique identifier corresponding to the first sub-application, obtain the configuration information corresponding to the first sub-application, and according to the configuration information corresponding to the first sub-application, load the static resources corresponding to the first sub-application and initialize the application communication module to support the first sub-application to communicate with the main application; render the first sub-page corresponding to the first sub-application.
[0111] In this embodiment, the loading process of the first sub-application can be: obtain appId and pageId through routing resolution, and obtain the corresponding configuration, that is, the configuration information corresponding to the first sub-application according to appId and pageId, so as to realize the loading of the first sub-application. Specifically, the front-end routing information is obtained through routing resolution, and the static resources required for loading the application are obtained through the configuration information preset in the Application Configuration Management (ACM). The simplified configuration is as follows, where common is a reusable resource configuration, navigation is an application resource configuration, and navigation / :path is a specific page configuration. Through the configuration, the sub-application rendering can be flexibly realized, and the theme switching, permission control, etc. are supported.
[0112] Optionally, according to the configuration information corresponding to the first sub-application, loading the static resources corresponding to the first sub-application may be achieved by the following steps:
[0113] Step d21: Determine whether the user of the first sub-application has access rights according to the permission point in the configuration information corresponding to the first sub-application.
[0114] Step d22: If there is access permission, obtain the second static resource from the configuration information corresponding to the first sub-application, and load the second static resource.
[0115] Among them, the second static resource is the static resource corresponding to the first sub-application.
[0116] In this embodiment, according to the permission point in the configuration, it is determined whether the current user has the permission to access, and if not, the page used to indicate no permission is redirected. The static resources in the configuration are loaded, and the front-end is routed to the corresponding page.
[0117] Optionally, the initialization of the application communication module may be achieved by the following steps:
[0118] An application program interface is matched between the main application and the first sub-application to support communication between the main application and the first sub-application.
[0119] In this embodiment, during the loading process of the first sub-application, the application communication module is initialized, the application program interface is configured and its functions are enabled, that is, communication between the main application and the first sub-application is achieved through the application program interface, so that the first sub-application can call methods provided by the main application, such as opening Tab, full screen and other common function operations.
[0120] Step d3: If the application is the second sub-application, then according to the application unique identifier and page number unique identifier corresponding to the second sub-application, obtain the preset log-free URL corresponding to the second sub-application, and according to the preset log-free URL, if the log-free is successful, mark the login state and render the second sub-page corresponding to the second sub-application; initialize the application communication module and the statistical dotting module to support the second sub-application to communicate with the main application and the second sub-application to support automatic dotting and on-demand dotting functions.
[0121] The main page, the first sub-page and the second sub-page are integrated on the target page.
[0122] In this embodiment, the loading process of the second sub-application can be: obtaining appId and pageId through routing resolution, and obtaining and loading the preset log-free URL according to appId and pageId, realizing log-free, and jumping to the target page.
[0123] Optionally, obtaining a preset login-free URL corresponding to the second sub-application according to the application unique identifier and the page code unique identifier corresponding to the second sub-application can be achieved by the following steps:
[0124] Step d31: Obtain the public key and secret key of the second sub-application according to the application unique identifier and the page number unique identifier of the second sub-application;
[0125] Step d32: obtaining a preset login-free URL corresponding to the second sub-application through a preset protocol according to the public key and the secret key;
[0126] In this embodiment, first of all, the prerequisite is: Independent Software Vendors (ISV) register the application, and the user purchases and activates the application. Then based on this scenario, the pre-defined free login URL is obtained according to the appId and pageId to implement free login (SSO, Oauth2.0), load the free login URL, and if the free login is successful, set the login state and jump to the target page (if there is an existing login state, you can skip the free login and jump directly to the target page). At the same time, the application integration method relies on the basic data provided by the ISV; specifically, it supports ISV to synchronize basic data (metadata definition, master data definition, factory model, process path, etc.) to the platform through the application AKS to realize system data and business data synchronization, so as to realize business data analysis (quality defect analysis, yield analysis, etc.).
[0127] Optionally, the initialization of the application communication module and the statistical management module may be implemented by the following steps:
[0128] Step e1, matching application program interfaces for the main application and the second sub-application to support communication between the main application and the second sub-application;
[0129] Step e1, matching the automatic dotting and on-demand dotting functions for the statistical dotting module and enabling the automatic dotting and on-demand dotting functions to support the second sub-application to realize the automatic dotting and on-demand dotting functions by obtaining the corresponding software development kit SDK. The main page, the first sub-page and the second sub-page are integrated on the target page.
[0130] In this embodiment, during the loading process of the second sub-application, the application communication module and the statistical dotting module are initialized. Among them, the application communication module is initialized; the application program interface is configured and its function is enabled, that is, the communication between the main application and the second sub-application is realized through the application program interface, and the second sub-application can call the method provided by the main application, such as opening Tab, full screen and other common function operations. The statistical dotting module is initialized; the statistical dotting module is configured and its function is started, that is, it is used to monitor the statistical dotting request of the second sub-application, and the second sub-application realizes automatic dotting and on-demand dotting functions through the relevant SDK.
[0131] For example, see Figure 2 The target page includes: 1. Address bar; 2. Menu: Menus are differentiated by application type; 3. Tabs: Multiple windows are opened on the page; 4. Function area: Alarm, message, enterprise information, etc.; 5. Sub-application: Responsible for rendering specific content; 6. Main application: Responsible for initializing the main framework and related SDKs, etc.
[0132] In this embodiment, combined with Figure 3As shown, Figure 3 A flowchart of an application integration method provided for another embodiment of the present application. First, obtain the URL, and then obtain the identifier and load the corresponding application through routing resolution. The specific process is: first determine whether the application is a one-party application. If it is a one-party application, determine whether it is a main application. If it is a main application, match the default route and resolve the required static resources (including public resources); load the main framework based on the static resources, and then perform application initialization operations, such as initializing the application communication module, business component module, statistics and management module, etc., and then initialize the application container, and load the sub-application according to the activeKey.
[0133] If it is determined that one application is not the main application, the application is determined to be a sub-application, the route is matched, the corresponding static resources are loaded according to the route, and the application communication module, statistical management module, etc. are initialized.
[0134] If it is determined that the application is not a first-party application, the application is determined to be a third-party sub-application, the route is matched, the corresponding application configuration information is obtained according to the activeKey, the free login URL is obtained (supports SSO and Oauth2.0 protocols), and the page is rendered.
[0135] Specifically, one-party applications use iframes to achieve decoupling of giant stone applications, independent development, independent deployment, and no relation to the technology stack; second- and third-party applications use iframes + application login-free methods to achieve application integration, integrating interaction, data, and services, without user perception; synchronize the sub-application URL to the main application through the application communication module to achieve browser and iframe URL synchronization; dynamically register business components through the main application to achieve sub-application and main application sharing components and achieve UI synchronization; integrate basic data, business data, application services, etc. to achieve data, interaction, and function unification; based on iframe, the cost of UI transformation is relatively low. Therefore, in this embodiment, application integration is achieved based on iframe lightweight, achieving application decoupling, independent development, and independent deployment; heterogeneous system application integration is no longer related to the technology stack, and sub-applications have full autonomy; function reuse maintains consistency of function and experience; all applications required in each stage are integrated through a unified system platform, unified portal, unified authority management, and unified data model.
[0136] Based on the same idea, the present application also provides a device corresponding to the above method, such as Figure 4 As shown, Figure 4 A schematic diagram of the structure of an application integration device provided in an embodiment of the present application. The application integration device may include:
[0137] The first processing module 401 is used to determine an identifier corresponding to each application according to the acquired uniform resource locator URL corresponding to each application;
[0138] A second processing module 402 is used to determine the type of each application and the front-end routing information of each application according to each identifier, wherein the application type includes a first application type and a second application type, the application of the first application type includes a main application and a first sub-application, and the application of the second application type includes a second sub-application;
[0139] The integration module 403 is used to load each application according to the type of each application and the front-end routing information of each application to obtain a target page;
[0140] The target page is a page integrated by each of the applications, and the main application on the target page supports providing services for the first sub-application and / or the second sub-application.
[0141] In this embodiment, by setting a first processing module 401, a second processing module 402, and an integration module 403, an identifier corresponding to each application is determined according to the URL corresponding to each application obtained, and then based on the identifier of each application, the type of each application and the front-end routing information are parsed. Since different application types correspond to different loading methods, the corresponding application is loaded by combining the application type and the front-end routing information, and the target page integrated with each application is rendered and displayed. During the application loading process, multiple modules provided by the main application are initialized, so that the integrated main application can support the provision of services for the first sub-application and / or the second sub-application, realizing functional reuse and unified interaction. There is no need to open the pages of each application in a new window, and operations can be performed on one page, providing users with convenient operations, thereby improving user experience.
[0142] Optionally, the second processing module 402 includes a first processing unit and a second processing unit; the first processing unit is used to determine the type of the application for each of the applications according to the combination of the character strings in the identifier; the second processing unit is used to obtain the front-end routing information of the application through routing resolution according to the identifier and the corresponding type of the application for each of the applications.
[0143] Optionally, the first processing unit is specifically configured to:
[0144] If the identifier does not contain a character string for representing a unique identification of an application, determining that the type of the application is a first application type and the application is a main application;
[0145] If the identifier contains a character string for representing a path and an application unique identifier, determining that the type of the application is a first application type and the application is a first sub-application;
[0146] If the identifier contains a character string for representing an application unique identifier and a page number unique identifier, it is determined that the type of the application is a second application type and the application is a second sub-application.
[0147] Optionally, the second processing unit is specifically configured to:
[0148] If the application is a main application in the first application type, obtaining preset routing information corresponding to the main application according to the identifier, and using the preset routing information as the front-end routing information corresponding to the main application;
[0149] If the application is the first sub-application in the first application type, the application unique identifier and the page number unique identifier corresponding to the first sub-application are parsed according to the identifier, and the application unique identifier and the page number unique identifier corresponding to the first sub-application are used as the front-end routing information corresponding to the first sub-application;
[0150] If the application is the second sub-application in the first application type, the application unique identifier and page number unique identifier corresponding to the second sub-application are parsed according to the identifier, and the application unique identifier and page number unique identifier corresponding to the second sub-application are used as the front-end routing information corresponding to the second sub-application.
[0151] Optional, integrated modules specifically for:
[0152] For each of the applications, perform the following steps:
[0153] If the application is the main application, then according to the preset routing information corresponding to the main application, the configuration information corresponding to the main application is obtained, and according to the configuration information corresponding to the main application, the main framework of the main application is loaded; multiple modules in the main application are initialized to support the main application to provide services for the first sub-application and / or the second sub-application, and the application container for storing the first sub-application and / or the second sub-application is initialized; the main page corresponding to the main application is rendered; wherein the multiple modules include an application communication module, a business component module, and a statistical management module;
[0154] If the application is the first sub-application, then according to the application unique identifier and the page number unique identifier corresponding to the first sub-application, obtain the configuration information corresponding to the first sub-application, and according to the configuration information corresponding to the first sub-application, load the static resources corresponding to the first sub-application and initialize the application communication module to support the first sub-application to communicate with the main application; render the first sub-page corresponding to the first sub-application;
[0155] If the application is the second sub-application, then according to the application unique identifier and page number unique identifier corresponding to the second sub-application, obtain the preset log-free URL corresponding to the second sub-application, and load the preset log-free URL. If the log-free URL is successful, mark the login state and render to obtain the second sub-page corresponding to the second sub-application; initialize the application communication module and the statistical dotting module to support the second sub-application to communicate with the main application and the second sub-application to support automatic dotting and on-demand dotting functions;
[0156] The main page, the first sub-page and the second sub-page are integrated on the target page.
[0157] Optional, integrated modules specifically for:
[0158] Obtaining, through preset configuration information corresponding to the main application, a first static resource required for loading the main application;
[0159] According to the first static resource, a main frame corresponding to the main application is loaded, and the main frame is used to represent the page layout.
[0160] Optionally, integrated modules are also specifically used for:
[0161] Matching application program interfaces to the main application, the first sub-application, and the second sub-application to support communication between the main application and the first sub-application and the second sub-application respectively;
[0162] Dynamically load the business component module pre-configured in the main application and enable the functions provided by the business component module through a preset module packager, so as to support the first sub-application and / or the second sub-application to use the functions provided by the business component module in the main application through the application communication module, wherein the functions provided by the business component module at least include a method for opening application content on a page;
[0163] Match the automatic docking and on-demand docking functions for the statistical docking module and enable the automatic docking and on-demand docking functions to support the main application in listening to the statistical docking requests of the second sub-application, and if the statistical docking request is listened to, support the second sub-application to implement automatic docking and on-demand docking functions by obtaining the corresponding software development kit SDK.
[0164] Optional, integrated modules specifically for:
[0165] Determining whether a user of the first sub-application has access rights according to the permission point in the configuration information corresponding to the first sub-application;
[0166] If there is access permission, the second static resource is obtained from the configuration information corresponding to the first sub-application, and the second static resource is loaded; the second static resource is the static resource corresponding to the first sub-application.
[0167] Optionally, integrated modules are also specifically used for:
[0168] An application program interface is matched between the main application and the first sub-application to support communication between the main application and the first sub-application.
[0169] Optional, integrated modules specifically for:
[0170] Acquire the public key and the secret key of the second sub-application according to the application unique identifier and the page number unique identifier of the second sub-application;
[0171] According to the public key and the secret key, a preset login-free URL corresponding to the second sub-application is obtained through a preset protocol.
[0172] Optionally, integrated modules are also specifically used for:
[0173] Matching application program interfaces for the main application and the second sub-application to support communication between the main application and the second sub-application;
[0174] The automatic dotting and on-demand dotting functions are matched and enabled for the statistical dotting module, so as to support the second sub-application to realize the automatic dotting and on-demand dotting functions by acquiring the corresponding software development kit SDK.
[0175] Optionally, the first processing module is specifically used to:
[0176] By accessing the URL corresponding to each of the obtained applications, an identifier corresponding to each of the applications is obtained.
[0177] The device provided in the embodiment of the present application can realize the above-mentioned Figure 1-3 The implementation principle and technical effect of the method in the embodiment shown are similar and will not be described in detail here.
[0178] Figure 5 The hardware structure diagram of the electronic device provided in the embodiment of the present application is shown in FIG. Figure 5 As shown, the electronic device 500 provided in this embodiment includes: a processor 501 and a memory connected to the processor in communication. The processor 501 and the memory 502 are connected via a bus 503 .
[0179] In a specific implementation process, the processor 501 executes the computer-executable instructions stored in the memory 502, so that the processor 501 executes the method in the above method embodiment.
[0180] The specific implementation process of the processor 501 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0181] In the above Figure 5 In the illustrated embodiment, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0182] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk storage.
[0183] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0184] An embodiment of the present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the application integration method of the above method embodiment is implemented.
[0185] An embodiment of the present application also provides a computer program product, including a computer program, and when the computer program is executed by a processor, the application integration method as described above is implemented.
[0186] The computer-readable storage medium mentioned above can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0187] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.
[0188] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0189] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. An application integration method, characterized in that: The method comprises: Determine an identifier corresponding to each application based on the acquired uniform resource locator URL corresponding to each application; the identifier includes a character string indicating type information of the application and front-end routing information of the application; Determining the type of each application according to each identifier; the application type includes a first application type and a second application type, the application of the first application type includes a main application and a first sub-application, and the application of the second application type includes a second sub-application; Obtaining front-end routing information for each application through routing resolution according to the identifier and the corresponding application type; According to the front-end routing information corresponding to the application, the configuration information corresponding to the application is obtained; according to the configuration information corresponding to the application, the application is loaded; the page corresponding to the application is rendered to obtain the target page; or Obtain the preset login-free URL corresponding to the application according to the front-end routing information corresponding to the application, and load the preset login-free URL. If the login is successful, mark the login state and render the page corresponding to the application to obtain the target page; The target page is a page integrated by each of the applications, and the main application on the target page supports providing services for the first sub-application and / or the second sub-application.
2. The method according to claim 1, characterized in that Determining the type of each application and the front-end routing information of each application according to each identifier includes: For each of the identifiers, perform the following steps: Determining the type of the application according to a combination of character strings in the identifier; According to the identifier and the corresponding type of the application, the front-end routing information of the application is obtained through routing resolution.
3. The method according to claim 2, characterized in that The determining the type of the application according to the combination of character strings in the identifier includes: If the identifier does not contain a character string for representing a unique identifier of an application, determining that the type of the application is a first application type and the application is a main application; If the identifier contains a character string for representing a path and an application unique identifier, determining that the type of the application is a first application type and the application is a first sub-application; If the identifier contains a character string for representing an application unique identifier and a page number unique identifier, it is determined that the type of the application is a second application type and the application is a second sub-application.
4. The method according to claim 2 or 3, characterized in that Obtaining the front-end routing information of the application through routing resolution according to the identifier and the corresponding application type includes: If the application is a main application in the first application type, obtaining preset routing information corresponding to the main application according to the identifier, and using the preset routing information as the front-end routing information corresponding to the main application; If the application is a first sub-application in the first application type, then, according to the identifier, parsing to obtain an application unique identifier and a page unique identifier corresponding to the first sub-application, and using the application unique identifier and the page unique identifier corresponding to the first sub-application as the front-end routing information corresponding to the first sub-application; If the application is the second sub-application in the first application type, the application unique identifier and page number unique identifier corresponding to the second sub-application are parsed according to the identifier, and the application unique identifier and page number unique identifier corresponding to the second sub-application are used as the front-end routing information corresponding to the second sub-application.
5. The method according to claim 4, characterized in that The step of loading each application according to the type of each application and the front-end routing information of each application to obtain a target page includes: For each of the applications, perform the following steps: If the application is the main application, then according to the preset routing information corresponding to the main application, the configuration information corresponding to the main application is obtained, and according to the configuration information corresponding to the main application, the main framework of the main application is loaded; multiple modules in the main application are initialized to support the main application in providing services for the first sub-application and / or the second sub-application, and the application container for storing the first sub-application and / or the second sub-application is initialized; the main page corresponding to the main application is rendered; wherein the multiple modules include an application communication module, a business component module, and a statistics and management module; If the application is the first sub-application, then according to the application unique identifier and the page number unique identifier corresponding to the first sub-application, obtain the configuration information corresponding to the first sub-application, and according to the configuration information corresponding to the first sub-application, load the static resources corresponding to the first sub-application and initialize the application communication module to support the first sub-application to communicate with the main application; and render the first sub-page corresponding to the first sub-application; If the application is the second sub-application, then according to the application unique identifier and page code unique identifier corresponding to the second sub-application, obtain the preset login-free URL corresponding to the second sub-application, and load the preset login-free URL. If the login is successful, mark the login state and render the second sub-page corresponding to the second sub-application; initialize the application communication module and the statistical dotting module to support the second sub-application to communicate with the main application and the second sub-application to support automatic dotting and on-demand dotting functions; The main page, the first sub-page and the second sub-page are integrated on the target page.
6. The method according to claim 5, characterized in that The step of loading the main framework of the main application according to the configuration information corresponding to the main application includes: Obtaining a first static resource required to load the main application through preset configuration information corresponding to the main application; Loading a main frame corresponding to the main application according to the first static resource, where the main frame is used to represent a page layout; Accordingly, the initialization of multiple modules in the main application includes: Matching application programming interfaces to the main application, the first sub-application, and the second sub-application to support communication between the main application and the first sub-application and the second sub-application respectively; Dynamically loading the pre-configured business component module in the main application through a preset module packager and enabling the functions provided by the business component module to support the first sub-application and / or the second sub-application in using the functions provided by the business component module in the main application through the application communication module, wherein the functions provided by the business component module include at least a method for opening application content on a page; Match the automatic docking and on-demand docking functions for the statistical docking module and enable the automatic docking and on-demand docking functions to support the main application in monitoring the statistical docking requests of the second sub-application, and if the statistical docking request is monitored, support the second sub-application to implement automatic docking and on-demand docking functions by obtaining the corresponding software development kit SDK.
7. The method according to claim 5, characterized in that The loading of static resources corresponding to the first sub-application according to the configuration information corresponding to the first sub-application includes: determining, based on the permission point in the configuration information corresponding to the first sub-application, whether the user of the first sub-application has access rights; If there is access permission, obtain a second static resource from the configuration information corresponding to the first sub-application and load the second static resource; the second static resource is the static resource corresponding to the first sub-application; Accordingly, the initializing the application communication module includes: An application programming interface is matched between the main application and the first sub-application to support communication between the main application and the first sub-application.
8. The method according to claim 5, characterized in that The acquiring, according to the application unique identifier and the page code unique identifier corresponding to the second sub-application, a preset login-free URL corresponding to the second sub-application includes: Obtaining the public key and the secret key of the second sub-application according to the application unique identifier and the page number unique identifier of the second sub-application; Obtaining, based on the public key and the secret key, a preset login-free URL corresponding to the second sub-application through a preset protocol; Accordingly, the initialization of the application communication module and the statistics management module includes: Matching an application programming interface between the main application and the second sub-application to support communication between the main application and the second sub-application; Match the automatic dotting and on-demand dotting functions to the statistical dotting module and enable the automatic dotting and on-demand dotting functions to support the second sub-application to implement the automatic dotting and on-demand dotting functions by obtaining the corresponding software development kit SDK.
9. The method according to any one of claims 1 to 3, characterized in that The determining, based on the acquired uniform resource locator URL corresponding to each application, an identifier corresponding to each application includes: By accessing the URL corresponding to each of the obtained applications, an identifier corresponding to each of the applications is obtained.
10. An application integration device, characterized in that: The device comprises: A first processing module is configured to determine an identifier corresponding to each application based on the acquired uniform resource locator URL corresponding to each application; the identifier includes a character string indicating type information of the application and front-end routing information of the application; a second processing module, configured to determine a type of each application based on each identifier; and obtain front-end routing information for each application through routing resolution based on the identifier and the corresponding application type; the application types include a first application type and a second application type, wherein applications of the first application type include a main application and a first sub-application, and applications of the second application type include a second sub-application; The integration module is configured to obtain configuration information corresponding to the application based on the front-end routing information corresponding to the application; load the application based on the configuration information corresponding to the application, render the page corresponding to the application, and obtain a target page; or obtain a preset login-free URL corresponding to the application based on the front-end routing information corresponding to the application, load the preset login-free URL, mark the login state if the login is successful, and render the page corresponding to the application to obtain the target page; The target page is a page integrated by each of the applications, and the main application on the target page supports providing services for the first sub-application and / or the second sub-application.
Citation Information
Patent Citations
Subprogram running method and device based on microkernel system and electronic equipment
CN111737032A
Business integration method and business platform
CN111949899A