Method and device for asynchronously loading functions during front-end runtime

By asynchronously loading the function collection and verifying the objective function during front-end runtime, the problem of not being able to dynamically obtain and call functions in the existing technology is solved, and the flexibility and efficiency of the front-end page are achieved.

CN113176912BActive Publication Date: 2024-12-31INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110563707.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-24
Publication Date
2024-12-31
Estimated Expiration
2041-05-24

AI Technical Summary

Technical Problem

The existing technology cannot dynamically obtain and call functions when running on the front end, which makes it inconvenient to repackage and deploy when the function logic needs to be adjusted, especially when the number of changes is small.

Method used

Provides a front-end runtime function asynchronous loading method. By obtaining function call requests, determining the function collection, and loading unloaded function collections according to the loading path, verifying and returning the target function, realizing asynchronous loading and calling third-party functions at runtime.

Benefits of technology

It realizes loading and executing third-party functions on demand when the front-end page is running, solves the problem that traditional packaging methods cannot dynamically obtain functions and improves the flexibility of the front-end.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113176912B_ABST
    Figure CN113176912B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for asynchronously loading functions during front-end runtime, which can be used in the financial field or other technical fields. The method includes: obtaining a function call request initiated by a function caller in a front-end page; determining a function set corresponding to a call target function; judging whether the function set has been loaded locally according to a local list of loaded function sets; when the function set has not been loaded locally, loading the function set locally according to a loading path of the function set stored locally, and then verifying whether the function set loaded locally contains the call target function, and if it contains the call target function, returning the call target function to the function caller. The present invention solves the technical problem that the prior art cannot dynamically obtain and call functions during front-end runtime.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of front-end development, and in particular to a method and device for asynchronously loading functions at a front-end runtime. Background Art

[0002] At present, mainstream web applications all adopt the development mode of front-end and back-end separation. The front-end files are packaged into static files and placed separately in the web server, such as nginx or tomcat, etc., and interact with the web server through the browser to initiate API requests. In this mode, after the front-end developer completes the coding, the source code is packaged and compressed into static files such as html, js and css through the packaging tool. Therefore, the execution logic of each function in the packaged front-end project has been determined at the time of packaging and cannot be dynamically changed or obtained at runtime. Sometimes, there are situations where the function execution logic can only be determined at runtime. For example, when the front-end performs dynamic form verification, the business meaning of each form element cannot be determined at the front-end coding stage, so the verification function logic of the specific form element cannot be determined. It is necessary to determine the business attributes of the form element based on the back-end return data at runtime, and then determine the verification function of the form element. At this time, the traditional solution cannot solve this kind of demand.

[0003] Although the existing technology can encode all possible verification functions in the front end in advance and package them into static files through exhaustive methods, when the function logic needs to be adjusted, it is still necessary to modify the front end source code and repackage and deploy it to make the update take effect. This is particularly inconvenient when the amount of change is small. Therefore, the existing technology lacks a solution for asynchronously loading and calling third-party functions when the front end is running. Summary of the invention

[0004] In order to solve the technical problems in the above-mentioned background technology, the present invention proposes a method and device for asynchronously loading functions during front-end runtime.

[0005] In order to achieve the above object, according to one aspect of the present invention, a method for asynchronously loading a function at a front-end runtime is provided, the method comprising:

[0006] Obtaining a function call request initiated by a function caller in a front-end page, wherein the function call request includes: a function name of a target function to be called;

[0007] Determine the function set corresponding to the calling target function according to the correspondence between the preset function name and the function set name;

[0008] Determine whether the function set has been loaded locally according to the local loaded function set list;

[0009] When the function set has been loaded locally, extracting the calling target function from the local function set and returning it to the function caller;

[0010] When the function set is not loaded locally, the function set is loaded locally according to the loading path of the function set stored locally, and then it is verified whether the function set loaded locally contains the calling target function. If it contains the calling target function, the calling target function is returned to the function caller.

[0011] Optionally, when the function set has been loaded locally, extracting the calling target function from the local function set and returning it to the function caller specifically includes:

[0012] When the function set has been loaded locally and the local function set contains the calling target function, the calling target function is extracted from the local function set and returned to the function caller.

