CN113778447B - Service compatibility method and device of front-end system, electronic equipment and storage medium - Google Patents

Service compatibility method and device of front-end system, electronic equipment and storage medium Download PDF

Info

Publication number
CN113778447B
CN113778447B CN202111086842.XA CN202111086842A CN113778447B CN 113778447 B CN113778447 B CN 113778447B CN 202111086842 A CN202111086842 A CN 202111086842A CN 113778447 B CN113778447 B CN 113778447B
Authority
CN
China
Prior art keywords
service
sub
page
main service
main
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
CN202111086842.XA
Other languages
Chinese (zh)
Other versions
CN113778447A (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.)
Kangjian Information Technology Shenzhen Co Ltd
Original Assignee
Kangjian Information Technology Shenzhen 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 Kangjian Information Technology Shenzhen Co Ltd filed Critical Kangjian Information Technology Shenzhen Co Ltd
Priority to CN202111086842.XA priority Critical patent/CN113778447B/en
Publication of CN113778447A publication Critical patent/CN113778447A/en
Application granted granted Critical
Publication of CN113778447B publication Critical patent/CN113778447B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • 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

Landscapes

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

Abstract

The application relates to the field of system performance optimization, and discloses a service compatibility method of a front-end system, which comprises the following steps: creating a main service and a plurality of sub-services of a front-end system, and constructing page views of the main service and each sub-service to obtain a main service page and a plurality of sub-service pages; constructing a communication link between each sub-service page and the main service page; according to the communication link, the running environments of the main service page and the sub service pages are isolated in a proxy mode, so that the sub services and the main service form a micro service architecture of the front-end system. The application also relates to a blockchain technique, wherein the main service and the sub-service can be stored in a blockchain node. The application also provides a service compatible device of the front-end system, electronic equipment and a readable storage medium. The application can optimize the compatibility between the services of the front-end system.

Description

