CN117435183A - Component data source configuration method and device, electronic equipment and medium - Google Patents

Component data source configuration method and device, electronic equipment and medium Download PDF

Info

Publication number
CN117435183A
CN117435183A CN202311596315.2A CN202311596315A CN117435183A CN 117435183 A CN117435183 A CN 117435183A CN 202311596315 A CN202311596315 A CN 202311596315A CN 117435183 A CN117435183 A CN 117435183A
Authority
CN
China
Prior art keywords
target
data source
target data
component
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311596315.2A
Other languages
Chinese (zh)
Inventor
朱浪锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China United Network Communications Group Co Ltd
Original Assignee
China United Network Communications Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China United Network Communications Group Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN202311596315.2A priority Critical patent/CN117435183A/en
Publication of CN117435183A publication Critical patent/CN117435183A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Landscapes

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

Abstract

The application provides a component data source configuration method, a device, electronic equipment and a medium. The method comprises the following steps: responding to the selection operation of a user acting on a target portal page, selecting a target WEB component from a first database, acquiring a target data source from the target database, determining target data structure information corresponding to the target WEB component from a second database according to the component type of the target WEB component, editing the data source information of the target data source according to the target data structure information to obtain target data source information, obtaining a configuration component instance according to the target data source information and the target WEB component, and displaying the configuration component instance in the target portal page. The method avoids changing the data source by modifying the code, simplifies the flow of data source configuration and improves the working efficiency.

Description

