CN113448650A - Live broadcast function plug-in loading method, device, equipment and storage medium - Google Patents

Live broadcast function plug-in loading method, device, equipment and storage medium Download PDF

Info

Publication number
CN113448650A
CN113448650A CN202110768648.3A CN202110768648A CN113448650A CN 113448650 A CN113448650 A CN 113448650A CN 202110768648 A CN202110768648 A CN 202110768648A CN 113448650 A CN113448650 A CN 113448650A
Authority
CN
China
Prior art keywords
plug
directory
live
directory path
end scaffold
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110768648.3A
Other languages
Chinese (zh)
Inventor
许宏斌
石宝源
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Cubesili Information Technology Co Ltd
Original Assignee
Guangzhou Cubesili Information 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 Guangzhou Cubesili Information Technology Co Ltd filed Critical Guangzhou Cubesili Information Technology Co Ltd
Priority to CN202110768648.3A priority Critical patent/CN113448650A/en
Publication of CN113448650A publication Critical patent/CN113448650A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services

Abstract

The application relates to a live broadcast function plug-in loading method, a live broadcast function plug-in loading device, live broadcast function plug-in loading equipment and a storage medium. The live broadcast function plug-in loading method comprises the following steps: determining the running environment of a front-end scaffold program; if the running environment of the front-end scaffold program is in global running, a first dependent directory path corresponding to global running is obtained, and if the running environment of the front-end scaffold program is in local running, a second dependent directory path corresponding to local running is obtained; determining a plug-in directory where a corresponding live function plug-in is located according to the first dependency directory path or the second dependency directory path; and enabling the front-end scaffold program to execute the corresponding plug-in entry file in the plug-in directory and load the corresponding live-broadcast functional plug-in. The live broadcast function plug-in loading method can run along with the dynamic plug-in loading of the program in different running environments, and the loading performance, maintainability and expandability of the front-end scaffold program are improved.

Description