Service compatibility method and device of front-end system, electronic equipment and storage medium
Technical Field
The present application relates to the field of system performance optimization, and in particular, to a service compatible method and apparatus for a front-end system, an electronic device, and a readable storage medium.
Background
Often, because the architecture versions of the technology stacks are not uniform, the problem that the services are difficult to be compatible occurs among the services of the traditional system, and in order to achieve compatibility, transformation migration needs to be performed on each service, and once transformation migration is involved, a great deal of time and cost are consumed, and the risk caused by code modification is increased.
Disclosure of Invention
The application provides a service compatibility method, a device, electronic equipment and a computer readable storage medium of a front-end system, and mainly aims to optimize the compatibility between services of the front-end system.
Responding to service demands, creating a main service and a plurality of sub-services of a front-end system, and constructing page views of the main service and each sub-service to obtain a main service page and a plurality of sub-service pages;
constructing a communication link between each sub-service page and the main service page;
and according to the communication link, isolating the running environments of the main service page and the plurality of sub service pages in a proxy mode so that the plurality of sub services and the main service form a micro service architecture of the front-end system.
Optionally, said building a page view of said main service and each of said sub-services includes:
constructing DOM trees and shadow DOM trees of the main service and each sub service;
setting page rules of the DOM tree of the main service and the DOM tree of the sub service respectively, and constructing a main service page rule document and a sub service page rule document by utilizing the page rules;
converting byte content in the main service page rule document into characters, combining the characters into a plurality of attribute-attribute value pairs according to the main service page rule, converting a plurality of attribute-attribute value pairs in main service into tree nodes, and then linking the tree nodes to a DOM tree of the main service and a shadow DOM tree of the main service;
converting byte content in the sub-service page rule document into characters, combining the characters into a plurality of attribute-attribute value pairs according to the sub-service page rule, converting a plurality of attribute-attribute value pairs in the sub-service into tree nodes, and then linking the tree nodes into a DOM tree of the sub-service and a DOM tree of a sub-service shadow;
and drawing the main service page according to the DOM tree of the main service and the shadow DOM tree of the main service and sub-service pages of the DOM tree of the sub-service and the shadow of the sub-service by using a preset page drawing tool.
Optionally, the converting the plurality of attribute-attribute value pairs in the main service into a DOM tree of the main service and a DOM tree of the main service shadow after the tree node is linked to the DOM tree of the main service includes:
converting the attribute-attribute value pairs of the main service into CSS tree nodes in a shadow DOM tree of the main service;
configuring CSS style of each tree node in the shadow DOM tree of the main service;
and linking the corresponding CSS tree nodes to the tree nodes of the main service shadow DOM tree according to the corresponding relation between each tree node of the main service shadow DOM tree and the corresponding CSS tree node.
Optionally, the setting the page rules of the DOM tree of the main service and the DOM tree of the sub service respectively, and constructing a main service page rule document and a sub service page rule document by using the page rules, includes:
respectively acquiring page style requirements of each sub-service and the main service;
constructing a page style configuration file according to the page style requirements;
and converting the style content in the page style configuration file into page style attributes, and storing the page style attributes in a page rule document to obtain the main service page rule document and the sub service rule document.
Optionally, said constructing a communication link between each of said sub-service pages and said sub-service page includes:
responding to a transmission request of a sub-service, and creating a demand request in the sub-service;
the main service responds to the demand request and transmits demand data to the sub-service;
when event change occurs in the sub-service, the sub-service triggers a predefined event instruction, transmits event change data to the main service, and waits for a processing instruction;
the main service receives the event change data and sends an event processing instruction to the sub-service according to the event change data.
Optionally, the isolating the running environments of the main service page and the plurality of sub service pages in the form of a proxy server includes:
setting operation configuration files of each sub-service and the main service;
setting up interception requirements between each sub-service and the main service by using the configuration file;
and according to the interception requirement, executing isolation of the running environment.
Optionally, the building an interception requirement between each sub-service and the main service includes:
setting access limiting requirements for data which are not accessible inside each sub-service and main service;
when a first sub-service accesses data which is not accessible in the second sub-service, the second sub-service executes access interception and returns early warning information to the first sub-service for unassigned definition.
In order to solve the above-mentioned problems, the present application also provides a service compatible device of a front-end system, the device comprising:
the page view construction module is used for responding to service requirements, creating a main service and a plurality of sub-services of the front-end system, and constructing page views of the main service and each sub-service to obtain a main service page and a plurality of sub-service pages;
the communication link construction module is used for constructing a communication link between each sub-service page and the main service page;
and the running environment isolation module is used for isolating the running environments of the main service page and the plurality of sub service pages in a proxy mode according to the communication link so that the plurality of sub services and the main service form a micro service architecture of the front-end system.
In order to solve the above-mentioned problems, the present application also provides an electronic apparatus including:
a memory storing at least one computer program; a kind of electronic device with high-pressure air-conditioning system
And the processor executes the computer program stored in the memory to realize the service compatibility method of the front-end system.
In order to solve the above-mentioned problems, the present application also provides a computer-readable storage medium having stored therein at least one computer program that is executed by a processor in an electronic device to implement the service compatibility method of the front-end system described above.
The embodiment of the application solves the problem of pattern isolation among the services by constructing the shadow DOM tree among the services, and also solves the problem of communication among the services by constructing the communication link for linking the services. Accordingly, the present application provides a service compatibility method, apparatus, electronic device, and computer-readable storage medium for a front-end system that optimizes compatibility between services of the front-end system.
Drawings
Fig. 1 is a flow chart illustrating a service compatible method of a front-end system according to an embodiment of the present application;
FIG. 2 is a schematic block diagram of a service compatible device of a front-end system according to an embodiment of the present application;
fig. 3 is a schematic diagram of an internal structure of an electronic device for implementing a service compatible method of a front-end system according to an embodiment of the present application;
the achievement of the objects, functional features and advantages of the present application will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The embodiment of the application provides a service compatibility method of a front-end system. The execution subject of the service compatible method of the front-end system includes, but is not limited to, at least one of a server, a terminal, and the like, which can be configured to execute the method provided by the embodiment of the application. In other words, the service compatibility method of the front-end system may be performed by software or hardware installed in a terminal device or a server device, and the software may be a blockchain platform. The service end includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like. The server may be an independent server, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (ContentDelivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms.
Referring to fig. 1, a flowchart of a service compatible method of a front-end system according to an embodiment of the present application is shown, where in the embodiment of the present application, the service compatible method of the front-end system includes:
s1, responding to service demands, creating a main service and a plurality of sub-services of a front-end system, and constructing page views of the main service and each sub-service to obtain a main service page and a plurality of sub-service pages;
in the embodiment of the present application, the service requirement may be a functional requirement that a user requires to implement an independent function in a front-end system, for example, in an application program, there is a requirement of network transaction, and a payment framework unit needs to be added in the application program, where the payment framework unit is the service requirement.
In the embodiment of the application, the main service can be an integral functional service framework capable of linking other sub-services, and the sub-services can be functional service frameworks capable of realizing single functions and existing in the main service. For example, in a Web page, the main service may be an overall page frame of the entire Web page, and the sub service may be a small page frame that implements a single function among the overall page frames of the Web. Each of the sub-service and the main service is a functional unit capable of independently realizing a predetermined function.
In the embodiment of the application, the page view may be a Web page drawn by using a page object and a page style or a page of an application program according to a page drawing rule, and the distribution condition of all contents of a document to be displayed on the page and the position of the document on each page view may be displayed in the page view.
In detail, the response business requirement creates a main service and a plurality of sub-services of a front-end system, and constructs a page view of the main service and each sub-service to obtain a main service page and a plurality of sub-service pages;
respectively constructing DOM trees and shadow DOM trees of the main service and each sub service;
setting page rules of the DOM tree of the main service and the DOM tree of the sub service respectively, and constructing a main service page rule document and a sub service page rule document by utilizing the page rules;
converting byte content in the main service page rule document into characters, combining the characters into a plurality of attribute-attribute value pairs according to the main service page rule, converting a plurality of attribute-attribute value pairs in main service into tree nodes, and then linking the tree nodes to a DOM tree of the main service and a shadow DOM tree of the main service;
converting byte content in the sub-service page rule document into characters, combining the characters into a plurality of attribute-attribute value pairs according to the sub-service page rule, converting a plurality of attribute-attribute value pairs in the sub-service into tree nodes, and then linking the tree nodes to the DOM tree of the sub-service and the shadow DOM tree of the sub-service;
and drawing the main service page and the sub service page by using a preset page drawing tool.
Further, the setting the page rules of the DOM tree of the main service and the DOM tree of the sub service respectively, and constructing a main service page rule document and a sub service page rule document by using the page rules, includes:
respectively acquiring page style requirements of each sub-service and the main service;
constructing a page style configuration file according to the page style requirements;
and converting the style content in the page style configuration file into page style attributes, and storing the page style attributes in a page rule document to obtain the main service page rule document and the sub service rule document.
In the embodiment of the application, the DOM tree can be a multi-layer tree relation structure formed by independently writing a plurality of code blocks obtained by a user through completing service and utilizing main code blocks and nested code blocks in the plurality of code blocks. In addition, the above-mentioned relation structure can be characterized by using folder structure in microcomputer, using "my computer" as main body, in which "C disk" and "D disk" are nested, in every disk there are many folders, in the folders are nested, and the process of opening file layer by layer is equivalent to the process of traversing from root node to leaf node, and the main body and nested body form a structural relation tree.
In the embodiment of the application, the shadow DOM tree is not obvious after being linked with the DOM tree, and can finish a multi-layer tree structure of functions contained in the DOM tree, for example, the DOM tree is constructed by utilizing various expressions and various behaviors in the function service, so that the DOM tree structure is complicated and not intuitive and concise when a user performs DOM tree structure inspection, and the user can package various expressions and various behaviors of the function service in the shadow DOM tree in the function embodiment, thereby realizing specific functions and simplifying the DOM tree structure.
Further, the converting the plurality of attribute-attribute value pairs in the main service into a DOM tree of the main service and a shadow DOM tree of the main service after the tree node is linked to the DOM tree of the main service includes:
converting the attribute-attribute value pairs of the main service into CSS tree nodes in a shadow DOM tree of the main service;
configuring CSS style of each tree node in the shadow DOM tree of the main service;
and linking the corresponding CSS tree nodes to the tree nodes of the main service shadow DOM tree according to the corresponding relation between each tree node of the main service shadow DOM tree and the corresponding CSS tree node.
Further, the steps of converting the plurality of attribute-attribute value pairs in the sub-service into the DOM tree of the tree node and then linking to the sub-service and the shadow DOM tree of the sub-service are the same as the steps of converting the plurality of attribute-attribute value pairs in the main service into the DOM tree of the tree node and then linking to the main service and the shadow DOM tree of the main service, which are not described herein.
S2, constructing a communication link between each sub-service page and the main service page;
in the embodiment of the application, the communication link may be a channel for sharing data between two services, two applications or two systems, and both sides constructing the communication link need to have a common language. For example, a bridge of data sharing and data connection, such as a communication link, can be constructed between an operating system on a microcomputer and a microcomputer application program, and the application program can access resources in the microcomputer system and obtain services of the microcomputer operating system through the data bridge.
In embodiments of the present application, the communication links for each of the sub-services and the main service may be constructed using properties tips based on VUE components.
In detail, the constructing a communication link between each sub-service page and the sub-service page includes:
responding to a transmission request of a sub-service, and creating a demand request in the sub-service;
the main service responds to the demand request and transmits demand data to the sub-service;
when event change occurs in the sub-service, the sub-service triggers a predefined event instruction, transmits event change data to the main service, and waits for a processing instruction;
the main service receives the event change data and sends an event processing instruction to the sub-service according to the event change data;
and completing the construction of the communication link by using the transmission request, the event instruction and the processing instruction.
And S3, isolating the running environments of the main service page and the plurality of sub service pages in a proxy server mode according to the communication link so that the plurality of sub service pages and the main service page form a micro service architecture of the front-end system.
In the embodiment of the application, the proxy is in the access form of network information, and can also be a middleware for communication between two services, for example, the proxy can be used for configuring private variables of the two services between the two services, so that each service is customized privately, and the external service can be successfully accessed only through the proxy when the external service wants to access.
The embodiment of the application sets the configuration files of each sub-service and the main service; setting up interception requirements between each sub-service and the main service by using the configuration file; and according to the interception requirement, executing isolation of the running environment.
In the embodiment of the present application, the configuration file may be a parameter file for making a proxy rule in a proxy, for example, when a proxy server is carried by using a proxy server carrying tool zabbix, the configured parameter file may include a server port parameter, a hostname parameter, a database name, and the like.
Further, the building, by using the configuration file, an interception requirement between each of the sub-services and the main service includes:
setting access limiting requirements for data which are not accessible inside each sub-service and main service;
when a first sub-service accesses data which is not accessible in the second sub-service, the second sub-service executes access interception and returns early warning information to the first sub-service for unassigned definition.
In the embodiment of the present application, the interception requirement may be a defined requirement set for data inaccessible in the application or service, for example, interception is set up for data in a certain service, when an external service accesses the data, the internal service intercepts, and early warning information is returned to the external service as undefined.
As shown in fig. 2, a functional block diagram of a service compatible device of the front-end system of the present application is shown.
The service compatible device 100 of the front-end system of the present application may be installed in an electronic apparatus. Depending on the functions implemented, the service compatible means of the front-end system may comprise a page view construction module 101, a communication link construction module 102, a running environment isolation module 103, which modules may also be referred to as units, refer to a series of computer program segments capable of being executed by the processor of the electronic device and of performing fixed functions, which are stored in the memory of the electronic device.
In the present embodiment, the functions concerning the respective modules/units are as follows:
the page view construction module 101 is configured to respond to a service requirement, create a main service and a plurality of sub-services of a front-end system, and construct a page view of the main service and each of the sub-services to obtain a main service page and a plurality of sub-service pages;
in the embodiment of the present application, the service requirement may be a functional requirement that a user requires to implement an independent function in a front-end system, for example, in an application program, there is a requirement of network transaction, and a payment framework unit needs to be added in the application program, where the payment framework unit is the service requirement.
In the embodiment of the application, the main service can be an integral functional service framework capable of linking other sub-services, and the sub-services can be functional service frameworks capable of realizing single functions and existing in the main service. For example, in a Web page, the main service may be an overall page frame of the entire Web page, and the sub service may be a small page frame that implements a single function among the overall page frames of the Web. Each of the sub-service and the main service is a functional unit capable of independently realizing a predetermined function.
In the embodiment of the application, the page view may be a Web page drawn by using a page object and a page style or a page of an application program according to a page drawing rule, and the distribution condition of all contents of a document to be displayed on the page and the position of the document on each page view may be displayed in the page view.
In detail, the response business requirement creates a main service and a plurality of sub-services of a front-end system, and constructs a page view of the main service and each sub-service to obtain a main service page and a plurality of sub-service pages;
respectively constructing DOM trees and shadow DOM trees of the main service and each sub service;
setting page rules of the DOM tree of the main service and the DOM tree of the sub service respectively, and constructing a main service page rule document and a sub service page rule document by utilizing the page rules;
converting byte content in the main service page rule document into characters, combining the characters into a plurality of attribute-attribute value pairs according to the main service page rule, converting a plurality of attribute-attribute value pairs in main service into tree nodes, and then linking the tree nodes to a DOM tree of the main service and a shadow DOM tree of the main service;
converting byte content in the sub-service page rule document into characters, combining the characters into a plurality of attribute-attribute value pairs according to the sub-service page rule, converting a plurality of attribute-attribute value pairs in the sub-service into tree nodes, and then linking the tree nodes to the DOM tree of the sub-service and the shadow DOM tree of the sub-service;
and drawing the main service page and the sub service page by using a preset page drawing tool.
Further, the setting the page rules of the DOM tree of the main service and the DOM tree of the sub service respectively, and constructing a main service page rule document and a sub service page rule document by using the page rules, includes:
respectively acquiring page style requirements of each sub-service and the main service;
constructing a page style configuration file according to the page style requirements;
and converting the style content in the page style configuration file into page style attributes, and storing the page style attributes in a page rule document to obtain the main service page rule document and the sub service rule document.
In the embodiment of the application, the DOM tree can be a multi-layer tree relation structure formed by independently writing a plurality of code blocks obtained by a user through completing service and utilizing main code blocks and nested code blocks in the plurality of code blocks. In addition, the above-mentioned relation structure can be characterized by using folder structure in microcomputer, using "my computer" as main body, in which "C disk" and "D disk" are nested, in every disk there are many folders, in the folders are nested, and the process of opening file layer by layer is equivalent to the process of traversing from root node to leaf node, and the main body and nested body form a structural relation tree.
In the embodiment of the application, the shadow DOM tree is not obvious after being linked with the DOM tree, and can finish a multi-layer tree structure of functions contained in the DOM tree, for example, the DOM tree is constructed by utilizing various expressions and various behaviors in the function service, so that the DOM tree structure is complicated and not intuitive and concise when a user performs DOM tree structure inspection, and the user can package various expressions and various behaviors of the function service in the shadow DOM tree in the function embodiment, thereby realizing specific functions and simplifying the DOM tree structure.
Further, the converting the plurality of attribute-attribute value pairs in the main service into a DOM tree of the main service and a shadow DOM tree of the main service after the tree node is linked to the DOM tree of the main service includes:
converting the attribute-attribute value pairs of the main service into CSS tree nodes in a shadow DOM tree of the main service;
configuring CSS style of each tree node in the shadow DOM tree of the main service;
and linking the corresponding CSS tree nodes to the tree nodes of the main service shadow DOM tree according to the corresponding relation between each tree node of the main service shadow DOM tree and the corresponding CSS tree node.
Further, the steps of converting the plurality of attribute-attribute value pairs in the sub-service into the DOM tree of the tree node and then linking to the sub-service and the shadow DOM tree of the sub-service are the same as the steps of converting the plurality of attribute-attribute value pairs in the main service into the DOM tree of the tree node and then linking to the main service and the shadow DOM tree of the main service, which are not described herein.
The communication link construction module 102 is configured to construct a communication link between each of the sub-service pages and the main service page;
in the embodiment of the application, the communication link may be a channel for sharing data between two services, two applications or two systems, and both sides constructing the communication link need to have a common language. For example, a bridge of data sharing and data connection, such as a communication link, can be constructed between an operating system on a microcomputer and a microcomputer application program, and the application program can access resources in the microcomputer system and obtain services of the microcomputer operating system through the data bridge.
In embodiments of the present application, the communication links for each of the sub-services and the main service may be constructed using properties tips based on VUE components.
In detail, the constructing a communication link between each sub-service page and the sub-service page includes:
responding to a transmission request of a sub-service, and creating a demand request in the sub-service;
the main service responds to the demand request and transmits demand data to the sub-service;
when event change occurs in the sub-service, the sub-service triggers a predefined event instruction, transmits event change data to the main service, and waits for a processing instruction;
the main service receives the event change data and sends an event processing instruction to the sub-service according to the event change data;
and completing the construction of the communication link by using the transmission request, the event instruction and the processing instruction.
The operation environment isolation module 103 is configured to isolate the operation environments of the main service page and the plurality of sub service pages in a proxy server mode according to the communication link, so that the plurality of sub service pages and the main service page form a micro service architecture of the front-end system.
In the embodiment of the application, the proxy is in the access form of network information, and can also be a middleware for communication between two services, for example, the proxy can be used for configuring private variables of the two services between the two services, so that each service is customized privately, and the external service can be successfully accessed only through the proxy when the external service wants to access.
The embodiment of the application sets the configuration files of each sub-service and the main service; setting up interception requirements between each sub-service and the main service by using the configuration file; and according to the interception requirement, executing isolation of the running environment.
In the embodiment of the present application, the configuration file may be a parameter file for making a proxy rule in a proxy, for example, when a proxy server is carried by using a proxy server carrying tool zabbix, the configured parameter file may include a server port parameter, a hostname parameter, a database name, and the like.
Further, the building, by using the configuration file, an interception requirement between each of the sub-services and the main service includes:
setting access limiting requirements for data which are not accessible inside each sub-service and main service;
when a first sub-service accesses data which is not accessible in the second sub-service, the second sub-service executes access interception and returns early warning information to the first sub-service for unassigned definition.
In the embodiment of the present application, the interception requirement may be a defined requirement set for data inaccessible in the application or service, for example, interception is set up for data in a certain service, when an external service accesses the data, the internal service intercepts, and early warning information is returned to the external service as undefined.
Fig. 3 is a schematic structural diagram of an electronic device implementing a service compatible method of a front-end system according to the present application.
The electronic device 1 may comprise a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may further comprise a computer program, such as a service compatible program of a front-end system, stored in the memory 11 and executable on the processor 10.
The processor 10 may be formed by an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be formed by a plurality of integrated circuits packaged with the same function or different functions, including one or more central processing units (Central Processing unit, CPU), a microprocessor, a digital processing chip, a graphics processor, a combination of various control chips, and so on. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, executes or executes programs or modules stored in the memory 11 (for example, executes a product recommendation program based on a user portrait, etc.), and invokes data stored in the memory 11 to perform various functions of the electronic device and process data.
The memory 11 includes at least one type of readable storage medium including flash memory, a removable hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, such as a mobile hard disk of the electronic device. The memory 11 may in other embodiments also be an external storage device of the electronic device, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only for storing application software installed in an electronic device and various types of data, such as codes of service compatible programs of a front-end system, but also for temporarily storing data that has been output or is to be output.
The communication bus 12 may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. The bus is arranged to enable a connection communication between the memory 11 and at least one processor 10 etc.
The communication interface 13 is used for communication between the electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), typically used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a Display (Display), an input unit such as a Keyboard (Keyboard), or alternatively a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the electronic device and for displaying a visual user interface.
Fig. 3 shows only an electronic device with components, and it will be understood by those skilled in the art that the structure shown in fig. 3 is not limiting of the electronic device and may include fewer or more components than shown, or may combine certain components, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power source (such as a battery) for supplying power to the respective components, and preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management, and the like are implemented through the power management device. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The electronic device may further include various sensors, bluetooth modules, wi-Fi modules, etc., which are not described herein.
It should be understood that the embodiments described are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
The service compatible program of the front-end system stored in the memory 11 in the electronic device is a combination of instructions, which when executed in the processor 10, may implement:
responding to service demands, creating a main service and a plurality of sub-services of a front-end system, and constructing page views of the main service and each sub-service to obtain a main service page and a plurality of sub-service pages;
constructing a communication link between each sub-service page and the main service page;
and according to the communication link, isolating the running environments of the main service page and the plurality of sub service pages in a proxy mode so that the plurality of sub services and the main service form a micro service architecture of the front-end system.
In particular, the specific implementation method of the processor 10 on the computer program may refer to the description of the relevant steps in the corresponding embodiment of fig. 1, which is not repeated herein.
Further, the modules/units integrated in the electronic device 1 may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as separate products. The computer readable medium may be non-volatile or volatile. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM).
Embodiments of the present application may also provide a computer readable storage medium storing a computer program which, when executed by a processor of an electronic device, may implement:
it should be understood that the embodiments described are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
Further, the computer-usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created from the use of blockchain nodes, and the like.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the application is not limited to the details of the foregoing illustrative embodiments, and that the present application may be embodied in other specific forms without departing from the spirit or essential characteristics thereof.
The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
The embodiment of the application can acquire and process the related data based on the artificial intelligence technology. Among these, artificial intelligence (Artificial Intelligence, AI) is the theory, method, technique and application system that uses a digital computer or a digital computer-controlled machine to simulate, extend and extend human intelligence, sense the environment, acquire knowledge and use knowledge to obtain optimal results.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. A plurality of units or means recited in the system claims can also be implemented by means of software or hardware by means of one unit or means. The terms second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present application and not for limiting the same, and although the present application has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present application without departing from the spirit and scope of the technical solution of the present application.

