CN113239328B - Service function acquisition method and device, electronic equipment and storage medium - Google Patents

Service function acquisition method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113239328B
CN113239328B CN202110552133.XA CN202110552133A CN113239328B CN 113239328 B CN113239328 B CN 113239328B CN 202110552133 A CN202110552133 A CN 202110552133A CN 113239328 B CN113239328 B CN 113239328B
Authority
CN
China
Prior art keywords
service
module
page
service module
interface
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
CN202110552133.XA
Other languages
Chinese (zh)
Other versions
CN113239328A (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.)
Hanyun Technology Co Ltd
Original Assignee
Hanyun 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 Hanyun Technology Co Ltd filed Critical Hanyun Technology Co Ltd
Priority to CN202110552133.XA priority Critical patent/CN113239328B/en
Publication of CN113239328A publication Critical patent/CN113239328A/en
Application granted granted Critical
Publication of CN113239328B publication Critical patent/CN113239328B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • 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/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons

Abstract

The application provides a service function acquisition method, a device, an electronic device and a storage medium, wherein the method comprises the following steps: exposing a routing object of a service page in a service module to obtain a first service module comprising a first interface for discovering the routing object; exposing a store object of Vuex in the first service module to obtain a second service module containing a second interface for discovering the store object; exposing a service page registered as a component in the second service module to obtain a third service module comprising a third interface for finding the service page; and storing the third business module to a server in the form of a plug-in. According to the method, the protection effect on the front end source code of the platform can be improved on the basis of realizing the service function of the platform.

Description