[0013] Optionally, when the function set is not loaded locally, loading the function set locally according to the loading path of the function set stored locally specifically includes:

[0014] When the function set has not been loaded locally, or when the function set has been loaded locally but the local function set does not contain the calling target function, the function set is loaded locally according to the loading path of the function set stored locally.

[0015] Optionally, the front-end runtime function asynchronous loading method further includes:

[0016] If the calling target function is not contained, the locally stored default function is returned to the function caller.

[0017] Optionally, the function set is stored in a WEB server in the form of a file, and the loading path is a storage path of the function set in the WEB server;

[0018] The step of loading the function set to the local according to the loading path of the function set stored locally specifically includes:

[0019] According to the storage path of the function set in the WEB server, the function set is loaded from the WEB server to the local.

[0020] Optionally, the loading path is a backend service interface;

[0021] The step of loading the function set to the local according to the loading path of the function set stored locally specifically includes:

[0022] Calling a backend service interface corresponding to the function set so that the backend server generates the function set according to the function logic text corresponding to the function set stored in the database;

[0023] The function set generated by the backend server is loaded locally.

[0024] In order to achieve the above object, according to another aspect of the present invention, a device for asynchronously loading functions during front-end runtime is provided, the device comprising:

[0025] The function call request acquisition module is used to acquire the function call request initiated by the function caller in the front-end page, wherein the function call request includes: the function name of the target function to be called;

[0026] A function set determination module, used to determine the function set corresponding to the calling target function according to the correspondence between the preset function name and the function set name;

[0027] A loaded function set list query module, used for judging whether the function set has been loaded locally according to the local loaded function set list;

[0028] A first function return module, used for extracting the calling target function from the local function set and returning it to the function caller when the function set has been loaded locally;

[0029] The second function return module is used to load the function set locally according to the loading path of the function set stored locally when the function set is not loaded locally, and then verify whether the function set loaded locally contains the calling target function. If it contains the calling target function, the calling target function is returned to the function caller.

[0030] Optionally, the first function return module is specifically used to extract the calling target function from the local function set and return it to the function caller when the function set has been loaded locally and the local function set contains the calling target function.

[0031] Optionally, the second function return module is specifically used to load the function set locally according to the loading path of the function set stored locally when the function set has not been loaded locally, or when the function set has been loaded locally but the local function set does not contain the calling target function.

[0032] In order to achieve the above-mentioned purpose, according to another aspect of the present invention, a computer device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the above-mentioned front-end runtime function asynchronous loading method when executing the computer program.

[0033] In order to achieve the above-mentioned purpose, according to another aspect of the present invention, a computer-readable storage medium is further provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed in a computer processor, the steps in the above-mentioned front-end runtime function asynchronous loading method are implemented.

[0034] The beneficial effects of the present invention are as follows: when a function call request is initiated by a function caller in a front-end page, the present invention first determines the function set corresponding to the calling target function; if the corresponding function set has not been loaded locally, the function set is loaded locally according to the loading path corresponding to the corresponding function set; and then the calling target function in the function set is returned to the function caller in the front-end page, thereby achieving the effect of asynchronously loading and calling third-party functions when the front-end is running, and solving the technical problem that the prior art cannot dynamically obtain and call functions when the front-end is running. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0036] Figure 1 This is a flow chart of a method for asynchronously loading functions when the front-end is running according to an embodiment of the present invention;

[0037] Figure 2 is a flowchart of loading a function set into a local device according to an embodiment of the present invention;

[0038] Figure 3 It is an application scenario diagram of the method for asynchronously loading functions when the front-end is running in the present invention;

[0039] Figure 4 This is another application scenario diagram of the method for asynchronously loading functions when the front-end is running;

[0040] Figure 5 It is the overall flow chart of the function call of the present invention;

[0041] Figure 6 It is a structural block diagram of a function asynchronous loading device during front-end runtime according to an embodiment of the present invention;

[0042] Figure 7 It is a schematic diagram of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0043] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0044] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0045] It should be noted that the terms "including" and "having" and any variations thereof in the specification and claims of the present invention and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or apparatus.

[0046] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0047] It should be noted that the method and device of the present invention can be applied to the financial field, and can also be applied to other technical fields.

