Method and device for calling local component by browser, electronic equipment and storage medium

By generating and encrypting request parameters, and directly calling ActiveX and COM components using the browser adaptation layer, the compatibility problem on non-IE kernel browsers is solved, and a low-cost compatibility solution is achieved, improving user experience and system security.

CN120386574APending Publication Date: 2025-07-29BEIJING ANZHENGTONG INFORMATION TECH HLDG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510524365.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-24
Publication Date
2025-07-29

AI Technical Summary

Technical Problem

In the prior art, the compatibility issues of ActiveX and COM components on non-IE kernel browsers have caused Web applications to fail to function properly, forcing developers to carry out high-cost and uncertain technical transformations.

Method used

By generating request parameters, serialization conversion and data encryption, the browser adaptation layer directly calls local registered ActiveX and COM components, including parameter verification and parsing, to ensure data security and integrity.

Benefits of technology

It reduces the cost of technology development, shortens the development cycle, improves the user experience, and improves the stability and security of the business system, preventing illegal tampering and attacks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120386574A_ABST
    Figure CN120386574A_ABST
Patent Text Reader

Abstract

The invention provides a method and a device for calling a local component by a browser, electronic equipment and a storage medium, and relates to the technical field of computers, the method comprises the following steps: generating a request parameter according to a service logic and a user demand; carrying out serialization conversion on the request parameter to obtain a request parameter format file; performing data encryption on the request parameter format file, and selecting a target request method to send the request parameter format file to local equipment; performing data verification on the request parameter format file, and performing data analysis on the request parameter format file passing the data verification to obtain a request parameter; and calling the local component to execute a corresponding method and / or access attribute according to the request parameter, and returning a calling result. According to the method, the browser can directly call the locally registered ActiveX component and COM component without technical transformation of the components, so that the technical development cost is reduced, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for a browser to call a local component. Background Art

[0002] In the early days of Web application development, ActiveX technology and the Component Object Model (COM) were the core means of building rich interactive experiences and enabling interaction with local programs. ActiveX provided a standardized component object model, enabling developers to easily embed multimedia effects, interactive objects, various document formats, and complex applications into Web pages, creating a high-quality multimedia experience. COM, as the foundation of ActiveX technology, defined a software architecture that supported interaction between different applications and between applications and their components. This modular design not only improved the maintainability and scalability of the system, but also promoted component reuse, effectively reducing development costs.

[0003] However, with the continuous evolution of web technologies, especially browser innovations, the application of ActiveX and COM component technologies has been significantly limited. Currently, these technologies primarily rely on browsers based on the Internet Explorer core or non-IE browsers that use the NPAPI technology for intermediary support. However, in recent years, mainstream browsers such as Chrome and Firefox have gradually stopped supporting NPAPI technology, leading to increasingly prominent compatibility issues for ActiveX and COM components on these browsers. This phenomenon has caused a large number of web applications based on these technologies to fail to function properly, forcing developers to invest resources in large-scale technical modifications to meet user needs and product goals. Such modifications are not only costly but also uncertain in effectiveness, posing a significant challenge for developers. Therefore, resolving the compatibility issues of ActiveX and COM components on non-IE browsers has become a key technical challenge that needs to be overcome in the current field of web application development. Summary of the Invention

[0004] In view of the above-mentioned deficiencies in the prior art, the present invention provides a method, device, electronic device and storage medium for a browser to call a local component, which effectively solves the compatibility problem of ActiveX and COM components on non-IE kernel browsers.

[0005] In a first aspect, the present invention provides a method for a browser to call a local component, the method comprising:

[0006] Generate request parameters based on business logic and user needs;

[0007] Perform serialization conversion on the request parameters to obtain a request parameter format file;

[0008] Encrypt the data of the request parameter format file, and select a target request method to send the request parameter format file to the local device;

[0009] Perform data verification on the request parameter format file, and perform data parsing on the request parameter format file after passing the data verification to obtain the request parameters;

[0010] Call the local component according to the request parameters to execute the corresponding method and / or access the property, and return the call result.

[0011] In an optional implementation manner, the local component at least includes an ActiveX component and a COM component, and the request parameters at least include target component information, component interface name, and interface parameters, where:

[0012] The target component information is used to identify the information of the target local component;

[0013] The component interface name is used to specify the method name and / or access property name of the target local component;