Claims (8)

1. A service compatible method for a front-end system, the method comprising:
responding to service demands, creating a main service and a plurality of sub-services of a front-end system, and constructing page views of the main service and each sub-service to obtain a main service page and a plurality of sub-service pages;
constructing a communication link between each sub-service page and the main service page;
according to the communication link, isolating the running environments of the main service page and the plurality of sub service pages in a proxy mode so that the plurality of sub services and the main service form a micro service architecture of the front-end system;
wherein said building a page view of said main service and each of said sub-services comprises: respectively constructing DOM trees and shadow DOM trees of the main service and each sub service; setting page rules of the DOM tree of the main service and the DOM tree of the sub service respectively, and constructing a main service page rule document and a sub service page rule document by utilizing the page rules; converting byte content in the main service page rule document into characters, combining the characters into a plurality of attribute-attribute value pairs according to the main service page rule, converting a plurality of attribute-attribute value pairs in main service into tree nodes, and then linking the tree nodes to a DOM tree of the main service and a shadow DOM tree of the main service; converting byte content in the sub-service page rule document into characters, combining the characters into a plurality of attribute-attribute value pairs according to the sub-service page rule, converting a plurality of attribute-attribute value pairs in the sub-service into tree nodes, and then linking the tree nodes to the DOM tree of the sub-service and the shadow DOM tree of the sub-service; drawing the main service page and the sub service page by using a preset page drawing tool;
said constructing a communication link between each of said sub-service pages and said main service page, comprising: responding to a transmission request of a sub-service, and creating a demand request in the sub-service; the main service responds to the demand request and transmits demand data to the sub-service; when event change occurs in the sub-service, the sub-service triggers a predefined event instruction, transmits event change data to the main service, and waits for a processing instruction; the main service receives the event change data and sends an event processing instruction to the sub-service according to the event change data.
2. The service compatible method of the front-end system according to claim 1, wherein the converting the plurality of attribute-attribute value pairs in the main service into the DOM tree of the main service and the shadow DOM tree of the main service after the tree node is linked, comprises:
converting the attribute-attribute value pairs of the main service into CSS tree nodes in a shadow DOM tree of the main service;
configuring CSS style of each tree node in the shadow DOM tree of the main service;
and linking the corresponding CSS tree nodes to the tree nodes of the main service shadow DOM tree according to the corresponding relation between each tree node of the main service shadow DOM tree and the corresponding CSS tree node.
3. The service compatible method of the front-end system according to claim 1, wherein the setting page rules of the DOM tree of the main service and the DOM tree of the sub service, respectively, and constructing a main service page rule document and a sub service page rule document using the page rules, comprises:
respectively acquiring page style requirements of each sub-service and the main service;
constructing a page style configuration file according to the page style requirements;
and converting the style content in the page style configuration file into page style attributes, and storing the page style attributes in a page rule document to obtain the main service page rule document and the sub service rule document.
4. The service compatible method of the front-end system of claim 1, wherein said isolating the running environments of the main service page and the plurality of sub service pages in the form of agents comprises:
setting operation configuration files of each sub-service and the main service;
setting up interception requirements between each sub-service and the main service by using the configuration file;
and according to the interception requirement, executing isolation of the running environment.
5. The service compatible method of the front-end system according to claim 4, wherein said establishing interception requirements between each of said sub-services and main service comprises:
setting access limiting requirements for data which are not accessible inside each sub-service and main service;
when a first sub-service accesses data which is not accessible in the second sub-service, the second sub-service executes access interception and returns early warning information to the first sub-service for unassigned definition.
6. A service compatible apparatus of a front-end system for implementing the service compatible method of the front-end system according to any one of claims 1 to 5, characterized in that the apparatus comprises:
the page view construction module is used for responding to service requirements, creating a main service and a plurality of sub-services of the front-end system, and constructing page views of the main service and each sub-service to obtain a main service page and a plurality of sub-service pages;
the communication link construction module is used for constructing a communication link between each sub-service page and the main service page;
and the running environment isolation module is used for isolating the running environments of the main service page and the plurality of sub service pages in a proxy mode according to the communication link so that the plurality of sub services and the main service form a micro service architecture of the front-end system.
7. An electronic device, the electronic device comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores a computer program executable by the at least one processor, the computer program instructions being executable by the at least one processor to enable the at least one processor to perform the service compatible method of the front end system of any one of claims 1 to 5.
8. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the service compatibility method of a front-end system according to any one of claims 1 to 5.
CN202111086842.XA 2021-09-16 2021-09-16 Service compatibility method and device of front-end system, electronic equipment and storage medium Active CN113778447B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111086842.XA CN113778447B (en) 2021-09-16 2021-09-16 Service compatibility method and device of front-end system, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111086842.XA CN113778447B (en) 2021-09-16 2021-09-16 Service compatibility method and device of front-end system, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113778447A CN113778447A (en) 2021-12-10
CN113778447B true CN113778447B (en) 2023-10-20