[0048] The present invention provides a front-end runtime function asynchronous loading solution, which can realize on-demand loading and execution of third-party functions when the front-end page is running, solves the problem that the traditional front-end packaging method cannot dynamically obtain functions at runtime, and improves the flexibility of the front-end.

[0049] Figure 1 Flowchart of the method for asynchronously loading functions at the front-end runtime of an embodiment of the present invention, wherein the implementation subject is a browser, such as Figure 1 As shown, the front-end runtime function asynchronous loading method of this embodiment includes steps S101 to S105.

[0050] Step S101, obtaining a function call request initiated by a function caller in a front-end page, wherein the function call request includes: a function name of a target function to be called.

[0051] In one embodiment of the present invention, the function caller is a module in the front-end page, such as a front-end dynamic form verification module. The function caller can call the function and execute the called function.

[0052] In one embodiment of the present invention, a user performs an operation on a front-end page on a browser. When the user's operation triggers a function call of a function caller in the front-end page, the browser obtains a function call request initiated by the function caller.

[0053] like Figure 3 As shown, in the present invention, the front-end files are packaged into static files and placed separately in the web server. The browser interacts with the web server by initiating an API request, loads the front-end files and runs them, and generates a front-end page on the browser. The web server is a static file server for storing static files.

[0054] Step S102: determining the function set corresponding to the calling target function according to the correspondence between the preset function names and the function set names.

[0055] In an embodiment of the present invention, functions that need to be asynchronously loaded can be divided into several function sets according to business scenarios, and each function set includes one or more specific functions, so the function can be uniquely determined according to "function set name + function name". In one embodiment of the present invention, the present invention saves each function set in a different js file and loads it at the granularity of the function set.

[0056] In the embodiment of the present invention, the present invention first presets the corresponding relationship between the function name and the function set name, and writes it into the front-end file.

[0057] Step S103: judging whether the function set has been loaded locally according to the local loaded function set list.

[0058] In one embodiment of the present invention, the present invention also presets basic information in the front-end file, and the basic information includes: the loading path corresponding to each function set, the list of loaded function sets, and the default function. The function set loading path is a dictionary with the set name as the key and the value as the corresponding loading path; the list of loaded function sets is used to record the function sets that have been loaded during the current front-end runtime to avoid repeated loading of the same set; the default function is used to return to the function caller when the function loading fails, and a built-in error message is used to prompt the user that the function loading failed.

[0059] In the present invention, local refers to the browser local.

[0060] Step S104: when the function set has been loaded locally, extract the calling target function from the local function set and return it to the function caller.

[0061] In one embodiment of the present invention, a function query module and a function loading module are also provided in the front-end engineering.

[0062] The function query module is used to query functions and return functions, and receives the function set name and function name as parameters. When the function caller needs to call a function, the function query module is called to first query whether the function set corresponding to the function to be loaded has been loaded into the local browser. If the function set to be found has been loaded and the target function to be called exists, the target function to be called is returned. If it is not loaded successfully, the function loading module is called to load the corresponding function set. When the loading fails or the loading is successful but the target function to be called is not included in the current set, the default function is returned to the function caller.

[0063] Step S105, when the function set is not loaded locally, the function set is loaded locally according to the loading path of the function set stored locally, and then it is verified whether the function set loaded locally contains the calling target function. If it contains the calling target function, the calling target function is returned to the function caller.

[0064] In one embodiment of the present invention, the function loading module is used to load a specified function set into the local browser. When called by the function query module, the loading path is queried in the basic information according to the passed-in function set name, and a reference (script tag) to the js script file corresponding to the function set is generated. The browser's appendChild method is called to mount this script reference tag on the DOM. When the script loading is completed, the loading result is returned to the function query module, and the loaded function is mounted into the browser's window object.

[0065] When calling a third-party function, the present invention also needs to change the original code for calling a static function to calling a function loading module entry function at the location where the function needs to be dynamically called in the front-end project, and the parameters are the function set name and the function name. For example, the code for calling a static function staticFunctionOne() is changed to calling a function loading module entry function loadFunction(setName, funcName), where staticFunctionOne is the original static method, loadFunction is the method provided by the query module, setName is the function set name, and funcName is the function name.