[0014] The interface parameter is used to set the parameters required for the method and / or access property.

[0015] In an optional implementation manner, performing serialization conversion on the request parameters to obtain a request parameter format file includes:

[0016] Determine the serialization format of the request parameters according to the business logic;

[0017] Encapsulate the request parameters according to the serialization format to obtain a parameter encapsulation structure;

[0018] Convert the parameter encapsulation structure into a text format to obtain the request parameter format file.

[0019] In an optional implementation manner, encrypting the data of the request parameter format file and selecting a target request method to send the request parameter format file to the local device includes:

[0020] Perform symmetric encryption on the request parameter format file and add a verification signature value;

[0021] Select a target request method according to business requirements and data volume, and the target request method at least includes a GET request method and a POST request method;

[0022] Send the request parameter format file to the local device according to the target request method.

[0023] In an alternative embodiment, performing data verification on the request parameter format file includes:

[0024] Verifying the legality of the verification signature value of the request parameter format file using a symmetric key;

[0025] Verifying the data integrity and data format of the request parameter format file.

[0026] In an alternative embodiment, performing data parsing on the request parameter format file after successful data verification to obtain the request parameters includes:

[0027] Extracting data from the request parameter format file according to the target request method to obtain a request parameter string;

[0028] Converting the data of the request parameter string to obtain initial request parameters;

[0029] Reorganizing the data of the initial request parameters to obtain the request parameters.

[0030] In an alternative embodiment, calling a local component according to the request parameters to execute corresponding methods and / or access attributes, and returning a call result includes:

[0031] Performing parameter verification on the request parameters;

[0032] If the parameter verification is successful, calling the local component to execute the corresponding methods and / or access attributes, and generating a call result for feedback;

[0033] If the parameter verification fails, directly generating a call failure result for feedback.

[0034] In a second aspect, the present invention provides a device for a browser to call a local component, the device including:

[0035] A parameter generation module, configured to generate request parameters according to business logic and user requirements;

[0036] A parameter conversion module, configured to perform serialization conversion on the request parameters to obtain a request parameter format file;

[0037] A file sending module, configured to encrypt the data of the request parameter format file, and select a target request method to send the request parameter format file to a local device;

[0038] A data parsing module, configured to perform data verification on the request parameter format file, perform data parsing on the request parameter format file after successful data verification, and obtain the request parameters;

[0039] A component calling module, configured to call a local component according to the request parameters to execute corresponding methods and / or access attributes, and return a call result.

[0040] In a third aspect, the present invention provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. The processor executes the computer program to implement the method for a browser to call a local component as described in the first aspect of the present invention.

[0041] In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the method for a browser to call a local component as described in the first aspect of the present invention.

[0042] The method, device, electronic device, and storage medium for a browser to call a local component provided by the present invention, by introducing an innovative browser adaptation layer, enable the browser to directly call locally registered ActiveX components and COM components without the need for technical transformation of these components. Only by relying on the JavaScript integration method supported by the browser, the technical development cost can be significantly reduced and the development cycle can be shortened. In addition, on the basis of retaining the original business logic and interface design, the present invention ensures that users can directly call ActiveX components and COM components on local devices using multiple browsers in an existing business system without additional transformation of the existing system. This feature not only avoids changing the user's operation habits but also further improves the user experience. At the same time, for the request parameters, by comprehensively verifying their formats, sources, integrity, and legality, the accuracy and security of data are effectively guaranteed, preventing illegal tampering and potential attack behaviors, improving the overall stability and security of the business system, and providing users with more reliable technical guarantees. Description of the Drawings

[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the embodiments. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other related drawings can be obtained based on these drawings.

[0044] Figure 1 It is the first schematic diagram of the method flow for a browser to call a local component provided by an embodiment of the present invention;

[0045] Figure 2 It is the second schematic diagram of the method flow for a browser to call a local component provided by an embodiment of the present invention;

[0046] Figure 3It is the third schematic diagram of the method flow for a browser to call a native component provided by an embodiment of the present invention;

[0047] Figure 4 It is the fourth schematic diagram of the method flow for a browser to call a native component provided by an embodiment of the present invention;

[0048] Figure 5 It is the fifth schematic diagram of the method flow for a browser to call a native component provided by an embodiment of the present invention;

[0049] Figure 6 It is the schematic diagram of the device structure for a browser to call a native component provided by an embodiment of the present invention;

[0050] Figure 7 It is the schematic diagram of the structure of an electronic device provided by an embodiment of the present invention.

[0051] Main element symbol description:

[0052] 600, device for a browser to call a native component; 610, parameter generation module; 620, parameter conversion module; 630, file sending module; 640, data parsing module; 650, component calling module; 700, electronic device; 710, processor; 720, communication interface; 730, memory; 740, communication bus. Detailed implementation manners

[0053] To make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be further described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention. It should be noted that the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0054] In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the present invention, "a plurality" means two or more unless otherwise specifically defined.