Service function acquisition method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the technical field of Web (World Wide Web) front-end development, and in particular, to a service function acquisition method, apparatus, electronic device, and storage medium.
Background
In the evolution process of the internet, the main content of web pages in early websites is static, mainly pictures and characters, and the behavior of users using websites is mainly browsing. With the development of internet technology, modern webpages are more attractive, have remarkable interaction effect and have more powerful functions. The development of the front end follows the development of the mobile internet, so that a large number of high-performance mobile terminal equipment applications are brought, and along with the improvement of the user demands, the development difficulty is gradually improved. In order to improve development efficiency, developers often directly use front-end source codes of some platforms to implement service functions, or perform secondary development on the basis of the front-end source codes.
The inventor finds out in the study that in the prior art, when a developer directly uses the front end source code of the platform to realize the service function or performs secondary development on the basis of the source code, all the front end source codes of the platform need to be acquired, so that the platform cannot open the service function to the developer under the condition of protecting the front end source code.
Disclosure of Invention
In view of this, the embodiments of the present application provide a service function obtaining method, apparatus, electronic device, and storage medium, so as to improve the protection effect on the front end source code of the platform on the basis of implementing the service function of the platform.
In a first aspect, an embodiment of the present application provides a service function obtaining method, where the method includes:
exposing a routing object of a service page in a service module to obtain a first service module comprising a first interface for discovering the routing object; when the service page is accessed through the routing object corresponding to the first interface, the first service module provides a front-end interface corresponding to the service page.
And exposing a warehouse store object of the state management mode Vuex in the first service module to obtain a second service module containing a second interface for discovering the store object so as to manage the state in the store object.
And exposing the service page registered as a component in the second service module to obtain a third service module comprising a third interface for discovering the service page.
Storing the third business module to a server in a plug-in form; and the plug-in formed by the third service module can be downloaded.
In a possible embodiment, before the exposing the routing object of the service page in the service module, the method further includes:
and generating a service module corresponding to each front-end source code according to the obtained front-end source code of the at least one platform current version.
And carrying a version number corresponding to the front-end source code for each generated service module so that a user can select the service module according to the version number.
In a possible embodiment, the storing the third service module in a form of a plug-in to the server includes:
and compiling the third business module to generate an interpreted script language js file, and taking the file as the plug-in.
The plug-in is stored into the packet management tool npm private server.
In a possible embodiment, after the storing the third service module in the form of a plug-in to the server, the method further includes:
and downloading the plug-in formed by the third business module from the server to introduce the plug-in into a front-end development project as a business plug-in.
And introducing the business page registered as a component into the front-end development project through the third interface.
Registering the introduced service page to determine the registered service page as a target service page; the target service page is displayed in a hypertext markup language (HTML) as a service tag.
And introducing the routing object into the front-end development project through the first interface so as to access the service label through the routing object.
In one possible embodiment, after the plug-in is introduced into the front-end development project as a service plug-in, the method further includes:
and when the front-end development project performs state sharing, introducing the store object into the front-end development project through the second interface.
In a second aspect, an embodiment of the present application further provides a service function obtaining apparatus, including:
the first exposure unit is used for exposing the routing object of the service page in the service module to obtain a first service module comprising a first interface for finding the routing object; when the service page is accessed through the routing object corresponding to the first interface, the first service module provides a front-end interface corresponding to the service page.
And the second exposing unit is used for exposing the warehouse store object of the state management mode Vuex in the first service module to obtain a second service module containing a second interface for finding the store object so as to manage the state in the store object.
And the third exposing unit is used for exposing the service page registered as the component in the second service module to obtain a third service module containing a third interface for finding the service page.
The storage unit is used for storing the third business module to a server in a plug-in mode; and the plug-in formed by the third service module can be downloaded.
In a possible embodiment, before the exposing the routing object of the service page in the service module, the method further includes:
and the generating unit is used for generating a service module corresponding to each front-end source code according to the obtained front-end source code of the at least one platform current version.
And the marking unit is used for carrying a version number corresponding to the front-end source code for each generated service module so that a user can select the service module according to the version number.
In a possible embodiment, the storing the third service module in a form of a plug-in to the server includes:
and the packaging unit is used for compiling the third business module to generate an interpreted script language js file, and taking the file as the plug-in.
And a storage unit, configured to store the plug-in to a private server of the packet management tool npm.
In a possible embodiment, after the storing the third service module in the form of a plug-in to the server, the method further includes:
and the acquisition unit is used for downloading the plug-in formed by the third business module from the server so as to introduce the plug-in into a front-end development project as a business plug-in.
The first introducing unit is used for introducing the business page registered as the component in the front-end development project through the third interface.
The registration unit is used for registering the introduced service page so as to determine the registered service page as a target service page; the target service page is displayed in a hypertext markup language (HTML) as a service tag.
And the second introducing unit is used for introducing the routing object into the front-end development project through the first interface so as to access the service label through the routing object.
In one possible embodiment, after the plug-in is introduced into the front-end development project as a service plug-in, the method further includes:
and the third introducing unit is used for introducing the store object into the front-end development project through the second interface when the front-end development project performs state sharing.
In a third aspect, an embodiment of the present application further provides an electronic device, including: a processor, a storage medium storing machine-readable instructions executable by the processor, the processor and the storage medium communicating over a bus when the electronic device is running, the processor executing the machine-readable instructions to perform steps as in any one of the possible implementations of the first aspect.
In a fourth aspect, the present application embodiment also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs steps as in any one of the possible embodiments of the first aspect.
According to the service function obtaining method, the device, the electronic equipment and the storage medium, a first service module comprising a first interface for finding out a service page in the service module is obtained by exposing the service page routing object; when the service page is accessed through the routing object corresponding to the first interface, the first service module provides a front-end interface corresponding to the service page; exposing a warehouse store object of a state management mode Vuex in the first service module to obtain a second service module containing a second interface for discovering the store object; exposing a service page registered as a component in the second service module to obtain a third service module comprising a third interface for finding the service page; and storing the third business module to a server in the form of a plug-in, so that the plug-in formed by the third business module can be used by a user through the server. The user does not directly obtain the front end source code of the platform, but introduces the third service module in the form of a plug-in, and the service function in the third service module is realized through the introduced plug-in, so that the user can realize the service function under the condition of not obtaining the front end source code. Therefore, by the method, the protection effect on the front end source code of the platform can be improved on the basis of realizing the service function of the platform.
In order to make the above objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered limiting the scope, and that other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 shows a flowchart of a service function obtaining method provided in an embodiment of the present application.
Fig. 2 shows a flowchart of another service function obtaining method provided in an embodiment of the present application.
Fig. 3 is a schematic structural diagram of a service function obtaining device according to an embodiment of the present application.
Fig. 4 shows a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purpose 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 accompanying drawings in the embodiments of the present application, and it should be understood that the accompanying drawings in the present application are only for the purpose of illustration and description, and are not intended to limit the protection scope of the present application. In addition, it should be understood that the schematic drawings are not drawn to scale. A flowchart, as used in this application, illustrates operations implemented according to some embodiments of the present application. It should be understood that the operations of the flow diagrams may be implemented out of order and that steps without logical context may be performed in reverse order or concurrently. Moreover, one or more other operations may be added to the flow diagrams and one or more operations may be removed from the flow diagrams as directed by those skilled in the art.
In addition, the described embodiments are only some, but not all, of the embodiments of the present application. The components of the embodiments of the present application, which are generally described and illustrated in the figures herein, may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, as provided in the accompanying drawings, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, are intended to be within the scope of the present application.
It should be noted in advance that the term "comprising" will be used in this application to indicate the presence of the features stated hereinafter, but not to preclude the addition of further features.
It should be noted in advance that, the apparatus, the electronic device, or the like according to the embodiments of the present application may be executed on a single server, or may be executed on a server group. The server group may be centralized or distributed. In some embodiments, the server may be local or remote to the terminal. For example, the server may access information and/or data stored in a service requester terminal, a service provider terminal, or a database, or any combination thereof, via a network. As another example, the server may be directly connected to at least one of the service requester terminal, the service provider terminal, and the database to access the stored information and/or data. In some embodiments, the server may be implemented on a cloud platform; by way of example only, the cloud platform may include a private cloud, public cloud, hybrid cloud, community cloud, distributed cloud, inter-cloud, multi-cloud, or the like, or any combination thereof.
In addition, the apparatus or the electronic device according to the embodiments of the present application may be executed on an access device or a third party device, and may specifically include: a mobile device, a tablet computer, a laptop computer, or a built-in device in a motor vehicle, etc., or any combination thereof. In some embodiments, the mobile device may include a smart home device, a wearable device, a smart mobile device, a virtual reality device, or an augmented reality device, or the like, or any combination thereof. In some embodiments, the smart home device may include a control device for a smart appliance device, a smart monitoring device, a smart television, a smart camera, or an intercom, or the like, or any combination thereof. In some embodiments, the wearable device may include a smart bracelet, a smart helmet, a smart watch, a smart accessory, etc., or any combination thereof. In some embodiments, the smart mobile device may include a smart phone, a PDA (Personal Digital Assistant ), a gaming device, a navigation device, etc., or any combination thereof. In some embodiments, the virtual reality device and/or the augmented reality device may include a virtual reality helmet, an augmented reality helmet, or the like, or any combination thereof. For example, the virtual reality device and/or the augmented reality device may include various virtual reality products, and the like.
Example 1
Fig. 1 is a flowchart of a service function obtaining method according to an embodiment of the present application, as shown in fig. 1, where the method may be implemented by the following steps:
step 101, exposing a routing object of a service page in a service module to obtain a first service module comprising a first interface for discovering the routing object; when the service page is accessed through the routing object corresponding to the first interface, the first service module provides a front-end interface corresponding to the service page.
Specifically, the service module is generated according to the front end source code of the platform, and the service module comprises a service page capable of realizing service functions, a routing object capable of accessing the service page and a store (warehouse) object comprising state objects. The exposure is intended to export an object for the user to import elsewhere. When front-end development is carried out, a total project is newly established, and the routing object is introduced into the total project through the exposed routing object so as to access a service page corresponding to the routing object through the routing object. In the total engineering, the higher the coupling between the objects is, the higher the maintenance cost is, the interaction between the total engineering and the service page is realized by exposing the routing objects capable of accessing the service page, when a user performs front-end development, the service page is accessed through the introduced routing objects in the total engineering file, the service function is realized, the codes in the third service module are not required to be edited in the total engineering, the codes in the third service module are independent from the codes in the total engineering, the service module and the total engineering can be decoupled to the greatest extent, the code quantity related to the service module in the total engineering is relatively reduced, and the maintenance cost of the front-end development project is reduced.
And 102, exposing a store object of Vuex (state management mode) in the first service module to obtain a second service module containing a second interface for discovering the store object so as to manage states in the store object.
Specifically, vuex is a state management mode specifically designed for vue.js (progressive framework for building user interfaces), which uses a centralized storage to manage the states of all the components of the application, and ensures that the states change in a predictable manner with corresponding rules, and each Vuex application has a core that is a store, which is basically a container that contains most of the states in the application.
The state sharing includes: if both page 1 and page 2 need to manipulate state a, then after state a is modified in page 1, page 2 needs to know the information of state a modified by page 1 at the first time, and similarly, after state a is modified by page 2, page 1 needs to know immediately. To achieve state sharing, it is necessary to expose the store object in the Vuex so that the user can discover the exposed store object through the second interface, thereby managing and using the states in the store object by introducing the store object.
And step 103, exposing the service page registered as a component in the second service module to obtain a third service module comprising a third interface for discovering the service page.
Specifically, after the user introduces the service page, the service page needs to be registered as a component and then used, so that the system can find the position of the component. When the service module is developed, the service page is registered into a component, and a registration interface is actually provided for the service page, so that the service page can be registered through the registration interface, therefore, the service page registered into the component is exposed, the exposed registration interface is actually used as a third interface for exposing the registration interface, and a user can find the exposed registration interface through the third interface when using the third service module, and the service page is registered through the registration interface.
Step 104, storing the third business module to a server in a plug-in mode; and the plug-in formed by the third service module can be downloaded.
Specifically, before step 104, the exposure sequence of the routing object, the store object of Vuex, and the service page registered as a component may be set according to the actual situation. For example, the exposure sequence may be set as: step 101, exposing a service page registered as a component; 102, exposing the routing object; step 103, exposing the store object of the Vuex; or, step 101, exposing a store object of the Vuex; 102, exposing the routing object; and 103, exposing the service page registered as the component.
According to the service function obtaining method, the device, the electronic equipment and the storage medium, a first service module comprising a first interface for finding out a service page in the service module is obtained by exposing the service page routing object; when the service page is accessed through the routing object corresponding to the first interface, the first service module provides a front-end interface corresponding to the service page; exposing a warehouse store object of a state management mode Vuex in the first service module to obtain a second service module containing a second interface for discovering the store object; exposing a service page registered as a component in the second service module to obtain a third service module comprising a third interface for finding the service page; and storing the third business module to a server in the form of a plug-in. The user does not directly obtain the front end source code of the platform, but introduces the third service module in the form of a plug-in, and the service function in the third service module is realized through the introduced plug-in, so that the user can realize the service function under the condition of not obtaining the front end source code. Therefore, by the method, the protection effect on the front end source code of the platform can be improved on the basis of realizing the service function of the platform.
In one possible embodiment, before performing step 101, the method further comprises the steps of:
generating a service module corresponding to each front-end source code according to the obtained front-end source code of the at least one platform current version; and carrying a version number corresponding to the front-end source code for each generated service module so that a user can select the service module according to the version number.
Specifically, an engineering template is selected and initialized through a scaffold, and a service module corresponding to each front-end source code is generated on the engineering template according to the front-end source codes. Scaffolds were created by publishers and packaged for publication in npm (Node Package Manager, node. Js packaging management tool) private servers. The essence of the scaffold is that a project infrastructure is created, project specifications and conventions are provided, so that developers do not need to configure themselves, and follow-up development work is performed based on the specifications and conventions in the scaffold. npm is a package management tool for node js, which is used to install various extensions of node js, so that js (JavaScript, interpreted programming language) developers can download third-party packages written by other persons from the npm server to local use, and easily use codes shared by other developers. The scaffold comprises a template management function and a template downloading function. The template management function is used for managing engineering templates downloaded from a Git (distributed version control system) warehouse so as to realize functions of template list display, engineering initialization and the like. The template downloading function is used for providing modes such as online downloading, offline downloading and the like, and can selectively download the business modules and the plug-ins. The Git warehouse is a platform for sharing open source projects, and provides a place for storing, sharing, publishing and collaborating with the centralized cloud storage of development projects for developers.
The engineering templates include tool engineering templates, business engineering templates, and general workers Cheng Moban. The general engineering template comprises the functions of basic directory structure, packaging, publishing, compiling and the like, a user can select a corresponding general worker Cheng Moban according to own requirements, and rapid development is realized on the general engineering template according to an engineering framework built in advance in the general engineering template. Each type of engineering template has its own independent code repository to independently manage tool engineering templates, business engineering templates, and general worker Cheng Moban. For example, upgrades, modifications, and version control to the master Cheng Moban may be implemented through a code repository that is independent of the master Cheng Moban, and a user may select an engineering template based on the version when in use.
And when the business function development is carried out, downloading at least one business engineering template from the Git warehouse through a scaffold so as to display the business engineering module in a template list. And selecting one of the business engineering templates in the template list and initializing engineering. And generating a service module on the service engineering template according to the front end source code of the current version of the platform. Wherein, according to the front-end source code, at least two business modules can be generated. At least one service function of the front end source code can be realized through a service page in the service module. For example, the business function may be user login, page display, and the like.
And carrying a version number for the service module according to the current version of the front-end source code of the platform, and displaying the version number. For example, if the current front end source code version of the platform a is 1.2, the version number carried by the corresponding service module is marked as 1.2, where the corresponding platform information is also marked for the service module. The marking mode of the version number can be set at will, and the method is not limited in the application. Wherein the business functions can be continuously developed on the basis of the front-end source code. By carrying the version number to the service module, when the front end source code changes due to the change of the platform version, the user can directly select the corresponding service module according to the version number of the front end source code, and only update a certain service module.
In one possible embodiment, in performing step 104, this may be accomplished by:
compiling the third business module to generate js file, and taking the file as the plug-in; the plug-in is stored in npm private server.
Specifically, js is an interpreted script language, which has been widely used in Web application development, and is often used to add various dynamic functions to a Web page, so as to provide a smoother and more attractive browsing effect for users. After compiling the third service module, finding a target directory according to a preset compiling output path, and generating js files in the target directory. And storing the generated js file as a plug-in to a npm private server.
In a possible implementation manner, fig. 2 is a flowchart of another service function obtaining method provided in the embodiment of the present application, after performing step 104, as shown in fig. 2, further includes the following steps:
and step 201, downloading the plug-in formed by the third business module from the server to introduce the plug-in into a front-end development project as a business plug-in.
Specifically, after step 104 is performed, the js file generated by the third service module is stored in the npm private server, and the js file is downloaded from the npm private server. When front-end development is carried out, for rapid development, the service functions in the js file can be realized by introducing the js file corresponding to the third service module, and other service functions can be expanded on the basis of the js file. The step of introducing the plug-in is that the user obtains the scaffold from the npm private server and installs the scaffold. And running the scaffold, and selecting one of the downloaded total engineering templates from the template list of the scaffold. And (3) newly establishing a project file in a general worker Cheng Moban, determining a target plug-in according to the requirements on service functions and version numbers of js files corresponding to the third service modules, and introducing the target plug-in into the project file.
Step 202, introducing the service page registered as a component into the front-end development project through the third interface.
Specifically, after the step 201 is executed, after the target plug-in is introduced into the project file, the service page registered as the component can be found through the third interface exposed in the target plug-in, that is, the registration interface of the service page after exposure corresponding to the third interface can be found, and the registration interface is introduced.
Step 203, registering the introduced service page to determine the registered service page as a target service page; wherein the target service page is presented as a service tag in HTML (Hyper Text Markup Language ).
Specifically, after step 202 is performed, a registration interface of the service page is already introduced into the project file, and the service page corresponding to the registration interface is used as the target service page. Registering the target service page through the registration interface, and displaying the registered target service page as a service tag in the HTML so as to use the service tag in a tag mode.
Step 204, introducing the routing object into the front-end development project through the first interface, so as to access the service label through the routing object.
Specifically, after step 201 is performed, a target plugin is already introduced into the project file, and through a first interface in the target plugin, a routing object exposed in the target plugin can be found, and the routing object is introduced into the project file. By introducing a routing object, a service tag corresponding to the routing object can be accessed.
In one possible embodiment, after performing step 201, the following steps are further included: and when the front-end development project performs state sharing, introducing the store object into the front-end development project through the second interface.
If state sharing is to be realized, a store object containing a state needs to be introduced into a project file, and the specific steps are as follows: after the target plug-in is introduced into the project file, the exposed store object can be discovered through the second interface exposed by the target plug-in, and the store object is introduced into the project file.
Example two
Fig. 3 is a schematic structural diagram of a service function obtaining device according to a second embodiment of the present application, where, as shown in fig. 3, the device includes: a first exposure unit 301, a second exposure unit 302, a third exposure unit 303, and a storage unit 304.
A first exposing unit 301, configured to expose a routing object of a service page in a service module, to obtain a first service module including a first interface for discovering the routing object; when the service page is accessed through the routing object corresponding to the first interface, the first service module provides a front-end interface corresponding to the service page.
And the second exposing unit 302 is configured to expose a repository store object of the state management mode Vuex in the first service module, so as to obtain a second service module including a second interface for discovering the store object, so as to manage a state in the store object.
And a third exposing unit 303, configured to expose a service page registered as a component in the second service module, to obtain a third service module including a third interface for discovering the service page.
A storage unit 304, configured to store the third service module in a plug-in form to a server; and the plug-in formed by the third service module can be downloaded.
In a possible embodiment, before the exposing the routing object of the service page in the service module, the method further includes:
and the generating unit is used for generating a service module corresponding to each front-end source code according to the obtained front-end source code of the at least one platform current version.
And the marking unit is used for carrying a version number corresponding to the front-end source code for each generated service module so that a user can select the service module according to the version number.
In a possible embodiment, the storing the third service module in a form of a plug-in to the server includes:
and the packaging unit is used for compiling the third business module to generate an interpreted script language js file, and taking the file as the plug-in.
And a storage unit, configured to store the plug-in to a private server of the packet management tool npm.
In a possible embodiment, after the storing the third service module in the form of a plug-in to the server, the method further includes:
and the acquisition unit is used for downloading the plug-in formed by the third business module from the server so as to introduce the plug-in into a front-end development project as a business plug-in.
The first introducing unit is used for introducing the business page registered as the component in the front-end development project through the third interface.
The registration unit is used for registering the introduced service page so as to determine the registered service page as a target service page; the target service page is displayed in a hypertext markup language (HTML) as a service tag.
And the second introducing unit is used for introducing the routing object into the front-end development project through the first interface so as to access the service label through the routing object.
In one possible embodiment, after the plug-in is introduced into the front-end development project as a service plug-in, the method further includes:
and the third introducing unit is used for introducing the store object into the front-end development project through the second interface when the front-end development project performs state sharing.
According to the service function obtaining method, the device, the electronic equipment and the storage medium, a first service module comprising a first interface for finding out a service page in the service module is obtained by exposing the service page routing object; when the service page is accessed through the routing object corresponding to the first interface, the first service module provides a front-end interface corresponding to the service page; exposing a warehouse store object of a state management mode Vuex in the first service module to obtain a second service module containing a second interface for discovering the store object; exposing a service page registered as a component in the second service module to obtain a third service module comprising a third interface for finding the service page; and storing the third business module to a server in the form of a plug-in. The user does not directly obtain the front end source code of the platform, but introduces the third service module in the form of a plug-in, and the service function in the third service module is realized through the introduced plug-in, so that the user can realize the service function under the condition of not obtaining the front end source code. Therefore, by the method, the protection effect on the front end source code of the platform can be improved on the basis of realizing the service function of the platform.
Example III
Fig. 4 is a schematic structural diagram of an electronic device according to a third embodiment of the present application, including: a processor 401, a storage medium 402 and a bus 403, wherein the storage medium 402 stores machine readable instructions executable by the processor 401, when the electronic device runs a service function acquiring method as in the first embodiment, the processor 401 communicates with the storage medium 402 through the bus 403, and the processor 401 executes the machine readable instructions to perform steps as in the first embodiment.
In the embodiment of the present application, the storage medium 402 may further execute other machine readable instructions to perform the method as described in the other embodiments, and the specific implementation of the steps and principles of the method are referred to in the description of the embodiment, and are not described in detail herein.
Example IV
The fourth embodiment of the present application also provides a computer readable storage medium having a computer program stored thereon, the computer program being executed by a processor when executed to perform the steps as in the first embodiment.
In the embodiment of the present application, the computer program may further execute other machine readable instructions when executed by the processor to perform the method as described in the other embodiments, and the specific implementation of the steps and principles of the method are referred to in the description of the embodiment, and are not described in detail herein.
In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, and the division of the modules is merely a logical function division, and there may be additional divisions when actually implemented, and for example, multiple modules or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, indirect coupling or communication connection of devices or modules, electrical, mechanical, or other form.
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 units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment 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 functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer readable storage medium executable by a processor. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk, etc.
The foregoing is merely a specific embodiment of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes or substitutions are covered in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. The service function acquisition method is characterized by comprising the following steps:
exposing a routing object of a service page in a service module to obtain a first service module comprising a first interface for discovering the routing object; when the service page is accessed through the routing object corresponding to the first interface, the first service module provides a front-end interface corresponding to the service page;
exposing a warehouse store object of a state management mode Vuex in the first service module to obtain a second service module containing a second interface for discovering the store object so as to manage state states in the store object;
exposing a service page registered as a component in the second service module to obtain a third service module comprising a third interface for finding the service page;
storing the third business module to a server in a plug-in form; and the plug-in formed by the third service module can be downloaded.
2. The method of claim 1, further comprising, prior to said exposing the routing object of the traffic page in the traffic module:
generating a service module corresponding to each front-end source code according to the obtained front-end source code of the at least one platform current version;
and carrying a version number corresponding to the front-end source code for each generated service module so that a user can select the service module according to the version number.
3. The method of claim 1, wherein storing the third business module in plug-in form to a server comprises:
compiling the third service module to generate an interpreted script language js file, and taking the file as the plug-in;
the plug-in is stored into the packet management tool npm private server.
4. The method of claim 1, further comprising, after storing the third business module in the form of a plug-in to a server:
downloading a plug-in formed by the third business module from the server to introduce the plug-in into a front-end development project as a business plug-in;
introducing the business page registered as a component into the front-end development project through the third interface;
registering the introduced service page to determine the registered service page as a target service page; the target service page is displayed in a hypertext markup language (HTML) as a service tag;
and introducing the routing object into the front-end development project through the first interface so as to access the service label through the routing object.
5. The method of claim 4, wherein after introducing the plug-in as a business plug-in into a front-end development project, further comprising:
and when the front-end development project performs state sharing, introducing the store object into the front-end development project through the second interface.
6. A service function acquiring apparatus, comprising:
the first exposure unit is used for exposing the routing object of the service page in the service module to obtain a first service module comprising a first interface for finding the routing object; when the service page is accessed through the routing object corresponding to the first interface, the first service module provides a front-end interface corresponding to the service page;
the second exposing unit is used for exposing the warehouse store object of the state management mode Vuex in the first service module to obtain a second service module comprising a second interface for finding the store object so as to manage the state in the store object;
a third exposing unit, configured to expose a service page registered as a component in the second service module, to obtain a third service module including a third interface for discovering the service page;
the storage unit is used for storing the third business module to a server in a plug-in mode; and the plug-in formed by the third service module can be downloaded.
7. The apparatus of claim 6, further comprising, prior to said exposing the routing object of the traffic page in the traffic module:
the generating unit is used for generating a service module corresponding to each front-end source code according to the obtained front-end source code of the current version of the at least one platform;
and the marking unit is used for carrying a version number corresponding to the front-end source code for each generated service module so that a user can select the service module according to the version number.
8. The apparatus as recited in claim 6, further comprising:
the obtaining unit is used for downloading the plugin formed by the third business module from the server after the storage unit stores the third business module to the server in the form of plugin so as to introduce the plugin into a front-end development project as a business plugin;
the first introducing unit is used for introducing the business page registered as a component in the front-end development project through the third interface;
the registration unit is used for registering the introduced service page so as to determine the registered service page as a target service page; the target service page is displayed in a hypertext markup language (HTML) as a service tag;
and the second introducing unit is used for introducing the routing object into the front-end development project through the first interface so as to access the service label through the routing object.
9. An electronic device, comprising: a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, the processor and the storage medium communicating over the bus when the electronic device is running, the processor executing the machine-readable instructions to perform the steps of a business function acquisition method according to any one of claims 1 to 5.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when executed by a processor, performs the steps of a service function acquisition method according to any one of claims 1 to 5.
CN202110552133.XA 2021-05-20 2021-05-20 Service function acquisition method and device, electronic equipment and storage medium Active CN113239328B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110552133.XA CN113239328B (en) 2021-05-20 2021-05-20 Service function acquisition method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110552133.XA CN113239328B (en) 2021-05-20 2021-05-20 Service function acquisition method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113239328A CN113239328A (en) 2021-08-10
CN113239328B true CN113239328B (en) 2023-06-06

