CN116760812A - Function component-based local resource access method and system - Google Patents
Function component-based local resource access method and system Download PDFInfo
- Publication number
- CN116760812A CN116760812A CN202311035501.9A CN202311035501A CN116760812A CN 116760812 A CN116760812 A CN 116760812A CN 202311035501 A CN202311035501 A CN 202311035501A CN 116760812 A CN116760812 A CN 116760812A
- Authority
- CN
- China
- Prior art keywords
- component
- execution engine
- function component
- function
- update package
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 20
- 230000003993 interaction Effects 0.000 claims abstract description 8
- 230000006870 function Effects 0.000 description 43
- 238000012545 processing Methods 0.000 description 4
- 239000008186 active pharmaceutical agent Substances 0.000 description 2
- 230000008901 benefit Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/34—Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/565—Conversion or adaptation of application format or content
Abstract
The application relates to a local resource access method based on a function component, which comprises the following steps: the browser-side interaction interface converts the calling information into a specified format and then transmits the format to the component execution engine; the component execution engine searches whether the corresponding function component exists locally according to the call information; if the function component exists locally, the component execution engine executes the function component and returns an execution result; if the function component does not exist locally, the component execution engine acquires a dynamic update package of the function component from the component server, and executes the function component after the dynamic update package is installed and returns an execution result.
Description
Technical Field
The application relates to a local resource access method and system based on a function component, and belongs to the field of computer software.
Background
When a user accesses a Web information system (or application system) using a browser, it is often necessary to call APIs local to the user's computing device, such as dynamic libraries, COM components, system APIs, and the like. However, for security reasons, various browsers are prohibited from directly accessing the local path as well as various types of local devices. In order to achieve the access of the browser to the local file and the device, a common manner in the industry is to add a client to take charge of the above functions. When the executed function logic in the browser needs to call some local files as well as local device functions, the interface provided by the client is called through a local address (localhost). And the client returns the execution result to the front end of the browser. Meanwhile, the execution flow of more high-performance load is arranged to be executed at the client side due to the performance of the browser, so that the performance bottleneck problem caused by the browser is solved.
However, as the number of services carried by the Web information system is increased, the function requirements are fragmented, the client needs to customize different interfaces and iterate new functions continuously to cope with different requirements, the file size of the client is increased continuously, and the network distribution cost is high; meanwhile, the client side often adopts a pure native scheme, is influenced by factors such as platform constraint or security interception, and is difficult to update remotely.
Therefore, there is a need for an easy-to-update-and-maintain method to enable access to local resources by a browser.
CN100590597C, method and device for accessing local resources, discloses the following steps: a first thread sets task parameters for accessing local resources, the first thread having the ability to interact with a user; the first thread Cheng Huanxing is a second thread which is written in Java and has the capability of accessing local resources; the second thread accesses a local resource using the task parameter. But the application range of the method needs to be further improved.
Disclosure of Invention
In order to overcome the problems in the prior art, the application designs a local resource access method and a system based on a function component, wherein the component is stored on a remote component server for management, and is installed locally by a component execution engine, so that the dynamic library can be updated remotely and is easy to update remotely even in a safe and controlled environment; the component execution engine organizes and executes the components in a function form, provides localized stateless services for the browser, and can flexibly acquire and execute different functional services according to calling requirements; the execution engine is used as a stateless service provider and is only responsible for receiving call information and executing corresponding processing logic, is not responsible for maintaining the state, can horizontally expand and efficiently utilize resources, and does not need to maintain and manage complex client state information.
In order to achieve the above purpose, the present application adopts the following technical scheme:
technical solution one
A local resource access method based on a function component comprises the following steps:
the browser-side interaction interface converts the calling information into a specified format and then transmits the format to the component execution engine;
the component execution engine searches whether the corresponding function component exists locally according to the call information;
if the function component exists locally, the component execution engine executes the function component and returns an execution result;
if the function component does not exist locally, the component execution engine acquires a dynamic update package of the function component from the component server, and executes the function component after the dynamic update package is installed and returns an execution result.
Further, if the component server does not have a dynamic update package of the function component, the component execution engine returns an error message to the browser.
Further, the component execution engine is preset with a plurality of universal WASM components.
Further, the dynamic update package includes a JS component and a WASM component, and after the dynamic update package is installed, the component execution engine invokes the WASM component through the JS component.
Technical proposal II
A function component based local resource access system, comprising:
the browser-side interaction interface is used for converting the calling information into a specified format and then transmitting the converted calling information to the component execution engine;
the component execution engine is used for searching whether the corresponding function component exists locally according to the calling information, executing the function component, returning an execution result, acquiring a dynamic update package of the function component from the component server, and installing the dynamic update package.
Further, the component execution engine is further configured to deliver error information to the browser after the dynamic update package cannot be acquired.
Further, the component execution engine is preset with a plurality of universal WASM components.
Further, the dynamic update package includes a JS component and a WASM component, and after the dynamic update package is installed, the component execution engine invokes the WASM component through the JS component.
Technical proposal III
A component execution engine, comprising: the system comprises a loader, a local cache module manager, a remote cache module manager and an execution engine;
the local cache module manager is used for searching whether the corresponding function component exists locally according to the calling information;
the remote cache module manager is used for acquiring a dynamic update package of the function component from the component server;
the loader is used for loading the function component;
the execution engine is used for installing the dynamic update package, executing the function component and returning the execution result.
Further, the component execution engine is preset with a plurality of universal WASM components.
Compared with the prior art, the application has the following characteristics and beneficial effects:
in the application, the components are stored on a remote component server for management, and the components are installed locally by a component execution engine, so that the dynamic library can be updated remotely even in a safe and controlled environment. The component execution engine organizes and executes the components in a functional form, provides localized stateless service for the browser, has the advantage of cross-platform and cross-CPU architecture, and can flexibly acquire and execute a plurality of components in parallel according to the calling requirement. Meanwhile, the component execution engine is used as a stateless service provider and is only responsible for receiving call information and executing corresponding processing logic, is not responsible for maintaining state, can horizontally expand and efficiently utilize resources, and does not need to maintain and manage complex client state information.
Drawings
FIG. 1 is a flow chart of the present application;
fig. 2 is a schematic diagram of the system of the present application.
Detailed Description
Before describing embodiments of the present application in further detail, the terms and terminology involved in the embodiments of the present application will be described, and the terms and terminology involved in the embodiments of the present application will be used in the following explanation.
A browser is a software application for accessing the internet, which is presented as an interface that can be understood and manipulated by a user by parsing HTML, CSS, and JavaScript codes of a web page.
JSON (JavaScript Object Notation) is a lightweight data exchange format consisting of key-value pairs, the keys being bracketed with double quotation marks, the values being strings, numbers, boolean values, arrays, objects (sets of key-value pairs) or null.
The JS (JavaScript) interface is a contract defining the properties and methods of objects, providing a standardized way to agree on the communication and interaction between objects.
Component execution engine refers to a tool that parses and executes component code, including without limitation React, vue, angular.
The present application will be described in more detail with reference to examples.
Example 1
As shown in fig. 1, a method for accessing local resources based on function components includes the following steps:
the browser obtains the call information. The call information includes call function names, call contexts, and the like.
The interaction interface of the browser end transmits the calling information to the component execution engine. In this embodiment, the interactive interface is a JS interface, and converts the call information into JSON format, and transmits the converted call information to the component execution engine in a remote call manner.
The component execution engine operates on a user computer where the browser is located, and searches whether a corresponding function component exists in a local cache according to the calling information;
if the function component exists locally, the component execution engine loads and executes the function component, and an execution result is returned to the browser; the component resources are mutually independent, and the component execution engine executes a plurality of components in parallel.
If the function component does not exist locally, the component execution engine acquires a dynamic update package of the function component from a remote component server, installs the dynamic update package, acquires an execution result of the function component after the installation is completed, and returns the execution result to the browser;
if the component server does not have a dynamic update package of the function component, the component execution engine passes the error information to the browser.
Example two
As shown in FIG. 2, the component execution engine includes a loader, a local cache module manager, a remote cache module manager, an execution engine, and a number of general-purpose components. The general component is prefabricated in the component execution engine in the form of a WASM component, and comprises and is not limited to a file IO operation module, a thread sheet analysis engine module and the like, so that the function of being used after being unpacked is realized.
Example III
In a scene sensitive to performance, a JS component for realizing business logic and a WASM component for realizing performance are integrated into a dynamic module update package, and a component execution engine downloads and installs the dynamic module update package to a local. The JS component serves as an entry for calling a function, and the component execution engine calls the WASM component or other JS components in the JS component. The JS component and the WASM component are respectively components written in JavaScript language and WebAsssembly language.
The method has the advantages that when the module execution engine executes the JS module to process business logic, the high performance of the WASM module is called to process some performance-sensitive tasks, performance and response speed are improved, and better user experience is provided.
Example IV
The operation of deriving Excel at a time is described as an example:
the browser requests the home page information from the service server (business web server), and the browser displays the received home page information;
after the client logs in, an Excel operation is triggered and exported, and the interaction interface converts the calling information into a JSON format and transmits the JSON format to the component execution engine.
The local cache module manager searches whether the corresponding function component exists in the local cache, and if not, the remote cache module manager requests the corresponding function component from a component server deployed at a remote end.
If the component server exists the function component, the component server returns its dynamic update package.
If the component server does not have the function component, the component server returns an error message.
After receiving the dynamic update package, the component execution engine installs and caches the dynamic update package locally so that the next time a call is required, no further requests need to be made to the component server. Then, the component execution engine executes the logic in the installed dynamic update package, and returns the execution result, i.e., excel file stream, to the browser.
The browser displays the Excel file.
It should be noted that, the above-mentioned local resource access system based on a function component is further used to implement the method steps corresponding to each embodiment in the local resource access method based on a function component shown in fig. 1, which is not repeated herein.
It should be noted that, in each embodiment of the present application, each functional unit/module may be integrated in one processing unit/module, or each unit/module may exist alone physically, or two or more units/modules may be integrated in one unit/module. The integrated units/modules described above may be implemented either in hardware or in software functional units/modules.
From the description of the embodiments above, it will be apparent to those skilled in the art that the embodiments described herein may be implemented in hardware, software, firmware, middleware, code, or any suitable combination thereof. For a hardware implementation, the processor may be implemented in one or more of the following units: an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a processor, a controller, a microcontroller, a microprocessor, other electronic units designed to perform the functions described herein, or a combination thereof. For a software implementation, some or all of the flow of an embodiment may be accomplished by a computer program to instruct the associated hardware. When implemented, the above-described programs may be stored in or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a computer. The computer readable media can include, but is not limited to, RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
Finally, it should be noted that the above embodiments are only for illustrating the technical solution of the present application, and not for limiting the scope of the present application, and although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solution of the present application without departing from the spirit and scope of the technical solution of the present application.
Claims (10)
1. A method for accessing local resources based on a function component, comprising the steps of:
the browser-side interaction interface converts the calling information into a specified format and then transmits the format to the component execution engine;
the component execution engine searches whether the corresponding function component exists locally according to the call information;
if the function component exists locally, the component execution engine executes the function component and returns an execution result;
if the function component does not exist locally, the component execution engine acquires a dynamic update package of the function component from the component server, and executes the function component after the dynamic update package is installed and returns an execution result.
2. The method of claim 1, wherein the component execution engine returns an error message to the browser if the component server does not have a dynamic update package for the function component.
3. The method for accessing local resources based on function components according to claim 1, wherein the component execution engine is preset with a plurality of universal WASM components.
4. The function component-based local resource access method of claim 1, wherein the dynamic update package comprises a JS component and a WASM component; after the dynamic update package is installed, the module execution engine calls the WASM module through the JS module.
5. A function component based local resource access system, comprising:
the browser-side interaction interface is used for converting the calling information into a specified format and then transmitting the converted calling information to the component execution engine;
the component execution engine is used for searching whether the corresponding function component exists locally according to the calling information, executing the function component, returning an execution result, acquiring a dynamic update package of the function component from the component server, and installing the dynamic update package.
6. The function component-based local resource access system of claim 5, wherein the component execution engine is further configured to communicate an error message to a browser after the dynamic update package is unavailable.
7. The function component-based local resource access system of claim 5, wherein the component execution engine is pre-configured with a number of generic WASM components.
8. The function component-based local resource access system of claim 5, wherein the dynamic update package comprises a JS component and a WASM component; after the dynamic update package is installed, the module execution engine calls the WASM module through the JS module.
9. A component execution engine, comprising: the system comprises a loader, a local cache module manager, a remote cache module manager and an execution engine;
the local cache module manager is used for searching whether the corresponding function component exists locally according to the calling information;
the remote cache module manager is used for acquiring a dynamic update package of the function component from the component server;
the loader is used for loading the function component;
the execution engine is used for installing the dynamic update package, executing the function component and returning the execution result.
10. The component execution engine of claim 9, wherein the component execution engine is pre-configured with a number of generic WASM components.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311035501.9A CN116760812A (en) | 2023-08-17 | 2023-08-17 | Function component-based local resource access method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311035501.9A CN116760812A (en) | 2023-08-17 | 2023-08-17 | Function component-based local resource access method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116760812A true CN116760812A (en) | 2023-09-15 |
Family
ID=87948191
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311035501.9A Pending CN116760812A (en) | 2023-08-17 | 2023-08-17 | Function component-based local resource access method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116760812A (en) |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101308465A (en) * | 2008-05-08 | 2008-11-19 | 华为技术有限公司 | Local resource access method and device |
CN101631033A (en) * | 2008-07-14 | 2010-01-20 | 中兴通讯股份有限公司 | Method, system, server and client for calling remote component |
CN104298523A (en) * | 2014-09-23 | 2015-01-21 | 北京金山安全软件有限公司 | Component loading method and device and terminal |
CN109445323A (en) * | 2018-10-11 | 2019-03-08 | 上海求本信息技术有限公司 | A kind of distributed intelligence TT&C software platform designing method based on WEB |
CN109857963A (en) * | 2017-08-31 | 2019-06-07 | 龙芯中科技术有限公司 | Local resource access method, device and electronic equipment |
CN114035971A (en) * | 2020-11-28 | 2022-02-11 | 中安网脉(北京)技术股份有限公司 | Software system convenient for different browsers to access local computer resources |
CN115695400A (en) * | 2022-09-15 | 2023-02-03 | 福建升腾资讯有限公司 | Method and terminal for interaction between Web page and local application |
CN116302250A (en) * | 2023-02-10 | 2023-06-23 | 中银金融科技有限公司 | Interface multiplexing method, device, electronic equipment and storage medium |
CN116541184A (en) * | 2023-04-23 | 2023-08-04 | 国网信息通信产业集团有限公司 | Multi-protocol application framework system |
-
2023
- 2023-08-17 CN CN202311035501.9A patent/CN116760812A/en active Pending
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101308465A (en) * | 2008-05-08 | 2008-11-19 | 华为技术有限公司 | Local resource access method and device |
CN101631033A (en) * | 2008-07-14 | 2010-01-20 | 中兴通讯股份有限公司 | Method, system, server and client for calling remote component |
CN104298523A (en) * | 2014-09-23 | 2015-01-21 | 北京金山安全软件有限公司 | Component loading method and device and terminal |
CN109857963A (en) * | 2017-08-31 | 2019-06-07 | 龙芯中科技术有限公司 | Local resource access method, device and electronic equipment |
CN109445323A (en) * | 2018-10-11 | 2019-03-08 | 上海求本信息技术有限公司 | A kind of distributed intelligence TT&C software platform designing method based on WEB |
CN114035971A (en) * | 2020-11-28 | 2022-02-11 | 中安网脉(北京)技术股份有限公司 | Software system convenient for different browsers to access local computer resources |
CN115695400A (en) * | 2022-09-15 | 2023-02-03 | 福建升腾资讯有限公司 | Method and terminal for interaction between Web page and local application |
CN116302250A (en) * | 2023-02-10 | 2023-06-23 | 中银金融科技有限公司 | Interface multiplexing method, device, electronic equipment and storage medium |
CN116541184A (en) * | 2023-04-23 | 2023-08-04 | 国网信息通信产业集团有限公司 | Multi-protocol application framework system |
Non-Patent Citations (1)
Title |
---|
朱明鹏: "《活动中台 揭秘vivo的千万级DAU活动中台》", 北京:机械工业出版社, pages: 150 - 152 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP2798494B1 (en) | Virtual channel for embedded process communication | |
US7587447B2 (en) | Systems, methods and computer programs for implementing and accessing web services | |
US5999941A (en) | Database access using active server pages | |
US7571208B2 (en) | Creating proxies from service description metadata at runtime | |
CN111600909A (en) | Data processing method, device, protocol conversion equipment and storage medium | |
CN110324169B (en) | Interface management method and device | |
US10574724B2 (en) | Automatic discovery of management nodes and generation of CLI using HA module | |
CN109240697B (en) | Call processing method and device and storage medium | |
US20150222664A1 (en) | Conflict resolution in extension induced modifications to web requests and web page content | |
CN110365724B (en) | Task processing method and device and electronic equipment | |
CN102937981A (en) | Webpage representing system and method | |
US20120227057A1 (en) | Driver Shimming | |
CN112787999A (en) | Cross-chain calling method, device, system and computer readable storage medium | |
CN111506368A (en) | Method, device, equipment and storage medium for transferring asynchronous call to synchronous call | |
CN111338717B (en) | Interface calling method, application program upgrading method, server and client | |
CN1179285C (en) | Method and apparatus for dynamic commmand extensibility in intelligent agent | |
KR20210144045A (en) | System and method for executing application based on microservice architecture and computer program for the same | |
CN116760812A (en) | Function component-based local resource access method and system | |
US7908397B1 (en) | Application server gateway technology | |
CN111447279B (en) | Server and interface analysis service package generation method | |
EP3872630B1 (en) | Request processing method and apparatus, electronic device, and computer storage medium | |
CN115563183B (en) | Query method, query device and program product | |
US20090313628A1 (en) | Dynamically batching remote object model commands | |
CN112565340B (en) | Service scheduling method, device, computer system and medium for distributed application | |
US20230334109A1 (en) | Method For Significantly Improving The Online Access Speed Of Matlab Web App |
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 |