[0066] It can be seen that the present invention achieves the effect of asynchronously loading and calling third-party functions when the front-end is running, and solves the technical problem that the prior art cannot dynamically obtain and call functions when the front-end is running.

[0067] In one embodiment of the present invention, when the front-end is running, the back-end interface first obtains the dynamic content of the page, which includes the function set name and function name corresponding to all functions. When the user triggers the function call on the front-end page, the function caller passes the function set name or function name to the function query module. The function asynchronous loading process is as follows: Figure 5 shown.

[0068] The function query module queries whether the target function set has been loaded through basic data, then queries whether the target function has been called, and finally returns the target function or the default function to the function caller.

[0069] In one embodiment of the present invention, when the function set has been loaded locally in the above step S104, the calling target function is extracted from the local function set and returned to the function caller, specifically:

[0070] When the function set has been loaded locally and the local function set contains the calling target function, the calling target function is extracted from the local function set and returned to the function caller.

[0071] In one embodiment of the present invention, when the function set is not loaded locally in the above step S105, the function set is loaded locally according to the loading path of the function set stored locally, specifically:

[0072] When the function set has not been loaded locally, or when the function set has been loaded locally but the local function set does not contain the calling target function, the function set is loaded locally according to the loading path of the function set stored locally.

[0073] In one embodiment of the present invention, the above step S105 specifically further includes:

[0074] If the calling target function is not contained, the locally stored default function is returned to the function caller.

[0075] In one embodiment of the present invention, the default function is used to return to the function caller when the function loading fails, and the default function has built-in error information to prompt the user that the function loading failed.

[0076] In the present invention, there are two ways to store the function set. One is to save it in the web server in the form of a static js file, such as Figure 3 As shown, if changes are required, just modify the corresponding js file. This method is relatively simple, but it requires additional operations on the web server files.

[0077] In one embodiment of the present invention, the function set is stored in the web server in the form of a file, and the loading path is the storage path of the function set in the web server.

[0078] The above step S105 of loading the function set to the local according to the loading path of the function set stored locally specifically includes:

[0079] According to the storage path of the function set in the web server, the function set is loaded from the web server to the local.

[0080] In one embodiment of the present invention, each function set is stored in the web server in the form of a js file, and the browser directly obtains the function set file from the web server.

[0081] In the present invention, another storage method of the function set is to dynamically generate a js file corresponding to the function set through an interface call to the backend service, and return the file to the browser, such as Figure 4 As shown, this method is more flexible and can store the function logic text in the database. When changes are needed, only the function logic text corresponding to the database needs to be modified. However, this method requires additional maintenance of the data table, which has some costs. The two storage methods of the present invention can be determined according to actual needs.

[0082] In one embodiment of the present invention, the loading path is specifically a backend service interface.

[0083] like Figure 2 As shown, the above step S105 of loading the function set locally according to the loading path of the function set stored locally specifically includes step S201 and step S202.

[0084] Step S201, calling the backend service interface corresponding to the function set, so that the backend server generates the function set according to the function logic text corresponding to the function set stored in the database;

[0085] In one embodiment of the present invention, the basic information of the front-end file also includes a back-end service interface list, which corresponds one-to-one to the function set. The back-end service interface list records the address of the back-end service interface corresponding to each function set.

[0086] When the browser needs to load a function set, it obtains the address of the backend service interface corresponding to the function set from the backend service interface list, and then calls the backend service interface according to the address. When the backend service interface corresponding to the function set is called by the browser, the backend server generates a file for the function set according to the function logic text corresponding to the function set stored in the database.

[0087] Step S202: Load the function set generated by the backend server to the local computer.

[0088] In the embodiment of the present invention, after generating the file of the function set, the backend server sends the file of the function set to the browser.

[0089] It can be seen from the above embodiments that the technical solution of the present invention changes the current situation where the function logic of the front-end page is completely determined after packaging, and realizes the ability to dynamically load and execute third-party functions when the page is running, thereby solving the problem that the traditional front-end packaging method cannot dynamically determine the execution function at runtime.