[0055] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which this application belongs. The terms used in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.

[0056] ActiveX technology and the Component Object Model (COM) are the core means of building rich interactive experiences and enabling local program interactions. With the continuous evolution of web technologies, especially the innovation of browser technologies, the application of ActiveX and COM component technologies has been significantly restricted. Currently, these technologies mainly rely on browsers based on the IE kernel or non-IE kernel browsers that are relayed through NPAPI technology. However, in recent years, mainstream browsers such as Chrome and Firefox have gradually stopped supporting NPAPI technology, leading to increasingly prominent compatibility issues of ActiveX and COM components on these browsers. This phenomenon has caused a large number of web applications based on these technologies to malfunction, forcing developers to invest resources in large-scale technological transformations to meet user needs and product goals. Such transformations are not only costly but also have uncertain effects, posing severe challenges to developers. Therefore, how to solve the compatibility issues of ActiveX and COM components on non-IE kernel browsers has become a key technical problem that urgently needs to be overcome in the current web application development field.

[0057] Example 1

[0058] The embodiment of the present invention provides a method for a browser to call a local component, effectively solving the compatibility issues of ActiveX and COM components on non-IE kernel browsers. Figure 1 It is the first schematic diagram of the method flow for a browser to call a local component provided by the embodiment of the present invention. As Figure 1 shown, the method includes the following steps:

[0059] S100. Generate request parameters according to business logic and user requirements.

[0060] In the embodiment of the present invention, the local component is an ActiveX component or a COM component. When web server development needs to interact with an ActiveX component or a COM component, the web server can dynamically generate request parameters according to business logic and user requirements. Specifically, different business logics may require calling different local components, and at the same time, users may select different function modules according to their own needs. By dynamically generating request parameters, it is possible to select appropriate components according to runtime conditions (such as user input and business rules). The request parameters are all the necessary information required to interact with the local component, including but not limited to target component information, component interface names, and interface parameters.

[0061] The target component information clearly indicates whether the target local component to interact with is an ActiveX component or a COM component, mainly including the component identifier, component path, and component version. Among them, the component identifier can be identifiers such as ProgID and CLSID, which are used for the local device listener to accurately identify and call the corresponding component. The component path is the physical path of the local component, which may need to be explicitly specified in some scenarios. If the system supports coexistence of multiple versions of components, the version number of the component to be called needs to be specified.

[0062] The component interface name is used to specify the specific method and / or the name of the access attribute in the ActiveX component or COM component to be called, mainly including the interface identifier and interface description. Through the component interface name, the local device listener can know which method and / or access attribute of which component should be called to perform the corresponding operation.

[0063] The interface parameters are used to set the parameters required by the method and / or access attribute. The interface parameters are formatted according to the component interface specification, mainly including the method name, parameter list, and parameter mapping. The method name is the specific method to be called, the parameter list is the input parameters of the method, including the parameter name, type, and value, and the parameter mapping maps the user input or business data to the method parameters.

[0064] S200. Serialize and convert the request parameters to obtain the request parameter format file.

[0065] Figure 2 It is the second schematic diagram of the method flow for the browser to call the local component provided by the embodiment of the present invention. As Figure 2 shown, the serialization conversion specifically includes the following steps:

[0066] S210. Determine the serialization format of the request parameters according to the business logic.

[0067] In the embodiment of the present invention, according to the business logic, clarify the data content that needs to be transmitted between the browser and the local listener, and determine whether complex data structures need to be supported. Then, select a suitable serialization format according to the data content and data structure. The selected serialization format should facilitate data transmission and parsing between the browser and the local listener. This serialization format can be the JSON format or the XML format. The JSON format is suitable for most scenarios and has the characteristics of clear structure, easy readability, and good cross-language support. The XML format is suitable for scenarios with strict specifications for data formats.