Live broadcast function plug-in loading method, device, equipment and storage medium
Technical Field
The present application relates to the field of live broadcast technologies, and in particular, to a live broadcast function plug-in loading method, apparatus, device, and storage medium.
Background
Currently, in a development project in the field of live webcasting technology, a front-end scaffold program is used to improve development efficiency, and the front-end scaffold program is a development tool and has the functions of compiling codes, generating initial projects, providing common development functions, and the like.
However, the inventor finds in practice that with the expansion of the live broadcast service, the change or increase of the demand of the live broadcast function requires continuous modification and addition of new content to the front-end scaffold, so that the front-end scaffold is more and more bloated in program, and is not beneficial to loading, maintenance, expansion and the like.
Disclosure of Invention
Based on this, an object of the present application is to provide a live function plug-in loading method, apparatus, device and storage medium, which have the advantages of being capable of dynamically loading plug-ins in different operating environments along with a program to operate, and improving the loading performance, maintainability and expandability of a front-end scaffold program.
According to a first aspect of an embodiment of the present application, a live function plug-in loading method is provided, where the live function plug-in loading method includes:
determining a running environment of a front-end scaffold program, wherein the running environment comprises global running and local running;
if the running environment of the front-end scaffold program is in global running, a first dependent directory path corresponding to global running is obtained, and if the running environment of the front-end scaffold program is in local running, a second dependent directory path corresponding to local running is obtained;
determining a plug-in directory where a corresponding live function plug-in is located according to the first dependency directory path or the second dependency directory path;
and enabling the front-end scaffold program to execute the corresponding plug-in entry file in the plug-in directory and load the corresponding live-broadcast functional plug-in.
According to a second aspect of the embodiments of the present application, there is provided a live function plug-in loading device, including:
the system comprises a first determination module, a second determination module and a third determination module, wherein the first determination module is used for determining the running environment of a front-end scaffold program, and the running environment comprises global running and local running;
the acquisition module is used for acquiring a first dependent directory path corresponding to global operation if the operation environment of the front-end scaffold program is global operation, and acquiring a second dependent directory path corresponding to local operation if the operation environment of the front-end scaffold program is local operation;
the second determining module is used for determining a plug-in directory where the corresponding live function plug-in is located according to the first dependency directory path or the second dependency directory path;
and the loading module is used for enabling the front-end scaffold program to execute the corresponding plug-in entry file under the plug-in directory and loading the live-broadcast functional plug-in.
According to a third aspect of embodiments of the present application, there is provided an electronic apparatus, including: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to execute any one of the live function plug-in loading methods.
According to a fourth aspect of embodiments of the present application, there is provided a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements any one of the live function plug-in loading methods.
In the application, the running environment of the front-end scaffold program can be determined, wherein the running environment comprises global running and local running; if the running environment of the front-end scaffold program is in global running, a first dependent directory path corresponding to global running is obtained, and if the running environment of the front-end scaffold program is in local running, a second dependent directory path corresponding to local running is obtained; determining a plug-in directory where a corresponding live function plug-in is located according to the first dependency directory path or the second dependency directory path; and enabling the front-end scaffold program to execute the corresponding plug-in entry file in the plug-in directory and load the corresponding live-broadcast functional plug-in. The method can dynamically load plug-ins to operate in different operating environments along with the program, meanwhile, different live broadcast function plug-ins are dynamically loaded by expanding the specific service scene, other functions do not need to be added or modified in the front-end scaffold program, the problem that the front-end scaffold program is more and more bloated due to service requirements is solved, the size of the front-end scaffold program is reduced, the front-end scaffold is convenient to load, maintain and expand, and the loading performance, maintainability and expandability of the front-end scaffold program are improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
For a better understanding and practice, the present application is described in detail below with reference to the accompanying drawings.
Drawings
Fig. 1 is a schematic view of an application scenario of a live function plug-in loading method according to an embodiment of the present application;
fig. 2 is a flowchart of a live function plug-in loading method according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a live function plug-in loading device according to an embodiment of the present application;
fig. 4 is a block diagram illustrating a structure of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
It should be understood that the embodiments described are only a few embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the application, as detailed in the appended claims.
In the description of the present application, it is to be understood that the terms "first," "second," "third," and the like are used solely to distinguish one from another and are not necessarily used to describe a particular order or sequence, nor are they to be construed as indicating or implying relative importance. The specific meaning of the above terms in the present application can be understood by those of ordinary skill in the art as appropriate. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. The word "if/if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination". Further, in the description of the present application, "a plurality" means two or more unless otherwise specified. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
Referring to fig. 1, fig. 1 is a schematic view of an application scenario of a live function plug-in loading method according to an embodiment of the present application, where the application scenario includes a live client 10 and a server 20. The live client 10 interacts with a server 20.
The hardware to which the live client 10 is directed is essentially a computer device, and in particular, it may be a computer device of the type of a smartphone, smart interactive tablet, personal computer, or the like. The live client 10 may access the internet via a known network access to establish a data communication link with the server 20.
The server 20 is a business server, and may be responsible for further connecting with related audio data servers, video streaming servers, and other servers providing related support, etc., so as to form a logically associated server cluster for providing services for related terminal devices, such as the live client 10 shown in fig. 1.
The live function plug-in loading method may be executed in the live client 10 and/or the server 20. The live client 10 and/or the server 20 determines an operating environment of a front-end scaffold program, wherein the operating environment includes global operation and local operation; if the running environment of the front-end scaffold program is in global running, a first dependent directory path corresponding to global running is obtained, and if the running environment of the front-end scaffold program is in local running, a second dependent directory path corresponding to local running is obtained; determining a plug-in directory where a corresponding live function plug-in is located according to the first dependency directory path or the second dependency directory path; and enabling the front-end scaffold program to execute the corresponding plug-in entry file in the plug-in directory and load the corresponding live-broadcast functional plug-in.
The first embodiment is as follows:
the embodiment of the application discloses a live broadcast functional plug-in loading method.
A live function plug-in loading method provided in an embodiment of the present application will be described in detail below with reference to fig. 2.
Referring to fig. 2, an embodiment of the present application provides a live function plug-in loading method, including the following steps:
s101: determining a runtime environment of a front-end scaffold program, wherein the runtime environment comprises a global run and a local run.
The front-end scaffold program is a tool developed in advance by a developer, has the functions of compiling codes, generating initial projects, providing common development functions and the like, and can call various functions of the front-end scaffold program through a preset command line.
The running environment of the front-end scaffold program means that the front-end scaffold program runs globally or locally. Globally, the front-end scaffold can be used by any local application module; during local operation, the front-end scaffold program can only be used by application modules in a local scope.
In one embodiment, the determining the running environment of the front-end scaffold program comprises the following steps:
acquiring a front-end scaffold directory path, wherein the front-end scaffold directory path is a directory path of a file directory where an entry file of a front-end scaffold program is located;
if the front-end scaffold directory path comprises a preset directory path of a global package management tool, determining that the operation environment is global operation;
and if the front-end scaffold directory path comprises a directory path of a dependent packet of the current live broadcast service module and does not comprise a directory path of a preset global packet management tool, determining that the operation environment is local operation.
The directory path of the file directory where the entry file of the front-end scaffold program is located, that is, the front-end scaffold directory path, may be obtained by accessing the attribute value process.
Js is a cross-platform operating environment of JavaScript which can be operated at a server side. Javascript (js) is a lightweight, interpreted or just-in-time programming language with function precedence, which is widely used in front-end projects. A process object is a global variable of a node.js, provides information about and can control the current node.js process. Each file is considered a module in node.js, and when node.js runs a file directly, the file is loaded as a master into a process.mainmodule, i.e. the process.mainmodule points to the master, while when the master changes during run time, the process.mainmodule also points to the new master. When the entry file of the front-end scaffold program is executed, the entry file of the front-end scaffold program is loaded into a process.
Among them, the global packet management tool may be npm (Node packet manager), nrm (npm registration manager, npm's mirror management tool), yarn (new packet management tool that compensates for some of the defects of npm), pnpm (packet management tool derived from npm and yarn), and the like.
If the front-end scaffold directory path comprises a preset directory path of a global package management tool, the front-end scaffold directory path belongs to a global dependency directory path, and the running environment of the front-end scaffold program can be determined to be global running.
If the front-end scaffold directory path includes a directory path of a dependent packet of the current live broadcast service module and does not include a directory path of a preset global packet management tool, it is described that the front-end scaffold directory path is a local dependent directory path, and it can be determined that the running environment of the front-end scaffold program is local running.
The directory path of the global package management tool is a path formed by all file directories between the file directory where the global package management tool is located and the root directory. The current live broadcast service module is a currently running live broadcast service function module, for example, when the audience presents a gift, the current live broadcast service module is a function module for presenting the gift. The dependency package is a file which needs to be used by the current live broadcast service module, namely a program block which needs to be called.
S102: if the running environment of the front-end scaffold program is in global running, a first dependent directory path corresponding to global running is obtained, and if the running environment of the front-end scaffold program is in local running, a second dependent directory path corresponding to local running is obtained.
The first dependent directory path is a global dependent directory path, and the second dependent directory path is a local dependent directory path.
Wherein the global dependent directory path may be directory paths of all global package management tools existing in the current operating system. The local dependency directory path may be a path formed by all file directories corresponding to a currently running local project module, where a project refers to a file related to providing a live broadcast service, and the local project module is a file related to providing a certain sub-service in the live broadcast service.
S103: and determining a plug-in directory where the corresponding live function plug-in is located according to the first dependency directory path or the second dependency directory path.
The live broadcast function plug-in can be an extended function plug-in of the front-end scaffold program, taking a micro front-end working area plug-in and an automatic project version update plug-in according to a git version as examples:
and the micro front end working area plug-in is used for providing a function of pulling the declaration file depended by the corresponding environment micro front end and the declaration file pulled by the local micro front end item. The method comprises the steps of defining a plug-in command workspace by using command exposed by the plug-in, defining a parameter type declaration file pull and parameter pullenv push environment by using option, defining function description of the plug-in by using description, and realizing specific function logic by using action. And pulling the declaration file of the micro front end dependency item corresponding to the environment, replacing each dependency address of the corresponding environment in the current emp item configuration file with a declaration file address, and then pulling, namely replacing each dependency address/emp.js with/index.d.ts. The local micro front-end items mutually pull the declaration files, local absolute addresses which are respectively pushed and pulled are configured, and the plug-in performs soft connection according to the local absolute addresses. The plug-in is installed under the file directory in the local dependent directory path or the file directory of the global dependent directory path of a certain local project module, and the plug-in can be used in the front-end scaffold program.
For an automatically updating project version plug-in from the git version, which is used to execute the version of git rev-parse- -abbrev-ref HEAD after matching git checkout, the project version will be automatically modified. The method comprises the steps of defining plug-in command gitversioning by using command exposed by a plug-in system, defining parameter regular matching regexpname by using option, defining function description of the plug-in by using description, and realizing specific function logic by using action. The plug-in modifies the version field in the package json file after it has executed git rev-part-abbrev-ref HEAD to get the current git version. The plug-in is installed under the file directory in the local dependent directory path or the file directory of the global dependent directory path of a certain local project module, and the plug-in can be used in the front-end scaffold program.
The two plug-ins can be installed under a file directory in a local dependency directory path or a file directory in a global dependency directory path, that is, the live function plug-in loading method of the embodiment of the application can be used for dynamic loading and running.
The application improves the expandability of the front end scaffold program. The front-end scaffold program can reserve the core function, plug in various service functions, decouple the core function and the service function of the front-end scaffold program, improve the maintainability of codes, and simultaneously provide more flexible function plug-in support and customization for various projects.
In an embodiment, the determining, according to the first dependent directory path or the second dependent directory path, a plug-in directory in which a corresponding live function plug-in is located includes the following steps:
searching a first target directory with a preset prefix name in the first dependent directory path;
determining the first target directory as a plug-in directory of the live function plug-in;
or the like, or, alternatively,
acquiring a plug-in list file of the current live broadcast service module;
reading the plug-in list file, and acquiring a prefix name of the live function plug-in;
searching a second target directory with the prefix name of the live function plug-in the second dependent directory path;
and determining the second target directory as a plug-in directory of the live function plug-in.
The preset prefix name may be a project name of the live function plug-in or a partial character in the project name.
The current live broadcast service module is a currently running local item module, for example, when the audience gives a gift, the current anchor service module is a related item module for realizing the function of giving the gift. The prefix name of the live broadcast function plug-in is all or partial characters of the name of the live broadcast function plug-in.
The first dependent directory path is a global dependent directory path, and the global dependent directory path includes directory paths of all package management tools that may exist in the current operating system.
The first target directory may be an installation directory of the live function plug-in, and is generally named according to a name of the live function plug-in, or is named according to a preset naming rule, where the name of the first target directory is known, and the first target directory may be found by searching in the global dependency directory path.
The plug-in list file may refer to a file storing information related to the live-broadcast functional plug-in, and generally, a file may be used in a development project to store names, versions, installation locations, and other information of all installed software packages (i.e., plug-ins), and the name of the plug-in list file may be specified in advance, for example, named "package.
S104: and enabling the front-end scaffold program to execute the corresponding plug-in entry file in the plug-in directory and load the corresponding live-broadcast functional plug-in.
The plug-in entry file refers to an entry file of the live function plug-in, the plug-in is a program written by an application program interface following a certain specification, and the entry file is an entry of the program.
In an embodiment, the causing the front-end scaffold program to execute the corresponding plug-in entry file in the plug-in directory includes the following steps:
transferring the object of the front-end scaffold program to the live broadcast functional plug-in;
and executing a corresponding plug-in entry file in the plug-in directory to enable the live broadcast functional plug-in to be loaded in a plug-in operable environment provided by the object of the front-end scaffold program.
The method provided by the live function plug-in can operate the object of the front-end scaffold program according to attributes such as a predefined command name, command description, option, parameter, processing function, version number and the like, so that various functions provided by the front-end scaffold program can be used.
In one embodiment, the live function plug-in has a specific protocol to enable the live function plug-in to be effectively loaded and executed by a front end scaffold program.
Js is a complete node.js command line solution, and the live function plug-in development can formulate a plug-in protocol based on commander: when the live broadcast function plug-in architecture operates, the OCP (Open-Closed Principle) Principle is used, the specific objects exposed inwards are expanded, and the main program is sealed outwards; the plug-in specification is expanded around a command object, the live broadcast function plug-in follows the item name prefix appointed by the front-end scaffold program, and the command name, the command description, the option, the action and the version number of the front-end scaffold program are respectively set through command, description, option, arguments, action and version during development.
The plug-in runnable environment refers to an environment in which the front-end scaffold program can compile codes of the live broadcast functional plug-in, so that a runnable environment can be provided for the live broadcast functional plug-in, and the environment comprises memory resources, CPU (central processing unit) operation resources and the like distributed by the front-end scaffold program for compiling the live broadcast functional plug-in.
In the embodiment of the application, the running environment of the front-end scaffold program can be determined, wherein the running environment comprises global running and local running; if the running environment of the front-end scaffold program is in global running, a first dependent directory path corresponding to global running is obtained, and if the running environment of the front-end scaffold program is in local running, a second dependent directory path corresponding to local running is obtained; determining a plug-in directory where a corresponding live function plug-in is located according to the first dependency directory path or the second dependency directory path; and enabling the front-end scaffold program to execute the corresponding plug-in entry file in the plug-in directory and load the corresponding live-broadcast functional plug-in. The method can dynamically load plug-ins to operate in different operating environments along with the program, meanwhile, different live broadcast function plug-ins are dynamically loaded by expanding the specific service scene, other functions do not need to be added or modified in the front-end scaffold program, the problem that the front-end scaffold program is more and more bloated due to service requirements is solved, the size of the front-end scaffold program is reduced, the front-end scaffold is convenient to load, maintain and expand, and the loading performance, maintainability and expandability of the front-end scaffold program are improved.
Example two:
the embodiment provides a live function plug-in loading device, which can be used for executing the live function plug-in loading method in the first embodiment of the application. For details not disclosed in the present embodiment, please refer to embodiment one of the present application.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a live function plug-in loading device disclosed in an embodiment of the present application. The live function plug-in loading device can run in a server or a live client. This live function plug-in loading device includes:
a first determining module 201, configured to determine an execution environment of a front-end scaffold program, where the execution environment includes a global operation and a local operation;
an obtaining module 202, configured to obtain a first dependent directory path corresponding to global operation if the operation environment of the front-end scaffold program is global operation, and obtain a second dependent directory path corresponding to local operation if the operation environment of the front-end scaffold program is local operation;
a second determining module 203, configured to determine, according to the first dependency directory path or the second dependency directory path, a plug-in directory where a corresponding live function plug-in is located;
and the loading module 204 is configured to enable the front-end scaffold program to execute the corresponding plug-in entry file in the plug-in directory, and load the live-broadcast functional plug-in.
As an optional implementation manner, the first determining module 201 obtains a front-end scaffold directory path, where the front-end scaffold directory path is a directory path of a file directory where an entry file of the front-end scaffold program is located; if the front-end scaffold directory path comprises a preset directory path of a global package management tool, determining that the operation environment is global operation; and if the front-end scaffold directory path comprises a directory path of a dependent packet of the current live broadcast service module and does not comprise a directory path of a preset global packet management tool, determining that the operation environment is local operation.
As an optional implementation manner, the second determining module 203 includes:
a first plug-in directory determination module, configured to search the first dependent directory path for a first target directory having a preset prefix name; determining the first target directory as a plug-in directory of the live function plug-in;
the second plug-in directory determining module is used for acquiring a plug-in list file of the current live broadcast service module; reading the plug-in list file to obtain a prefix name of the live broadcast functional plug-in; searching a second target directory with the prefix name of the live function plug-in the second dependent directory path; and determining the second target directory as a plug-in directory of the live function plug-in.
As an optional implementation manner, the loading module 204 enables the front-end scaffold program to execute a corresponding plug-in entry file in the plug-in directory, where the manner of loading the live function plug-in specifically is:
transferring the object of the front-end scaffold program to the live broadcast functional plug-in;
and executing a corresponding plug-in entry file in the plug-in directory to load the plug-in a plug-in runnable environment provided by the object of the front-end scaffold program.
In the live broadcast function plug-in loading device of the embodiment of the application, the running environment of a front-end scaffold program can be determined, wherein the running environment comprises global running and local running; if the running environment of the front-end scaffold program is in global running, a first dependent directory path corresponding to global running is obtained, and if the running environment of the front-end scaffold program is in local running, a second dependent directory path corresponding to local running is obtained; determining a plug-in directory where a corresponding live function plug-in is located according to the first dependency directory path or the second dependency directory path; and enabling the front-end scaffold program to execute the corresponding plug-in entry file in the plug-in directory and load the corresponding live-broadcast functional plug-in. The method can dynamically load plug-ins to operate in different operating environments along with the program, meanwhile, different live broadcast function plug-ins are dynamically loaded by expanding the specific service scene, other functions do not need to be added or modified in the front-end scaffold program, the problem that the front-end scaffold program is more and more bloated due to service requirements is solved, the size of the front-end scaffold program is reduced, the front-end scaffold is convenient to load, maintain and expand, and the loading performance, maintainability and expandability of the front-end scaffold program are improved.
Example three:
the embodiment provides an electronic device, which can be used for executing all or part of the steps of the live function plug-in loading method according to the first embodiment of the present application. For details not disclosed in the present embodiment, please refer to embodiment one of the present application.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. The electronic device 900 may be, but is not limited to, a combination of one or more of various servers, personal computers, laptops, smartphones, tablets, and the like.
In the preferred embodiment of the present application, the electronic device 900 comprises a memory 901, at least one processor 902, at least one communication bus 903, and a transceiver 904.
Those skilled in the art will appreciate that the configuration of the electronic device shown in fig. 4 is not limited to the embodiments of the present application, and may be a bus-type configuration or a star-type configuration, and that the electronic device 900 may include more or less hardware or software than those shown, or a different arrangement of components.
In some embodiments, the electronic device 900 is a device capable of automatically performing numerical calculations and/or information processing according to instructions set or stored in advance, and the hardware includes but is not limited to a microprocessor, an application specific integrated circuit, a programmable gate array, a digital processor, an embedded device, and the like. The electronic device 900 may also include a client device, which includes, but is not limited to, any electronic product capable of interacting with a client through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device, for example, a personal computer, a tablet computer, a smart phone, a digital camera, and the like.
It should be noted that the electronic device 900 is only an example, and other existing or future electronic products, such as those that may be adapted to the present application, are also included in the scope of the present application and are incorporated by reference herein.
In some embodiments, the memory 901 stores a computer program, which when executed by the at least one processor 902, implements all or part of the steps of the live function plug-in loading method according to the first embodiment. The Memory 901 includes a Read-Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), a One-time Programmable Read-Only Memory (OTPROM), an electronically Erasable rewritable Read-Only Memory (Electrically-Erasable Programmable Read-Only Memory (EEPROM)), an optical Read-Only Memory (CD-ROM) or other optical disk Memory, a magnetic disk Memory, a tape Memory, or any other medium readable by a computer that can be used to carry or store data.
In some embodiments, the at least one processor 902 is a Control Unit (Control Unit) of the electronic device 900, connects various components of the electronic device 900 by various interfaces and lines, and executes various functions and processes data of the electronic device 900 by running or executing programs or modules stored in the memory 901 and calling data stored in the memory 901. For example, when the at least one processor 902 executes the computer program stored in the memory, all or part of the steps of the live function plug-in loading method described in the embodiment of the present application are implemented; or all or part of functions of the live function plug-in loading device are realized. The at least one processor 902 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips.
In some embodiments, the at least one communication bus 903 is arranged to enable connective communication between the memory 901 and the at least one processor 902, etc.
The electronic device 900 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Example four:
the present embodiment provides a computer-readable storage medium, where a computer program is stored, where the instructions are suitable for being loaded by a processor and executing the live function plug-in loading method in the first embodiment of the present application, and a specific execution process may refer to a specific description in the first embodiment, which is not described herein again.
For the apparatus embodiment, since it basically corresponds to the method embodiment, reference may be made to the partial description of the method embodiment for relevant points. The above-described device embodiments are merely illustrative, wherein the components described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A live function plug-in loading method is characterized by comprising the following steps:
determining a running environment of a front-end scaffold program, wherein the running environment comprises global running and local running;
if the running environment of the front-end scaffold program is in global running, a first dependent directory path corresponding to global running is obtained, and if the running environment of the front-end scaffold program is in local running, a second dependent directory path corresponding to local running is obtained;
determining a plug-in directory where a corresponding live function plug-in is located according to the first dependency directory path or the second dependency directory path;
and enabling the front-end scaffold program to execute the corresponding plug-in entry file in the plug-in directory and load the corresponding live-broadcast functional plug-in.
2. The live function plug-in loading method according to claim 1, wherein the determining the running environment of the front-end scaffold program comprises the following steps:
acquiring a front-end scaffold directory path, wherein the front-end scaffold directory path is a directory path of a file directory where an entry file of a front-end scaffold program is located;
if the front-end scaffold directory path comprises a preset directory path of a global package management tool, determining that the operation environment is global operation;
and if the front-end scaffold directory path comprises a directory path of a dependent packet of the current live broadcast service module and does not comprise a directory path of a preset global packet management tool, determining that the operation environment is local operation.
3. The live function plug-in loading method according to claim 2, wherein the step of determining the plug-in directory where the corresponding live function plug-in is located according to the first dependency directory path or the second dependency directory path includes the steps of:
searching a first target directory with a preset prefix name in the first dependent directory path;
determining the first target directory as a plug-in directory of the live function plug-in;
or the like, or, alternatively,
acquiring a plug-in list file of the current live broadcast service module;
reading the plug-in list file, and acquiring a prefix name of the live function plug-in;
searching a second target directory with the prefix name of the live function plug-in the second dependent directory path;
and determining the second target directory as a plug-in directory of the live function plug-in.
4. The live function plug-in loading method according to claim 2, wherein the step of causing the front-end scaffold program to execute the corresponding plug-in entry file in the plug-in directory includes the steps of:
transferring the object of the front-end scaffold program to the live broadcast functional plug-in;
and executing a corresponding plug-in entry file in the plug-in directory to enable the live broadcast functional plug-in to be loaded in a plug-in operable environment provided by the object of the front-end scaffold program.
5. The utility model provides a live function plug-in loading device which characterized in that, live function plug-in loading device includes:
the system comprises a first determination module, a second determination module and a third determination module, wherein the first determination module is used for determining the running environment of a front-end scaffold program, and the running environment comprises global running and local running;
the acquisition module is used for acquiring a first dependent directory path corresponding to global operation if the operation environment of the front-end scaffold program is global operation, and acquiring a second dependent directory path corresponding to local operation if the operation environment of the front-end scaffold program is local operation;
the second determining module is used for determining a plug-in directory where the corresponding live function plug-in is located according to the first dependency directory path or the second dependency directory path;
and the loading module is used for enabling the front-end scaffold program to execute the corresponding plug-in entry file under the plug-in directory and loading the live-broadcast functional plug-in.
6. The live-broadcast functional plug-in loading device according to claim 5, wherein the first determining module obtains a front-end scaffold directory path, wherein the front-end scaffold directory path is a directory path of a file directory in which an entry file of the front-end scaffold program is located; if the front-end scaffold directory path comprises a preset directory path of a global package management tool, determining that the operation environment is global operation; and if the front-end scaffold directory path comprises a directory path of a dependent packet of the current live broadcast service module and does not comprise a directory path of a preset global packet management tool, determining that the operation environment is local operation.
7. The live function plug-in loading device according to claim 5, wherein the second determining module comprises:
the first plug-in directory determining module is used for searching a first target directory with a preset prefix name in the first dependent directory path and determining the first target directory as a plug-in directory of the live broadcast function plug-in;
and the second plug-in directory determination module is used for acquiring a plug-in list file of the current live broadcast service module, reading the plug-in list file, acquiring a prefix name of the live broadcast function plug-in, searching a second target directory with the prefix name of the live broadcast function plug-in the second dependent directory path, and determining the second target directory as the plug-in directory of the live broadcast function plug-in.
8. The live-function plug-in loading device according to claim 5, wherein the loading module transfers the object of the front-end scaffold program to the live-function plug-in, executes a corresponding plug-in entry file in the plug-in directory, and loads the plug-in a plug-in runnable environment provided by the object of the front-end scaffold program.
9. An electronic device, comprising: a processor and a memory, the memory storing a computer program adapted to be loaded by the processor and to perform the live function plug-in loading method of any of claims 1 to 4.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a live function plug-in loading method according to any one of claims 1 to 4.
CN202110768648.3A 2021-07-07 2021-07-07 Live broadcast function plug-in loading method, device, equipment and storage medium Pending CN113448650A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110768648.3A CN113448650A (en) 2021-07-07 2021-07-07 Live broadcast function plug-in loading method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110768648.3A CN113448650A (en) 2021-07-07 2021-07-07 Live broadcast function plug-in loading method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113448650A true CN113448650A (en) 2021-09-28