[0090] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0091] Based on the same inventive concept, an embodiment of the present invention also provides a front-end runtime function asynchronous loading device, which can be used to implement the front-end runtime function asynchronous loading method described in the above embodiment, as described in the following embodiment. Since the principle of solving the problem by the front-end runtime function asynchronous loading device is similar to that of the front-end runtime function asynchronous loading method, the embodiment of the front-end runtime function asynchronous loading device can refer to the embodiment of the front-end runtime function asynchronous loading method, and the repeated parts will not be repeated. As used below, the term "unit" or "module" can be a combination of software and / or hardware that implements predetermined functions. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.

[0092] Figure 6 is a structural block diagram of a function asynchronous loading device during front-end runtime according to an embodiment of the present invention. Figure 6 As shown, the front-end runtime function asynchronous loading device of the embodiment of the present invention includes:

[0093] The function call request acquisition module 1 is used to acquire the function call request initiated by the function caller in the front-end page, wherein the function call request includes: the function name of the target function to be called;

[0094] Function set determination module 2, used to determine the function set corresponding to the calling target function according to the correspondence between the preset function name and the function set name;

[0095] A loaded function set list query module 3 is used to determine whether the function set has been loaded locally according to the local loaded function set list;

[0096] A first function return module 4, used for extracting the calling target function from the local function set and returning it to the function caller when the function set has been loaded locally;

[0097] The second function return module 5 is used to load the function set locally according to the loading path of the function set stored locally when the function set is not loaded locally, and then verify whether the function set loaded locally contains the calling target function. If it contains the calling target function, the calling target function is returned to the function caller.

[0098] In one embodiment of the present invention, the first function return module 4 is specifically used to extract the calling target function from the local function set and return it to the function caller when the function set has been loaded locally and the local function set contains the calling target function.

[0099] In one embodiment of the present invention, the second function return module 5 is specifically used to load the function set locally according to the loading path of the function set stored locally when the function set has not been loaded locally, or when the function set has been loaded locally but the local function set does not contain the calling target function.

[0100] In one embodiment of the present invention, the second function returning module 5 is further configured to return a locally stored default function to the function caller if the calling target function is not contained.

[0101] In one embodiment of the present invention, the function set is stored in a WEB server in the form of a file, and the loading path is the storage path of the function set in the WEB server. The second function returning module 5 loads the function set from the WEB server to the local according to the storage path of the function set in the WEB server.

[0102] In one embodiment of the present invention, the loading path is a backend service interface. The second function return module 5 specifically includes:

[0103] An interface calling unit, used for calling a backend service interface corresponding to the function set, so that a backend server generates the function set according to a function logic text corresponding to the function set stored in a database;

[0104] A data loading unit is used to load the function set generated by the backend server to the local.

[0105] In order to achieve the above object, according to another aspect of the present application, a computer device is also provided. Figure 7 As shown, the computer device includes a memory, a processor, a communication interface and a communication bus. A computer program that can be executed on the processor is stored in the memory. When the processor executes the computer program, the steps in the above-mentioned embodiment method are implemented.

[0106] The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.

[0107] The memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer executable programs and units, such as the corresponding program units in the above method embodiments of the present invention. The processor executes various functional applications of the processor and works data processing by running the non-transitory software programs, instructions and modules stored in the memory, that is, implementing the method in the above method embodiments.

[0108] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0109] The one or more units are stored in the memory, and when executed by the processor, the method in the above embodiment is performed.

[0110] The specific details of the above-mentioned computer device can be understood by referring to the corresponding related descriptions and effects in the above-mentioned embodiments, and will not be repeated here.