[0068] S220. Package the request parameters according to the serialization format to obtain the parameter packaging structure.

[0069] Parameter encapsulation is the process of converting request parameters into structured parameters, ensuring data integrity, clarity, and compliance with business rules. First, define the parameter structure, then ensure that all required parameters are provided and perform legality verification, then perform dynamic parameter processing, and finally convert the request parameters into a unified data structure to obtain the parameter encapsulation structure.

[0070] S230. Convert the parameter encapsulation structure into a text format to obtain a request parameter format file.

[0071] In an embodiment of the present invention, the parameter encapsulation structure is converted into a text format through a serialization tool to obtain a request parameter format file.

[0072] S300. Encrypt the data in the request parameter format file and select a target request method to send the request parameter format file to the local device.

[0073] Figure 3 This is the third schematic diagram of the method flow for a browser to call a local component provided by an embodiment of the present invention. As Figure 3 shown, step S300 specifically includes the following steps:

[0074] S310. Perform symmetric encryption on the request parameter format file and add a verification signature value.

[0075] During data transmission, to ensure information security, it is necessary to encrypt the sent request parameter format file to prevent it from being illegally intercepted by a third-party program. Therefore, the caller of the WEB server and the local device monitoring program need to pre-agree to use the SM4 symmetric encryption algorithm and unify the key standard, that is, the JSON or XML format request parameter format file to be sent needs to be encrypted through the SM4 algorithm before transmission. Thus, after receiving the encrypted data, the local device monitoring program decrypts it using the SM4 symmetric key agreed upon by both parties to restore the content of the original JSON or XML format request parameter format file. And it is necessary to attach a verification signature value. Specifically, use a pre-agreed signature private key to calculate the PKCS1 signature value for the sent JSON or XML format request parameter format file to obtain the verification signature value.

[0076] S320. Select a target request method according to business requirements and data volume. The target request method includes at least the GET request method and the POST request method.

[0077] In the embodiments of the present invention, according to different service requirements and data volumes, the WEB server can choose to use the GET request method or the POST request method to send the request parameter format file. The GET request method is usually used to obtain data, and the request parameters are appended to the query string of the URL. Due to the length limit of the URL, the GET request method may not be suitable for transmitting a large amount of data. The POST request is more suitable for sending a large amount of data because the data is included in the body part of the HTTP request and is not restricted by the URL length.

[0078] S330. Send the request parameter format file to the local device according to the target request method.

[0079] In the embodiments of the present invention, the WEB server can send a target request to a specified listening port of a local device (such as 127.0.0.1) through the HTTP protocol. Since the request is sent and received on the same device, the efficiency and security of data transmission can be greatly improved. The listening port is a pre-set network port, and the listening program on the local device will continuously wait on this port to receive requests from the WEB server. Once a request is received, the listening program can process the request according to its content and return the corresponding response result.

[0080] S400. Perform data verification on the request parameter format file, and perform data parsing on the request parameter format file after passing the data verification to obtain the request parameters.

[0081] In the embodiments of the present invention, the listening program on the local device has been running on the specified listening port, waiting to receive the request parameter format file from the WEB server. Once a request is received, the listening program will first perform verification to ensure that the request parameter format file is legal and secure. After passing the verification, the listening program will parse the data in the request parameter format file and call the methods or access the properties of the corresponding ActiveX component or COM component according to the interface name and interface parameters.

[0082] Optionally, the local listening program processes the received request parameter format file in a multi-threaded manner, supporting asynchronous processing. After receiving a request parameter format file, a thread is immediately established to process the current request parameter format file, and the thread resources are released after the request processing is completed. This can ensure that the main thread of the listening program is not blocked, and multiple tasks can be processed simultaneously, thereby improving the processing efficiency.

[0083] Figure 4 It is the fourth schematic diagram of the method flow for a browser to call a local component provided by the embodiments of the present invention. As Figure 4 shown, the data parsing specifically includes the following steps:

[0084] S410. Use the symmetric key to verify the legality of the verification signature value of the request parameter format file.

[0085] In the embodiment of the present invention, the listening program verifies the received PKCS1 signature value through the public key that matches the agreed signature private key. If the verification passes, the legality check is passed.

[0086] S420. Verify the data integrity and data format of the request parameter format file.