Component data source configuration method and device, electronic equipment and medium
Technical Field
The present disclosure relates to the field of data source configuration technologies, and in particular, to a method, an apparatus, an electronic device, and a medium for configuring a component data source.
Background
With the deep progress of enterprise digitization, WEB portals for different content, data, task aggregation are increasingly demanded. For businesses, various types of portals need to be able to cope with different business needs, such as business promotions, internal management, business processes, etc. In order to meet the demands of enterprises in different fields, portals must develop along the 'personalized customization, intelligent management and social interaction', and take more important positions in enterprise digital transformation.
In the prior art, the development of the WEB portal is mainly realized through two schemes: firstly, an overall pure code development scheme is adopted, and a component data source is configured through codes; secondly, a portal engine scheme realized based on a grid canvas system and a componentization technology provides a canvas and a series of preset portlets for a developer, a front page of a portal is built in a dragging mode, and a code configuration data source is written at the rear end.
However, in the prior art, when the data source needs to be changed, the code needs to be rewritten, so that the problems of complicated data source change and large workload are caused.
Disclosure of Invention
The application provides a method, a device, electronic equipment and a medium for configuring a component data source, which are used for solving the problems of complicated data source change and large workload in the prior art.
In a first aspect, the present application provides a component data source configuration method, including:
responding to the selection operation of a user acting on a target portal page, selecting a target WEB component from a first database, and acquiring a target data source from the target database, wherein the first database is a database which is preconfigured and is used for storing more than two component types of WEB components;
determining target data structure information corresponding to the target WEB component from a second database according to the component type of the target WEB component, wherein the second database is a database which is preconfigured and is used for storing a data structure, corresponding relation information of the data structure and the component type and data structure information of the data structure;
editing data source information of a target data source according to the target data structure information to obtain target data source information;
obtaining a configuration component instance according to the target data source information and the target WEB component;
the contents of the configuration component instance are displayed in the target portal page.
In this application, the data source information of the target data source includes a data interface URL, and a data message field,
editing the data source information of the target data source according to the target data structure information to obtain the target data source information, wherein the editing comprises the following steps:
Establishing a mapping relation between the data message field and the target data structure information according to the target data structure information;
and obtaining the target data source information according to the data interface URL and the mapping relation.
In this application, the method further comprises:
responding to the login operation of a user acting on a target portal page, and acquiring personal information of the user;
and displaying the target data corresponding to the personal information in the target data source in the target portal page according to the personal information and the configuration component example.
In the application, according to personal information and configuration component examples, displaying target data corresponding to the personal information in a target data source in a target portal page comprises the following steps:
determining target data source information and a data interface URL and a mapping relation in the target data source information according to the configuration component instance;
acquiring target data corresponding to the personal information from a target data source according to the personal information, the data interface URL and the mapping relation;
and rendering the target portal page according to the target data so as to display the target data in the target portal page.
In this application, the method further comprises:
determining updated target data in the target data source in response to an updating operation of the target data in the target data source by a user;
And responding to the refreshing operation of the user on the target portal page, and displaying the updated target data in the target portal page.
In this application, in response to a user's update operation on target data in a target data source, determining updated target data in the target data source includes:
determining data to be updated in the target data source and the data source type of the target data source in response to the updating operation of the user on the target data in the target data source;
and updating the target data in the target data source according to the data to be updated in the target data source and the data source type of the target data source to obtain updated target data.
In this application, when the data source type is a programming interface type,
after determining the data to be updated in the target data source and the data source type of the target data source in response to the user's update operation on the target data in the target data source, the method further comprises:
determining callback information corresponding to a target data source, wherein the callback information comprises a callback URL, a callback Token and a callback Key;
and updating the target data in the target data source according to the callback information and the data to be updated to obtain updated target data.
In the application, before responding to the selection operation of the user on the target portal page, selecting the target WEB component from the first database and acquiring the target data source from the target database, the method further comprises the following steps:
responding to the newly-built operation of the user on the target WEB component, and determining the target WEB component and the component type of the target WEB component;
and storing the target WEB component and the component type of the target WEB component into a first database.
In this application, the method further comprises:
determining a target data structure corresponding to the component type according to the component type of the target WEB component, and establishing a corresponding relation between the component type and the target data structure;
determining target data structure information of the target data structure according to the target data structure;
storing the target data structure, the correspondence between the component type and the data structure, and the target data structure information to a second database.
In a second aspect, the present application provides a component data source configuration apparatus, including:
the selection module is used for responding to the selection operation of a user acting on a target portal page, selecting a target WEB component from a first database, acquiring a target data source from the target database, wherein the first database is a database which is preconfigured and is used for storing more than two WEB components of component types;
The determining module is used for determining target data structure information corresponding to the target WEB component from a second database according to the component type of the target WEB component, wherein the second database is a database which is preconfigured and is used for storing a data structure, corresponding relation information of the data structure and the component type and data structure information of the data structure;
the editing module is used for editing the data source information of the target data source according to the target data structure information to obtain the target data source information;
the obtaining module is used for obtaining a configuration component example according to the target data source information and the target WEB component;
and the display module is used for displaying the content of the configuration component instance in the target portal page.
In a third aspect, the present application provides an electronic device, comprising:
a processor, a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
the processor executes the computer-executable instructions stored in the memory to implement the methods provided herein.
In a fourth aspect, the present application provides a computer-readable storage medium having stored therein computer-executable instructions that, when executed by a processor, are configured to implement the methods provided herein.
According to the component data source configuration method, device, electronic equipment and medium, a target WEB component is selected from a first database in response to a selection operation of a user on a target portal page, a target data source is acquired from the target database, and the first database is a database which is preconfigured and is used for storing more than two component types of WEB components; determining target data structure information corresponding to the target WEB component from a second database according to the component type of the target WEB component, wherein the second database is a database which is preconfigured and is used for storing a data structure, corresponding relation information of the data structure and the component type and data structure information of the data structure; editing data source information of a target data source according to the target data structure information to obtain target data source information; obtaining a configuration component instance according to the target data source information and the target WEB component; the contents of the configuration component instance are displayed in the target portal page. In the method, the target WEB component and the target data structure information are stored in different databases, decoupling of the target WEB component and the target data structure information is achieved, configuration adjustment based on the data structure information does not affect the WEB component, editing processing is conducted on data source information of a target data source through the target data structure information to obtain means of the target data source information, adding of the target data source and data acquisition content management of the target data source are achieved, data source changing operation is facilitated, finally means of configuration component examples are obtained according to the target data source information and the target WEB component, the purpose of flexible configuration of the target WEB component and the target data source is achieved, the data source is prevented from being changed through modification codes, the data source configuration flow is simplified, and work efficiency is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
Fig. 1 is a schematic view of a scenario of a component data source configuration provided in an embodiment of the present application;
FIG. 2 is a flowchart illustrating a method for configuring a component data source according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating another method for configuring a component data source according to an embodiment of the present application;
FIG. 4 is a schematic structural diagram of a device for configuring a component data source according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Specific embodiments thereof have been shown by way of example in the drawings and will herein be described in more detail. These drawings and the written description are not intended to limit the scope of the inventive concepts in any way, but to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as detailed in the accompanying claims.
For a clear understanding of the technical solutions of the present application, the prior art solutions will be described in detail first.
With the deep progress of enterprise digitization, WEB portals for different content, data, task aggregation are increasingly demanded. For businesses, various types of portals need to be able to cope with different business needs, such as business promotions, internal management, business processes, etc. In order to meet the demands of enterprises in different fields, portals must develop along the 'personalized customization, intelligent management and social interaction', and take more important positions in enterprise digital transformation.
In the prior art, the development of the WEB portal is mainly realized through two schemes: firstly, an overall pure code development scheme is adopted, and a component data source is configured through codes; secondly, a portal engine scheme realized based on a grid canvas system and a componentization technology provides a canvas and a series of preset portlets for a developer, a front page of a portal is built in a dragging mode, and a code configuration data source is written at the rear end.
However, in the prior art, when the data source needs to be changed, the code needs to be rewritten, so that the problems of complicated data source change and large workload are caused.
Aiming at the problems of complicated data source change and large workload, the inventor finds that the designed WEB component is pre-stored in a first database, the data structure information corresponding to the WEB component is pre-stored in a second database, when a portal page needs to be constructed, a required data source is determined, then the required WEB component is selected from the first database, then the data structure information is selected from the second database according to the WEB component, then the data source is edited according to the data structure information to obtain the data source information, finally the data source information is related to the WEB component, the purpose of acquiring data from the data source by the WEB component is achieved, when the required data source of the portal page needs to be changed, the change can be completed by binding the WEB component with the data source information of the changed data source, the process of data source change through codes is avoided, the data source configuration flow is simplified, and the working efficiency is improved.
The application scenario of the component data source configuration method provided in the embodiment of the present application is described below.
Fig. 1 is a schematic view of a scenario of component data source configuration provided in an embodiment of the present application, as shown in fig. 1, where the scenario includes: the portal page data source configuration can be realized by associating the WEB component with the required data source information when the portal page is designed, and when the portal page needs to change the data source configuration, only the association relation between the WEB component and the data source information needs to be switched.
The following describes the technical solutions of the present application and how the technical solutions of the present application solve the above technical problems in detail with specific embodiments. The following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Fig. 2 is a flow chart of a method for configuring a component data source according to an embodiment of the present application, as shown in fig. 2, where the method includes:
s201, responding to the selection operation of a user acting on a target portal page, selecting a target WEB component from a first database, and acquiring a target data source from the target database, wherein the first database is a database which is preconfigured and is used for storing more than two component types of WEB components.
The target portal page may refer to a portal page that needs to be configured by a WEB component data source.
By way of example, portal pages may refer to an aggregation of scene information specific to a class, which may be divided by roles, such as group portals, sub-company portals, high-level portals, specialty business portals, external collaboration portals, personal post portals. The system can also be divided according to functions, such as an information display portal, a data interaction portal, a comprehensive thematic portal and a personal work portal.
The first database may refer to a database for storing WEB components of more than two component types. In particular, the first database may be a component library in a portal engine. The portal engine is a portal page design platform, in which common WEB components are built.
By way of example, component types may include to-Do type, teletext type, card carousel type, news information type, and statistics chart type, among others.
The target WEB component can refer to a WEB component needing to be subjected to data source configuration, the WEB component can refer to a general whole or module which abstracts common page elements in a portal page, multiplexing is convenient, and the display of the portal page is composed of a plurality of WEB components.
The WEB component may be a new personalized component developed by a user according to a specification established by the portal engine, or may be a component preset in the portal engine.
The target data source may refer to a data source of content that the target portal page needs to display. A data source may refer to a device or original media that provides some desired data, which may be a file, a particular database on a DBMS (Database Management System ), or even a real-time data feed, the data may be located on the same computer on which the program is located, or on another computer at some location on the network.
In this embodiment, when a user needs to design a target portal page, a required target WEB component may be selected from a preset first database, and then a target data source is determined according to content to be displayed on the portal page, so as to provide a basis for association configuration of a subsequent target WEB component and the target data source. And the selection of the WEB components is diversified through the action of the first database, so that the method can adapt to different portal page scenes.
S202, determining target data structure information corresponding to the target WEB component from a second database according to the component type of the target WEB component, wherein the second database is a database which is preconfigured and is used for storing a data structure, corresponding relation information of the data structure and the component type and data structure information of the data structure.
The second database may refer to a database for storing a data structure, correspondence information between the data structure and a component type, and data structure information of the data structure, specifically, the data structure may be used for representing a data structure of the WEB component, the data structure information may be specific content of the data structure, and content displayed by the WEB component may be known through the data structure information.
For example, the data structure information corresponding to the teletext type component may include a picture, a title, a release time, a summary, and a release source. After the WEB component is instantiated, the picture, the title, the release time, the abstract and the release source in a specific data source are displayed in the portal page.
The method for determining the data structure may include that when a user wants to define a new WEB component based on the portal engine, the supporting scaffold provided in the portal engine requires the user to define a required data structure in the component code, then the data structure information of the data structure is extracted according to the data structure, and finally the corresponding relation between the data structure and the component type of the WEB component is established.
In this embodiment, the data structure of the WEB component and the WEB component are separately decoupled to generate separate data structure information, so that configuration adjustment based on the data structure information can not affect the WEB component, on one hand, the intrusion code is prevented from modifying the configuration information of the WEB component, and on the other hand, the configuration information of the WEB component is more flexible and changeable, and can adapt to more application scenarios. In addition, the target data structure information corresponding to the target WEB component is stored in the second database, so that the target data structure information can be directly selected from the second database when the target data structure information needs to be acquired, the operation steps are simplified, the technical threshold is reduced, and the method is suitable for more users.
S203, editing the data source information of the target data source according to the target data structure information to obtain the target data source information.
Among the data source information of the target data source, the data source information may refer to original information of the target data source, for example, a data interface URL (Uniform Resource Locator ), a data source type, a datagram field, and the like of the target data source.
The target data source information may refer to information corresponding to target data structure information, through which desired data can be accurately obtained from a data source. Specifically, the target data source information may include a data interface URL, a data source type, a data message field, and a target data structure information mapping relationship.
The method for editing the data source information of the target data source can comprise the steps of obtaining a data message field of the target data source, determining the field meaning in the data message field, obtaining the required information in the data message field item by item according to the required information in the target data structure information, and then respectively establishing a mapping relation between the required information in the data message field and each item of the target data structure information, so that the required information can be obtained from the target data source through the combination of a data interface URL and the mapping relation.
Further, a data source information database may be established, the correspondence between the target data structure information and the target data source information, and the target data source information may be stored in the data source information database, and when the target data source information needs to be used, the data source information may be directly obtained from the data source information database, and when the data source needs to be changed, other data sources may be obtained from the data source information database again according to the correspondence.
For example, in order to realize dynamic switching of data sources, different data sources may be configured under the same portal page for the same WEB component through a preset condition format, a trigger condition may be set as login information of a user, and a required data source is selected according to the login information of the user; the trigger condition may also be set to a login time period, with different data sources being selected at different time periods, wherein the condition format is for example an IF function. The embodiment can also realize different application effects through other combination forms of the WEB component, the portal page and the data source, and the application effects are not limited herein.
The data source information may include information such as data interface URL, data source type, mapping relationship between data message field and component data model, etc.
In this embodiment, the data source information of the target data source is edited to obtain the means of the target data source information, so as to establish the configuration relationship between the target data source and the target data structure information, so that the data of the target data source is adapted according to the target data structure information, and the cutting of the original data of the target data source is completed.
Wherein, in the embodiment of the application, the data source information of the target data source comprises a data interface URL and a data message field,
editing the data source information of the target data source according to the target data structure information to obtain the target data source information, wherein the editing comprises the following steps:
establishing a mapping relation between the data message field and the target data structure information according to the target data structure information;
and obtaining the target data source information according to the data interface URL and the mapping relation.
S204, obtaining a configuration component instance according to the target data source information and the target WEB component.
The method for obtaining the configuration component example can include establishing an association relationship between target data source information and a target WEB component, so that the target WEB component obtains data from a target data source.
In this embodiment, an association relationship is established between the target WEB component and the target data source information, so that the configuration operation of the target WEB component and the target data source can be completed. Compared with the prior art, the method has the advantages that the data source is configured for the target WEB component in a code mode, the configuration flow of the target data source is simplified, the working efficiency is improved, in addition, when the target data source needs to be changed or switched, the association relation between the target WEB component and the target data source information is directly changed or the association relation between the newly-added target WEB component and the target data source information of another data source is directly changed, and different data sources can be flexibly applied based on the conditional format.
S205, displaying the content of the configuration component instance in the target portal page.
In this embodiment, after the configuration of the target data source of the target WEB component is completed, the target WEB component may obtain the required target data from the target data source, and render the target data and display the rendered target data in the target portal page.
Wherein, in the embodiment of the application, the method further comprises the following steps:
responding to the login operation of a user acting on a target portal page, and acquiring personal information of the user;
and displaying the target data corresponding to the personal information in the target data source in the target portal page according to the personal information and the configuration component example.
The personal information may refer to a login account, a name, a personal ID, a phone number, a mailbox, and any combination of the foregoing.
In this embodiment, by means of acquiring the target data corresponding to the personal information, the data of the target data source may be displayed in a personalized manner, so that the portal page is more humanized in display, which is beneficial to accurate delivery of the data and security requirements of the data, for example, in a to-be-handled component, only the data related to the personal information needs to be acquired from the target data source and displayed in the to-be-handled list. Correspondingly, in the news type component, data is not required to be acquired according to personal information.
In this embodiment of the present application, according to personal information and a configuration component instance, displaying target data corresponding to the personal information in a target data source in a target portal page includes:
determining target data source information and a data interface URL and a mapping relation in the target data source information according to the configuration component instance;
acquiring target data corresponding to the personal information from a target data source according to the personal information, the data interface URL and the mapping relation;
and rendering the target portal page according to the target data so as to display the target data in the target portal page.
Wherein, in the embodiment of the application, the method further comprises the following steps:
determining updated target data in the target data source in response to an updating operation of the target data in the target data source by a user;
and responding to the refreshing operation of the user on the target portal page, and displaying the updated target data in the target portal page.
The update operation may refer to an operation of updating the target data source, for example, after the backlog is processed, adjusting data in the data source according to the processed backlog; after filling out the questionnaire, the filled-out content is saved to the data source.
Updating the target data may refer to updated data in the target data source.
The refresh operation may refer to reloading the portal page under the current portal page to cause the portal page to retrieve the data source data.
In this embodiment, the data of the target data source is updated in real time by updating the target data source, so that the display content of the target portal page is also updated in real time. In addition, the target WEB component not only can acquire data from the target data source, but also can update the target data source, and the application scenes of the WEB component and the data source are increased, so that the application of the portal component is more diversified.
In this embodiment of the present application, in response to an update operation of target data in a target data source by a user, determining update target data in the target data source includes:
determining data to be updated in the target data source and the data source type of the target data source in response to the updating operation of the user on the target data in the target data source;
and updating the target data in the target data source according to the data to be updated in the target data source and the data source type of the target data source to obtain updated target data.
The data source types may include database types and programming interface types, among others.
For example, if the data source type is a database type, the method for updating the target data source according to the data to be updated may be: and directly updating the database according to the data to be updated and the preset updating mapping relation. For example, for a to-Do type component, if the data source of the to-Do type component is a database type, the update purpose is: when the user reads the backlog and adjusts the data in the data source according to the processed backlog, the updating mapping relation between the newly added data in the backlog type component and the original data of the data source is preset, the data to be updated is obtained, the data of the data source is updated according to the updating mapping relation and the data to be updated, and the updated data in the database is the update target data.
The method for determining the data to be updated may include determining the data to be updated according to operations such as modification, addition, deletion, etc. of the target data by the user.
Wherein, in the embodiment of the application, when the data source type is a programming interface type,
after determining the data to be updated in the target data source and the data source type of the target data source in response to the user's update operation on the target data in the target data source, the method further comprises:
Determining callback information corresponding to a target data source, wherein the callback information comprises a callback URL, a callback Token and a callback Key;
and updating the target data in the target data source according to the callback information and the data to be updated to obtain updated target data.
The callback information may include a callback URL, a callback Token, and a callback Key, where the callback URL may be a destination URL of the target portal page pushing data, in this embodiment, the callback URL may refer to a URL of the target data source, and the callback Token is a preset encryption manner, and is used to encrypt data to be updated in a callback process, so as to ensure security and uniqueness of the data. The callback Key is used for decrypting the encrypted data to be updated.
The method for updating the target data in the target data source according to the callback information and the data to be updated can comprise the steps of encrypting the data to be updated through a callback Token, sending the encrypted data to a callback URL, decrypting the data to be updated through the callback Key after the callback URL receives the encrypted data to be updated, obtaining the data to be updated, and updating the target data source according to the data to be updated by the callback URL.
In this embodiment of the present application, before selecting a target WEB component from the first database in response to a selection operation of a user on a target portal page, and acquiring a target data source from the target database, the method further includes:
Responding to the newly-built operation of the user on the target WEB component, and determining the target WEB component and the component type of the target WEB component;
and storing the target WEB component and the component type of the target WEB component into a first database.
Wherein, in the embodiment of the application, the method further comprises the following steps:
determining a target data structure corresponding to the component type according to the component type of the target WEB component, and establishing a corresponding relation between the component type and the target data structure;
determining target data structure information of the target data structure according to the target data structure;
storing the target data structure, the correspondence between the component type and the data structure, and the target data structure information to a second database.
According to the component data source configuration method provided by the embodiment, the required target WEB component is selected from the preset first database in response to the selection operation of the user on the target portal page, and then the target data source is determined according to the content required to be displayed by the portal page, so that a foundation is provided for the association configuration of the subsequent target WEB component and the target data source. And the selection of the WEB components is diversified through the action of the first database, so that the method can adapt to different portal page scenes. The data structure of the WEB component is stored in the second database, so that the data structure and the WEB component are separated and decoupled, and independent data structure information is generated, so that the WEB component is not influenced by configuration adjustment based on the data structure information, on one hand, the configuration information of the WEB component is prevented from being modified by intrusion codes, and on the other hand, the configuration information of the WEB component is more flexible and changeable, and can adapt to more application scenes. In addition, the target data structure information corresponding to the target WEB component is stored in the second database, so that the target data structure information can be directly selected from the second database when the target data structure information needs to be acquired, the operation steps are simplified, the technical threshold is reduced, and the method is suitable for more users. The original data of the target data source is cut by means of editing the data source information of the target data source to obtain the target data source information. And then, the association relation is established between the target WEB component and the target data source information, so that the configuration flow of the target data source is simplified, and the working efficiency is improved. And finally, acquiring target data from a target data source through a target WEB component, rendering the target data, and displaying the rendered target data in a target portal page to realize target data display.
FIG. 3 is a flowchart of another method for configuring a component data source according to an embodiment of the present application, where the method includes:
s301, determining the data structure type according to the WEB component.
The WEB component is a WEB component in the component management module and is used for a portal engine.
The whole portal engine is consistent with the existing general portal engine, and mainly comprises a portal management module, a component configuration module and a portal rendering module. The core principle describes the layout, components, styles and services of the WEB portal page through metadata, and packages and stores various metadata of a single portal into a portal configuration database. When a user opens the instantiated portal page, the portal engine renders portal content according to the configured metadata, and content display is achieved. The invention can add the association configuration of the dynamic adapter in the portal component configuration module to realize the binding of the component and the dynamic data source, and add the dynamic display mechanism of the data in the portal rendering module to realize the dynamic change of the data source.
The component management module principle is similar to the componentization expansion function of other engines, is used for developing SDK for the portal engine provided by the programmer, can develop new personalized components based on the established specification of the portal engine, and is accessed into the component library of the portal engine. The invention adds the association configuration of the dynamic adapter in the component management module, so that the data source definition specification of the component is required to be followed when the component is developed, the data sources of the data structures required by the component in different states are defined, and the dynamic adapter is automatically associated when the component is uploaded, so that the matched data source type is generated.
The determination of the data structure type is accomplished by a data structure type definition module that provides an initialized preset data structure type for adapting to a preset WEB component of the portal engine. When a developer is to define a new WEB component based on a portal engine, a matched scaffold provided by component management can require the required data structure to be defined in a component code, a preset data structure type can be directly used, if the preset type cannot be met, the required data structure type can be defined by the developer, and when the component package is uploaded, a new matched data structure type can be synchronously generated in a data structure type definition module.
S302, adding the data source according to the data structure type to obtain the added data source.
The data source adding is completed through a data source management module, and the data source management module is mainly used for managing data source instantiations of different data structure types, can add, edit and delete data sources under the data sources of different data structure types, and can support a plurality of data sources under one data structure type. The data source information comprises information such as data interface URL, data source interface type, mapping relation between data message field and component data model, etc., and the added data source can be used in association when configuring portal components. Configuration data for the data source management module may be stored in the portal configuration database.
S303, associating the WEB component with the added data source so that the WEB component acquires data from the added data source.
Wherein, associate the WEB component with the added data source to enable the WEB component to obtain data from the added data source, comprising:
data synchronization: and the data synchronization module is used for taking effect of data synchronization of the data source, completing corresponding data synchronization according to the type of the data source interface, completing cutting of the data source according to the mapping relation between the message and the model, and storing the cutting of the data source into the component content database.
Data presentation: when a user opens a WEB portal page, a portal engine acquires a dynamic adaptation relation of the component from a portal configuration database, positions related data sources, directly reads corresponding data in the component content database and displays the corresponding data according to service logic, and adjusts the portal configuration data in real time to dynamically adapt to different data sources in real time.
Wherein, in the embodiment of the application, the method further comprises the following steps:
different data source forms are supported, the method is not limited to a database, and supporting API and Socket modes are added to meet the requirements of real-time information and to-be-handled pushing scenes.
The data processing module is simplified, the data source is not processed by multi-table ETL, and only single-table fields are cut for use, so that the real-time performance of data updating is ensured.
A standard callback method is added to the data processing module, the database can be directly updated aiming at the direct-connection database, and the source data can be automatically callback updated after user operation data can be realized by only adding a callback URL, a callback Token and a callback Key when the data source is newly added aiming at the API and Socket type data source. The method can directly update the source data, and meets the scenes of read and unread information, update of data to be handled, approval confirmation and the like in the portal scene.
According to the method for configuring the component data source, the WEB component and the data structure are decoupled by determining the means of the data structure type through the WEB component, the data source is added according to the data structure type when configuration modification based on the data structure does not affect the WEB component, the means of the added data source is obtained, the data source and the data structure type are bound, the WEB component and the added data source are associated, and therefore the WEB component obtains data from the added data source, and configuration of the WEB component and the data source is achieved. When the data source is required to be changed, the data source can be changed only by changing the association relation between the WEB component and the added data source without modification in an intrusion code mode, so that the change content is simplified, and the working efficiency is improved.
Fig. 4 is a schematic structural diagram of a device for configuring a component data source according to an embodiment of the present application, as shown in fig. 4, where the device includes: a selection module 401, a determination module 402, an editing module 403, an obtaining module 404, and a display module 405, wherein:
the selection module 401 is configured to respond to a selection operation of a user acting on a target portal page, select a target WEB component from a first database, and obtain a target data source from the target database, where the first database is a database that is preconfigured and is used for storing WEB components of more than two component types;
a determining module 402, configured to determine, according to a component type of the target WEB component, target data structure information corresponding to the target WEB component from a second database, where the second database is a database that is configured in advance and is used to store a data structure, correspondence information between the data structure and the component type, and data structure information of the data structure;
the editing module 403 is configured to edit data source information of a target data source according to the target data structure information, so as to obtain target data source information;
an obtaining module 404, configured to obtain a configuration component instance according to the target data source information and the target WEB component;
A display module 405 for displaying the content of the configuration component instance in the target portal page.
Wherein, in the embodiment of the present application, the editing module 403 is further configured to:
establishing a mapping relation between the data message field and the target data structure information according to the target data structure information;
and obtaining the target data source information according to the data interface URL and the mapping relation.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 5, the electronic device 50 includes:
the electronic device 50 may include one or more processing cores 'processors 501, one or more computer-readable storage media's memory 502, communication components 503, and the like. The processor 501, the memory 502, and the communication unit 503 are connected via a bus 504.
In a specific implementation, at least one processor 501 executes computer-executable instructions stored in memory 502, causing at least one processor 501 to perform the component data source configuration method as described above.
The specific implementation process of the processor 501 may refer to the above-mentioned method embodiment, and its implementation principle and technical effects are similar, and this embodiment will not be described herein again.
In the embodiment shown in fig. 5, it should be understood that the processor may be a central processing unit (english: central Processing Unit, abbreviated as CPU), or may be other general purpose processors, digital signal processors (english: digital Signal Processor, abbreviated as DSP), application specific integrated circuits (english: application Specific Integrated Circuit, abbreviated as ASIC), or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in a processor for execution.
The Memory may comprise high-speed Memory (Random Access Memory, RAM) or may further comprise Non-volatile Memory (NVM), such as at least one disk Memory.
The bus may be an industry standard architecture (Industry Standard Architecture, ISA) bus, an external device interconnect (Peripheral Component, PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, among others. The buses may be divided into address buses, data buses, control buses, etc. For ease of illustration, the buses in the drawings of the present application are not limited to only one bus or one type of bus.
In some embodiments, a computer program product is also presented, comprising a computer program or instructions which, when executed by a processor, implement the steps in any of the component data source configuration methods described above.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor.
To this end, embodiments of the present application provide a computer readable storage medium having stored therein a plurality of instructions capable of being loaded by a processor to perform steps in any of the component data source configuration methods provided by embodiments of the present application.
Wherein the storage medium may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
According to one aspect of the present application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium.
The instructions stored in the storage medium may perform steps in any component data source configuration method provided in the embodiments of the present application, so that the beneficial effects that any component data source configuration method provided in the embodiments of the present application can be achieved, which are detailed in the previous embodiments and are not described herein.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It is to be understood that the present application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (12)

1. A method for configuring a component data source, comprising:
responding to the selection operation of a user acting on a target portal page, selecting a target WEB component from a first database, and acquiring a target data source from the target database, wherein the first database is a database which is preconfigured and is used for storing more than two component types of WEB components;
determining target data structure information corresponding to the target WEB component from a second database according to the component type of the target WEB component, wherein the second database is a database which is preconfigured and is used for storing a data structure, corresponding relation information of the data structure and the component type and data structure information of the data structure;
editing the data source information of the target data source according to the target data structure information to obtain target data source information;
obtaining a configuration component instance according to the target data source information and the target WEB component;
And displaying the content of the configuration component instance in the target portal page.
2. The method of claim 1, wherein the data source information of the target data source includes a data interface URL, and a data message field,
the editing processing is performed on the data source information of the target data source according to the target data structure information to obtain target data source information, including:
establishing a mapping relation between the data message field and the target data structure information according to the target data structure information;
and obtaining target data source information according to the data interface URL and the mapping relation.
3. The method according to claim 1, wherein the method further comprises:
responding to the login operation of a user acting on the target portal page, and acquiring personal information of the user;
and displaying target data corresponding to the personal information in the target data source in the target portal page according to the personal information and the configuration component instance.
4. The method according to claim 3, wherein the displaying the target data corresponding to the personal information in the target data source in the target portal page according to the personal information and the configuration component instance comprises:
Determining the target data source information and the data interface URL and the mapping relation in the target data source information according to the configuration component instance;
acquiring target data corresponding to the personal information from the target data source according to the personal information, the data interface URL and the mapping relation;
and rendering the target portal page according to the target data so as to display the target data in the target portal page.
5. A method according to claim 3, characterized in that the method further comprises:
determining updated target data in the target data source in response to an updating operation of a user on the target data in the target data source;
and responding to the refreshing operation of the user on the target portal page, and displaying the updated target data in the target portal page.
6. The method of claim 5, wherein the determining updated target data in the target data source in response to a user's update operation on target data in the target data source comprises:
determining data to be updated in the target data source and a data source type of the target data source in response to updating operation of a user on the target data in the target data source;
And updating the target data in the target data source according to the data to be updated in the target data source and the data source type of the target data source to obtain updated target data.
7. The method of claim 6, wherein when the data source type is a programming interface type,
after determining the data to be updated in the target data source and the data source type of the target data source in response to the updating operation of the user on the target data in the target data source, the method further comprises:
determining callback information corresponding to the target data source, wherein the callback information comprises a callback URL, a callback Token and a callback Key;
and updating the target data in the target data source according to the callback information and the data to be updated to obtain updated target data.
8. The method of claim 1, wherein prior to the selecting the target WEB component from the first database and retrieving the target data source from the target database in response to a user selection of the target portal page, the method further comprises:
responding to a new operation of a user on a target WEB component, and determining the target WEB component and the component type of the target WEB component;
And storing the target WEB component and the component type of the target WEB component into a first database.
9. The method of claim 8, wherein the method further comprises:
determining a target data structure corresponding to the component type according to the component type of the target WEB component, and establishing a corresponding relation between the component type and the target data structure;
determining target data structure information of the target data structure according to the target data structure;
and storing the target data structure, the corresponding relation between the component type and the data structure and the target data structure information to a second database.
10. A component data source configuration apparatus, comprising:
the selection module is used for responding to the selection operation of a user acting on a target portal page, selecting a target WEB component from a first database, and acquiring a target data source from the target database, wherein the first database is a database which is preconfigured and is used for storing more than two WEB components;
the determining module is used for determining target data structure information corresponding to the target WEB component from a second database according to the component type of the target WEB component, wherein the second database is a database which is preconfigured and used for storing a data structure, corresponding relation information of the data structure and the component type and data structure information of the data structure;
The editing module is used for editing the data source information of the target data source according to the target data structure information to obtain target data source information;
the obtaining module is used for obtaining a configuration component instance according to the target data source information and the target WEB component;
and the display module is used for displaying the content of the configuration component instance in the target portal page.
11. An electronic device, comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored in the memory to implement the method of any one of claims 1-9.
12. A computer readable storage medium having stored therein computer executable instructions which when executed by a processor are adapted to carry out the method of any one of claims 1-9.
CN202311596315.2A 2023-11-27 2023-11-27 Component data source configuration method and device, electronic equipment and medium Pending CN117435183A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311596315.2A CN117435183A (en) 2023-11-27 2023-11-27 Component data source configuration method and device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311596315.2A CN117435183A (en) 2023-11-27 2023-11-27 Component data source configuration method and device, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN117435183A true CN117435183A (en) 2024-01-23

Family

ID=89553483

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311596315.2A Pending CN117435183A (en) 2023-11-27 2023-11-27 Component data source configuration method and device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN117435183A (en)

Similar Documents

Publication Publication Date Title
US11799984B2 (en) Installable web applications
CN109597814B (en) Online rapid delivery system of background management information system
CN112632942B (en) Document processing method, device, equipment and medium
US20160170712A1 (en) Method for integrally implementing development and release of APP
KR101625238B1 (en) Inserting a multimedia file through a web-based desktop productivity application
US7284208B2 (en) System and method for enabling at least one independent data navigation and interaction activity within a document
US8555200B2 (en) Representing editable attributes of embedded content
KR20080091424A (en) Method of managing fonts in multimedia scenes and corresponding computer program and terminal
US20100088270A1 (en) Data versioning concept including time dependency and active and inactive states
CN104704468A (en) Cross system installation of WEB applications
CN111796823A (en) Method and device for updating page and displaying page and page maintenance system
US20210174004A1 (en) Methods and systems for dynamic customization of independent webpage section templates
US20150365497A1 (en) Providing access to information across multiple computing devices
US20150317406A1 (en) Re-Use of Web Page Thematic Elements
US20060156243A1 (en) Systems and methods for sharing loops
US20190050420A1 (en) Edit and share unsupported files through instantly generated preview
EP4080507A1 (en) Method and apparatus for editing object, electronic device and storage medium
EP4246312A1 (en) Content display method and terminal device
CN112328140B (en) Image input method, device, equipment and medium thereof
US20220028425A1 (en) System and Method to Customizing Video
KR20200001139A (en) Server for editing electronic document based on message including edit command and operating method thereof
US20060155724A1 (en) Loop channels
CN117435183A (en) Component data source configuration method and device, electronic equipment and medium
CN112487218B (en) Content processing method, system, device, computing equipment and storage medium
CN111782192B (en) Method for developing mobile office system in mixed mode

Legal Events

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