Family

ID=78851551

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111086842.XA Active CN113778447B (en) 2021-09-16 2021-09-16 Service compatibility method and device of front-end system, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113778447B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111641706A (en) * 2020-05-28 2020-09-08 深圳壹账通智能科技有限公司 Micro service system creating method and device, electronic equipment and storage medium
CN112487400A (en) * 2020-12-15 2021-03-12 平安银行股份有限公司 Single sign-on method and device based on multiple pages, electronic equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7401325B2 (en) * 2003-11-05 2008-07-15 International Business Machines Corporation Method and apparatus for a configurable Java Server pages processing framework

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111641706A (en) * 2020-05-28 2020-09-08 深圳壹账通智能科技有限公司 Micro service system creating method and device, electronic equipment and storage medium
CN112487400A (en) * 2020-12-15 2021-03-12 平安银行股份有限公司 Single sign-on method and device based on multiple pages, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN113778447A (en) 2021-12-10

Similar Documents

Publication Publication Date Title
CN111813963B (en) Knowledge graph construction method and device, electronic equipment and storage medium
CN103092599A (en) Software develop kit
CN111427971B (en) Business modeling method, device, system and medium for computer system
CN113704665B (en) Dynamic service release method and device, electronic equipment and storage medium
CN110795697B (en) Method and device for acquiring logic expression, storage medium and electronic device
CN111897831A (en) Service message generation method and device, electronic equipment and storage medium
CN107844519A (en) Electronic installation, data base querying scenario generation method and storage medium
CN114881616A (en) Business process execution method and device, electronic equipment and storage medium
CN113868528A (en) Information recommendation method and device, electronic equipment and readable storage medium
CN114844792A (en) Dynamic monitoring method, device, equipment and storage medium based on LUA language
CN113722533B (en) Information pushing method and device, electronic equipment and readable storage medium
CN113032275A (en) Method and device for testing field, electronic equipment and storage medium
CN113778447B (en) Service compatibility method and device of front-end system, electronic equipment and storage medium
CN115002011B (en) Flow bidirectional test method and device, electronic equipment and storage medium
CN116450723A (en) Data extraction method, device, computer equipment and storage medium
CN113687827B (en) Data list generation method, device and equipment based on widget and storage medium
CN113051171B (en) Interface testing method, device, equipment and storage medium
CN115712422A (en) Form page generation method and device, computer equipment and storage medium
CN114064033A (en) Front-end component development method and device, electronic equipment and readable storage medium
CN1932760B (en) System and method for execution of application program
CN114547011A (en) Data extraction method and device, electronic equipment and storage medium
CN117633075A (en) Micro-service application data cooperation method and device, electronic equipment and storage medium
CN113452785B (en) Service access method and device based on offline resources, electronic equipment and medium
CN115033605A (en) Data query method and device, electronic equipment and storage medium
CN115237956A (en) Project display method, device, equipment and storage medium

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