[0087] Before passing the request parameter format file to the ActiveX component or COM component, the listening program should verify the request parameter format file, including but not limited to checking the data format and data integrity.

[0088] First, the listening program checks whether the received data conforms to the expected format. Exemplarily, if the expected data is in JSON format, it verifies whether the data contains a valid JSON structure. To ensure security, the listening program verifies the source of the request, which can be achieved by checking the IP address of the request, the port number, and specific fields in the HTTP header, etc. The listening program may also verify the data integrity, for example, by checking whether the data contains the expected fields and the corresponding field values meet the requirements, or by calculating the hash value of the data and comparing it with the hash value provided by the sender.

[0089] Once the data verification passes, the listening program parses the request parameter format file into a format content that conforms to the interface specification of the local ActiveX component or COM component and passes it in.

[0090] S430. Extract data from the request parameter format file according to the target request method to obtain the request parameter string.

[0091] In the embodiment of the present invention, the listening program parses the HTTP request to extract the request parameter string. Specifically, it determines whether the request is a GET request or a POST request. For a GET request, it parses the query string part of the URL to extract the parameters in the form of key-value pairs. For a POST request, it parses the request body (such as JSON, XML, or form data) to extract the request parameter string.

[0092] S440. Perform data conversion on the request parameter string to obtain the initial request parameters.

[0093] In the embodiment of the present invention, the extracted request parameter string is usually in text format. To conform to the interface specification of the local ActiveX component or COM component, the listening program needs to convert these request parameter strings into appropriate data types to obtain the initial request parameters.

[0094] S450. Reorganize the initial request parameters to obtain the request parameters.

[0095] Before passing the initial request parameters to an ActiveX component or a COM component, the listener may need to recombine these initial request parameters into a structure that conforms to the component interface specification. For example, according to the specification of the component interface, create a structure or class instance; assign the converted parameter values to the properties or fields of the structure or class instance; if the component interface expects to receive nested structures or object graphs, the listener needs to construct these nested structures accordingly.

[0096] S500. Call the local component according to the request parameters to execute the corresponding methods and / or access the properties, and return the call result.

[0097] Figure 5 This is the fifth schematic diagram of the method flow for a browser to call a local component provided by an embodiment of the present invention. As Figure 5 shown, calling the local component specifically includes the following steps:

[0098] S510. Perform parameter verification on the request parameters.

[0099] In the embodiments of the present invention, after receiving the request parameters internally, the ActiveX component or the COM component will first perform parameter verification. Parameter verification includes, but is not limited to, checking whether the parameter types are correct, whether the parameter values are within the valid range, and whether all required parameters are provided.

[0100] S520. If the parameter verification is successful, call the local component to execute the corresponding methods and / or access the properties, and generate a call result for feedback.

[0101] In the embodiments of the present invention, if the parameter verification is successful, the ActiveX component or the COM component will execute the corresponding methods and / or access the properties according to the received request parameters. Specifically, by calling the functions inside the component or accessing the state variables of the component, if a method is called, the ActiveX component or the COM component will execute the logic defined by the method, including but not limited to calculations, data processing, and interactions with external systems. If an attribute access is called, such as obtaining or setting the value of an attribute, the ActiveX component or the COM component will read or update the corresponding state variable.

[0102] After executing a method and / or accessing an attribute, an ActiveX component or a COM component generates a call result. This call result can be a simple value (such as an integer, a floating-point number, and a string), or a more complex structure (such as a structure, an array, or an object). The ActiveX component or the COM component needs to return the generated call result to the WEB server, and determine whether the ActiveX component or the COM component is successfully called based on the return value.

[0103] S530. If the parameter verification fails, directly generate a call failure result for feedback.

[0104] If the parameter verification fails, the ActiveX component or the COM component usually returns an error code or throws an exception to notify the WEB server that there is a problem.

[0105] The method for a browser to call a local component provided by an embodiment of the present invention enables the browser to directly call locally registered ActiveX components and COM components by introducing an innovative browser adaptation layer, without the need for technical transformation of these components. Only by leveraging the JavaScript integration method supported by the browser can the technical development cost be significantly reduced and the development cycle be shortened. In addition, on the basis of retaining the original business logic and interface design, the present invention ensures that users can directly call ActiveX components and COM components on local devices using multiple browsers in an existing business system without additional transformation of the existing system. This feature not only avoids changing the user's operation habits but also further improves the user experience.