Family

ID=77137915

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110552133.XA Active CN113239328B (en) 2021-05-20 2021-05-20 Service function acquisition method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113239328B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015013936A1 (en) * 2013-07-31 2015-02-05 华为技术有限公司 Associated plugin management method, device and system
CN108614960A (en) * 2018-05-11 2018-10-02 西北大学 A kind of JavaScript virtualization guard methods based on front end bytecode technology

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015013936A1 (en) * 2013-07-31 2015-02-05 华为技术有限公司 Associated plugin management method, device and system
CN108614960A (en) * 2018-05-11 2018-10-02 西北大学 A kind of JavaScript virtualization guard methods based on front end bytecode technology

Also Published As

Publication number Publication date
CN113239328A (en) 2021-08-10

Similar Documents

Publication Publication Date Title
CN108279932B (en) Method and device for dynamically configuring user interface of mobile terminal
CN110968325B (en) Applet conversion method and device
CN110442330B (en) List component conversion method and device, electronic equipment and storage medium
CN104049991A (en) Method and system for converting network applications into mobile applications
CN113010827B (en) Page rendering method and device, electronic equipment and storage medium
CN111338623B (en) Method, device, medium and electronic equipment for developing user interface
CN103092599A (en) Software develop kit
CN110140108B (en) Handling sibling calls
CN110020329A (en) For generating the methods, devices and systems of webpage
CN112416458A (en) Preloading method and device based on ReactNative, computer equipment and storage medium
CN110598135A (en) Network request processing method and device, computer readable medium and electronic equipment
CN113076294A (en) Information sharing method and device
CN113536185A (en) Application page loading method, storage medium and related equipment thereof
CN112631590A (en) Component library generation method and device, electronic equipment and computer readable medium
CN114612279A (en) Watermark adding method and device
CN111290996A (en) Document format conversion method, device, equipment and readable storage medium
CN113239328B (en) Service function acquisition method and device, electronic equipment and storage medium
CN110647327A (en) Method and device for dynamic control of user interface based on card
CN112181408A (en) Method and device for displaying view list on front page of application program
CN111581578B (en) Interface request processing method and device
CN116521285A (en) Application trial method and device, electronic equipment and storage medium
CN111488286B (en) Method and device for independently developing Android modules
CN113656041A (en) Data processing method, device, equipment and storage medium
CN112394972B (en) Cloud application publishing method, device, equipment and storage medium
CN114115855A (en) Code multiplexing method and device, computer readable storage medium and electronic equipment

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