Family

ID=77815524

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110768648.3A Pending CN113448650A (en) 2021-07-07 2021-07-07 Live broadcast function plug-in loading method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113448650A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114338652A (en) * 2021-12-30 2022-04-12 北京欧珀通信有限公司 Distribution method and downloading method of installation package and related products
CN115129333A (en) * 2022-09-02 2022-09-30 城云科技(中国)有限公司 Npm resource packet management method, device and system suitable for micro front-end framework

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114338652A (en) * 2021-12-30 2022-04-12 北京欧珀通信有限公司 Distribution method and downloading method of installation package and related products
CN114338652B (en) * 2021-12-30 2023-10-20 北京欧珀通信有限公司 Distribution method and downloading method of installation package and related products
CN115129333A (en) * 2022-09-02 2022-09-30 城云科技(中国)有限公司 Npm resource packet management method, device and system suitable for micro front-end framework
CN115129333B (en) * 2022-09-02 2022-11-25 城云科技(中国)有限公司 NPm resource package management method, device and system suitable for micro front-end framework

Similar Documents

Publication Publication Date Title
US11656852B2 (en) System and method for autowiring of a microservice architecture
CN108958796B (en) Service request processing method and device and service request processing system
US10740114B2 (en) Component invoking method and apparatus, and component data processing method and apparatus
US20240111549A1 (en) Method and apparatus for constructing android running environment
CN113448650A (en) Live broadcast function plug-in loading method, device, equipment and storage medium
CN113645262A (en) Cloud computing service system and method
CN110968331A (en) Method and device for running application program
CN113050940A (en) Method for previewing small program, related device and computer program product
CN114968406B (en) Plug-in management method and device, electronic equipment and storage medium
WO2021097683A1 (en) Android system starting method and apparatus, device, and storage medium
CN112235132A (en) Method, device, medium and server for dynamically configuring service
CN112256421A (en) Communication processing method, communication processing device, storage medium and electronic equipment
CN110599112B (en) Network page development and maintenance method and device
CN110569104A (en) Management method and computer storage medium for task training in deep learning system
CN107301089B (en) APP deployment and calling method and terminal
CN111581578B (en) Interface request processing method and device
CN113050962B (en) Mobile service upgrading method, device and terminal
CN112597408A (en) System fusion method, device, equipment and storage medium
CN112685051A (en) Method, device, platform and storage medium for automatically executing shell script
CN113296802B (en) Virtual machine hot upgrading method, host device and storage medium
CN110191141B (en) Service calling information processing method and device and computer system
CN110321335B (en) Modeling data downloading method and device, electronic equipment and computer storage medium
CN117806674A (en) Distributed storage cluster deployment method, electronic equipment and storage medium
CN118051275A (en) Application program interaction method and storage medium
CN115480771A (en) Method for deploying algorithms and related device

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