[0106] Embodiment 2

[0107] Based on the same technical concept as in Method Embodiment 1 above, an embodiment of the present invention provides a device for a browser to call a local component. Figure 6 It is a schematic structural diagram of the device for a browser to call a local component provided by an embodiment of the present invention. As Figure 6 shown, the device 600 for a browser to call a local component includes:

[0108] A parameter generation module 610, configured to generate request parameters according to business logic and user requirements.

[0109] A parameter conversion module 620, configured to perform serialization conversion on the request parameters to obtain a request parameter format file.

[0110] A file sending module 630, configured to encrypt the request parameter format file and select a target request method to send the request parameter format file to a local device.

[0111] The data parsing module 640 is configured to perform data verification on the request parameter format file, parse the request parameter format file after passing the data verification, and obtain request parameters.

[0112] The component calling module 650 is configured to call a local component according to the request parameters to execute corresponding methods and / or access attributes, and return a call result.

[0113] The device for a browser to call a local component provided by an embodiment of the present invention comprehensively verifies the format, source, integrity, and legality of request parameters at the same time, thereby effectively ensuring the accuracy and security of data, preventing illegal tampering and potential attack behaviors, improving the overall stability and security of the service system, and providing a more reliable technical guarantee for users.

[0114] It can be understood that the implementation manners in the method for a browser to call a local component described in the above Embodiment 1 are equally applicable to this embodiment and can achieve the same technical effects, so they will not be repeated here.

[0115] Embodiment 3

[0116] Based on the same concept, an embodiment of the present invention further provides an electronic device. Figure 7 It is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. As Figure 7 shown, the electronic device 700 may include: a processor 710, a communication interface 720, a memory 730, and a communication bus 740. Among them, the processor 710, the communication interface 720, and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call logic instructions in the memory 730 to execute the steps of the method for a browser to call a local component as described in the above embodiments. For example, it includes:

[0117] S100. Generate request parameters according to business logic and user requirements;

[0118] S200. Perform serialization conversion on the request parameters to obtain a request parameter format file;

[0119] S300. Encrypt the request parameter format file and select a target request method to send the request parameter format file to the local device;

[0120] S400. Perform data verification on the request parameter format file, parse the request parameter format file after passing the data verification, and obtain request parameters;

[0121] S500. Call a local component according to the request parameters to execute corresponding methods and / or access attributes, and return a call result.

[0122] Among them, the processor 710 may be a Central Processing Unit (CPU). The processor may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. chips, or a combination of the above types of chips.

[0123] In addition, when the logical instructions in the above-mentioned memory 730 can be implemented in the form of software functional units and sold or used as an independent product, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: USB flash drives, mobile hard disks, Read-Only Memories (ROMs), Random Access Memories (RAMs), magnetic disks, or optical discs, etc., various media that can store program codes.

[0124] The memory 730 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created by the processor, etc. In addition, the memory may include high-speed random access memory and may also include non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory optionally includes a memory remotely provided relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the above-mentioned network include but are not limited to the Internet, enterprise intranets, local area networks, mobile communication networks, and combinations thereof.

[0125] Embodiment 4

[0126] Based on the same concept, an embodiment of the present invention further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, which includes at least one piece of code. The at least one piece of code can be executed by a main control device to control the main control device to implement the steps of the method for a browser to call a local component as described in the above embodiments. For example, it includes:

[0127] S100. Generate request parameters according to business logic and user requirements;

[0128] S200. Perform serialization conversion on the request parameters to obtain a request parameter format file;

[0129] S300. Encrypt the data of the request parameter format file and select a target request method to send the request parameter format file to a local device;

[0130] S400. Perform data verification on the request parameter format file, and perform data parsing on the request parameter format file after passing the data verification to obtain request parameters;

[0131] S500. Call a local component according to the request parameters to execute corresponding methods and / or access attributes, and return a call result.

[0132] Based on the same technical concept, an embodiment of the present invention further provides a computer program. When the computer program is executed by a main control device, it is used to implement the above method embodiment.

