Component management method, device, electronic device, storage medium and program product
By splitting the terminal components into a business component layer and a protocol layer, and realizing adaptive loading of the business components, the complexity and high cost problems caused by strong coupling between traditional terminal component components and APP are solved, and customization efficiency is improved.
Patent Information
- Application Number
- CN202210473033.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-29
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2042-04-29
AI Technical Summary
The components in traditional terminal components are highly coupled with the APP, resulting in high complexity, high customization costs and low efficiency when reusing components.
By splitting the terminal components into a business component layer and a protocol layer, the update time of the server component introduction files is detected, and new business components and resource dependency protocols are obtained and stored to realize the adaptive loading of business components.
It realizes the decoupling of business components and APP, reduces the customization complexity and cost during component reuse, and improves customization efficiency.
Smart Images

Figure CN114880140B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of front-end development and can be applied to the financial field or other fields. The present disclosure specifically relates to a component management method, device, electronic device, storage medium and program product. Background Art
[0002] For component providers, customization capability is one of the important indicators to measure the quality of components. Currently provided terminal components are configured in device terminals and embedded in applications (Application, APP) to provide functional support to APP.
[0003] Terminal components generally include multiple components. In traditional terminal components, components are directly connected to APPs, resulting in strong coupling between components and APPs. When a terminal component is reused by multiple APPs, traditional reuse technology causes the components in the terminal component to simultaneously contain customized content from multiple APPs, resulting in high component complexity. At this time, if you want to customize new content for an APP, such as adding new components, it will affect the entire system. Not only does the terminal component in the current APP need to be modified, but the corresponding terminal components in all APPs must also be modified, resulting in a large workload, high customization costs, and low efficiency. Summary of the invention
[0004] In view of the above problems, the present disclosure provides a component management method, apparatus, electronic device, storage medium and program product.
[0005] According to a first aspect of the present disclosure, a component management method is provided, which is applied to a terminal component on a device terminal, wherein the terminal component includes an application layer, a protocol layer, and a service component layer, and the component management method includes:
[0006] Detect the update time of the component import file in the server;
[0007] When the update time of the component import file does not match the local cache, obtaining the component import file;
[0008] According to the component introduction file, obtaining a newly added service component and a first resource dependency protocol corresponding to the newly added service component from the server;
[0009] Storing the newly added business component in the business component layer, and storing the first resource dependency protocol in the protocol layer;
[0010] In response to a first operation instruction, a first resource dependency protocol in the protocol layer that matches the first operation instruction is configured in the application layer, and the first resource dependency protocol is used to enable the application layer to adaptively load the corresponding new business components in the business component layer according to the first resource dependency protocol.
[0011] According to an embodiment of the present disclosure, storing the newly added business component in the business component layer and storing the first resource dependency protocol in the protocol layer includes:
[0012] locally registering the first resource-dependent protocol to store the first resource-dependent protocol in the protocol layer;
[0013] When the first resource dependency protocol is successfully registered locally, storing the newly added business component corresponding to the first resource dependency protocol in the business component layer;
[0014] A first operation page of the newly added business component in the business component layer is determined, and a corresponding menu entry is configured for the newly added business component in the first operation page.
[0015] According to an embodiment of the present disclosure, the first operation instruction includes a jump operation instruction issued by a user through the menu entry, and in response to the first operation instruction, configuring a first resource dependency protocol matching the first operation instruction in the protocol layer to the application layer includes:
[0016] In response to a jump operation instruction issued by the user through the menu entry, the first resource dependency protocol matching the jump operation is injected into the application layer.
[0017] According to an embodiment of the present disclosure, the component management method further includes:
[0018] According to the component import file, determining the component to be uninstalled from the business component layer;
[0019] Setting the second resource dependency protocol in the protocol layer that matches the component to be uninstalled to be disabled;
[0020] The menu entry in the first operation page that matches the disabled second resource dependency protocol is set to be invisible.
[0021] According to an embodiment of the present disclosure, the first resource dependency protocol includes an initialization method and a resource calling method of the newly added service component, and the adaptive loading operation includes:
[0022] According to the initialization method, creating a second operation page for the newly added business component;
[0023] According to the resource calling method, resources are configured for the second operation page and automatically adapted to obtain a third operation page;
[0024] Jump to the third operation page.
[0025] According to an embodiment of the present disclosure, the resource includes a basic component configured in a public business component library and a UI business component library, and the resource is configured for the second operation page and automatically adapted according to the resource calling method, including:
[0026] According to the resource calling method, determining at least a part of basic components from the public business component library and the UI business component library;
[0027] Connecting the determined basic component to the second operation page;
[0028] According to the resource calling method, the basic component connected to the second operation page is adjusted to perform the adaptation.
[0029] According to an embodiment of the present disclosure, the resource also includes a composite component configured in a composite business component library, the composite component calls a basic component pre-configured in a public business component library and a UI business component library, and the resource is configured for the second operation page and automatically adapted according to the resource calling method, and further includes:
[0030] According to the resource calling method, determining at least one composite component from the composite business component library;
[0031] Connecting the determined composite component to the second operation page;
[0032] According to the resource calling method, the composite component connected to the second operation page is adjusted to perform the adaptation.
[0033] A second aspect of the present disclosure provides a component management device, which is applied to a terminal component on a device terminal, wherein the terminal component includes an application layer, a protocol layer, and a service component layer, and the component management device includes:
[0034] The detection module is used to detect the update time of the component import file in the server;
[0035] A first acquisition module, configured to acquire the component import file when the update time of the component import file does not match the local cache;
[0036] A second acquisition module, configured to acquire, from the server side, a newly added service component and a first resource dependency protocol corresponding to the newly added service component according to the component introduction file;
[0037] A first processing module, used for storing the newly added business component in the business component layer, and storing the first resource dependency protocol in the protocol layer;
[0038] The second processing module is used to configure the first resource dependency protocol matching the first operation instruction in the protocol layer to the application layer in response to the first operation instruction, and the first resource dependency protocol is used to enable the application layer to adaptively load the corresponding new business components in the business component layer according to the first resource dependency protocol.
[0039] According to an embodiment of the present disclosure, the component management device further includes:
[0040] A third processing module, configured to determine a component to be uninstalled from the business component layer according to the component import file;
[0041] A fourth processing module, configured to set the second resource dependency protocol in the protocol layer that matches the component to be uninstalled to be disabled;
[0042] The fifth processing module is used to set the menu entry in the first operation page that matches the disabled second resource dependency protocol to be invisible.
[0043] A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the above-mentioned component management method.
[0044] A fourth aspect of the present disclosure further provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the above-mentioned component management method.
[0045] A fifth aspect of the present disclosure also provides a computer program product, including a computer program, which implements the above-mentioned component management method when executed by a processor.
[0046] One or more of the above embodiments have the following advantages or beneficial effects:
[0047] Through the layered idea, the terminal component is split into a business component layer and a protocol layer, so that a matching resource dependency protocol (i.e., the first resource dependency protocol) can be configured for the newly added business component (i.e., the newly added business component). When the user needs to use the functions provided by the newly added business component in the APP, the embodiment of the present disclosure can find the corresponding resource dependency protocol from the protocol layer and configure the resource dependency protocol to the application layer. The application layer will automatically realize the adaptive loading of the newly added business component according to the configured resource dependency protocol. In this way, the business component realizes the bridge with the APP through the resource dependency protocol, instead of directly docking with the APP, thereby realizing the decoupling of the business component from the APP. When a terminal component is reused by multiple APPs, the business component in the terminal component no longer needs to have customized content of multiple APPs at the same time, which simplifies the complexity of the business component. On this basis, when customizing new content for an APP (for example, adding a new business component), the embodiment of the present disclosure can automatically realize the adaptive loading of the newly added business component according to the first resource dependency protocol, thereby realizing customized configuration for the APP, and other APPs are not affected, thereby greatly reducing the workload of customization, saving customization costs, and greatly improving work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0049] Figure 1 The application scenario diagram schematically shows the component management method, apparatus, electronic device, storage medium and program product according to the embodiments of the present disclosure;
[0050] Figure 2 One of the flowcharts of the component management method according to an embodiment of the present disclosure is schematically shown;
[0051] Figure 3 A flowchart schematically illustrates storing a newly added service component and a first resource dependency protocol to a service component layer and a protocol layer respectively according to an embodiment of the present disclosure;
[0052] Figure 4 A flowchart of configuring a first resource dependency protocol into an application layer according to an embodiment of the present disclosure is schematically shown;
[0053] Figure 5 The second flowchart of the component management method according to the embodiment of the present disclosure is schematically shown;
[0054] Figure 6 A flowchart of an adaptive loading operation according to an embodiment of the present disclosure is schematically shown;
[0055] Figure 7a One of the flowcharts of automatic adaptation according to an embodiment of the present disclosure is schematically shown;
[0056] Figure 7b The second flowchart of automatic adaptation according to an embodiment of the present disclosure is schematically shown;
[0057] Figure 8 The structure diagram of the component management device according to the embodiment of the present disclosure is schematically shown;
[0058] Fig. 9 A block diagram of an electronic device suitable for implementing a component management method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0059] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0060] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0061] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0062] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0063] It should be noted that the component management method, device, electronic device, storage medium and program product provided by the present disclosure relate to the field of front-end development technology. The component management method, device, electronic device, storage medium and program product provided by the embodiments of the present disclosure can be applied to the financial field or any field other than the financial field. For example, the component management method, device, electronic device, storage medium and program product provided by the embodiments of the present disclosure can be applied to the front-end development business in the financial field. The present disclosure does not limit the application field of the component management method, device, electronic device, storage medium and program product.
[0064] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision, disclosure and application of user personal information involved comply with the provisions of relevant laws and regulations, take necessary confidentiality measures, and do not violate public order and good morals.
[0065] An embodiment of the present disclosure provides a component management method, which is applied to a terminal component on a device terminal, wherein the terminal component includes an application layer, a protocol layer and a business component layer, and the component management method includes: detecting the update time of a component introduction file in a server; when the update time of the component introduction file does not match the local cache, obtaining the component introduction file; according to the first configuration information in the component introduction file, obtaining a newly added business component and a first resource dependency protocol corresponding to the newly added business component from the server; storing the newly added business component in the business component layer, and storing the first resource dependency protocol in the protocol layer; in response to a first operation instruction, configuring the first resource dependency protocol in the protocol layer that matches the first operation instruction to the application layer, and the first resource dependency protocol is used to enable the application layer to load the corresponding newly added business component in the business component layer according to the first resource dependency protocol.
[0066] In the embodiment of the present disclosure, the terminal component is split into a business component layer and a protocol layer through the layered concept, so that a matching resource dependency protocol (that is, the first resource dependency protocol) can be configured for the newly added business component (that is, the newly added business component). When a user needs to use the functions provided by the newly added business component in the APP, the embodiment of the present disclosure can find the corresponding resource dependency protocol from the protocol layer and configure the resource dependency protocol to the application layer. The application layer will automatically realize the adaptive loading of the newly added business component according to the configured resource dependency protocol. In this way, the business component realizes bridging with the APP through the resource dependency protocol, instead of directly docking with the APP, thereby realizing the decoupling of the business component and the APP. When a terminal component is reused by multiple APPs, the business component in the terminal component no longer needs to have customized content of multiple APPs at the same time, which simplifies the complexity of the business component. On this basis, when customizing new content for an APP (for example, adding new business components), the embodiments of the present disclosure can automatically realize adaptive loading of the new business components according to the first resource dependency protocol, thereby realizing customized configuration for the APP, and other APPs are not affected, thereby greatly reducing the customization workload, saving customization costs, and greatly improving work efficiency.
[0067] Figure 1 The application scenario diagram of the component management method, apparatus, electronic device, storage medium and program product according to the embodiments of the present disclosure is schematically shown.
[0068] like Figure 1 As shown, the application scenario 100 according to this embodiment may include device terminals 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the device terminals 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0069] The user can use the device terminals 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the device terminals 101, 102, 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0070] The device terminals 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0071] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the device terminals 101, 102, and 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the device terminals.
[0072] It should be noted that the component management method provided in the embodiment of the present disclosure can generally be executed by the device terminals 101, 102, 103. Accordingly, the component management apparatus provided in the embodiment of the present disclosure can generally be set in the device terminals 101, 102, 103.
[0073] It should be understood that Figure 1 The number of device terminals, networks, and servers in the figure is only for illustration. Any number of device terminals, networks, and servers may be provided according to implementation requirements.
[0074] The component management method of the embodiment of the present disclosure is applied to a device terminal. Specifically, the component management method is applied to a terminal component on a device terminal to manage components in the terminal component. The terminal component can be embedded in an APP to provide functional support for the APP. For example, the terminal component can include a pass component, and the components in the pass component can include an account management component, an identity verification component, and the like.
[0075] Optionally, the component management method of the embodiment of the present disclosure can be used to manage the addition and removal of components in the terminal component, thereby realizing a terminal component that can be quickly plugged in (add components) or unplugged (removed components) according to customized needs. Figure 1 The scene described by Figure 2 to Figure 7b The component management method of the disclosed embodiment is described in detail.
[0076] Figure 2 One of the flowcharts of the component management method according to an embodiment of the present disclosure is schematically shown. Figure 2 As shown, the component management method of this embodiment includes steps S210 to S250. It should be noted that although Figure 2The steps in the figure are shown in sequence as indicated by the arrows, but the steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of the steps, and they can be executed in other orders. Moreover, at least some of the steps in the figure may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0077] In the embodiment of the present disclosure, the terminal component includes an application layer, a protocol layer and a business component layer, wherein the application layer is used to connect with the APP, the protocol layer is used to configure the resource dependency protocol to be mentioned below, and the business component layer is used to configure the business components to be mentioned below.
[0078] In step S210, the update time of the component import file in the server is detected.
[0079] In step S220, when the update time of the component import file does not match the local cache, the component import file is obtained.
[0080] In the embodiment of the present disclosure, a component library is configured in the server. When new content needs to be customized for the terminal components in the device terminal, such as adding new components (such as the new business components mentioned below), the new components can be uploaded to the component library of the server, and the corresponding component introduction (podfile) file can be modified to increase the introduction of the new components, and at the same time, the update time of the component introduction file can be modified.
[0081] It should be noted that when the update time of the component import file matches the local cache, it means that the component import file has not changed, and the current state can be maintained at this time.
[0082] Optionally, when the APP in the device terminal is started, the update time of the component introduction file in the server can be detected. When the update time of the component introduction file does not match the local cache in the device terminal, it can be determined that the component introduction file has changed. At this time, the component introduction file can be obtained through step S220.
[0083] In step S230, according to the component introduction file, a newly added business component and a first resource dependency protocol corresponding to the newly added business component are obtained from the server.
[0084] In the embodiments of the present disclosure, the newly added business component may refer to a newly added business component. The business component may include a component that can implement a business function. For example, the terminal component may provide functional support for a type of business to the APP, and the business component may be used to implement one of the business functions. The component introduction file may include the business component introduced into the terminal component. When the update time of the component introduction file changes, it means that the business component introduced in the component introduction file has changed. By analyzing which business components are introduced in the component introduction file, the newly added business component can be determined, that is, the newly added business component is determined. The first resource dependency protocol may refer to a resource dependency protocol that matches the newly added business component. The resource dependency protocol can realize the bridging between the business component and the APP, thereby realizing the decoupling of the business component from the APP. The first resource dependency protocol may include the customized content of the business component for the APP, such as resource call methods and initialization methods, etc.
[0085] In step S240, the newly added business component is stored in the business component layer, and the first resource dependency protocol is stored in the protocol layer.
[0086] In step S250, in response to the first operation instruction, the first resource dependency protocol in the protocol layer that matches the first operation instruction is configured in the application layer, and the first resource dependency protocol is used to enable the application layer to adaptively load the corresponding new business component in the business component layer according to the first resource dependency protocol.
[0087] In the disclosed embodiment, the first resource dependency protocol may include an initialization method and a resource calling method of the business component. The first operation instruction may include a jump operation instruction issued by a user to use the function provided by the newly added business component, and the loading operation may load the newly added business component to display the corresponding operation page. For example, when a user wants to use the "living expenses payment" function, the instruction issued by the user to jump to the "living expenses payment" is the first operation instruction, and loading the "living expenses payment" component to display the "living expenses payment" operation page is the loading operation. The adaptive loading operation may refer to the implementation of a custom loading method of the newly added business component through the initialization method and the resource calling method in the first resource dependency protocol, such as resource calling logic, page color and size, etc., which will be described in detail below and will not be repeated here.
[0088] In the embodiment of the present disclosure, the terminal components are split into a business component layer and a protocol layer through the layered concept, so that a matching resource dependency protocol (i.e., a first resource dependency protocol) can be configured for a newly added business component (i.e., a newly added business component). As mentioned above, the first resource dependency protocol may include, for example, a business component initialization method and a resource calling method, etc. When a user needs to use the functions provided by a newly added business component in an APP, the embodiment of the present disclosure can find the corresponding resource dependency protocol from the protocol layer and configure the resource dependency protocol to the application layer. The application layer will automatically realize the adaptive loading of the newly added business component according to the configured resource dependency protocol.
[0089] In this way, the business component is bridged with the APP through the resource dependency protocol, instead of the business component directly connecting to the APP, thereby realizing the decoupling of the business component and the APP. When a terminal component is reused by multiple APPs, the business component in the terminal component no longer needs to have customized content of multiple APPs at the same time, which simplifies the complexity of the business component. On this basis, when customizing new content for an APP (for example, adding a new business component), the embodiment of the present disclosure can automatically realize the adaptive loading of the newly added business component according to the first resource dependency protocol, thereby realizing customized configuration for the APP, and other APPs are not affected, thereby greatly reducing the customization workload, saving customization costs, and greatly improving work efficiency.
[0090] Combine the following Figures 2 to 7b The component management method of the embodiment of the present disclosure is further described.
[0091] Figure 3 A flowchart of storing a newly added service component and a first resource dependency protocol in a service component layer and a protocol layer respectively according to an embodiment of the present disclosure is schematically shown. Figure 3 As shown, in some specific embodiments, step S240 includes steps S241 to S243.
[0092] In step S241, the first resource-dependent protocol is locally registered to store the first resource-dependent protocol in the protocol layer.
[0093] In the embodiment of the present disclosure, the first resource-dependent protocol may be locally registered in real time, or a plurality of first resource-dependent protocols may be locally registered in batches according to a preset period.
[0094] In step S242, when the first resource-dependent protocol is successfully registered locally, the newly added business component corresponding to the first resource-dependent protocol is stored in the business component layer.
[0095] In the embodiment of the present disclosure, when the first resource dependency protocol fails to register locally, at least one retry operation can be initiated. When multiple retry operations still fail, the corresponding newly added business components can be removed, or stored in a backup component library, and a corresponding prompt message can be generated to inform the local registration failure.
[0096] Optionally, when local registration fails, the cause of the failure may be analyzed, and a corresponding analysis report may be generated based on the cause of the failure.
[0097] Optionally, when the corresponding newly added business component is stored in the spare component library, this registration can be performed manually.
[0098] In step S243, a first operation page of the newly added business component in the business component layer is determined, and a corresponding menu entry is configured for the newly added business component in the first operation page.
[0099] In the embodiments of the present disclosure, a newly added business component may correspond to an operation page for visualizing the functions that it can implement, such as the second operation page mentioned below, and the first operation page may refer to the upper-level page of the second operation page. The first operation page may be deployed with menu entries of multiple business components, and different first operation pages may be deployed with menu entries of different business components. The menu entry may include an operation interface that can execute a jump to the operation page corresponding to the newly added business component.
[0100] For example, the first operation page is configured with menu entry B1, menu entry B2 and menu entry B3 corresponding to business component A1, business component A2 and business component A3 respectively, wherein business component A3 may be a newly added business component, and menu entry B3 is a menu entry newly configured according to business component A3. The user can jump to the operation page of business component A1 through menu entry B1, jump to the operation page of business component A2 through menu entry B2, and jump to the operation page of business component A3 through menu entry B3.
[0101] In some specific embodiments, the first operation instruction includes a jump operation instruction issued by the user through the menu entry. Figure 4 The flowchart of configuring the first resource dependency protocol into the application layer according to an embodiment of the present disclosure is schematically shown. Figure 4 As shown, step S250 includes step S251.
[0102] In step S251, in response to a jump operation instruction issued by the user through a menu entry, a first resource dependency protocol matching the jump operation is injected into the application layer.
[0103] In the disclosed embodiment, after the newly added business component and the first resource dependency protocol are obtained, the two can be stored in the business component layer and the resource dependency protocol layer respectively, and a menu entry can be configured for the newly added business component. Afterwards, when the user issues a jump operation instruction to jump to the newly added business component through the menu entry, the corresponding first resource dependency protocol is injected into the application layer, thereby realizing the rapid configuration of the first resource dependency protocol, so as to be used for the application layer to perform subsequent adaptive loading operations, etc.
[0104] Figure 5 The second flowchart of the component management method according to the embodiment of the present disclosure is schematically shown. Figure 5 As shown, in some specific embodiments, the component management method further includes steps S310 to S330.
[0105] In step S310, components to be uninstalled are determined from the business component layer according to the component import file.
[0106] In the disclosed embodiment, the component introduction file is configured with business components introduced into the terminal component. When the update time of the component introduction file changes, it means that the business components introduced into the component introduction file have changed. In addition to the addition of business components mentioned above, the change of business components also includes the situation where the introduced business components are reduced, that is, the situation where the corresponding business components in the terminal component are desired to be uninstalled. By analyzing which business components are introduced into the component introduction file, the components to be uninstalled, that is, the business components desired to be uninstalled, can be determined.
[0107] In step S320, the second resource dependency protocol in the protocol layer that matches the component to be deleted is set to be disabled.
[0108] In step S330, the menu entry in the first operation page that matches the disabled second resource dependency protocol is set to be invisible.
[0109] In the embodiment of the present disclosure, the second resource dependency protocol may refer to the resource dependency protocol corresponding to the business component to be uninstalled. For example, for business component A1, its first resource dependency protocol and second resource dependency protocol may be the same protocol. In the embodiment of the present disclosure, in order to distinguish the adding and uninstalling processes of business components, these protocols are respectively referred to as the first resource dependency protocol and the second resource dependency protocol.
[0110] In the embodiment of the present disclosure, when it is detected that the second resource dependency protocol is disabled, the corresponding menu entry is set to invisible, so that the user cannot access it. When the business component is re-enabled, the disabled second resource dependency protocol can be set to "enabled". At this time, the menu entry can be set to visible, thereby achieving convenient uninstallation and re-addition.
[0111] In some specific embodiments, the first resource dependency protocol includes an initialization method for a newly added service component and a resource calling method. Figure 6 The flowchart of the adaptive loading operation according to the embodiment of the present disclosure is schematically shown. Figure 6 As shown, the adaptive loading operation includes steps S410 to S430.
[0112] In step S410, a second operation page is created for the newly added business component according to the initialization method.
[0113] In the embodiment of the present disclosure, the second operation page may refer to an operation page for implementing the function of the newly added business component. Optionally, the terminal component may be implemented based on object-oriented technology. In step S410, the object-oriented technology may be used to perform operations such as initializing the data in the newly added business component to the required format and allocating addresses in the memory based on the initialization method in the first resource dependency protocol to obtain the second operation page.
[0114] In step S420, according to the resource calling method, resources are configured for the second operation page and automatically adapted to obtain a third operation page.
[0115] In the disclosed embodiment, the resource calling method may include customized content for the APP, such as the resources required to be called by the business component, the calling logic of the resources, and the display method of the resources, etc. Through automatic adaptation, automatic access to resources and adaptive adjustment according to customized content can be achieved, thereby obtaining the final operation page of the newly added business component, that is, the third operation page.
[0116] In some specific embodiments, the resources include basic components configured in a public business component library and a UI business component library. Figure 7a One of the flowcharts of automatic adaptation according to an embodiment of the present disclosure is schematically shown, as shown in FIG. Figure 7a As shown, step S420 includes steps S421 to S423.
[0117] In step S421, at least a part of basic components are determined from the public business component library and the UI business component library according to the resource calling method.
[0118] In the disclosed embodiments, the basic components include components for providing basic functions to the business components. For example, the business components may include a "living expenses payment" component, and the basic components that the "living expenses payment" component depends on may include a "log recording" component, an "image processing" component, and a "data analysis" component, etc. In addition, the basic components in the public business component library may also include tracking components, network request components, encryption and decryption components, and performance monitoring components, etc.; the basic components in the UI business component library may also include rich text components, button components, dialog components, input box components, check box components, switch slider components, and sliding components, etc. The configuration of the basic components can be determined according to actual needs, and will not be listed one by one here.
[0119] In step S422, the determined basic components are connected to the second operation page.
[0120] In step S423, according to the resource calling method, the basic components connected to the second operation page are adjusted for adaptation.
[0121] For example, the skin and size of the business component and the logical relationship between the basic components called by the business component can be adjusted according to the resource calling method, such as calling basic component X first and then calling basic component Y; or, when basic component X meets a certain condition, calling basic component Y, etc. The specific method can be determined according to actual needs and is not limited here. Through the resource calling method, a low coupling connection between each component and the basic component can be achieved, and the dependence between business components can be reduced, which is conducive to quick and easy addition and removal.
[0122] In some specific embodiments, the resource also includes a composite component configured in a composite business component library, and the composite component calls a basic component pre-configured in a public business component library and a UI business component library. Figure 7b The second flowchart of automatic adaptation according to an embodiment of the present disclosure is schematically shown. Figure 7b As shown, step S420 also includes steps S424 to S427.
[0123] In step S424, at least one composite component is determined from the composite business component library according to the resource calling method.
[0124] In the embodiment of the present disclosure, the composite component can call at least two basic components. For example, the composite component can include a face recognition component, a voiceprint recognition component, a handwriting signature component, etc. The configuration of the composite component can be determined according to actual needs and will not be listed here one by one.
[0125] In step S425, the determined composite component is connected to the second operation page.
[0126] In step S426, the composite component accessed to the second operation page is adjusted according to the resource calling method for adaptation.
[0127] For example, the calling and displaying methods of the composite components can be adjusted according to the resource calling method, which can be determined according to actual needs and is not limited here. Through the resource calling method, a low coupling connection between each business component and the review component can be achieved, which is conducive to fast and easy addition and removal.
[0128] In some specific embodiments, in a terminal component, horizontal dependencies between business components are prohibited.
[0129] In step S430, jump to the third operation page to complete the corresponding display.
[0130] By adopting the component management method of the embodiment of the present disclosure, for the APP, the terminal component embedded therein realizes the decoupling of the business component and the APP through the resource dependency protocol, so that the terminal component only contains the customized content for the APP and the basic components it depends on, thereby effectively reducing the size of the installation package, reducing the code coupling, and improving the code execution efficiency, thereby making the system run more stable, meeting the business needs for rapid iteration, and improving the research and development efficiency. For the component provider, the customization complexity is reduced, thereby enhancing reusability and reducing subsequent maintenance costs. In addition, the business components of the embodiment of the present disclosure are quick and easy to add and uninstall, so that a terminal component that can be quickly plugged in (add business components) and unplugged (uninstall business components) can be realized, which is conducive to the development of an APP with good scalability and easy maintenance.
[0131] Based on the above-mentioned component management method, the present disclosure also provides a component management device. Figure 8 The device is described in detail.
[0132] Figure 8 The structure block diagram of the component management device according to the embodiment of the present disclosure is schematically shown. Figure 8 As shown, the component management device 800 of this embodiment is applied to the terminal component on the device terminal, wherein the terminal component includes an application layer, a protocol layer and a business component layer, and the component management device 800 of this embodiment includes a detection module 810, a first acquisition module 820, a second acquisition module 830, a first processing module 840 and a second processing module 850.
[0133] The detection module 810 is used to detect the update time of the component import file in the server. In one embodiment, the detection module 810 can be used to execute the step S210 described above, which will not be repeated here.
[0134] The first acquisition module 820 is used to acquire the component import file when the update time of the component import file does not match the local cache. In one embodiment, the first acquisition module 820 can be used to execute the step S220 described above, which will not be repeated here.
[0135] The second acquisition module 830 is used to acquire the newly added business component and the first resource dependency protocol corresponding to the newly added business component from the server according to the component import file. In one embodiment, the second acquisition module 830 can be used to execute the step S230 described above, which will not be repeated here.
[0136] The first processing module 840 is used to store the newly added business component in the business component layer and store the first resource dependency protocol in the protocol layer. In one embodiment, the first processing module 840 can be used to execute the step S240 described above, which will not be described in detail here.
[0137] The second processing module 850 is used to configure the first resource dependency protocol matching the first operation instruction in the protocol layer to the application layer in response to the first operation instruction, and the first resource dependency protocol is used to enable the application layer to adaptively load the corresponding newly added business component in the business component layer according to the first resource dependency protocol. In one embodiment, the second processing module 850 can be used to execute step S250 described above, which will not be repeated here.
[0138] In the embodiment of the present disclosure, the terminal components are split into a business component layer and a protocol layer through the layered concept, so that a matching resource dependency protocol (i.e., a first resource dependency protocol) can be configured for a newly added business component (i.e., a newly added business component). As mentioned above, the first resource dependency protocol may include, for example, a business component initialization method and a resource calling method, etc. When a user needs to use the functions provided by a newly added business component in an APP, the embodiment of the present disclosure can find the corresponding resource dependency protocol from the protocol layer and configure the resource dependency protocol to the application layer. The application layer will automatically realize the adaptive loading of the newly added business component according to the configured resource dependency protocol.
[0139] In this way, the business component is bridged with the APP through the resource dependency protocol, instead of the business component directly connecting to the APP, thereby realizing the decoupling of the business component and the APP. When a terminal component is reused by multiple APPs, the business component in the terminal component no longer needs to have customized content of multiple APPs at the same time, which simplifies the complexity of the business component. On this basis, when customizing new content for an APP (for example, adding a new business component), the embodiment of the present disclosure can automatically realize the adaptive loading of the newly added business component according to the first resource dependency protocol, thereby realizing customized configuration for the APP, and other APPs are not affected, thereby greatly reducing the customization workload, saving customization costs, and greatly improving work efficiency.
[0140] According to an embodiment of the present disclosure, any multiple modules of the detection module 810, the first acquisition module 820, the second acquisition module 830, the first processing module 840, and the second processing module 850 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the detection module 810, the first acquisition module 820, the second acquisition module 830, the first processing module 840, and the second processing module 850 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware or in a suitable combination of any of them. Alternatively, at least one of the detection module 810, the first acquisition module 820, the second acquisition module 830, the first processing module 840 and the second processing module 850 can be at least partially implemented as a computer program module, and when the computer program module is executed, the corresponding function can be executed.
[0141] In some specific embodiments, the component management device further includes: a third processing module, a fourth processing module and a fifth processing module.
[0142] The third processing module is used to determine the components to be uninstalled from the business component layer according to the component import file.
[0143] The fourth processing module is used to set the second resource dependency protocol matching the component to be uninstalled in the protocol layer to be disabled.
[0144] The fifth processing module is used to set the menu entry matching the disabled second resource dependency protocol in the first operation page to be invisible.
[0145] By using the component management device of the embodiment of the present disclosure, for the APP, the terminal component embedded therein realizes the decoupling of the business component and the APP through the resource dependency protocol, so that the terminal component only contains the customized content for the APP and the basic components it depends on, thereby effectively reducing the size of the installation package, reducing the code coupling, and improving the code execution efficiency, thereby making the system run more stable, meeting the business needs for rapid iteration, and improving the research and development efficiency. For the component provider, the customization complexity is reduced, thereby enhancing reusability and reducing subsequent maintenance costs. In addition, the business components of the embodiment of the present disclosure are quick and easy to add and uninstall, so that a terminal component that can be quickly plugged in (add business components) and unplugged (uninstall business components) can be realized, which is conducive to the development of an APP with good scalability and easy maintenance.
[0146] Fig. 9 A block diagram of an electronic device suitable for implementing a component management method according to an embodiment of the present disclosure is schematically shown. Fig. 9 As shown, the electronic device 900 according to an embodiment of the present disclosure includes a processor 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage part 908 into a random access memory (RAM) 903. The processor 901 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 901 may also include an onboard memory for caching purposes. The processor 901 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0147] In RAM 903, various programs and data required for the operation of electronic device 900 are stored. Processor 901, ROM 902 and RAM 903 are connected to each other via bus 904. Processor 901 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 902 and / or RAM 903. It should be noted that the program can also be stored in one or more memories other than ROM 902 and RAM 903. Processor 901 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0148] According to an embodiment of the present disclosure, the electronic device 900 may further include an input / output (I / O) interface 905, which is also connected to the bus 904. The electronic device 900 may further include one or more of the following components connected to the I / O interface 905: an input portion 906 including a keyboard, a mouse, etc.; an output portion 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 908 including a hard disk, etc.; and a communication portion 909 including a network interface card such as a LAN card, a modem, etc. The communication portion 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed, so that a computer program read therefrom is installed into the storage portion 908 as needed.
[0149] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the component management method according to the embodiment of the present disclosure is implemented.
[0150] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus, or a device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 902 and / or RAM 903 described above and / or one or more memories other than ROM 902 and RAM 903.
[0151] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the component management method provided by the embodiment of the present disclosure.
[0152] The above functions defined in the system / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 901. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0153] In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of a signal on a network medium, and downloaded and installed through the communication part 909, and / or installed from a removable medium 911. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0154] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 909, and / or installed from the removable medium 911. When the computer program is executed by the processor 901, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
[0155] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0156] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0157] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0158] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A component management method, applied to a terminal component on a device terminal, characterized in that: The terminal component includes an application layer, a protocol layer and a service component layer, and the component management method includes: Detect the update time of the component import file in the server; When the update time of the component import file does not match the local cache, obtaining the component import file; According to the component introduction file, obtaining a newly added service component and a first resource dependency protocol corresponding to the newly added service component from the server; Storing the newly added business component in the business component layer, and storing the first resource dependency protocol in the protocol layer; In response to a first operation instruction, a first resource dependency protocol in the protocol layer that matches the first operation instruction is configured in the application layer, and the first resource dependency protocol is used to enable the application layer to adaptively load the corresponding new business components in the business component layer according to the first resource dependency protocol.
2. The component management method according to claim 1, characterized in that: The storing the newly added business component to the business component layer and storing the first resource dependency protocol to the protocol layer includes: locally registering the first resource-dependent protocol to store the first resource-dependent protocol in the protocol layer; When the first resource dependency protocol is successfully registered locally, storing the newly added business component corresponding to the first resource dependency protocol in the business component layer; A first operation page of the newly added business component in the business component layer is determined, and a corresponding menu entry is configured for the newly added business component in the first operation page.
3. The component management method according to claim 2, characterized in that: The first operation instruction includes a jump operation instruction issued by a user through the menu entry, and the response to the first operation instruction, configuring a first resource dependency protocol matching the first operation instruction in the protocol layer to the application layer, includes: In response to a jump operation instruction issued by the user through the menu entry, the first resource dependency protocol matching the jump operation is injected into the application layer.
4. The component management method according to claim 2, characterized in that: The component management method further includes: According to the component import file, determining the component to be uninstalled from the business component layer; Setting the second resource dependency protocol in the protocol layer that matches the component to be uninstalled to be disabled; The menu entry in the first operation page that matches the disabled second resource dependency protocol is set to be invisible.
5. The component management method according to claim 1, characterized in that: The first resource dependency protocol includes an initialization method and a resource calling method for the newly added business component, and the adaptive loading operation includes: According to the initialization method, creating a second operation page for the newly added business component; According to the resource calling method, resources are configured for the second operation page and automatically adapted to obtain a third operation page; Jump to the third operation page.
6. The component management method according to claim 5, characterized in that: The resource includes basic components configured in a public business component library and a UI business component library, and the resource is configured for the second operation page and automatically adapted according to the resource calling method, including: According to the resource calling method, determining at least a part of basic components from the public business component library and the UI business component library; Connecting the determined basic component to the second operation page; According to the resource calling method, the basic component connected to the second operation page is adjusted to perform the adaptation.
7. The component management method according to claim 5, characterized in that: The resource also includes a composite component configured in a composite business component library, the composite component calls a basic component pre-configured in a public business component library and a UI business component library, and the resource is configured for the second operation page and automatically adapted according to the resource calling method, further comprising: According to the resource calling method, determining at least one composite component from the composite business component library; Connecting the determined composite component to the second operation page; According to the resource calling method, the composite component accessed into the second operation page is adjusted to perform the adaptation.
8. A component management device, applied to a terminal component on a device terminal, characterized in that: The terminal component includes an application layer, a protocol layer and a service component layer, and the component management device includes: The detection module is used to detect the update time of the component import file in the server; A first acquisition module, configured to acquire the component import file when the update time of the component import file does not match the local cache; A second acquisition module, configured to acquire, from the server side, a newly added service component and a first resource dependency protocol corresponding to the newly added service component according to the component introduction file; A first processing module, used for storing the newly added business component in the business component layer, and storing the first resource dependency protocol in the protocol layer; The second processing module is used to configure the first resource dependency protocol matching the first operation instruction in the protocol layer to the application layer in response to the first operation instruction, and the first resource dependency protocol is used to enable the application layer to adaptively load the corresponding new business components in the business component layer according to the first resource dependency protocol.
9. The component management device according to claim 8, characterized in that: The component management device also includes: A third processing module, configured to determine a component to be uninstalled from the business component layer according to the component import file; A fourth processing module, configured to set the second resource dependency protocol in the protocol layer that matches the component to be uninstalled to be disabled; The fifth processing module is used to set the menu entry in the first operation page that matches the disabled second resource dependency protocol to be invisible.
10. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors are enabled to execute the component management method according to any one of claims 1 to 7.
11. A computer-readable storage medium, characterized in that: Executable instructions are stored thereon, and when the instructions are executed by a processor, the processor is caused to execute the component management method according to any one of claims 1 to 7.
12. A computer program product, characterized in that The invention comprises a computer program, which implements the component management method according to any one of claims 1 to 7 when being executed by a processor.
Citation Information
Patent Citations
Service software construction method and system adapting to multiple business abstraction levels
CN101794226A
Application program modularization method and device, application program component calling method and device, application program component initialization method and device
CN112698888A