CN112925998B - Interface data processing method, device and system, electronic equipment and storage medium - Google Patents

Interface data processing method, device and system, electronic equipment and storage medium Download PDF

Info

Publication number
CN112925998B
CN112925998B CN202110341279.XA CN202110341279A CN112925998B CN 112925998 B CN112925998 B CN 112925998B CN 202110341279 A CN202110341279 A CN 202110341279A CN 112925998 B CN112925998 B CN 112925998B
Authority
CN
China
Prior art keywords
interface element
access request
target
interface
address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110341279.XA
Other languages
Chinese (zh)
Other versions
CN112925998A (en
Inventor
陈恺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202110341279.XA priority Critical patent/CN112925998B/en
Publication of CN112925998A publication Critical patent/CN112925998A/en
Application granted granted Critical
Publication of CN112925998B publication Critical patent/CN112925998B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9566URL specific, e.g. using aliases, detecting broken or misspelled links
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9538Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application relates to an interface data processing method, device, system, electronic equipment and storage medium. Therefore, the interface elements which are independently developed and deployed can be loaded by the front-end application program, and the API interfaces corresponding to the interface elements can be called after the interface elements are loaded, and the interface elements developed by different teams can be flexibly used in a crossing manner in the process of developing and operating the website, so that the developing and operating efficiency of the website is improved, and the communication and cooperation cost is reduced.

Description

Interface data processing method, device and system, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to an interface data processing method, apparatus, system, electronic device, and storage medium.
Background
With the development of internet technology, modern website functions are highly complex and require division cooperation of large-scale teams to complete. The traditional division mode is generally divided based on a front-end interface and a back-end service, then different functional modules are divided in the front-end interface or the back-end service, each module is developed by different teams, and finally the modules are imported into a summarized project to complete the overall construction and deployment. Because all modules are required to be built and deployed together finally, a large amount of coordination work is generated between the modules, so that the development and operation processes of large websites are caused, and the problems of high coordination cost and low efficiency are caused.
Disclosure of Invention
In order to solve the above technical problems or at least partially solve the above technical problems, embodiments of the present application provide an interface data processing method, an apparatus, a system, an electronic device, and a storage medium.
According to an aspect of the embodiments of the present application, there is provided an interface data processing method, including:
receiving an initial access request from a front-end application program, wherein the initial access request comprises an initial address corresponding to a first interface element;
analyzing the initial access request to obtain a unique identifier corresponding to the first interface element;
inquiring a target address corresponding to the first interface element based on the unique identification;
replacing an initial address in the initial access request with the target address to obtain a target access request;
sending the target access request to a target server corresponding to the target address, and inquiring by the target server based on the target access request to obtain accessed data;
and forwarding the accessed data fed back by the target server to the front-end application program.
Optionally, the unique identifier includes object information corresponding to the first interface element;
the analyzing the initial access request to obtain the unique identifier corresponding to the first interface element includes:
Analyzing the initial address to obtain attribute information corresponding to the first interface element;
obtaining object information corresponding to the first interface element based on the attribute information;
the querying the target address corresponding to the first interface element based on the unique identifier includes:
inquiring extension information corresponding to the object information, and obtaining the target address from the extension information, wherein the extension information is stored in a database in an object storage mode.
Optionally, the analyzing the initial access request to obtain the unique identifier corresponding to the first interface element further includes:
analyzing to obtain a request type corresponding to the initial access request, wherein the request type comprises a resource request or an interface request;
the querying the target address corresponding to the first interface element based on the unique identifier includes:
inquiring the expansion information corresponding to the unique identifier;
and inquiring a target resource address corresponding to the resource request or a target interface address corresponding to the interface request from the extension information.
According to another aspect of the embodiments of the present application, there is provided an interface data processing method, including:
Generating an initial access request corresponding to a first interface element, wherein the initial access request comprises a unique identifier and an initial address corresponding to the first interface element;
the initial access request is sent to a public background server, the public background server inquires a target address corresponding to the unique identifier according to the initial access request, the initial address in the initial access request is replaced by the target address to obtain a target access request, the target access request is sent to a target server corresponding to the target address, and accessed data fed back by the target server based on the target access request is received;
and displaying the first interface element according to the accessed data forwarded by the public background server.
Optionally, the generating the initial access request corresponding to the first interface element includes:
when a loading request of the functional component corresponding to the first interface element is received, generating an initial access request for requesting the static resource corresponding to the first interface element;
or alternatively, the first and second heat exchangers may be,
when an operation request for the first interface element is received, an initial access request for requesting interface data corresponding to the first interface element is generated.
Optionally, when the first interface element is disposed inside a second interface element, the first interface element is defined as a custom element, and a custom element tag is inserted at an insertion position of the first interface element inside the second interface element;
when the received accessed data includes the static resource corresponding to the first interface element, displaying the first interface element according to the accessed data forwarded by the public background server, including:
operating a script file containing the static resource in the accessed data to obtain rendering parameters corresponding to the custom elements;
searching a custom element tag corresponding to the first interface element;
and rendering the custom element with the rendering parameters to an insertion position corresponding to the custom element tag so as to display the first interface element.
According to another aspect of the embodiments of the present application, there is provided an interface data processing apparatus, including:
the receiving module is used for receiving an initial access request from a front-end application program, wherein the initial access request comprises an initial address corresponding to a first interface element;
the analysis module is used for analyzing the initial access request to obtain a unique identifier corresponding to the first interface element;
The query module is used for querying a target address corresponding to the first interface element based on the unique identification;
the replacing module is used for replacing the initial address in the initial access request with the target address to obtain a target access request;
the sending module is used for sending the target access request to a target server corresponding to the target address, and the target server inquires to obtain accessed data based on the target access request;
and the receiving module is used for forwarding the accessed data fed back by the target server to the front-end application program.
According to another aspect of the embodiments of the present application, there is provided an interface data processing apparatus, including:
the generating module is used for generating an initial access request corresponding to the first interface element, wherein the initial access request comprises an initial address of the first interface element, and the first interface element is arranged inside the second interface element;
the sending module is used for sending the initial access request to a public background server, inquiring a target address corresponding to the first interface element by the public background server according to the initial access request, replacing the initial address in the initial access request with the target address to obtain a target access request, sending the target access request to a target server corresponding to the target address, and receiving accessed data fed back by the target server based on the target access request;
And the display module is used for displaying the first interface element according to the accessed data forwarded by the public background server.
According to another aspect of an embodiment of the present application, there is provided an interface data processing system, including: front-end application programs, a public background server and a target server;
the front-end application program is used for generating an initial access request corresponding to the first interface element, wherein the initial access request comprises an initial address of the first interface element; sending the initial access request to a public background server;
the public background server is used for analyzing the initial access request to obtain a unique identifier corresponding to the first interface element; inquiring a target address corresponding to the first interface element based on the unique identification; replacing an initial address in the initial access request with the target address to obtain a target access request; sending the target access request to a target server corresponding to the target address;
the target server is used for inquiring to obtain accessed data based on the target access request;
the public background server is used for forwarding the accessed data fed back by the target server to the front-end application program;
The front-end application is used for displaying the first interface element according to the accessed data.
According to another aspect of the embodiments of the present application, there is also provided a storage medium including a stored program that performs the steps described above when running.
According to another aspect of an embodiment of the present application, there is provided an electronic device including: the device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
the memory is used for storing a computer program;
the processor is configured to implement the above-mentioned method steps when executing the computer program.
According to another aspect of the embodiments of the present application, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the above-mentioned method steps.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages:
in this embodiment of the present application, after an interface element is deployed independently, when any front-end application uses the interface element, a static resource request required for loading the interface element may be forwarded to an independently deployed resource server through object data corresponding to the interface element stored in advance in a common background server, and a back-end API interface request sent by the interface element that has been loaded by the front-end application may be forwarded to the independently deployed interface server according to the object data. Thus, the front-end application program can query the static resources or the interface data corresponding to the interface element by the public background server only according to the unique identifier of the interface element without knowing the server for deploying the static resources or the interface data of the interface element. Therefore, the interface elements which are independently developed and deployed can be loaded by the front-end application program, the API interface corresponding to the interface elements can be called after the interface elements are loaded, and the interface elements developed by different teams can be flexibly used in a cross mode in the process of developing and operating the website, so that the developing and operating efficiency of the website is improved, and the communication and cooperation cost is reduced.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a flowchart of an interface data processing method according to an embodiment of the present application;
FIG. 2 is a flowchart of an interface data processing method according to another embodiment of the present disclosure;
FIG. 3 is a flowchart of an interface data processing method according to another embodiment of the present disclosure;
FIG. 4 is a flowchart of an interface data processing method according to another embodiment of the present disclosure;
FIG. 5 is a flowchart of an interface data processing method according to another embodiment of the present disclosure;
FIG. 6 is a flowchart of an interface data processing method according to another embodiment of the present disclosure;
FIG. 7 is a block diagram of an interface data processing apparatus according to an embodiment of the present application;
FIG. 8 is a block diagram of an interface data processing apparatus according to another embodiment of the present application;
FIG. 9 is a block diagram of an interface data processing system provided in an embodiment of the present application;
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present application based on the embodiments herein.
The interface element (interface element) in the embodiment of the present application refers to a series of elements that are included in a software or system interface capable of meeting the interaction requirement and meet the user interaction requirement. Interface elements can be divided into the following categories: windows, dialog boxes, menus, scroll bars, graphics, dashboards, clipboards, cursor buttons, and the like.
In order to solve the problems of high cost and low efficiency of large website development operation and maintenance collaboration in the prior art, the embodiment of the application provides an interface data processing technology, and a public background server is adopted to inquire static resources or interface data corresponding to interface elements to be loaded by a front-end application program.
For interface elements developed by different teams, after static resources of the interface elements are deployed to a resource server or interface data are deployed to an interface server, target addresses of the static resources of the interface elements or the interface data in the resource server are stored in a database through a public background server in an extended information mode. Therefore, the interface element is loaded by the application program at the front end, and the static resource or the interface data corresponding to the interface element can be obtained through inquiring of the public background server without knowing the server address of the static resource or the interface data for deploying the interface element. Therefore, in the process of website development operation and maintenance, interface elements developed by different teams can be flexibly used in a crossing way, the website development operation and maintenance efficiency is improved, and the communication cooperation cost is reduced.
In this embodiment, at least one insertion position (also referred to as a slot) for placing other interface elements may be provided inside an interface element. Based on the characteristics of the Web Components specification in the HTML standard, an interface element inserted into a slot is defined as a Custom element (Custom Elements), and static resources such as HTML, css, javascript and the like required to be used by the interface element are packaged as a Javascript script file, for example, by a tool such as Webpack and the like. The packaged script file can be deployed to a resource server, and an initial address (URL) for accessing the script file is provided to the outside.
The Custom element (Custom Elements) is an object of a customizable interface under the Web Components specification.
The embodiment of the application relates to a front-end application program, a public background server and a target server. The front-end application program is used for loading interface elements and requesting to access static resources and interface data of the interface elements; a public background server (Portal) forwards an access request of a front-end application program to an actual target server; the target server sends the accessed data corresponding to the access request to the Portal, and the Portal forwards the accessed data to the front-end application program.
The following first describes an interface data processing method provided by the embodiment of the present invention.
In the technical scheme of the application, the static resource and the interface API service of each interface element are independently deployed, namely are respectively deployed on different servers and are accessed through different URL addresses. However, the static resources of the interface element and the API interface service as a whole are accessed by the front-end application, typically using the same domain name. Therefore, the embodiment of the application provides an interface data processing method, so that the URL addresses of the front-end application program requests all use the same domain name, and the Portal can forward the access request sent by the front-end application program to an actual target server.
Fig. 1 is a flowchart of an interface data processing method according to an embodiment of the present application. As shown in fig. 1, the method is applied to the Portal, and comprises the following steps:
step S11, an initial access request from a front-end application program is received, wherein the initial access request comprises an initial address corresponding to a first interface element.
Wherein the initial address is not the actual address to be accessed by the initial access request, but is a virtual URL address using the same domain name. The initial address is used for inquiring the Portal about the actual target address corresponding to the interface element.
And step S12, analyzing the initial access request to obtain the unique identifier corresponding to the first interface element.
The initial access request may include a unique identifier corresponding to the first interface element and an initial address.
Wherein the unique identification of the interface element may include, but is not limited to, at least one of the following:
(1) Object information
The object information may include an object type of kind.
The kine includes: group name, simpleName and version number version.
(2) Scope name scope and name
An interface element may be globally unique determined by scope and name.
(3) Fully Qualified Name (FQN)
Here, fqn= < scope > + '/' + < object name > to which the object belongs.
(4) Universal unique identification code (Universally Unique Identifier UUID)
Wherein the UUID is generated at the time of interface element creation.
With any of the above information, the interface element may be uniquely determined by Portal.
Thus, the initial address may be a predefined virtual URL address, such as/ui/extension/Portal/xxx, or/api/extension/Portal/xxx, which is used only to enter the initial access request into the Portal and to determine the request type of the initial access request as a resource request ("ui") or an interface request ("api").
Step S13, inquiring the target address corresponding to the first interface element based on the unique identification.
In the database, the actual address of the interface element at the target server, i.e. the address of the static resource or API interface data that can actually access the interface element, is stored. Portal can query its corresponding target address from the database by the unique identification of the interface element.
Step S14, replacing the initial address in the initial access request with the target address to obtain the target access request.
Portal replaces the initial address in the initial access request with the target address obtained by inquiry, and then a target access request containing the actual URL address is obtained.
Step S15, a target access request is sent to a target server corresponding to the target address, and the target server queries the accessed data based on the target access request.
By means of the target address, the Portal can send a target access request to the target server actually storing the static resources served by the interface element or providing the API, from which the data to be accessed is available.
And S16, forwarding the accessed data fed back by the target server to the front-end application program.
Portal forwards the queried accessed data to a front-end application, which may display interface elements based on the accessed data.
After the interface element is deployed independently in the steps S11 to S16, when any front-end application program uses the interface element, the static resource request required for loading the interface element can be forwarded to the independently deployed resource server by querying the object data corresponding to the interface element stored in the database in advance through the Portal, and the back-end API interface request sent by the interface element loaded by the front-end application program is forwarded to the independently deployed interface server according to the object data.
Thus, the front-end application program can query the static resources or the interface data corresponding to the interface element by the public background server only according to the unique identifier of the interface element without knowing the server for deploying the static resources or the interface data of the interface element. Therefore, the interface elements which are independently developed and deployed can be loaded by the front-end application program, and the API interfaces corresponding to the interface elements can be called after the interface elements are loaded, and the interface elements developed by different teams can be flexibly used in a crossing manner in the process of developing and operating the website, so that the developing and operating efficiency of the website is improved, and the communication and cooperation cost is reduced.
In the embodiment of the application, after the interface element is created and the static resource is deployed to the resource server, the expansion information of the interface element can be stored in the database through the association interface of the Portal and the database.
Fig. 2 is a flowchart of an interface data processing method according to another embodiment of the present application. As shown in fig. 2, the method further comprises the steps of:
step S21, element expansion information corresponding to the first interface element is obtained; the static resources corresponding to the first interface element are deployed on the resource server; the element extension information includes: a unique identifier of the first interface element, and a target resource address of the static resource on the resource server;
step S22, obtaining a target interface address of an interface server corresponding to a first interface element serving as interface expansion information;
step S23, the element expansion information and the interface expansion information are used as expansion information corresponding to the first interface element, and are stored in a database in an object storage mode.
In this embodiment, the extension information is stored in the database in an object storage manner. In the object storage mode, each object is a tree structured document and is expressed in a YAML or Json format.
Taking YAML format as an example, the object form stored in the database is as follows:
kine: < object type >
metadata:
UUID < globally unique UUID, server side automatically generates >, when in creation
Revimsion is an object version, and is automatically generated by the server during creation and automatically updated by the server during update
scope < FQN as target of scope)
name < unique name under the same scope at the current time point >
labels:<String->String>
annotations:<String->String>
spec:
.. < each object type may define a respective spec schema >
Wherein each object can be globally uniquely determined by scope and name, and can be uniquely identified by the form of FQN.
Fqn= < scope > +/' + < object name > to which the object belongs.
Each object must be under a scope, each object forming a scope named FQN for that object.
The life cycle of an object always is within the life cycle of its scope object, its scope must already exist before the object is created, and after the scope object is deleted, all objects under its scope should be recursively deleted. The global scope is denoted by '/' and is not generated by any object nor can it be deleted.
The object has a type specified by a kind field. The value of kined is a string of the form < group >/< simpleName >/< version >.
Any tree structured data can be stored under the spec field of each object, thereby providing generalized unified storage capability for all applications. Whereas the spec field of the kined object has a specific format, for example:
spec:
group:mesos
simpleName:qae
version:0.1.0
uiExtension:
baseUrl:http://qae-ui
components:
-element:qae-app-view
bundlePath:/component/qae-app-view.js
slot:default
apiExtension:
baseURL:http://qae-api
wherein the group, simpleName and version fields indicate that the kined object defines an object type named < meso >/< qae >/<0.1.0 >. The uiExtension and apiExtension fields store the extension information of the interface element, and may store information such as the HTML tag name of the Custom Elements of the interface element, the insertion location of the interface element, and the like, in addition to the target address URL that is required to be used when forwarding the request.
Optionally, all extension information stored in the object storage manner may be externally provided with an access interface through a set of rest pi pairs, to support querying, creating, deleting, and modifying (including the kind object) the stored object.
In the embodiment, the object storage model is adopted, and besides the data required by the storage expansion mechanism, the flexible and general data persistence storage capability is provided, so that the development of the application program is realized without developing respective data storage layers, and the complexity of the development of the application program is greatly simplified.
In another alternative embodiment, the unique identifier may include object information, i.e. the object type, kind, corresponding to the first interface element, so that the initial access request does not contain a field corresponding to the unique identifier, and the initial address includes the object type, kind, and the unique identifier may be parsed from the initial address. Fig. 3 is a flowchart of an interface data processing method according to an embodiment of the present application. As shown in fig. 3, the step S12 includes:
step S31, analyzing from the initial address to obtain attribute information corresponding to the first interface element;
optionally, the attribute information includes a group name, an abbreviation, and a version number;
step S32, obtaining object information corresponding to the first interface element based on the attribute information;
the step S13 includes:
step S33, inquiring the expansion information corresponding to the object information, and obtaining the target address from the expansion information, wherein the expansion information is stored in the database in an object storage mode.
For example, in an initial request received by Portal, the initial address includes: ui/extension/< kind.group >/< kind.simplename >/< kind.version >. From the initial address, three variables of a group name of kind.group, abbreviated as kind.simplename, and a version number of kind.version can be resolved, so that object information (object type of kind) corresponding to the interface element is obtained.
Since the extension information is stored in the database in the form of object storage, based on the object information (object type ind), the extension information corresponding to the object information can be queried, and thus, the target address corresponding to the access request can be queried.
In an alternative embodiment, the initial access request sent by the front-end application, the content of the request may be static resources of interface elements or API interface data. Fig. 4 is a flowchart of an interface data processing method according to an embodiment of the present application. As shown in fig. 4, the step S12 includes:
step S41, analyzing to obtain a request type corresponding to the initial access request, wherein the request type comprises a resource request or an interface request;
the step S13 includes:
step S42, inquiring the extension information corresponding to the unique identifier;
step S43, inquiring the target resource address corresponding to the resource request or the target interface address corresponding to the interface request from the extension information.
For example, in an initial access request received by a Portal, the initial address includes: the request type of the initial access request may be determined as a resource request based on "ui" therein. If the initial address in the initial access request includes: the request type of the initial access request can be determined as an interface request based on the "api" therein. After inquiring corresponding expansion information in the database based on the unique identification, inquiring a target address corresponding to the request type from the expansion information.
In the above embodiment, the front-end application program does not need to acquire the actual deployment address of the interface element, and the same initial address can be adopted no matter the initial access request is made to the static resource and the API interface data, and the Portal obtains the static resource or the API interface data of the interface element from the corresponding target server according to the request type in the initial access request. Therefore, the front-end application program can load the interface element, and can call the API interface corresponding to the interface element through Portal after the front-end application program is loaded. Therefore, for the front-end application program, the static resources and API interface data of the interface element can be accessed only according to the interface element identification, the data request of the deployed interface element is simpler, the data request is prevented from being limited by cross-domain access of the browser, the exposure of the internal architecture information of the application program is also avoided, and the safety of the application program is improved.
In another embodiment, for an interface element newly developed by a developer, the interface element may also be registered with a Portal after the static resources and interface data are deployed to the corresponding resource server. The method further comprises the steps of:
step a1, element expansion information and interface expansion information corresponding to a first interface element are obtained.
Wherein the first interface element inserted into the second interface element is defined as a custom element, and the insertion position of the first interface element in the second interface element is inserted into the custom element tag.
The static resources corresponding to the first interface element are packaged into script files, and the script files are deployed to a resource server; the unique identifier corresponding to the first interface element and the target resource address of the script file deployed on the resource server are used as element expansion information, and the target interface address of the interface server corresponding to the first interface element is used as interface expansion information.
And a2, the element expansion information and the interface expansion information are used as expansion information corresponding to the first interface element, the expansion information is sent to a database, and the expansion information is stored in the database in an object storage mode.
Wherein the second interface element may be a UI frame of a front-end application (website, page, etc.). Multiple slots may be included in one interface element. One or more slots may also be included in the inserted first interface element, and other interface elements may be inserted.
Thus, through the steps a1 and a2, for the interface elements developed by different teams, after the static resources of the interface elements are deployed to the resource server or the interface data are deployed to the interface server, the static resources of the interface elements or the target addresses of the interface data in the resource server are stored in the database through the public background server in an extended information mode. After finishing registering the newly developed interface element on the Portal, the subsequent front-end application program can query the static resource or interface data corresponding to the interface element by the Portal according to the unique identifier of the interface element.
The following describes an interface data processing method provided by the embodiment of the invention.
Fig. 5 is a flowchart of an interface data processing method according to an embodiment of the present application. As shown in fig. 5, the method is applied to a front-end application program, and comprises the following steps:
step S51, generating an initial access request corresponding to the first interface element, wherein the initial access request comprises a unique identifier and an initial address corresponding to the first interface element.
Wherein the initial address is not the actual address to be accessed, but a virtual URL address using the same domain name. The initial address is used to query a public background server (Portal) for the actual target address corresponding to the interface element.
Step S52, the initial access request is sent to the public background server, the public background server inquires a target address corresponding to the unique identifier according to the initial access request, the initial address in the initial access request is replaced by the target address, the target access request is obtained, the target access request is sent to a target server corresponding to the target address, and the accessed data fed back by the target server based on the target access request is received.
Step S53, the first interface element is displayed according to the accessed data forwarded by the public background server.
Optionally, the front-end application may generate an access request to the static resource or the API interface data, where step S51 includes: when a loading request of a functional component corresponding to a first interface element is received, generating an initial access request for requesting the static resource corresponding to the first interface element; or when an operation request for the first interface element is received, generating an initial access request for requesting the interface data corresponding to the first interface element.
Alternatively, the request static resources or API interface data may be differentiated by adding "ui" or "API" to the initial access request.
Optionally, when the first interface element is disposed inside the second interface element, the first interface element is defined as a custom element, and a custom element tag is inserted at an insertion position of the first interface element inside the second interface element.
Fig. 6 is a flowchart of an interface data processing method according to an embodiment of the present application. As shown in fig. 6, for the front-end application, when the received accessed data includes the static resource corresponding to the first interface element, the step S53 includes:
step S61, running script files containing static resources in the accessed data to obtain rendering parameters corresponding to the custom elements;
Wherein, the rendering parameters are parameters required for rendering the first interface element, such as style, color, text, and the like of the first interface element.
Step S62, searching a custom element label corresponding to the first interface element;
step S63, the custom element with the rendering parameters is rendered to the insertion position corresponding to the custom element label, so as to display the first interface element.
In this embodiment, after the front-end application program receives the accessed data, the Javascript code is run, and definition of the custom is completed through the obtained rendering parameters, and since a custom tag is already inserted into the slot of the second element, the custom element with the rendering parameters can be rendered to the slot according to the tag, so that display of the first interface element is realized.
The following are device embodiments of the present application, which may be used to perform method embodiments of the present application.
Fig. 7 is a block diagram of an interface data processing apparatus according to an embodiment of the present application, where the apparatus may be implemented as part or all of an electronic device by software, hardware, or a combination of both. As shown in fig. 7, the interface data processing apparatus is applied to a Portal, and includes:
A receiving module 81, configured to receive an initial access request from a front-end application, where the initial access request includes an initial address corresponding to a first interface element;
the parsing module 82 is configured to parse the initial access request to obtain a unique identifier corresponding to the first interface element;
a query module 83, configured to query a target address corresponding to the first interface element based on the unique identifier;
a replacing module 84, configured to replace an initial address in the initial access request with a target address, so as to obtain a target access request;
a sending module 85, configured to send a target access request to a target server corresponding to the target address, where the target server obtains accessed data based on the query of the target access request; and forwarding the accessed data fed back by the target server to the front-end application program.
Fig. 8 is a block diagram of an interface data processing apparatus according to another embodiment of the present application, where the apparatus may be implemented as part or all of an electronic device by software, hardware, or a combination of both. As shown in fig. 8, the interface data processing apparatus is applied to a front-end application, and includes:
the generating module 91 is configured to generate an initial access request corresponding to a first interface element, where the initial access request includes an initial address of the first interface element, and the first interface element is disposed inside the second interface element;
The sending module 92 is configured to send an initial access request to a public background server, and the public background server queries a target address corresponding to the first interface element according to the initial access request, replaces the initial address in the initial access request with the target address to obtain a target access request, sends the target access request to a target server corresponding to the target address, and receives accessed data fed back by the target server based on the target access request;
and the display module 93 is configured to display the first interface element according to the accessed data forwarded by the public background server.
FIG. 9 is a block diagram of an interface data processing system according to an embodiment of the present application, as shown in FIG. 10, where the system includes: front-end application 101, public backend server 102, and target server 103.
The front-end application 101 is configured to generate an initial access request corresponding to the first interface element, where the initial access request includes an initial address of the first interface element; the initial access request is sent to the public background server 102.
The public background server 102 is configured to parse the initial access request to obtain a unique identifier corresponding to the first interface element; inquiring a target address corresponding to the first interface element based on the unique identification; replacing an initial address in the initial access request with a target address to obtain a target access request; and sending the target access request to the target server 103 corresponding to the target address.
The target server 103 is configured to obtain the accessed data based on the target access request query.
The public background server 102 is configured to forward the accessed data fed back by the target server 103 to the front-end application 101.
The front-end application 101 is configured to display a first interface element according to the accessed data.
The whole flow of the interface data processing will be described in detail below.
The front-end application is a browser and includes a UI framework that includes one or more UI slots therein. When a link of a certain functional module in the UI framework is accessed, the UI framework starts to load a UI component corresponding to the functional module, and the loading process is as follows:
step A1, a browser acquires object information corresponding to the UI component, such as an object type of kind;
step A2, the browser initiates a request to the Portal service according to the group, simpleName, version of the object type kin and the bundlePath of the interface element, wherein the initial address is/ui/extension/< kin.group >/< kin.simpleName >/< kin.version >/bundlePat h;
step A3, according to the group, simpleName and version information in the request, the Portal searches the corresponding object from the database to obtain the destination address URL for actually providing the static resource of the UI component, forwards the request to the resource server corresponding to the destination address URL, and returns the static resource file from the resource server for actually providing the static resource file;
Step A4, after receiving the content of the static resource file, the browser runs the Javascript code in the static resource file to complete definition of the custom;
step A5, because the browser inserts a custom tab in the UI slot in advance, the browser renders the UI component after obtaining the static resource file;
and step A6, when the UI component is used or the UI component is initialized, the browser initiates a request to Portal, wherein the prefix of the request path is/API/extension/< kind.group >/< kind.simpleName >/< kind.version >, and the Portal searches an object corresponding to the object type kind from the database according to the group, simpleName and version information in the request to obtain a destination address URL (uniform resource locator) for actually providing API (application program interface) interface data, forwards the request to an interface server corresponding to the destination address URL, and returns a response by the interface server for actually providing the API service.
According to the embodiment of the application, the interface elements which are independently deployed can be dynamically loaded on the front-end application program, so that the front-end function of one functional module can be independently developed, deployed and operated, the coupling degree between different functional modules is greatly reduced, and the collaboration cost between development teams is reduced.
The access request forwarding mechanism in the embodiment of the invention forwards the static resource and the back-end API request uniformly through Portal, so that the resources and services which are independently deployed and accessed through independent URLs can be exposed to the browser through the same domain name, the limitation of cross-domain access of the browser is avoided, and the exposure of the internal architecture information of the website is also avoided.
According to the embodiment of the application, the object storage model is adopted, and besides the data required by the storage expansion mechanism, the flexible and general data persistence storage capability is provided, so that the development of the application program is realized without developing respective data storage layers, and the development complexity of the application program is greatly simplified.
The embodiment of the application further provides an electronic device, as shown in fig. 10, where the electronic device may include: the device comprises a processor 1501, a communication interface 1502, a memory 1503 and a communication bus 1504, wherein the processor 1501, the communication interface 1502 and the memory 1503 are in communication with each other through the communication bus 1504.
A memory 1503 for storing a computer program;
the processor 1501, when executing the computer program stored in the memory 1503, implements the steps of the method embodiments described below.
The communication bus mentioned above for the electronic device may be a peripheral component interconnect standard (Peripheral ComponentInterconnect, pi) bus or an extended industry standard architecture (Extended Industry StandardArchitecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also Digital signal processors (Digital SignalProcessing, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
The present application also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method embodiments described below.
It should be noted that, with respect to the apparatus, electronic device, and computer-readable storage medium embodiments described above, since they are substantially similar to the method embodiments, the description is relatively simple, and reference should be made to the description of the method embodiments for relevant points.
It is further noted that relational terms such as "first" and "second", and the like, are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing is only a specific embodiment of the invention to enable those skilled in the art to understand or practice the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. An interface data processing method, comprising:
receiving an initial access request from a front-end application program, wherein the initial access request comprises an initial address corresponding to a first interface element;
analyzing the initial access request to obtain a unique identifier corresponding to the first interface element;
inquiring a target address corresponding to the first interface element based on the unique identification;
replacing an initial address in the initial access request with the target address to obtain a target access request;
sending the target access request to a target server corresponding to the target address, and inquiring by the target server based on the target access request to obtain accessed data;
forwarding the accessed data fed back by the target server to the front-end application program;
the unique identifier comprises object information corresponding to the first interface element;
the analyzing the initial access request to obtain the unique identifier corresponding to the first interface element includes:
analyzing the initial address to obtain attribute information corresponding to the first interface element;
obtaining object information corresponding to the first interface element based on the attribute information;
The querying the target address corresponding to the first interface element based on the unique identifier includes:
inquiring extension information corresponding to the object information, and obtaining the target address from the extension information, wherein the extension information is stored in a database in an object storage mode.
2. The method of claim 1, wherein the parsing the initial access request to obtain the unique identifier corresponding to the first interface element includes:
analyzing to obtain a request type corresponding to the initial access request, wherein the request type comprises a resource request or an interface request;
the querying the target address corresponding to the first interface element based on the unique identifier includes:
inquiring the expansion information corresponding to the unique identifier;
and inquiring a target resource address corresponding to the resource request or a target interface address corresponding to the interface request from the extension information.
3. An interface data processing method, comprising:
generating an initial access request corresponding to a first interface element, wherein the initial access request comprises a unique identifier and an initial address corresponding to the first interface element; the unique identifier comprises object information corresponding to the first interface element;
The initial access request is sent to a public background server, the public background server analyzes the initial address to obtain attribute information corresponding to the first interface element, obtains object information corresponding to the first interface element based on the attribute information, inquires extension information corresponding to the object information, and obtains a target address from the extension information, wherein the extension information is stored in a database in an object storage mode, the initial address in the initial access request is replaced by the target address to obtain a target access request, the target access request is sent to a target server corresponding to the target address, and the accessed data fed back by the target server based on the target access request is received;
and displaying the first interface element according to the accessed data forwarded by the public background server.
4. The method of claim 3, wherein the generating the initial access request corresponding to the first interface element comprises:
when a loading request of the functional component corresponding to the first interface element is received, generating an initial access request for requesting the static resource corresponding to the first interface element;
Or alternatively, the first and second heat exchangers may be,
when an operation request for the first interface element is received, an initial access request for requesting interface data corresponding to the first interface element is generated.
5. The method of claim 4, wherein when the first interface element is disposed inside a second interface element, the first interface element is defined as a custom element, and a custom element tag is inserted at an insertion position of the first interface element inside the second interface element;
when the received accessed data includes the static resource corresponding to the first interface element, displaying the first interface element according to the accessed data forwarded by the public background server, including:
operating a script file containing the static resource in the accessed data to obtain rendering parameters corresponding to the custom elements;
searching a custom element tag corresponding to the first interface element;
and rendering the custom element with the rendering parameters to an insertion position corresponding to the custom element tag so as to display the first interface element.
6. An interface data processing apparatus, comprising:
the receiving module is used for receiving an initial access request from a front-end application program, wherein the initial access request comprises an initial address corresponding to a first interface element;
The analysis module is used for analyzing the initial access request to obtain a unique identifier corresponding to the first interface element;
the query module is used for querying a target address corresponding to the first interface element based on the unique identification;
the replacing module is used for replacing the initial address in the initial access request with the target address to obtain a target access request;
the sending module is used for sending the target access request to a target server corresponding to the target address, and the target server inquires to obtain accessed data based on the target access request; forwarding the accessed data fed back by the target server to the front-end application program;
the unique identifier comprises object information corresponding to the first interface element;
the analysis module is used for analyzing the initial address to obtain attribute information corresponding to the first interface element; obtaining object information corresponding to the first interface element based on the attribute information;
the query module is configured to query extension information corresponding to the object information, and obtain the target address from the extension information, where the extension information is stored in a database in an object storage manner.
7. An interface data processing apparatus, comprising:
the generating module is used for generating an initial access request corresponding to the first interface element, wherein the initial access request comprises an initial address of the first interface element, and the first interface element is arranged inside the second interface element;
the sending module is used for sending the initial access request to a public background server, analyzing the initial address by the background server to obtain attribute information corresponding to the first interface element, obtaining object information corresponding to the first interface element based on the attribute information, inquiring extension information corresponding to the object information, and obtaining a target address from the extension information, wherein the extension information is stored in a database in an object storage mode, the initial address in the initial access request is replaced by the target address to obtain a target access request, the target access request is sent to a target server corresponding to the target address, and the target server receives accessed data fed back based on the target access request;
and the display module is used for displaying the first interface element according to the accessed data forwarded by the public background server.
8. An interface data processing system, comprising: front-end application programs, a public background server and a target server;
the front-end application program is used for generating an initial access request corresponding to the first interface element, wherein the initial access request comprises an initial address of the first interface element; sending the initial access request to a public background server;
the public background server is used for analyzing the initial access request to obtain a unique identifier corresponding to the first interface element; inquiring a target address corresponding to the first interface element based on the unique identification; replacing an initial address in the initial access request with the target address to obtain a target access request; sending the target access request to a target server corresponding to the target address;
the target server is used for inquiring to obtain accessed data based on the target access request;
the public background server is used for forwarding the accessed data fed back by the target server to the front-end application program;
the front-end application program is used for displaying the first interface element according to the accessed data
The unique identifier comprises object information corresponding to the first interface element;
the public background server is used for analyzing the initial address to obtain the attribute information corresponding to the first interface element, obtaining the object information corresponding to the first interface element based on the attribute information, inquiring the extension information corresponding to the object information, and obtaining the target address from the extension information, wherein the extension information is stored in a database in an object storage mode.
9. An electronic device, comprising: the device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
the memory is used for storing a computer program;
the processor being adapted to carry out the method steps of any one of claims 1-5 when the computer program is executed.
10. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, carries out the method steps of any of claims 1-5.
CN202110341279.XA 2021-03-30 2021-03-30 Interface data processing method, device and system, electronic equipment and storage medium Active CN112925998B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110341279.XA CN112925998B (en) 2021-03-30 2021-03-30 Interface data processing method, device and system, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110341279.XA CN112925998B (en) 2021-03-30 2021-03-30 Interface data processing method, device and system, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112925998A CN112925998A (en) 2021-06-08
CN112925998B true CN112925998B (en) 2023-07-25

Family

ID=76176566

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110341279.XA Active CN112925998B (en) 2021-03-30 2021-03-30 Interface data processing method, device and system, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112925998B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5999941A (en) * 1997-11-25 1999-12-07 Micron Electronics, Inc. Database access using active server pages
JP2008033386A (en) * 2006-07-26 2008-02-14 Vip Partners Llc Information processing provision system
CN102624729A (en) * 2012-03-12 2012-08-01 北京星网锐捷网络技术有限公司 Web authentication method, device and system
CN104516885A (en) * 2013-09-26 2015-04-15 腾讯科技(深圳)有限公司 Implementation method and device of browse program double-kernel assembly
CN105229633A (en) * 2013-03-13 2016-01-06 萨勒斯福斯通讯有限公司 For realizing system, method and apparatus disclosed in data upload, process and predicted query API
CN107451162A (en) * 2016-06-01 2017-12-08 广州市动景计算机科技有限公司 Network resource accession equipment, mixing apparatus and method
CN108717435A (en) * 2018-05-16 2018-10-30 腾讯科技(深圳)有限公司 Webpage loading method, information processing method, computer equipment and storage medium
CN110187983A (en) * 2019-05-24 2019-08-30 北京奇艺世纪科技有限公司 A kind of remote invocation method, device and electronic equipment
CN111026491A (en) * 2019-12-10 2020-04-17 北京小米移动软件有限公司 Interface display method and device, electronic equipment, server and storage medium
CN111478935A (en) * 2019-12-16 2020-07-31 马上消费金融股份有限公司 Resource access method, internetwork connecting device, system and device
CN111866124A (en) * 2020-07-17 2020-10-30 北京金山云网络技术有限公司 Method, device, server and machine-readable storage medium for accessing webpage

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11900132B2 (en) * 2017-06-14 2024-02-13 The Toronto-Dominion Bank Dynamic modification of displayed interface elements based on contextual data
US20190102465A1 (en) * 2017-09-29 2019-04-04 Ca, Inc. Api query extension

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5999941A (en) * 1997-11-25 1999-12-07 Micron Electronics, Inc. Database access using active server pages
JP2008033386A (en) * 2006-07-26 2008-02-14 Vip Partners Llc Information processing provision system
CN102624729A (en) * 2012-03-12 2012-08-01 北京星网锐捷网络技术有限公司 Web authentication method, device and system
CN105229633A (en) * 2013-03-13 2016-01-06 萨勒斯福斯通讯有限公司 For realizing system, method and apparatus disclosed in data upload, process and predicted query API
CN104516885A (en) * 2013-09-26 2015-04-15 腾讯科技(深圳)有限公司 Implementation method and device of browse program double-kernel assembly
CN107451162A (en) * 2016-06-01 2017-12-08 广州市动景计算机科技有限公司 Network resource accession equipment, mixing apparatus and method
CN108717435A (en) * 2018-05-16 2018-10-30 腾讯科技(深圳)有限公司 Webpage loading method, information processing method, computer equipment and storage medium
CN110187983A (en) * 2019-05-24 2019-08-30 北京奇艺世纪科技有限公司 A kind of remote invocation method, device and electronic equipment
CN111026491A (en) * 2019-12-10 2020-04-17 北京小米移动软件有限公司 Interface display method and device, electronic equipment, server and storage medium
CN111478935A (en) * 2019-12-16 2020-07-31 马上消费金融股份有限公司 Resource access method, internetwork connecting device, system and device
CN111866124A (en) * 2020-07-17 2020-10-30 北京金山云网络技术有限公司 Method, device, server and machine-readable storage medium for accessing webpage

Also Published As

Publication number Publication date
CN112925998A (en) 2021-06-08

Similar Documents

Publication Publication Date Title
US7870482B2 (en) Web browser extension for simplified utilization of web services
US7698256B1 (en) History support for stateless Javascript Web client
US8082488B2 (en) Method for accessing a parent page while browsing web pages
US20090271690A1 (en) Handling cross-domain web service calls
US7509422B2 (en) System and method for locating web services
US20100049842A1 (en) Computing Environment Arranged to Support Predetermined URL Patterns
US7747604B2 (en) Dynamic sitemap creation
US20120331372A1 (en) Methods for making ajax web applications bookmarkable and crawlable and devices thereof
JP2004318842A (en) Webpage generation device, embedding device, method for control of webpage generation, webpage generation program, and recording medium
US20060173815A1 (en) Facilitating Identification of Entire Web Pages When Each Web Page is Rendered From Multiple Portions and Interest is Expressed Based on Content of the Portions
EP2648388B1 (en) Method, system, and device for displaying page
CN103873918A (en) Picture processing method, device and terminal
US20120278489A1 (en) Extracting web services from resources using a web services resources programming model
CN103500210A (en) Method, device and browser for carrying out webpage loading
US20140089383A1 (en) Method and system for automatic detecting and resolving apis
US8090702B2 (en) Analyzing web site traffic
CN111651703B (en) Page jump method and device, electronic equipment and readable storage medium
CN103530329A (en) Method and device for performing webpage loading and browsers
US20080172396A1 (en) Retrieving Dated Content From A Website
US8140575B2 (en) Apparatus, method, and program product for information processing
KR20210089081A (en) Landing page processing method, device, equipment and medium
US20070050394A1 (en) Method and apparatus for automated database creation from Web Services Description Language (WSDL)
US9189546B2 (en) Semantic client, semantic information management server, method of generating semantic information, method of searching semantic information, and computer program recording medium for performing the methods
CN112925998B (en) Interface data processing method, device and system, electronic equipment and storage medium
WO2018081963A1 (en) Method and device for dns resolution and network system

Legal Events

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