[0133] In summary, the method, device, electronic device, and storage medium for a browser to call a local component provided by the present invention introduce an innovative browser adaptation layer, enabling the browser to directly call locally registered ActiveX components and COM components without technical transformation of these components. Only by relying on the JavaScript integration method supported by the browser can the technical development cost be significantly reduced and the development cycle be shortened. In addition, on the basis of retaining the original business logic and interface design, the present invention ensures that users can directly call ActiveX components and COM components on a local device using multiple browsers in an existing business system without additional transformation of the existing system. This feature not only avoids changing the user's operation habits but also further improves the user experience. At the same time, for request parameters, comprehensive verification is performed on their format, source, integrity, and legality, thereby effectively ensuring the accuracy and security of data, preventing illegal tampering and potential attack behaviors, improving the overall stability and security of the business system, and providing more reliable technical guarantees for users.

[0134] Reference to "embodiments" in this specification means that the specific features, structures, or characteristics described in connection with the embodiments can be included in at least one embodiment of the present application. The phrase appears in various places in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.

[0135] The above-described embodiments merely represent several implementation manners of the present invention. Their descriptions are relatively specific and detailed, but should not be construed as limiting the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present invention, several modifications and improvements can be made, and these all fall within the protection scope of the present invention. Therefore, the protection scope of the invention patent shall be subject to the appended claims.

[0136] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A method for a browser to call a native component, characterized in that The method includes: Generating request parameters according to business logic and user requirements; Performing serialization conversion on the request parameters to obtain a request parameter format file; Encrypting the data of the request parameter format file and selecting a target request method to send the request parameter format file to a local device; Performing data verification on the request parameter format file, and performing data parsing on the request parameter format file after passing the data verification to obtain the request parameters; Invoking a local component according to the request parameters to execute corresponding methods and / or access attributes, and returning a call result.

2. The method for a browser to call a local component according to claim 1, wherein The local component at least includes an ActiveX component and a COM component, and the request parameters at least include target component information, component interface name, and interface parameters, where: The target component information is used to identify information of a target local component; The component interface name is used to specify a method name and / or access attribute name of the target local component; The interface parameters are used to set parameters required for the method and / or access attribute.

3. The method for a browser to call a local component according to claim 2, wherein Performing serialization conversion on the request parameters to obtain a request parameter format file, including: Determining the serialization format of the request parameters according to the business logic; Encapsulating the request parameters according to the serialization format to obtain a parameter encapsulation structure; Converting the parameter encapsulation structure into a text format to obtain the request parameter format file.

4. The method for a browser to call a local component according to claim 1, wherein Encrypting the data of the request parameter format file and selecting a target request method to send the request parameter format file to a local device, including: Performing symmetric encryption on the request parameter format file and adding a verification signature value; Selecting a target request method according to business requirements and data volume, and the target request method at least includes a GET request method and a POST request method; Sending the request parameter format file to the local device according to the target request method.

5. The method for a browser to call a local component according to claim 4, wherein Performing data verification on the request parameter format file, including: Verifying the legality of the verification signature value of the request parameter format file by using a symmetric key; Verifying the data integrity and data format of the request parameter format file.

6. The method for a browser to call a local component according to claim 5, wherein Performing data parsing on the request parameter format file after passing the data verification to obtain the request parameters, including: Performing data extraction on the request parameter format file according to the target request method to obtain a request parameter string; Performing data conversion on the request parameter string to obtain initial request parameters; Performing data recombination on the initial request parameters to obtain the request parameters.

7. The method for a browser to call a local component according to claim 1, characterized in that Invoking a local component according to the request parameters to execute corresponding methods and / or access attributes, and returning a call result, including: Performing parameter verification on the request parameters; If the parameter verification is successful, invoking the local component to execute the corresponding methods and / or access attributes, and generating a call result for feedback; If the parameter verification fails, directly generating a call failure result for feedback.

8. A device for a browser to call a local component, characterized in that, The device includes: A parameter generation module, configured to generate request parameters according to business logic and user requirements; A parameter conversion module, configured to perform serialization conversion on the request parameters to obtain a request parameter format file; A file sending module, configured to encrypt data of the request parameter format file and select a target request method to send the request parameter format file to a local device; A data parsing module, configured to perform data verification on the request parameter format file, parse the request parameter format file after the data verification is passed, and obtain the request parameters; A component calling module, configured to call a local component according to the request parameters to execute corresponding methods and / or access attributes, and return a call result.

9. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the method for a browser to call a local component according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method for a browser to call a local component according to any one of claims 1 to 7.