A browser extension-based, seamless migration method, system, and medium for trusted innovation
Through browser extension plug-ins, seamless migration of Windows front-end applications is achieved on Linux systems, solving the problem of cross-system reuse, reducing development costs and time, and maintaining consistency in customer experience.
Patent Information
- Application Number
- CN202210762177.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-30
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2042-06-30
AI Technical Summary
In existing technologies, Windows front-end application systems cannot be reused across systems, resulting in repeated development and repeated testing of business front-end systems, increasing development costs and cycles, and failing to maintain a consistent customer experience.
Through browser extension plug-ins, the browser extension layer, front-end customization service layer and middleware service layer are used to realize the conversion of browser peripheral interfaces and WebSocket communication, ensuring that the front-end application system on the Windows side can be migrated to the Linux system without modification, maintaining the consistency of code functions and performance.
It achieves seamless migration of front-end application systems, shortens the migration time of trusted computing, reduces workload and difficulty, and ensures code reuse across system platforms and consistency of customer experience.
Smart Images

Figure CN115292632B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of browser extension plug-ins, and in particular to a method, system and medium for seamless migration of trusted computing based on browser extension plug-ins. Background Art
[0002] The Protocol for Intelligence Terminal Standards Architecture (PISA), a standard system architecture for intelligent terminals, is also known as the PISA protocol. It is a financial driver service specification under the Linux system and is currently the most widely used peripheral access standard in the field of financial self-service information innovation. The Chromium browser in the information innovation field is a widely used open source browser that provides an extension plug-in mechanism, namely Extension, to enhance browser functionality. By using the interface provided by Chromium, namely API, Extension can access the network, modify browsing behavior, manipulate web page content, trigger network communication, etc.
[0003] For financial self-service business systems, to achieve self-service control of financial self-service systems, it is necessary to develop or migrate self-service business systems in a trustworthy and innovative environment based on self-service secure CPUs, motherboards, and operating systems. Figure 1 As shown, various business components ultimately need to call peripherals through a universal channel JS component. The JS component implements specific peripheral calls through the C# peripheral service window.bridge.sendMessage method. The peripheral service then loads a custom logic processing library. This logic processing library, depending on the specific business request, calls a combination of third-party and system APIs, or calls peripheral middleware interfaces such as the PIN pad and second-generation ID card, ultimately implementing the peripheral call. Within the entire Windows framework, the custom browser is written using the C# .NET framework, using Internet Explorer as the browser core, an OCX control as the peripheral middleware, and the SP standard of WOSA-XFS based on the Windows Message Messaging mechanism. Because the .NET framework, IE browser, OCX control, WOSA-XFS, and other components are strongly dependent on the Windows system, cross-system reuse of the entire Windows front-end application system is completely impossible.
[0004] To reduce duplicate development and testing of front-end systems, shorten development costs and cycles, and maintain a consistent customer experience, we must reuse the business logic code on the Windows platform, keeping the front-end code largely unchanged. To achieve this, we designed a cross-platform front-end business system platform that can migrate the front-end code intact to a fully compatible container. Summary of the Invention
[0005] The present invention provides a method, system and medium for seamless migration of trusted innovation based on browser extension plug-ins. Through the browser plug-in, namely the browser extension layer, front-end customization service and middleware service, it ensures that the upper-layer application can be migrated from the Windows side to the domestic Linux system with zero modification, maintaining the complete consistency of code functions and product performance, and truly realizing code-level seamless migration.
[0006] In a first aspect, the present invention provides a method for seamless migration based on a browser extension plug-in, comprising:
[0007] The browser extension layer converts browser peripheral interface calls into WebSocket communication messages and sends them to the front-end customized service layer; the interface types include synchronous peripheral interface, asynchronous peripheral interface, and local API interface;
[0008] The front-end customized service layer parses the WebSocket communication message and executes the corresponding interface call strategy according to the parsing result; the interface call strategy includes synchronous call strategy, asynchronous call strategy, and local API call strategy;
[0009] If the local API call strategy is executed, the front-end customized service layer calls the local API interface and obtains the execution result. If the synchronous call strategy or asynchronous call strategy is executed, the middleware service layer is called to respond. The middleware service layer completes the response by calling the device SP service layer. The device SP service layer returns the execution result to the middleware service layer, and then the middleware service layer sends the execution result to the front-end customized service layer.
[0010] The front-end customized service layer returns the execution result to the browser extension layer, and the browser extension layer transmits the execution result to the browser page.
[0011] Furthermore, the browser extension layer converts the browser's call request to the peripheral interface into a WebSocket communication message and sends it to the front-end customized service layer, specifically including:
[0012] Call the peripheral interface in the browser business process and convert the peripheral interface into a unified universal peripheral calling interface;
[0013] The browser extension layer is reconstructed to implement a unified universal peripheral calling interface, and the interface is converted into a WebSocket communication message and sent to the front-end customized service layer.
[0014] Furthermore, the front-end customized service layer parses the WebSocket communication message and executes the corresponding interface call strategy according to the parsing result, specifically including:
[0015] The customized WebSocket service in the front-end customized service layer loads the logic processing library and calls the plug-in initialization function of the logic processing library, passing the callback function pointer as the input parameter of the initialization function;
[0016] The customized WebSocket service in the front-end customized service layer parses the received WebSocket communication message and converts it into a call to the task sending interface of the logic processing library;
[0017] After receiving the call request, the logic processing library queries the local method map in the library. If a local method is found, the local API call strategy is adopted; if not, the interface call is converted into an Http message call and a synchronous call strategy or an asynchronous call strategy is executed.
[0018] Furthermore, the local API call policy execution process includes:
[0019] The logic processing library in the front-end custom service layer loads and calls third-party SDKs or system interfaces;
[0020] The logic processing library of the front-end custom service layer converts the call results of the SDK or system interface into callback function input parameters, calls back to the custom WebSocket service, and returns it to the browser extension layer through WebSocket communication.
[0021] Furthermore, the synchronous call strategy execution process includes:
[0022] The middleware service layer determines the input parameters according to Devid and FuncName, converts the HTTP message into the task queue of the module corresponding to Devid, and adds the globally incremented repid parameter;
[0023] The Devid module process obtains tasks from the input task queue, starts thread processing, and checks the asynchronous flag of the input parameter. When the flag is 0, it calls the synchronous interface of the device SP service layer.
[0024] The device SP service layer completes the call to the device module through the U port or serial port, and returns the execution result and output parameters to the middleware service layer;
[0025] The middleware service layer adds the execution results and output parameters of the device SP service layer to the output queue and saves the repid parameter passed in previously;
[0026] The middleware service layer obtains tasks from the output queue and converts them into the json message required by Http;
[0027] The middleware service layer returns the task execution results to the logic processing library in the front-end customization layer through the Http service.
[0028] Furthermore, the asynchronous call strategy execution process includes:
[0029] The middleware service layer determines the input parameters according to Devid and FuncName, converts the HTTP message into the task queue of the module corresponding to Devid, and adds the globally incremented repid parameter;
[0030] Each module process cyclically obtains tasks from the input task queue, starts thread processing, and makes a judgment based on the synchronous and asynchronous flag parameter in the input parameter. When its value is 1, the asynchronous interface of the device SP service layer is called. If the call fails, the process events generated by the device SP service layer during the interface execution and the asynchronous completion events of the execution are uploaded to the middleware service layer through customized Socket communication; otherwise, the device SP service layer completes the call to the device module through the U port or serial port;
[0031] The middleware service layer adds the event name and parameters to the output queue and sets the repid to -1.
[0032] The middleware service layer obtains the job from the output queue and converts the job into a WebSocket message if the repid is -1.
[0033] The middleware service layer returns the task execution results and process events to the logic processing library in the front-end custom service layer through the WebSocket service.
[0034] Furthermore, the front-end customization service layer returns the execution result to the browser extension layer; the browser extension layer transmits the execution result to the browser page, specifically including:
[0035] The WebSocket service of the front-end custom service layer processes the callback function: it converts the input parameters into a WebSocket message, uses this message as the input parameter, sets the execution method parameter to the JS method, and sends it to the WebSocket client;
[0036] In the browser extension layer, the received WebSocket messages are classified and processed according to the method parameter;
[0037] In the browser extension layer, if the method parameter is to execute the JS method, the JS execution is performed directly on the parameter, that is, the global message response method is executed in the script area and the result is transmitted to the browser page; otherwise, according to different method parameters, it is directly implemented in the browser extension layer and the result is transmitted to the browser page.
[0038] In a second aspect, the present invention provides a browser extension plug-in-based trust innovation and seamless migration system, comprising:
[0039] Front-end application module, front-end customized service layer module, middleware service layer module, device SP service layer module;
[0040] The front-end application module is used to start the front-end application browser and load the browser extension layer; the browser extension layer sends all peripheral call requests of each business component to the front-end customized service layer through the WebSocket communication module; the browser extension layer transmits the execution results to the front-end application browser page;
[0041] The front-end customized service layer module is used to perform interface parsing on the call request received by the front-end customized service layer, obtain the execution result by adopting the interface call strategy, and return the execution result to the browser extension layer; wherein the interface type includes synchronous peripheral interface, asynchronous peripheral interface, and local API interface; the interface call strategy includes synchronous call strategy, asynchronous call strategy, and local API call strategy;
[0042] The middleware service layer module is used to respond by adopting a synchronous call strategy or an asynchronous call strategy according to the parsing result of the front-end customized service layer; and call the device SP service layer to complete the response, and send the response execution result returned to the middleware service layer to the front-end customized service layer;
[0043] The device SP service layer module is used to receive application layer instructions through the SP API interface, convert application instructions into SP execution instructions, complete device specific operations through the U port and serial port, and return the execution result service program to the middleware service layer.
[0044] Furthermore, the front-end customized service layer and the middleware service layer use native Http communication to complete synchronous and asynchronous interface calls and synchronous result returns, and use native WebSocket communication to complete message transmission of asynchronous execution results and process events; the browser extension layer and the front-end customized service layer use native WebSocket communication to complete message transmission.
[0045] In the third aspect, the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-mentioned browser extension plug-in-based seamless migration method.
[0046] Beneficial effects
[0047] The present invention provides a method, system and medium for seamless migration of trusted innovation systems based on browser extension plug-ins. By utilizing the high embeddability of browser plug-ins and the high scalability of Linux services, the trusted innovation migration of front-end application systems can be achieved without any modification of the application code, which greatly shortens the trusted innovation migration time, reduces the trusted innovation migration workload and work difficulty, and truly realizes seamless trusted innovation migration. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 This is the original Windows system architecture diagram provided by the implementation case of the present invention;
[0049] Figure 2 This is an overall schematic diagram of the cross-system front-end business platform provided by the implementation case of the present invention;
[0050] Figure 3 This is a timing diagram of a synchronous peripheral interface provided by an embodiment of the present invention;
[0051] Figure 4 This is a timing diagram of an asynchronous peripheral interface provided by an embodiment of the present invention;
[0052] Figure 5 This is a timing diagram of a local API interface call provided by an embodiment of the present invention;
[0053] Figure 6 This is a timing diagram of an implementation example provided by the present invention. DETAILED DESCRIPTION
[0054] How to achieve the migration of front-end applications without any changes to the front-end applications, and also make the message communication between the two processes fast, stable, and highly decoupled. The following is a further explanation of the implementation methods of synchronous peripheral interfaces, asynchronous peripheral interfaces, and local API interfaces in conjunction with the embodiments.
[0055] The present invention is mainly explained based on the Chromium browser, but other common browsers such as Chrome and FireFox can also be supported. The self-looping network communication in this solution, that is, the communication IP used for the local network communication is a fixed 127.0.01, and the data is directly transmitted from the local sending protocol stack to the receiving protocol stack for message communication between the two processes. This embodiment uses two local WebSocket communications and Http communications: the browser extension layer and the front-end customized service layer use local WebSocket communication to complete all message transmission; and the front-end customized service layer and the middleware service layer use local Http communication to complete synchronous and asynchronous interface calls and synchronous result returns, and use local WebSocket communication to complete asynchronous execution results and process event message transmission.
[0056] The present invention comprises a browser extension layer, a front-end customization service layer, a middleware service layer, and a device SP service layer.
[0057] Browser extension layer: The browser extension layer is responsible for converting browser peripheral call requests (including but not limited to synchronous calls, asynchronous calls, and local API calls) into channel function calls of the browser extension layer through the global window object. The browser extension layer also reconstructs the original peripheral call channel interface function. In this reconstructed function, the peripheral interface call is converted into a WebSocket communication message and sent to the front-end custom service layer for implementation. Finally, the WebSocket communication response function converts the custom service execution result into a JS execution parameter, and executes the JS command callback to the browser extension layer.
[0058] Front-end Custom Service Layer: The front-end custom service layer is divided into two parts. The WebSocket service serves as the process and communication agent, completing WebSocket communication and converting messages into interface calls. The logic processing library, acting as the logic processing agent, provides two types of methods: an interface for logging custom services, which is relatively simple in function and design; and a functional messaging interface, such as the plugin initialization interface and the plugin message sending interface. The plugin message sending interface in the logic processing library converts all peripheral calls into HTTP communication messages. Interface execution results or process events are returned via this HTTP or another WebSocket communication method.
[0059] Middleware service layer: The peripheral service serves as the call processing service for all self-service device peripheral modules. It adopts independent communication service processes, sub-service processes for each module, and global double-ended queues to achieve multi-concurrency, high decoupling and other functional features. It provides functional interfaces including but not limited to password keyboards, card readers, receipt printers and other modules, and provides Http, WebSocket services and message processing and conversion functions for communication with the customized service layer.
[0060] Device SP service layer: receives application layer instructions through the SP API interface, converts application instructions into SP execution commands, and completes specific device operations through the USB port and serial port; and returns execution results and process events in a targeted manner based on the differences between synchronous and asynchronous calls in the middleware service layer.
[0061] Example 1
[0062] like Figure 2 、 3 As shown in the figure, when the interface is a synchronous peripheral interface, the specific implementation steps of the synchronous call strategy are as follows:
[0063] Step 1: When the browser starts, load the browser extension layer, such as Extension.js.
[0064] Step 2: Call the peripheral synchronization interface in the browser business process, such as the module status query of the second-generation ID card reading module; and convert the peripheral interface call into a unified general peripheral call interface.
[0065] Step 3: Reconstruct the browser extension layer to implement a unified universal peripheral calling interface and convert the interface into a WebSocket communication message.
[0066] Step 4: Send a WebSocket message: If the sending fails, go to step 16; otherwise, go to step 5.
[0067] Step 5: The customized WebSocket service in the front-end customized service layer loads the logic processing library and calls the plug-in initialization function of the logic processing library, passing the callback function pointer as the input parameter of the initialization function.
[0068] Step 6: The customized WebSocket service in the front-end customized service layer parses the received communication message and converts it into a call to the task sending interface of the logic processing library. If the call fails, the callback function is called and step 14 is executed; otherwise, step 7 is executed.
[0069] Step 7: After receiving the call request, the logic processing library in the front-end customized service layer queries the local method Map (STL associative container) in this library: if no method is found, the interface call is converted into an Http message call. If the Http message fails to be sent, the interface directly returns failure; otherwise, proceed to step 8.
[0070] Step 8: The middleware service layer determines based on the Devid and FuncName in the input parameters, converts the Http message and inputs it into the task queue of the module corresponding to Devid, and adds the globally incremented repid parameter; if the parameter is illegal, directly execute step 13, otherwise execute step 9.
[0071] Step 9: The corresponding module process of Devid obtains the task from the input task queue, starts thread processing, and determines the asynchronous flag of the input parameter. When the value of the asynchronous flag is 0, the synchronous interface of the device SP service layer is called. If the call fails, step 11 is directly executed. If the call succeeds, step 10 is executed.
[0072] Step 10: The device SP service layer completes the call to the device module through the U port or serial port, and returns the execution result and output parameters to the middleware service layer.
[0073] Step 11: The middleware service layer adds the execution result and output parameters of the device SP service layer to the output queue. If the execution fails, only the execution result is returned and the repid parameter passed in step 8 is saved.
[0074] Step 12: The middleware service layer obtains the task from the output queue and converts it into the JSON message required by Http.
[0075] Step 13: The middleware service layer returns the task execution results to the logic processing library in the front-end custom service layer through the Http service.
[0076] Step 14: The logic processing library in the front-end customized service layer converts the HTTP message into the input parameters of the callback function, reorganizes the parameters into the form of Func("+retData+"), and calls the callback function.
[0077] Step 15: The customized WebSocket service in the front-end customized service layer processes the callback function: it converts the input parameters into a WebSocket message, uses this message as the input parameter, fixes the execution method parameter to the execution JS method (such as runJS), and sends it to the WebSocket client.
[0078] Step 16: In the browser extension layer, the received WebSocket message is classified and processed according to the method parameter.
[0079] Step 17: In the browser extension layer, when the method parameter is to execute a JS method (such as runJS), the JS is directly executed on the parameter, that is, the global message response method is executed in the script area, and the result is transmitted to the front-end application browser page.
[0080] Example 2
[0081] like Figure 2 、 4 As shown in the figure, when the interface is an asynchronous peripheral interface, the specific implementation steps of the asynchronous call strategy are as follows:
[0082] Step 1: When the browser starts, load the browser extension layer, such as Extension.js.
[0083] Step 2: Call the peripheral asynchronous interface in the browser business process, such as the card insertion and reading module of the second-generation card; and convert the peripheral interface call into a unified general peripheral call interface.
[0084] Step 3: Reconstruct the browser extension layer to implement a unified universal peripheral calling interface and convert the interface into a WebSocket communication message.
[0085] Step 4: Send the WebSocket message: If the sending fails, go to step 16; otherwise, go to step 5.
[0086] Step 5: The customized WebSocket service in the front-end customized service layer loads the logic processing library and calls the plug-in initialization function of the logic processing library, passing the callback function pointer as the input parameter of the initialization function.
[0087] Step 6: The custom logic processing library in the front-end custom service layer establishes a long WebSocket link with the middleware service layer for the middleware service layer to asynchronously complete events and process events.
[0088] Step 7: The WebSocket service in the front-end custom service layer parses the received communication message and converts it into a call to the task sending interface of the logic processing library. If the call fails, the callback function is called and step 14 is executed; otherwise, step 8 is executed.
[0089] Step 8: After receiving the call request, the logic processing library in the front-end custom service layer queries the local method map (STL associative container) within the library. If no method is found, the interface call is converted to an HTTP message call. If the HTTP message fails, the interface directly returns a failure. Otherwise, proceed to step 9.
[0090] Step 9: The middleware service layer determines based on the Devid and FuncName in the input parameters, converts the Http message and inputs it into the task queue of the module corresponding to Devid, and adds the globally incremented repid parameter; if the parameter is illegal, directly execute step 13, otherwise execute step 10.
[0091] Step 10: In each module process, the task is obtained from the input task queue in a loop, thread processing is started, and the synchronous and asynchronous flag parameters in the input parameters are judged. When the value is 1, the asynchronous interface of the SP is called. If the call fails, step 12 is directly executed, otherwise step 11 is performed.
[0092] Step 11: The device SP service layer completes the call to the device module through the U or serial port.
[0093] Step 12: The device SP service layer uploads the process events (such as the card insertion event CardInsert) and the asynchronous completion event of the execution completion generated during the interface execution process to the middleware service layer through customized Socket communication.
[0094] Step 13: The middleware service layer adds the event name and parameters to the output queue and sets the repid to -1.
[0095] Step 14: The middleware service layer obtains the task from the output queue. If the repid is -1, the task is converted into a WebSocket message.
[0096] Step 15: The middleware service layer returns the task execution results and process events to the logic processing library in the front-end custom service layer through the WebSocket communication service.
[0097] Step 16: The logic processing library in the front-end custom service layer converts the WebSocket message into the input parameters of the callback, reorganizes the input parameters into the form of eventName "("+retData+");", and calls the callback function.
[0098] Step 17: Implement the callback function for the customized WebSocket communication in the front-end customized service layer: convert the input parameters into a WebSocket message, use this message as the input parameter, fix the execution method parameter to the execution JS method (such as runJS), and send it to the client.
[0099] Step 18: At the browser extension layer, the received WebSocket message is classified and processed according to the method parameter.
[0100] Step 19: In the browser extension layer, if the method parameter is the execution function of the JS method (such as runJS), the eventName function pre-defined on the page is directly executed to transmit the asynchronous completion result or process event to the browser page.
[0101] Example 3
[0102] like Figure 2 、 5 As shown, when the interface is a local API interface, the specific implementation steps of the local API call strategy are as follows:
[0103] Step 1: When the browser starts, load the browser extension layer, such as Extension.js.
[0104] Step 2: Call the local API interface of the peripherals in the browser business process, such as the input method soft keyboard, PDF display and other interfaces, and convert the peripheral interface calls into a unified universal peripheral call interface.
[0105] Step 3: The browser extension layer classifies the local methods. If the JS layer has implementable methods (such as PDF display, returning to the homepage, etc.), execute step 13; otherwise, execute step 4.
[0106] Step 4: For interfaces that rely on third-party plug-ins, reconstruct the general peripheral call interface at the browser extension layer and convert it into a WebSocket communication message.
[0107] Step 5: The browser extension layer sends a WebSocket communication message. If the sending fails, execute step 13; otherwise, execute step 5.
[0108] Step 6: The customized WebSocket service in the front-end customized service layer loads the logic processing library, calls the plug-in initialization function, and passes the callback function pointer as the input parameter of the initialization function to the logic processing library.
[0109] Step 7: After receiving the call request, the logic processing library in the front-end customized service layer queries the local method Map (STL associative container) in the library. After finding the method, it proceeds to step 8. Otherwise, it automatically enters the general synchronous and asynchronous interface call process.
[0110] Step 8: The logic processing library in the front-end customized service layer loads and calls the third-party SDK or system interface.
[0111] Step 9: The logic processing library in the front-end custom service layer converts the call result of step 8 into the input parameters of the callback function, reorganizes the input parameters into a form similar to Func("+retData+"), and calls the callback function.
[0112] Step 10: Implement the callback function for the customized WebSocket communication in the front-end customized service layer: convert the input parameters into a WebSocket message, use this message as the input parameter, fix the execution method parameter to the execution JS method (such as runJS), and send it to the client.
[0113] Step 11: In the browser extension layer, the received WebSocket message is classified and processed according to the method parameter.
[0114] Step 12: In the browser extension layer, when the method parameter is to execute the JS method, the JS execution is directly performed on the parameter, that is, the global message response method is executed in the script area and the result is transmitted to the page; otherwise, according to different method parameters, it is directly implemented in the browser extension layer and the result is transmitted to the page.
[0115] Example 4
[0116] This embodiment provides a browser extension plug-in-based seamless migration system, including:
[0117] Front-end application module, front-end customized service layer module, middleware service layer module, device SP service layer module;
[0118] The front-end application module is used to start the front-end application browser and load the browser extension layer; the browser extension layer sends all peripheral call requests of each business component to the front-end customized service layer through the WebSocket communication module; the browser extension layer transmits the execution results to the front-end application browser page;
[0119] The front-end customized service layer module is used to perform interface parsing on the call request received by the front-end customized service layer, obtain the execution result by adopting the interface call strategy, and return the execution result to the browser extension layer; wherein the interface includes a synchronous peripheral interface, an asynchronous peripheral interface, and a local API interface; the interface call strategy includes a synchronous interface call strategy, an asynchronous interface call strategy, and a local API interface call strategy;
[0120] The middleware service layer module is used to respond with a synchronous call strategy or an asynchronous call strategy according to the parsing result of the front-end customized service layer; and call the device SP service layer to complete the response, and send the response execution result returned to the middleware service layer to the front-end customized service layer;
[0121] The device SP service layer module is used to receive application layer instructions through the SP API interface, convert application instructions into SP execution instructions, complete device specific operations through the U port and serial port, and return the execution result service program to the middleware service layer.
[0122] The synchronous calling strategy, asynchronous calling strategy, and local API calling strategy in this embodiment are the same as those in Example 1, Example 2, and Example 3, respectively, and thus will not be described in detail.
[0123] Example 5
[0124] The present invention provides a readable storage medium that stores a computer program, which is called by a processor to execute: the steps of the browser extension plug-in-based seamless migration method.
[0125] Please refer to the above description for the specific implementation process of each step, and the present invention will not go into details here.
[0126] It should be understood that in the embodiments of the present invention, the processor referred to may be a central processing unit (CPU), and 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, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The memory may include a read-only memory and a random access memory, and provides instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.
[0127] The readable storage medium is a computer-readable storage medium, which may be an internal storage unit of the controller described in any of the aforementioned embodiments, such as a hard disk or memory of the controller. The readable storage medium may also be an external storage device of the controller, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the controller. Furthermore, the readable storage medium may also include both an internal storage unit of the controller and an external storage device. The readable storage medium is used to store the computer program and other programs and data required by the controller. The readable storage medium may also be used to temporarily store data that has been output or is to be output.
[0128] Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned readable storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0129] like Figure 6 As shown, the present invention can be applied to the ICT transformation needs of the front-end business system where all business logics are implemented using HTML+JS, and its support for front-end services and middleware services adopts a mixed method of C++ and Python, and can run on all Windows systems and Linux systems. A solution with multi-end input queues and single-end output queues is adopted to queue and thread the execution of input commands and the sending of output results to achieve concurrent response support for the overall solution: that is, each peripheral module creates an independent process and input queue according to the module name to ensure that instructions from different modules can be called concurrently. Different commands of the same module are distinguished by different repids, and calls to SP are converted into asynchronous calls through the middleware library to remove the single-channel constraints of the SP manager; and asynchronous events are directly distinguished by unique event names. By utilizing the high embeddability of browser plug-ins and the high scalability of Linux services, the ICT migration of the front-end application system can be achieved without any modification of the application code, which greatly shortens the ICT migration time, reduces the workload and difficulty of ICT migration, and truly realizes ICT seamless migration. It completes the call of peripherals based on the PISA (compatible with WOSA-XFS under Windows) specification and is compatible with multiple equipment manufacturers; it can complete compatibility with peripherals in the fields of government affairs, taxation, transportation, etc., and is applicable to multiple operating systems such as Windows and Linux.
[0130] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.
Claims
1. A browser plug-in-based seamless migration method, characterized in that: include: The browser extension layer converts browser peripheral interface calls into WebSocket communication messages and sends them to the front-end customized service layer; the interface types include synchronous peripheral interface, asynchronous peripheral interface, and local API interface; The front-end customized service layer parses the WebSocket communication message and executes the corresponding interface call strategy according to the parsing result; the interface call strategy includes synchronous call strategy, asynchronous call strategy, and local API call strategy; If the local API call strategy is executed, the front-end customized service layer calls the local API interface and obtains the execution result. If the synchronous call strategy or asynchronous call strategy is executed, the middleware service layer is called to respond. The middleware service layer completes the response by calling the device SP service layer. The device SP service layer returns the execution result to the middleware service layer, and then the middleware service layer sends the execution result to the front-end customized service layer. The front-end custom service layer returns the execution result to the browser extension layer, and the browser extension layer transmits the execution result to the browser page; The browser extension layer converts the browser peripheral interface call request into a WebSocket communication message and sends it to the front-end customized service layer, specifically including: Call the peripheral interface in the browser business process and convert the peripheral interface call into a unified universal peripheral call interface; The browser extension layer is reconstructed to implement a unified universal peripheral calling interface, which is converted into a WebSocket communication message and sent to the front-end customized service layer.
2. According to the browser plug-in-based seamless migration method of claim 1, it is characterized in that: The front-end customized service layer parses the WebSocket communication message and executes the corresponding interface call strategy according to the parsing result, specifically including: The customized WebSocket service in the front-end customized service layer loads the logic processing library and calls the plug-in initialization function of the logic processing library, passing the callback function pointer as the input parameter of the initialization function; The customized WebSocket service in the front-end customized service layer parses the received WebSocket communication message and converts it into a call to the task sending interface of the logic processing library; After receiving the call request, the logic processing library queries the local method map in the library. If a local method is found, the local API call strategy is adopted; if not, the interface call is converted into an Http message call and a synchronous call strategy or an asynchronous call strategy is executed.
3. The browser plug-in-based seamless migration method according to claim 2 is characterized in that: The local API call policy execution process includes: The logic processing library in the front-end custom service layer loads and calls third-party SDKs or system interfaces; The logic processing library of the front-end custom service layer converts the call results of the SDK or system interface into callback function input parameters, calls back to the custom WebSocket service, and returns it to the browser extension layer through WebSocket communication.
4. The browser plug-in-based seamless migration method according to claim 2 is characterized in that: The synchronous call strategy execution process includes: The middleware service layer determines the input parameters according to Devid and FuncName, converts the HTTP message into the task queue of the module corresponding to Devid, and adds the globally incremented repid parameter; The Devid module process obtains tasks from the input task queue, starts thread processing, and checks the asynchronous flag of the input parameter. When the flag is 0, it calls the synchronous interface of the device SP service layer. The device SP service layer completes the call to the device module through the U port or serial port, and returns the execution result and output parameters to the middleware service layer; The middleware service layer adds the execution results and output parameters of the device SP service layer to the output queue and saves the repid parameter passed in previously; The middleware service layer obtains tasks from the output queue and converts them into the json message required by Http; The middleware service layer returns the task execution results to the logic processing library in the front-end custom service layer through the Http service.
5. The browser plug-in-based seamless migration method according to claim 2 is characterized in that: The asynchronous call strategy execution process includes: The middleware service layer determines the input parameters according to Devid and FuncName, converts the HTTP message into the task queue of the module corresponding to Devid, and adds the globally incremented repid parameter; Each module process cyclically obtains tasks from the input task queue, starts thread processing, and makes a judgment based on the synchronous and asynchronous flag parameter in the input parameter. When its value is 1, the asynchronous interface of the device SP service layer is called. If the call fails, the process events generated by the device SP service layer during the interface execution and the asynchronous completion events of the execution are uploaded to the middleware service layer through customized Socket communication; otherwise, the device SP service layer completes the call to the device module through the U port or serial port; The middleware service layer adds the event name and parameters to the output queue and sets the repid to -1. The middleware service layer obtains the job from the output queue and converts it into a WebSocket message when the repid is -1. The middleware service layer returns the task execution results and process events to the logic processing library in the front-end custom service layer through the WebSocket service.
6. The browser plug-in-based seamless migration method according to claim 1 is characterized in that: The front-end customization service layer returns the execution result to the browser extension layer; the browser extension layer transmits the execution result to the browser page, specifically including: The customized WebSocket service in the front-end customized service layer processes the callback function: it converts the input parameters into a WebSocket message, uses this message as the input parameter, sets the execution method parameter to the JS method, and sends it to the WebSocket client. In the browser extension layer, the received WebSocket messages are classified and processed according to the method parameter; In the browser extension layer, if the method parameter is to execute the JS method, the JS execution is performed directly on the parameter, that is, the global message response method is executed in the script area and the result is transmitted to the browser page; otherwise, according to different method parameters, it is directly implemented in the browser extension layer and the result is transmitted to the browser page.
7. A browser plug-in-based seamless migration system, characterized in that: include: Front-end application module, front-end customized service layer module, middleware service layer module, device SP service layer module; The front-end application module is used to start the front-end application browser and load the browser extension layer; the browser extension layer sends all peripheral interface call requests of each business component to the front-end customized service layer through the WebSocket communication module; the browser extension layer transmits the execution results to the front-end application browser page; The browser extension layer converts the browser peripheral interface call request into a WebSocket communication message and sends it to the front-end customized service layer, specifically including: Call the peripheral interface in the browser business process and convert the peripheral interface call into a unified universal peripheral call interface; The browser extension layer is restructured to implement a unified universal peripheral call interface, which is converted into a WebSocket communication message and sent to the front-end customized service layer; The front-end customized service layer module is used to perform interface parsing on the call request received by the front-end customized service layer, obtain the execution result using the interface call strategy, and return the execution result to the browser extension layer; the interface types include synchronous peripheral interface, asynchronous peripheral interface, and local API interface; the interface call strategy includes synchronous call strategy, asynchronous call strategy, and local API call strategy; The middleware service layer module is used to respond by adopting a synchronous call strategy or an asynchronous call strategy according to the parsing result of the front-end customized service layer; and call the device SP service layer to complete the response, and send the response execution result returned to the middleware service layer to the front-end customized service layer; The device SP service layer module is used to receive application layer instructions through the SP API interface, convert application instructions into SP execution instructions, complete device specific operations through the U port and serial port, and return the execution result service program to the middleware service layer.
8. The browser plug-in-based seamless migration system according to claim 7 is characterized in that: The front-end customized service layer and the middleware service layer use local Http communication to complete synchronous and asynchronous interface calls and synchronous result returns, and use local WebSocket communication to complete message transmission of asynchronous execution results and process events; the browser extension layer and the front-end customized service layer use local WebSocket communication to complete message transmission.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by the processor, the steps of the browser plug-in-based seamless migration method as described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Websocket-based front bank transaction system building method
CN104463670A
Method for interacting with desktop application in webpage
CN111611052A