Plug-in processing method, device, electronic device and computer program product
By using the translation environment and the interface of the target application simulation terminal in a Linux operating system with non-X86 architecture, the problem that browser controls cannot be displayed normally on non-X86 architecture platforms is solved, and function extension and session information are achieved consistency.
Patent Information
- Application Number
- CN202411399691.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-10-08
AI Technical Summary
There are very few browser controls developed under Linux operating systems with non-X86 architecture, and the browser controls under Windows operating systems with X86 architecture cannot run directly under Linux operating systems with non-X86 architecture, resulting in limited functions.
By calling the interface of the target application simulation end in the translation environment, the session information in the local environment is obtained and encrypted and stored, the target application plug-in is normally displayed and functionally expanded on non-X86 architecture platforms.
It implements application controls under the Windows operating system of X86 architecture under the Linux operating system of non-X86 architecture, enriches browser functions, and ensures the consistency of session information to avoid reading errors.
Smart Images

Figure CN118916101B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a plug-in processing method, device, electronic device and computer program product. Background Art
[0002] In the field of network informatization, there are many types of application controls developed under the Windows operating system based on the X86 architecture, but there are very few application controls developed under the Linux operating system based on the non-X86 architecture. For example, for browsers, there are many types of browser controls developed under the Windows operating system based on the X86 architecture, and these browser controls enrich the functions of the browser. For example, controls such as Flash and silverlgitht can support streaming media functions; for another example, controls such as owc and supcan can support data reporting functions, and so on.
[0003] However, there are very few browser controls developed under non-X86 architecture Linux operating systems, and these browser controls under X86 architecture Windows operating systems cannot be directly run in browsers under non-X86 architecture Linux operating systems, resulting in limited browser functions under non-X86 architecture Linux operating systems. Summary of the invention
[0004] In view of the above problems, an embodiment of the present invention is proposed to provide a plug-in processing method that overcomes the above problems or at least partially solves the above problems, which can correctly load the target application plug-in in the display translation environment in the local target application, thereby enabling applications under the non-X86 architecture Linux operating system to use application controls under the X86 architecture Windows operating system, thereby enriching the application functions under the non-X86 architecture Linux operating system.
[0005] Correspondingly, the embodiment of the present invention also provides a plug-in processing device, an electronic device, and a computer program product to ensure the implementation and application of the above method.
[0006] In a first aspect, an embodiment of the present invention discloses a plug-in processing method, the method comprising:
[0007] When the target application plug-in in the translation environment executes the target function, the first interface of the target application simulation end in the translation environment is called; the first interface of the target application simulation end is used to perform a first interaction with the local target application in the local environment through the local plug-in library in the local environment to obtain the session information stored by the local target application in the local environment database;
[0008] The target application simulation terminal encrypts and stores the acquired session information in a translation environment database;
[0009] During the process of the target application plug-in executing the target function, when a network request operation is executed to request the server to obtain target data, the session information is read from the translation environment database, and the network request operation is executed based on the session information to obtain the target data.
[0010] In a second aspect, an embodiment of the present invention discloses a plug-in processing device, the device comprising a target application plug-in and a target application simulation terminal in a translation environment, and a local target application and a local plug-in library in a local environment, wherein:
[0011] The target application plug-in is used to call the first interface of the target application simulation end in the translation environment when executing the target function; the first interface of the target application simulation end is used to perform a first interaction with the local target application in the local environment through the local plug-in library in the local environment to obtain the session information stored by the local target application in the local environment database;
[0012] The target application simulation terminal is used to encrypt and store the acquired session information in a translation environment database;
[0013] The target application plug-in is also used to read the session information from the translation environment database when executing the target function and perform the network request operation to obtain the target data from the server, and perform the network request operation based on the session information to obtain the target data.
[0014] In a third aspect, an embodiment of the present invention discloses an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute the steps of any of the plug-in processing methods described above.
[0015] In a fourth aspect, an embodiment of the present invention discloses a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, any plug-in processing method described in the embodiment of the present invention can be implemented.
[0016] In a fifth aspect, an embodiment of the present invention discloses a computer program product, including a computer program, which, when executed by a processor, performs the steps of any of the aforementioned plug-in processing methods.
[0017] The embodiments of the present invention include the following advantages:
[0018] Through the embodiment of the present invention, the interoperability problem between the local target application and the target application plug-in in the translation environment can be solved, and then the session information saved by the local target application running in the local environment can be reused by the target application plug-in in the translation environment, so that the target application plug-in can complete the request operation of requesting the server to obtain the target data, thereby correctly loading and displaying the target application plug-in in the translation environment in the local target application. For example, a browser under a non-X86 architecture Linux operating system can use a browser control under an X86 architecture Windows operating system, thereby enriching the browser functions under a non-X86 architecture Linux operating system.
[0019] In addition, when the session information in the translation environment database is updated, the embodiment of the present invention can also synchronously update the session information stored in the local environment database, so that the session information stored in the local environment database is always consistent with the session information stored in the translation environment database, thereby avoiding errors in subsequent reading of the session information. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 is a flowchart of steps of an embodiment of a plug-in processing method of the present invention;
[0021] Figure 2 It is a schematic diagram of the system architecture involved in the plug-in processing method of the present invention;
[0022] Figure 3 It is a schematic diagram of a process of a target browser control in a translation environment of the present invention acquiring session information of a local browser;
[0023] Figure 4 It is a schematic diagram of the process of synchronously updating session information in the present invention;
[0024] Figure 5 is a structural block diagram of an embodiment of a plug-in processing device of the present invention;
[0025] Figure 6 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0027] The terms "first", "second", etc. in the specification and claims of the present invention are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable when appropriate, so that the embodiments of the present invention can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, the term "and / or" in the specification and claims is used to describe the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. In the embodiments of the present invention, the term "multiple" refers to two or more, and other quantifiers are similar.
[0028] Binary translation can be used to solve the problem of binary-level applications running across instruction set architectures (ISAs). Specifically, binary translation technology can convert instruction sequences in one instruction set architecture into instruction sequences in another instruction set architecture. For example, binary translation can translate instruction sequences in the X86 instruction set architecture into instruction sequences in the arm instruction set architecture (such as arm64), and vice versa.
[0029] Therefore, the browser controls running under the Windows operating system of the X86 architecture can be translated in the Linux operating system of the non-X86 architecture by means of binary translation.
[0030] However, after the user logs in to the local browser, the local browser and the server will maintain the user's login session information to identify the user's identity. In the binary translation scenario, when the target browser plug-in in the translation environment needs to request data from the server, it needs to obtain the user's login session information, otherwise the data request will fail, and the target browser plug-in will not be displayed normally on the local browser.
[0031] To solve the above problems, the present invention proposes a plug-in processing method, which can translate and execute the target application plug-in (such as a target browser plug-in) of the source architecture platform on the target architecture platform, and enable the target application plug-in (such as a target browser plug-in) to be displayed normally on the local target application (such as the local target application).
[0032] Reference Figure 1 , shows a flowchart of a plug-in processing method embodiment of the present invention, the method may include the following steps:
[0033] Step 101: When the target application plug-in in the translation environment executes the target function, the first interface of the target application simulation end in the translation environment is called; the first interface of the target application simulation end is used to perform a first interaction with the local target application in the local environment through the local plug-in library in the local environment to obtain the session information stored by the local target application in the local environment database;
[0034] Step 102: the target application simulation terminal encrypts and stores the acquired session information in a translation environment database;
[0035] Step 103, during the process of the target application plug-in executing the target function, when a network request operation is executed to request the server to obtain target data, the session information is read from the translation environment database, and the network request operation is executed based on the session information to obtain the target data.
[0036] The method provided by the embodiment of the present invention can be applied to the target architecture platform, and is used to translate and run the target application plug-in of the source architecture platform in the target architecture platform, and realize that the translated and run target application plug-in can be displayed normally on the local target application.
[0037] The target architecture platform is the host machine, such as a non-X86 architecture Linux operating system platform. The source architecture platform is the client machine, such as an X86 architecture Windows operating system platform.
[0038] A local target application is an application that runs on a target architecture platform. The running environment of a local target application is also called a local environment.
[0039] The target application simulation end has a running environment of the source architecture platform. The target application simulation end is used to simulate the running of the target application of the source architecture platform in the translation environment of the target architecture platform. The running environment of the target application simulation end is also called the translation environment.
[0040] The translation environment is a binary translation compatibility layer in the target architecture platform, which is used to translate applications running on the source architecture platform on the target architecture platform (such as translating browser plug-ins running on the source architecture platform).
[0041] The target application plug-in of the source architecture platform that is translated and run in the target architecture platform is called the target application plug-in in the translation environment.
[0042] The local environment database refers to the database in the local environment, such as the database used by the local target application. The translation environment database refers to the database in the translation environment, such as the database used by the target application simulation end.
[0043] It should be noted that the embodiments of the present invention do not limit the target architecture platform and the source architecture platform. For example, the target architecture platform may be a non-X86 architecture Linux operating system platform; the source architecture platform may be an X86 architecture Windows operating system platform. That is, the target application plug-in under the X86 architecture Windows operating system can be translated and run in the target application under the non-X86 architecture Linux operating system by binary translation.
[0044] In an optional embodiment of the present invention, the target application may be a browser. A browser is a software application that can be used to retrieve, present and browse information resources transmitted via the Internet. A browser is one of the common tools for users to access Web applications. It parses and displays content requested from a Web server, such as web pages and Web services. The target application plug-in may be a target browser plug-in, the target application simulation terminal may be a browser simulation terminal, and the local target application may be a local browser.
[0045] It should be noted that the embodiment of the present invention does not limit the type of the target application. The target application may be software that needs to call a plug-in, and the software may be system software or application software.
[0046] Exemplarily, the target application may be a Web application. A Web application refers to a software application running on a Web server that can provide services over the Internet. Users can access Web applications through a browser or other Web client. Web applications may include front-end pages (HTML, CSS, JavaScript), back-end logic (such as server-side scripts, database interactions), and possible API interfaces, etc.
[0047] The relationship between web applications and browsers is mutually dependent but distinct. A browser is not a type of web application, but a tool for accessing web applications. Web applications are server-side software that can be accessed through a browser or other client-side tools. The operation of web applications does not depend on a specific browser, but browsers provide a convenient way to interact with users. At the same time, the design of web applications usually needs to consider the compatibility of different browsers to ensure that all users can get a consistent experience.
[0048] In an optional embodiment of the present invention, the target application plug-in may be a target Web application plug-in, the target application simulation terminal may be a Web application simulation terminal, and the local target application may be a local Web application.
[0049] In Web development, session management is a common requirement, which can be used to track user login status and user preferences, etc. For example, Java Web applications may use HttpSession to manage sessions, and some applications may develop plug-ins to extend the functionality of session management, such as custom session storage or enhanced security.
[0050] In an optional embodiment of the present invention, the target application may be an instant messaging (IM) application, such as GoEasy IM instant messaging service, which may support functions such as private chat, group chat, and online customer service. Instant messaging applications may use plug-ins to add additional session management functions, such as message encryption, message review, or custom notification services. The target application plug-in may be a target instant messaging application plug-in, the target application simulation terminal may be an instant messaging application simulation terminal, and the local target application may be a local instant messaging application.
[0051] In an optional embodiment of the present invention, the target application may be a dialogue system, such as the Koishi dialogue system, and session information may be obtained through a plug-in, such as an inspect plug-in, and an auth plug-in allows a user to log in to a Koishi account on a console and manage their own user information. The target application plug-in may be a target dialogue system plug-in, the target application simulation terminal may be a dialogue system simulation terminal, and the local target application may be a local dialogue system.
[0052] In an optional embodiment of the present invention, the target application may be an AI conversation service, such as LobeChat, which supports multiple model service providers, local large language models, model visual recognition, voice conversation and other functions. LobeChat's plug-in allows the introduction of new functions, such as real-time information acquisition and processing, and the integration of third-party services. The target application plug-in may be a target AI conversation service plug-in, the target application simulation end may be an AI conversation service simulation end, and the local target application may be a local AI conversation service.
[0053] In an optional embodiment of the present invention, the target application may be a mobile application. In the mobile application, a plug-in may be used to manage the user's session information, for example, the plug-in may be used to track the user's login status or synchronize the session with the backend service. The target application plug-in may be a target mobile application plug-in, the target application simulation terminal may be a mobile application simulation terminal, and the local target application may be a local mobile application.
[0054] In an optional embodiment of the present invention, the target application may be an e-commerce platform. The e-commerce platform may use plug-ins to enhance session management, for example, to implement shopping cart synchronization, user behavior tracking, or personalized recommendations through plug-ins. The target application plug-in may be a target e-commerce platform plug-in, the target application simulation terminal may be an e-commerce platform simulation terminal, and the local target application may be a local e-commerce platform.
[0055] In an optional embodiment of the present invention, the target application may be an online education platform. The online education platform may use plug-ins to track students' learning progress and session activities to provide a personalized learning experience. The target application plug-in may be a target online education platform plug-in, the target application simulation terminal may be an online education platform simulation terminal, and the local target application may be a local online education platform.
[0056] In an optional embodiment of the present invention, the target application may be an enterprise resource planning (ERP) system. The ERP system may use a plug-in to manage user session information so as to track the user's operation history and authority control. The target application plug-in may be a target ERP system plug-in, the target application simulation terminal may be an ERP system simulation terminal, and the local target application may be a local ERP system.
[0057] In an optional embodiment of the present invention, the target application may be an application based on blockchain technology, such as a shared certificate application. Shared certificates may use plug-ins to ensure the authenticity and credibility of electronic certificate information and realize cross-departmental and cross-regional certificate information sharing. The target application plug-in may be a target shared certificate plug-in, the target application simulation terminal may be a shared certificate simulation terminal, and the local target application may be a local shared certificate.
[0058] For the above different target applications, the flexibility and scalability of session management can be improved by using plug-ins developed for each application, but it also brings certain security and compatibility challenges. The purpose of the present invention is to translate and run the target application plug-in of the source architecture platform in the target architecture platform, and to achieve that the translated and run target application plug-in can be displayed normally on the local target application, thereby expanding the compatibility of the target application plug-in.
[0059] It should be noted that the embodiments of the present invention are mainly described by taking the target application as a browser as an example, and scenarios of other target applications can be referenced to each other.
[0060] In an optional embodiment of the present invention, the target application is a browser, the target application plug-in is a target browser plug-in, and the target browser plug-in may include: an ActiveX control encapsulated based on the Netscape Plugin Application Programming Interface (NPAPI) standard or an NPAPI plug-in.
[0061] The embodiment of the present invention does not limit the types of local browsers and target browser plug-ins. For example, the local browser may be a browser that supports the IE kernel, such as the IE browser; or the local browser may be a browser that supports non-IE kernels, such as the Firefox browser or the Chromium browser.
[0062] The target browser plug-in may include the following two categories: ActiveX controls and NPAPI plug-ins. In order to support ActiveX controls, the present invention encapsulates ActiveX controls based on the NPAPI standard to obtain an NPAPI plug-in encapsulation library. NPAPI plug-ins are native NPAPI plug-ins under the Windows platform, such as silverlight plug-ins, office plug-ins, etc.
[0063] It should be noted that in the embodiment of the present invention, the ActiveX control supporting the IE core browser and the NPAPI plug-in supporting the non-IE core browser are collectively referred to as browser plug-ins.
[0064] The browser plug-in in the embodiment of the present invention is based on the NPAPI standard. The NPAPI standard can provide the following three function interfaces: The interface prefixed with NP_ is the top-level interface provided by the NPAPI plug-in to the browser, which is generally the export interface of the dynamic link library. The interface prefixed with NPP_ is the interface provided by the plug-in itself to the browser for calling. The interface prefixed with NPN_ is the interface provided by the browser for calling the plug-in.
[0065] Take the target application as a browser as an example, refer to Figure 2 , shows a schematic diagram of the system architecture involved in the plug-in processing method of the present invention, and the system architecture runs on the target architecture platform. Figure 2 The system architecture shown includes a local environment and a translation environment. The local environment refers to the operating environment under the target architecture platform, that is, the host environment; the translation environment refers to the compatibility layer environment implemented by binary translation under the target architecture platform, which can be used to translate and execute browser plug-ins under the source architecture platform.
[0066] In a specific implementation, the local environment may include a local target application and a local plug-in library. The translation environment may include a target application simulation terminal and an application plug-in of a source architecture platform. In a specific implementation, the translation environment may include application plug-ins of multiple source architecture platforms, and the application plug-in of the source architecture platform currently being translated and executed is called a target application plug-in.
[0067] like Figure 2 As shown, the local environment includes a local browser and a local plug-in library. The translation environment includes a browser simulation terminal and a browser plug-in of the source architecture platform. In a specific implementation, the translation environment may include browser plug-ins of multiple source architecture platforms, and the browser plug-in of the source architecture platform currently executed by the translation is called the target browser plug-in.
[0068] The local plug-in library may be a dynamic link library (such as a so file) implemented according to the NPAPI standard, which implements interfaces prefixed with NP_ and NPP_. The local browser and the local plug-in library may communicate by calling interfaces implemented based on the NPAPI standard.
[0069] The browser simulation end implements function interfaces prefixed with NPN_, such as a first interface and a second interface, according to the NPAPI standard. The first interface and the second interface can be called by the target browser plug-in. The first interface can be used to obtain session information from the local environment database when the target browser plug-in needs to request data from the server. The second interface can be used to synchronously update the session information in the local environment database when the session information in the translation environment database changes.
[0070] A session refers to a series of requests and responses that occur continuously between a client (browser) and a web server. The basic principle of a session is to distinguish different users and different sessions by an identifier. When a user visits a website, the server creates a unique identifier for the user and stores it in the browser's cookie. With this identifier, the server can maintain status between different requests of the user and associate relevant data with the user. The session information in the embodiment of the present invention may include the unique identifier.
[0071] The local browser may include multiple processes such as a rendering process, a plug-in process, and a network process. Among them, the rendering process is responsible for controlling the web page content displayed in the browser tab. The plug-in process is responsible for controlling the browser plug-in used by the browser web page. The plug-in process provides an interface prefixed with NPN_ for the browser plug-in to call. The network process is responsible for network-related request processing.
[0072] The embodiment of the present invention is based on Figure 2The system architecture shown enables the target browser plug-in in the translation environment to reuse the session information between the local browser running in the local environment and the server, so that the target browser plug-in in the translation environment can request data from the server based on the session information, and then it can be correctly displayed in the local browser.
[0073] Specifically, when the target browser plug-in in the translation environment executes the target function, the first interface of the browser simulation terminal in the translation environment is called.
[0074] In the examples of the present invention, the target function function refers to the interface function implemented by the target application plug-in in order to implement a certain function. In one example, taking the target application as a browser as an example, the target function function can be the interface function of the target browser plug-in in order to implement viewing specified data. For example, in a certain browser, by executing the target function function of viewing personal expense reimbursement provided by the target browser plug-in, the data of personal expense reimbursement can be displayed in the browser. It can be understood that the specific function implemented by the target function function can be determined according to the scenarios of different target applications.
[0075] In a specific implementation, a local browser running in a local environment can send a call request to a browser simulation end running in a translation environment through a local plug-in library, wherein the call request is used to request to call a target function function of a target browser plug-in under the translation environment; after receiving the call request, the browser simulation end calls the target function function of the target browser plug-in under the translation environment; the target browser plug-in responds to the call request, executes the target function function, and before executing the target function function, first executes the above-mentioned steps 101 to 103 to obtain session information in a local database, and then in the subsequent execution of the target function function, the required target data can be requested from the server based on the session information.
[0076] The first interface of the target application simulation end is used to perform a first interaction with the local target application in the local environment through the local plug-in library in the local environment to obtain session information stored by the local target application in the local environment database.
[0077] Furthermore, the local plug-in library running in the local environment and the target application simulation terminal running in the translation environment can communicate with each other through the IPC (Inter-Process Communication) mechanism under Linux.
[0078] In an optional embodiment of the present invention, the first interaction with the local target application in the local environment through the local plug-in library in the local environment may include:
[0079] The first interface of the target application simulation end sends a first process message (referred to as a first IPC message) to the local plug-in library through a process communication pipe (referred to as an IPC pipe); the first IPC message carries a first parameter;
[0080] When the local plug-in library parses the first parameter in the first IPC message, the first interface of the local target application is called based on the first parameter; the first interface of the local target application is used to read the session information from the local environment database;
[0081] The local plug-in library returns the read session information to the target application simulation end through the IPC pipe.
[0082] Taking the target application as a browser as an example, in the embodiment of the present invention, the local plug-in library can be a plug-in implemented according to the NPAPI standard, providing an interface that can be called by the local browser. When the interface is called by the local browser, the local plug-in library forwards the call request to the browser simulation terminal running in the translation environment through the IPC method.
[0083] Take the target application as a browser as an example, refer to Figure 3 , shows a schematic diagram of the process of the target browser control in the translation environment of the present invention obtaining the session information of the local browser. Figure 3 As shown, based on Figure 2 In the system architecture shown, the process of performing the first interaction with the local browser in the local environment through the local plug-in library in the local environment can be as follows:
[0084] 1) The local browser stores the session information with the server in an encrypted form in the local environment database (see Figure 3 Step 1 in the above code).
[0085] Specifically, after the user successfully logs in by entering the login account and login password in the local browser, the local browser can encrypt and store the user's login session information in the local environment database. The local environment database refers to the database in the operating environment where the local browser is located.
[0086] 2) Before executing the target function, the target browser plug-in in the translation environment first calls the first interface of the browser simulation terminal running in the translation environment, such as the first interface represented by NPN_GetValueForURL (see Figure 3 The first interface of the browser simulation end is used to send a first IPC message to the local plug-in library running in the local environment through the IPC pipeline, and wait for the local plug-in library to return the session information (see Figure 3 Step 3 in the above code).
[0087] 3) After the local plug-in library parses the first parameter in the first IPC message, since the first parameter contains the characteristic information of the first interface NPN_GetValueForURL, the local plug-in library calls the first interface NPN_GetValueForURL of the local browser (see Figure 3 4 in step 4).
[0088] The first interface of the local browser is used to interact with the kernel of the local browser to obtain the session information stored in the local environment database.
[0089] It should be noted that the first interface NPN_GetValueForURL provided by the browser simulation end and the first interface NPN_GetValueForURL provided by the local browser provide the same calling parameters, but the execution processes of the two are different. The operation performed by the first interface NPN_GetValueForURL provided by the browser simulation end is simply to pass the first parameter provided by the caller to the local browser through the local plug-in library through the IPC pipeline, and then wait for the result returned. The operation performed by the first interface NPN_GetValueForURL provided by the local browser is to interact with the kernel of the local browser to implement specific operation logic and read the session information of the currently logged-in user between the local browser and the server stored in the local database.
[0090] 4) After the first interface NPN_GetValueForURL of the local browser is called, the operation of reading the session information of the currently logged-in user from the local environment database is executed (see Figure 3 Step 5 in the above example) and returns the read session information to the local plugin library (see Figure 3 Step 6 in ); Next, the local plug-in library returns the received session information to the browser simulation terminal running in the translation environment through the IPC pipeline (see Figure 3 7 in the previous step).
[0091] 5) The browser simulation terminal running in the translation environment encrypts and stores the acquired session information in the translation environment database in the translation environment (compatibility layer) (see Figure 3 8 in the previous step).
[0092] 6) During the process of executing the target function by the target browser plug-in running in the translation environment, when a network request operation is executed to request the server to obtain the target data, the session information can be directly read from the translation environment database (see Figure 3 In step 9), the network request operation is performed based on the session information to obtain the target data, thereby completing the network request operation to the server.
[0093] The network request operation refers to an operation that requires requesting network data from the server. For example, after user A successfully logs in in the local browser, the local browser is triggered to call the target browser plug-in to provide the target function of user A's personal expense reimbursement data. In the process of executing the target function, the target browser plug-in needs to trigger the network request operation to request the target data (i.e., user A's expense reimbursement data) from the server. Assuming that steps 101 to 103 have been executed to save the session information of user A's login in the translation environment database, the target browser plug-in can directly read the session information of user A from the translation environment database, and execute the operation of requesting user A's expense reimbursement data from the server based on the session information of user A.
[0094] Through the embodiments of the present invention, the problem of mutual operation between a local browser (such as a browser under a non-X86 architecture Linux operating system) and a target browser plug-in under a translation environment (such as a browser plug-in under an X86 architecture Windows operating system) can be solved, and then the session information saved by the local browser running in the local environment can be reused by the target browser plug-in under the translation environment, so that the target browser plug-in under the translation environment can complete the network request operation of requesting the server to obtain target data, thereby realizing the normal loading and display of the target browser plug-in under the translation environment by the local browser.
[0095] It is understandable that, for different target applications, the first interface and the second interface may be different.
[0096] In an optional embodiment of the present invention, the method may further include:
[0097] The target application plug-in sends the acquired target data to the local plug-in library through the target application simulation terminal, and then sends it to the local target application through the local plug-in library for display.
[0098] Taking the target application as an example, in an embodiment of the present invention, the target browser plug-in that is translated and run reuses the session information between the local browser running in the local environment and the server, so that the target browser plug-in can obtain the target data of the server, and thus the requested target data can be loaded and displayed in the local browser through a control, so that the browser plug-in of the source architecture platform can be displayed normally on the browser of the target architecture platform, and the effect consistent with the browser loading and displaying the browser control under the Windows operating system of the X86 architecture can be achieved.
[0099] In an optional embodiment of the present invention, the method may further include:
[0100] The target application simulation terminal detects in real time whether the session information in the translation environment database is changed;
[0101] When a change in the session information in the translation environment database is detected, the second interface of the target application simulation end is called; the second interface of the target application simulation end is used to perform a second interaction with the local target application in the local environment through the local plug-in library in the local environment to synchronously update the session information stored in the local environment database.
[0102] The technical solution of the present invention may include the following two parts: the first part is that the target application plug-in in the translation environment obtains session information from the local environment database; the second part is that when the session information in the translation environment database is updated, the session information stored in the local environment database is synchronously updated, so that the session information stored in the local environment database and the translation environment database are always consistent.
[0103] Specifically, during the process of executing the target function, the target application plug-in in the translation environment receives a session information update request and executes the session information update operation, and the session information in the translation environment database is changed. When the target application simulation end detects that the session information in the translation environment database has changed, the second interface of the target application simulation end is called, and the second interface of the target application simulation end is used to perform a second interaction with the local target application in the local environment through the local plug-in library in the local environment, so as to synchronously update the session information stored in the local environment database.
[0104] In an optional embodiment of the present invention, the real-time detection of whether the session information in the translation environment database is changed may include:
[0105] The data state of the session information in the translation environment database is detected in real time; if the data state is a first state, it is determined that the session information in the translation environment database has changed; if the data state is a second state, it is determined that the session information in the translation environment database has not changed.
[0106] The data state of the session information in the translation environment database is used to indicate whether the session information of the current user logged in and stored in the translation environment database has changed. When the target application simulation end detects that the data state of the session information in the translation environment database is in the first state, it can be determined that the session information in the translation environment database has changed, and then the second interface of the target application simulation end is called to synchronously update the session information stored in the local environment database.
[0107] The method may further comprise:
[0108] During the process of the target application plug-in executing the target function, if a session information update request is received, the session information in the translation environment database is updated, and the data state of the session information in the translation environment database is set to the first state.
[0109] The session information update request refers to the server actively requesting to update the session information of the current user login maintained between it and the target application client according to its own update mechanism. During the process of executing the target function, if the target application plug-in running the translation receives a session information update request from the server, it responds to the session information update request, updates the session information in the translation environment database, and sets the data state of the session information in the translation environment database to the first state.
[0110] Taking the target application as a browser as an example, the session information update request can be sent from the server to the local browser, then sent by the local browser to the browser simulation end through the local preset library, and finally sent by the browser simulation end to the target browser plug-in in the translation environment. The session information update request can carry the session information to be updated, and the target browser plug-in responds to the session information update request, updates the session information in the translation environment database, and sets the data state of the session information in the translation environment database to the first state after the update.
[0111] The browser simulation end in the translation environment can start a thread to detect the data state of the session information in the translation environment database in real time. If the data state is detected to be the first state, the second interface of the browser simulation end is called to synchronously update the session information stored in the local environment database. After the browser simulation end determines that the synchronous update of the session information stored in the local environment database is successful, the data state of the session information in the translation environment database is set to the second state.
[0112] The embodiment of the present invention does not limit the setting method of the data state. For example, a flag bit can be set in the translation environment database to indicate the data state of the session information. When the value of the flag bit is "dirty", it indicates that the data state is the first state; when the flag bit is "clean", it indicates that the data state is the second state.
[0113] In an optional embodiment of the present invention, the performing a second interaction with a local target application in the local environment through a local plug-in library in the local environment may include:
[0114] The second interface of the target application simulation end sends a second IPC message to the local plug-in library through the IPC pipeline; the second IPC message carries a second parameter;
[0115] When the local plug-in library parses the second parameter in the second IPC message, the second interface of the local target application is called based on the second parameter; the second interface of the local target application is used to update the session information in the local environment database based on the second parameter; the second parameter carries the updated session information;
[0116] After the local target application updates the session information in the local environment database based on the second parameter, returning the execution status to the local plug-in library;
[0117] After receiving the execution status, the local plug-in library sends the execution status to the target application simulation end through a process communication pipeline;
[0118] After receiving the execution status, if the target application simulation end parses the execution status as successful, it is determined that the session information stored in the local environment database is successfully updated synchronously.
[0119] Take the target application as a browser as an example, refer to Figure 4 , shows a schematic diagram of the process of synchronously updating session information in the present invention. Figure 4 As shown, based on Figure 2 In the architecture shown, the process of performing the second interaction with the local browser in the local environment through the local plug-in library in the local environment can be as follows:
[0120] 1) When the target browser plug-in in the translation environment is executing the target function, if it receives a session information update request from the server, it updates the session information in the translation environment database and sets the data state of the session information in the translation environment database to the first state (see Figure 4 Step 0 in the above example).
[0121] 2) If the browser simulation end in the translation environment detects that the data state of the session information in the translation environment database is the first state, the second interface implemented by the browser simulation end (such as NPN_SetValueForURL) is called. The second interface of the browser simulation end sends a second IPC message to the local plug-in library running in the local environment through the IPC pipeline, and waits for the result returned by the local plug-in library running in the local environment (see Figure 4 Steps 1 to 3 in the above code).
[0122] 3) After the local plug-in library parses the second parameter in the second IPC message, since the second parameter contains the characteristic information of the second interface NPN_SetValueForURL, the local plug-in library calls the second interface NPN_SetValueForURL of the local browser (see Figure 4 4 in step 4).
[0123] The second interface of the local browser is used to interact with the kernel of the local browser to update the session information stored in the local environment database.
[0124] It should be noted that the second interface NPN_SetValueForURL provided by the browser simulation end and the second interface NPN_SetValueForURL provided by the local browser provide the same calling parameters, but the execution processes of the two are different. The operation performed by the second interface NNPN_SetValueForURL provided by the browser simulation end is simply to pass the second parameter provided by the caller to the local browser end through the local plug-in library through the IPC pipeline, and then wait for the result returned. The operation performed by the second interface NPN_SetValueForURL provided by the local browser is to interact with the kernel of the local browser to implement specific operation logic to update the session information saved in the local environment database.
[0125] 4) After the second interface NPN_SetValueForURL of the local browser is called, the operation of updating the session information in the local environment database based on the second parameter is executed (see Figure 4 After the update is completed, the execution status is returned to the local plug-in library, and the local plug-in library returns the execution status to the browser simulation end running in the translation environment through the IPC pipeline (see Figure 4 6 and 7 in the previous step).
[0126] 5) After receiving the execution status, if the execution status is parsed as successful, the data status of the session information in the translation environment database is set to the second status "clean"; if the execution status is parsed as failed, the data status of the session information in the translation environment database is kept unchanged (see Figure 4 8 and 9 in the previous step).
[0127] At this point, the session information stored in the translation environment database is consistent with that in the local environment database.
[0128] In summary, through the embodiments of the present invention, the interoperability problem between the local target application (such as a browser under a non-X86 Linux system) and the target application plug-in under the translation environment (such as a browser control under an X86 Windows system) can be solved, and then the session information saved by the local target application running in the local environment can be reused by the target application plug-in under the translation environment, so that the target application plug-in (such as a control running in a browser under a non-X86 Linux system) can complete the request operation of requesting the server to obtain the target data, so that the target application plug-in under the translation environment can be correctly loaded and displayed in the local target application. For example, a browser under a non-X86 Linux operating system can use a browser control under an X86 Windows operating system, thereby enriching the browser functions under a non-X86 Linux operating system.
[0129] In addition, when the session information in the translation environment database is updated, the embodiment of the present invention can also synchronously update the session information stored in the local environment database, so that the session information stored in the local environment database is always consistent with the session information stored in the translation environment database, thereby avoiding errors in subsequent reading of the session information.
[0130] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0131] Reference Figure 5 , shows a structural block diagram of an embodiment of a plug-in processing device of the present invention, the device may include a target application plug-in 501 and a target application simulation terminal 502 in a translation environment, and a local plug-in library 503 and a local target application 504 in a local environment, wherein:
[0132] The target application plug-in 501 is used to call the first interface of the target application simulation end 502 in the translation environment when executing the target function; the first interface of the target application simulation end is used to perform a first interaction with the local target application 504 in the local environment through the local plug-in library 503 in the local environment to obtain the session information stored by the local target application in the local environment database;
[0133] The target application simulation terminal 502 is used to encrypt and store the acquired session information in a translation environment database;
[0134] The target application plug-in 501 is also used to read the session information from the translation environment database when executing the target function and perform the network request operation to obtain the target data from the server. The target application plug-in 501 is also used to read the session information from the translation environment database and perform the network request operation based on the session information to obtain the target data.
[0135] Optionally, the target application simulation end is used to send a first process message to the local plug-in library through a process communication pipeline based on its first interface; the first process message carries a first parameter;
[0136] The local plug-in library is used to call the first interface of the local target application based on the first parameter when parsing the first parameter in the first process message; the first interface of the local target application is used to read the session information from the local environment database;
[0137] The local plug-in library is further used to return the read session information to the target application simulation end through the process communication pipeline.
[0138] Optionally, the target application simulation end is also used to detect in real time whether the session information in the translation environment database has changed; when it is detected that the session information in the translation environment database has changed, the second interface of the target application simulation end is called; the second interface of the target application simulation end is used to perform a second interaction with the local target application in the local environment through the local plug-in library in the local environment, so as to synchronously update the session information stored in the local environment database.
[0139] Optionally, the target application plug-in is specifically used to detect the data state of the session information in the translation environment database in real time; if the data state is a first state, it is determined that the session information in the translation environment database has changed; if the data state is a second state, it is determined that the session information in the translation environment database has not changed;
[0140] Optionally, the target application plug-in is further configured to update the session information in the translation environment database and set the data state of the session information in the translation environment database to the first state if a session information update request is received during the execution of the target function;
[0141] The target application simulation end is further used to set the data state of the session information in the translation environment database to the second state after determining that the synchronous update of the session information stored in the local environment database is successful.
[0142] Optionally, the target application simulation end is used to send a second process message to the local plug-in library through a process communication pipe based on its second interface; the second process message carries a second parameter;
[0143] The local plug-in library is used to call the second interface of the local target application based on the second parameter when parsing the second parameter in the second process message; the second interface of the local target application is used to update the session information in the local environment database based on the second parameter; the second parameter carries the updated session information;
[0144] The local target application is used to return the execution status to the local plug-in library after updating the session information in the local environment database based on the second parameter;
[0145] The local plug-in library is used to send the execution status to the target application simulation end through a process communication pipeline after receiving the execution status;
[0146] The target application simulation end is used to determine that the synchronous update of the session information stored in the local environment database is successful after receiving the execution status and parsing the execution status as successful.
[0147] Optionally, the target application plug-in is further used to send the acquired target data to the local plug-in library through the target application simulation terminal, and then send it to the local target application through the local plug-in library for display.
[0148] Optionally, the target application plug-in includes an ActiveX control or an NPAPI plug-in encapsulated based on the Netscape Plug-in Application Programming Interface NPAPI standard.
[0149] Through the embodiment of the present invention, the interoperability problem between the local target application (such as a browser under a non-X86 architecture Linux system) and the target application plug-in under the translation environment (such as a browser control under an X86 architecture Windows system) can be solved, and then the session information saved by the local target application running in the local environment can be reused by the target application plug-in under the translation environment, so that the target application plug-in (such as a control running in a browser under a non-X86 architecture Linux system) can complete the request operation of requesting the server to obtain the target data, so that the target application plug-in under the translation environment can be correctly loaded and displayed in the local target application. For example, a browser under a non-X86 architecture Linux operating system can use a browser control under an X86 architecture Windows operating system, thereby enriching the browser functions under a non-X86 architecture Linux operating system.
[0150] In addition, when the session information in the translation environment database is updated, the embodiment of the present invention can also synchronously update the session information stored in the local environment database, so that the session information stored in the local environment database is always consistent with the session information stored in the translation environment database, thereby avoiding errors in subsequent reading of the session information.
[0151] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0152] Reference Figure 6 , is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Figure 6 As shown, the electronic device includes: a processor, a memory, a communication interface and a communication bus, and the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute the steps of the plug-in processing method of the aforementioned embodiment.
[0153] An embodiment of the present invention provides a non-transitory computer-readable storage medium. When instructions in the storage medium are executed by a program or processor of a terminal, the terminal is enabled to execute the steps of the plug-in processing method of any of the aforementioned embodiments.
[0154] An embodiment of the present invention discloses a computer program product, including a computer program. When the computer program is executed by a processor, the steps of the plug-in processing method in any of the above embodiments are performed.
[0155] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0156] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0157] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0158] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal device to operate in a predictable manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0159] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0160] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0161] Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A plug-in processing method, It is characterized in that The method comprises: When the target application plug-in in the translation environment executes the target function, the first interface of the target application simulation end in the translation environment is called; the first interface of the target application simulation end is used to perform a first interaction with the local target application in the local environment through the local plug-in library in the local environment to obtain the session information stored by the local target application in the local environment database; the session information is used to identify the identity of the currently logged-in user; The target application simulation terminal encrypts and stores the acquired session information in a translation environment database; During the process of the target application plug-in executing the target function, when a network request operation is executed to request the server to obtain target data, the session information is read from the translation environment database, and the network request operation is executed based on the session information to obtain the target data; the target data is associated with the user identity.
2. The method according to claim 1, It is characterized in that The first interaction with the local target application in the local environment through the local plug-in library in the local environment includes: The first interface of the target application simulation end sends a first process message to the local plug-in library through a process communication pipeline; the first process message carries a first parameter; When the local plug-in library parses the first parameter in the first process message, the first interface of the local target application is called based on the first parameter; the first interface of the local target application is used to read the session information from the local environment database; The local plug-in library returns the read session information to the target application simulation end through the process communication pipeline.
3. The method according to claim 1, It is characterized in that The method further comprises: The target application simulation terminal detects in real time whether the session information in the translation environment database is changed; When a change in the session information in the translation environment database is detected, the second interface of the target application simulation end is called; the second interface of the target application simulation end is used to perform a second interaction with the local target application in the local environment through the local plug-in library in the local environment to synchronously update the session information stored in the local environment database.
4. The method according to claim 3, It is characterized in that The real-time detection of whether the session information in the translation environment database has changed includes: Real-time detection of the data state of the session information in the translation environment database; if the data state is a first state, determining that the session information in the translation environment database has changed; if the data state is a second state, determining that the session information in the translation environment database has not changed; The method further comprises: During the process of the target application plug-in executing the target function, if a session information update request is received, the session information in the translation environment database is updated, and the data state of the session information in the translation environment database is set to a first state; After the target application simulation end determines that the synchronous update of the session information stored in the local environment database is successful, the data state of the session information in the translation environment database is set to a second state.
5. The method according to claim 3, It is characterized in that The second interaction with the local target application in the local environment through the local plug-in library in the local environment includes: The second interface of the target application simulation end sends a second process message to the local plug-in library through the process communication pipeline; the second process message carries a second parameter; When the local plug-in library parses the second parameter in the second process message, the second interface of the local target application is called based on the second parameter; the second interface of the local target application is used to update the session information in the local environment database based on the second parameter; the second parameter carries the updated session information; After the local target application updates the session information in the local environment database based on the second parameter, returning the execution status to the local plug-in library; After receiving the execution status, the local plug-in library sends the execution status to the target application simulation end through a process communication pipeline; After receiving the execution status, if the target application simulation end parses the execution status as successful, it is determined that the session information stored in the local environment database is successfully updated synchronously.
6. The method according to claim 1, It is characterized in that The method further comprises: The target application plug-in sends the acquired target data to the local plug-in library through the target application simulation terminal, and then sends it to the local target application through the local plug-in library for display.
7. The method according to claim 1, It is characterized in that The target application plug-in includes an ActiveX control or an NPAPI plug-in encapsulated based on the Netscape Plug-in Application Programming Interface NPAPI standard.
8. The method according to any one of claims 1 to 7, It is characterized in that The target application plug-in is a target browser plug-in, the target application simulation end is a browser simulation end, and the local target application is a local browser.
9. A plug-in processing device, It is characterized in that The device includes a target application plug-in and a target application simulation terminal in a translation environment, and a local target application and a local plug-in library in a local environment, wherein: The target application plug-in is used to call the first interface of the target application simulation end in the translation environment when executing the target function; the first interface of the target application simulation end is used to perform a first interaction with the local target application in the local environment through the local plug-in library in the local environment to obtain the session information stored by the local target application in the local environment database; the session information is used to identify the identity of the currently logged-in user; The target application simulation terminal is used to encrypt and store the acquired session information in a translation environment database; The target application plug-in is also used to read the session information from the translation environment database when executing the target function and perform the network request operation to obtain the target data from the server, and perform the network request operation based on the session information to obtain the target data; the target data is associated with the user identity.
10. An electronic device, It is characterized in that include: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute the steps of the plug-in processing method according to any one of claims 1 to 8.
11. A computer program product comprising a computer program, It is characterized in that The computer program executed by the processor is the steps of the plug-in processing method according to any one of claims 1 to 8.