[0111] In order to achieve the above purpose, according to another aspect of the present application, a computer-readable storage medium is also provided, wherein the computer-readable storage medium stores a computer program, and the computer program implements the steps in the above-mentioned front-end runtime function asynchronous loading method when executed in a computer processor. Those skilled in the art can understand that the implementation of all or part of the process in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and the program can include the process of the embodiment of each method as described above when executed. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (Flash Memory), a hard disk (Hard Disk Drive, abbreviated as: HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above-mentioned types of memory.

[0112] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0113] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for asynchronously loading functions during front-end runtime, characterized in that: Applied to a browser, the method comprises: Obtain a function call request initiated by a function caller in a front-end page, wherein the function call request includes: a function name of a target function to be called; a front-end file is packaged into a static file and placed in a web server, a browser interacts with the web server by initiating an API request, loads and runs the front-end file, and generates a front-end page on the browser, the function caller is a module in the front-end page, a user operates on the front-end page on the browser, and when the user's operation triggers a function call of a function caller in the front-end page, the browser obtains the function call request initiated by the function caller; Determine the function set corresponding to the calling target function according to the correspondence between the preset function name and the function set name; Determine whether the function set has been loaded locally according to the local list of loaded function sets, wherein local refers to the browser local; When the function set has been loaded locally, extracting the calling target function from the local function set and returning it to the function caller; When the function set is not loaded locally, the function set is loaded locally according to the loading path of the function set stored locally, and then it is verified whether the function set loaded locally contains the calling target function. If it contains the calling target function, the calling target function is returned to the function caller.

2. The method for asynchronously loading functions during front-end runtime according to claim 1, characterized in that: When the function set has been loaded locally, extracting the calling target function from the local function set and returning it to the function caller specifically includes: When the function set has been loaded locally and the local function set contains the calling target function, the calling target function is extracted from the local function set and returned to the function caller.

3. The method for asynchronously loading functions during front-end runtime according to claim 1, characterized in that: When the function set is not loaded locally, loading the function set locally according to the loading path of the function set stored locally specifically includes: When the function set has not been loaded locally, or when the function set has been loaded locally but the local function set does not contain the calling target function, the function set is loaded locally according to the loading path of the function set stored locally.

4. The method for asynchronously loading functions during front-end runtime according to claim 1, characterized in that: Also includes: If the calling target function is not contained, the locally stored default function is returned to the function caller.

5. The method for asynchronously loading functions during front-end runtime according to claim 1, characterized in that: The function set is stored in the WEB server in the form of a file, and the loading path is the storage path of the function set in the WEB server; The step of loading the function set to the local according to the loading path of the function set stored locally specifically includes: According to the storage path of the function set in the WEB server, the function set is loaded from the WEB server to the local.

6. The method for asynchronously loading functions during front-end runtime according to claim 1, characterized in that: The loading path is a backend service interface; The step of loading the function set to the local according to the loading path of the function set stored locally specifically includes: Calling a backend service interface corresponding to the function set so that the backend server generates the function set according to the function logic text corresponding to the function set stored in the database; The function set generated by the backend server is loaded locally.

7. A function asynchronous loading device during front-end runtime, characterized in that: Applied to a browser, the device comprises: A function call request acquisition module is used to acquire a function call request initiated by a function caller in a front-end page, wherein the function call request includes: a function name of a target function to be called; a front-end file is packaged into a static file and placed in a web server, a browser interacts with the web server by initiating an API request, loads and runs the front-end file, and generates a front-end page on the browser, the function caller is a module in the front-end page, a user operates on the front-end page on the browser, and when the user's operation triggers a function call of a function caller in the front-end page, the browser acquires the function call request initiated by the function caller; A function set determination module, used to determine the function set corresponding to the calling target function according to the correspondence between the preset function name and the function set name; A loaded function set list query module, used to determine whether the function set has been loaded locally according to the local loaded function set list, wherein the local refers to the browser local; A first function return module, used for extracting the calling target function from the local function set and returning it to the function caller when the function set has been loaded locally; The second function return module is used to load the function set locally according to the loading path of the function set stored locally when the function set is not loaded locally, and then verify whether the function set loaded locally contains the calling target function. If it contains the calling target function, the calling target function is returned to the function caller.

8. The front-end runtime function asynchronous loading device according to claim 7, characterized in that: The first function return module is specifically used to extract the calling target function from the local function set and return it to the function caller when the function set has been loaded locally and the local function set contains the calling target function.

9. The front-end runtime function asynchronous loading device according to claim 7, characterized in that: The second function return module is specifically used to load the function set locally according to the loading path of the function set stored locally when the function set has not been loaded locally, or when the function set has been loaded locally but the local function set does not contain the calling target function.

10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.

11. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed in a computer processor, the computer program implements the method according to any one of claims 1 to 6.