Hardware access method and device, electronic equipment and medium
By receiving hardware access requests under the first operating system, determining the target operating system environment and calling the target browser kernel, the problem of high cost of service program migration is solved and efficient hardware access in different operating system environments is achieved.
Patent Information
- Application Number
- CN202310870226.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-14
- Publication Date
- 2025-01-14
AI Technical Summary
The prior art adds cost and complexity when migrating service programs from one operating system to another, especially when running service programs in different operating system environments.
By receiving hardware access requests, determining the target operating system environment, and calling the browser kernel of the target operating system environment to process the hardware access requests, thereby running the service program of the second operating system environment under the first operating system.
Saves the cost of migrating service programs from the second operating system to the first operating system, and improves hardware access efficiency across operating system environments.
Smart Images

Figure CN119311317A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of communication technology, and in particular, to a hardware access method, device, electronic device and medium. Background Art
[0002] With the development of communication technology, service programs in technical fields such as banking, securities, insurance, etc. usually have the need to access hardware. For example, service programs in the banking field usually need to access hardware such as printers and scanners.
[0003] In actual applications, the developed service program may be applicable to a single operating system environment; for example, service program A is only applicable to the Windows environment. In this case, if service program A needs to be run in a Linux environment, service program A needs to be migrated from the Windows environment to the Linux environment, and the migration of the service program increases the service cost. Summary of the invention
[0004] The embodiment of the present application provides a hardware access method, which can run a service program corresponding to a second operating system environment under a first operating system, thereby saving the cost of migrating the service program from the second operating system to the first operating system.
[0005] Correspondingly, the embodiment of the present application also provides a hardware access device, an electronic device and a machine-readable medium to ensure the implementation and application of the above method.
[0006] In order to solve the above problem, an embodiment of the present application discloses a hardware access method, which is applied to a first operating system; the method includes:
[0007] receiving hardware access requests;
[0008] Determine a target operating system environment corresponding to the hardware access request; the target operating system environment includes: any one of a first operating system environment and a second operating system environment;
[0009] Providing the target operating system environment;
[0010] A target browser kernel corresponding to the target operating system environment is called, and the target browser kernel processes the hardware access request.
[0011] In order to solve the above problem, an embodiment of the present application discloses a hardware access device, which is applied to a first operating system and includes:
[0012] A request receiving module, used for receiving a hardware access request;
[0013] A system environment determination module, used to determine a target operating system environment corresponding to the hardware access request; the target operating system environment includes: any one of a first operating system environment and a second operating system environment;
[0014] A system environment providing module, used for providing the target operating system environment;
[0015] The kernel calling module is used to call the target browser kernel corresponding to the target operating system environment, and the target browser kernel processes the hardware access request.
[0016] Optionally, the system environment determination module includes:
[0017] a first system environment determination module, configured to search, according to the page address information corresponding to the hardware access request, in a mapping relationship between the page address information and the operating system environment, so as to obtain a target operating system environment corresponding to the hardware access request; or
[0018] The second system environment determination module is used to determine the target operating system environment corresponding to the hardware access request according to a user instruction.
[0019] Optionally, the system environment providing module includes:
[0020] a first system environment providing module, configured to provide a second operating system environment according to a compatibility layer software of the second operating system when the target operating system environment is a second operating system environment; or
[0021] The second system environment providing module is used to provide the first operating system environment by using the first operating system when the target operating system environment is the first operating system environment.
[0022] Optionally, the target browser kernel processes the hardware access request, including:
[0023] The target browser kernel loads a page corresponding to the hardware access request and accesses the hardware corresponding to the hardware access request.
[0024] Optionally, the target browser kernel processes the hardware access request, including: processing the hardware access request according to an access mode corresponding to the target browser kernel.
[0025] Optionally, the target operating system environment is a first operating system environment, the target browser kernel includes: a first browser kernel, and the access method includes: a network protocol access method, or a first plug-in access method; or
[0026] The target operating system environment is a second operating system environment, the target browser kernel includes: a second browser kernel, and the access method includes: a network protocol access method, or a second plug-in access method; or
[0027] The target operating system environment is a second operating system environment, the target browser kernel includes: a third browser kernel, and the access method includes: a network protocol access method, or a third plug-in access method.
[0028] Optionally, the target browser kernel processes the hardware access request, including:
[0029] In a case where the target operating system environment is a second operating system environment, determining a first interface call request corresponding to the hardware access request;
[0030] According to the compatibility layer software of the second operating system, the first interface call request is converted into a second interface call request adapted to the first operating system environment, and the second interface call request is executed.
[0031] The embodiment of the present application further discloses an electronic device, including: a processor; and a memory, on which executable code is stored. When the executable code is executed, the processor executes the method described in the embodiment of the present application.
[0032] The embodiment of the present application further discloses a machine-readable medium on which executable code is stored. When the executable code is executed, a processor executes the method described in the embodiment of the present application.
[0033] The embodiments of the present application include the following advantages:
[0034] In the technical solution of the embodiment of the present application, when a hardware access request is received, the target operating system environment corresponding to the hardware access request is first determined, then the target operating system environment is provided, and the target browser kernel corresponding to the target operating system environment is called, and the hardware access request is processed by the target browser kernel.
[0035] In the case where the target operating system environment is the second operating system environment, the embodiment of the present application can provide the second operating system environment under the first operating system, and call the target browser kernel corresponding to the second operating system environment, and the target browser kernel processes the hardware access request. Since the embodiment of the present application can provide the second operating system environment under the first operating system and call the target browser kernel corresponding to the second operating system environment to process the hardware access request, the embodiment of the present application can run the service program corresponding to the second operating system environment under the first operating system. Therefore, the embodiment of the present application can save the cost of migrating the service program from the second operating system to the first operating system. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 This is a schematic diagram of the steps of a hardware access method according to an embodiment of the present application;
[0037] Figure 2 It is a flowchart of determining a target operating system environment corresponding to a hardware access request according to an embodiment of the present application;
[0038] Figure 3 It is a structural diagram of a hardware access device according to an embodiment of the present application;
[0039] Figure 4 It is a structural diagram of a hardware access device according to an embodiment of the present application;
[0040] Figure 5 It is a schematic diagram of the structure of a device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0041] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0042] In order to enable those skilled in the art to better understand the embodiments of the present application, the meanings of the technical terms in the embodiments of the present application are first explained.
[0043] Chrome: A web browser developed by Google.
[0044] IE (Internet Explorer) is a web browser launched by Microsoft.
[0045] ActiveX (ActiveX): ActiveX is Microsoft's name for a series of strategic object-oriented programming technologies and tools, among which the main technology is COM (Component Object Model).
[0046] NPAPI (Netscape Plugin Application Programming Interface) is an ActiveX-like plug-in interface used by browsers.
[0047] WebSocket (Web Socket): is a protocol for full-duplex communication over a single TCP connection.
[0048] Linux: is a free to use and free to distribute UNIX-like operating system.
[0049] Windows (Windows Operating System): It is an operating system developed by Microsoft based on a graphical user interface, mainly used in computers, smart phones and other devices.
[0050] Dual-core browser: A browser with two cores. Generally, dual-core browsers have two cores: an IE compatible core and a non-IE high-speed core, which can meet the different needs of the same user.
[0051] Wine (Wine Is Not an Emulator): is a compatibility layer that can run Windows applications on multiple POSIX-compliant (Portable Operating System Interface of Unix-compliant) operating systems.
[0052] In view of the technical problem in the related art that if service program A needs to be run in a Linux environment, service program A needs to be migrated from a Windows environment to a Linux environment, an embodiment of the present application provides a hardware access method, which can be applied to a first operating system, and specifically includes: receiving a hardware access request; determining a target operating system environment corresponding to the hardware access request; the target operating system environment includes: any one of a first operating system environment and a second operating system environment; providing the target operating system environment; calling a target browser kernel corresponding to the target operating system environment, and the target browser kernel processes the hardware access request.
[0053] When receiving a hardware access request, the embodiment of the present application first determines the target operating system environment corresponding to the hardware access request, then provides the target operating system environment, and calls the target browser kernel corresponding to the target operating system environment, and the target browser kernel processes the hardware access request.
[0054] In the case where the target operating system environment is the second operating system environment, the embodiment of the present application can provide the second operating system environment under the first operating system, and call the target browser kernel corresponding to the second operating system environment, and the target browser kernel processes the hardware access request. Since the embodiment of the present application can provide the second operating system environment under the first operating system and call the target browser kernel corresponding to the second operating system environment to process the hardware access request, the embodiment of the present application can run the service program corresponding to the second operating system environment under the first operating system. Therefore, the embodiment of the present application can save the cost of migrating the service program from the second operating system to the first operating system.
[0055] Method Embodiment
[0056] refer to Figure 1 , shows a schematic flow chart of the steps of a hardware access method according to an embodiment of the present application, the method can be applied to a first operating system, and the method can specifically include the following steps:
[0057] Step 101: receiving a hardware access request;
[0058] Step 102: determine the target operating system environment corresponding to the hardware access request; the target operating system environment specifically includes: any one of the first operating system environment and the second operating system environment;
[0059] Step 103: providing the target operating system environment;
[0060] Step 104: calling a target browser kernel corresponding to the target operating system environment, and having the target browser kernel process the hardware access request.
[0061] In the embodiments of the present application, the hardware may be hardware that can be accessed by the computer. In practical applications, the hardware may include: external devices of the computer. External devices are referred to as peripherals, which are a general term for input, output devices, and external storage devices in a computer system. They play a role in transmitting, transferring, and storing data and information, and are an important part of the computer system. Peripherals may involve any device other than the host. Peripherals may be attached or auxiliary devices connected to a computer and can expand the computer system. Examples of peripherals may include: printers or scanners, etc. It can be understood that the embodiments of the present application do not limit specific peripherals and specific hardware.
[0062] In the embodiment of the present application, examples of the first operating system may include: Linux, macOS (Macintosh Operating System) and BSD (Berkeley Software Distribution), etc. Examples of the second operating system may include: Windows operating system, etc. It can be understood that the embodiment of the present application does not limit the specific first operating system and the second operating system.
[0063] Figure 1 At least one step included in the method shown may be executed by a target device corresponding to the first operating system. Figure 1 At least one step included in the method shown can be executed by a browser program on the target device. Figure 1 The specific execution subject corresponding to at least one step included in the method is not limited.
[0064] In step 101, a hardware access request may be sent by a service program. The service program may be used to provide services. In practical applications, the service program may provide services in the form of a service website. In practical applications, the service website may include a website page, and a user may trigger a hardware access request based on a plug-in on the website page. Of course, the embodiment of the present application does not limit the specific triggering method of the hardware access request.
[0065] In step 102, the target operating system environment may be an operating system environment suitable for processing a hardware access request.
[0066] The above-mentioned determination method adopted for determining the target operating system environment corresponding to the hardware access request may specifically include:
[0067] Determination method 1: searching in a mapping relationship between page address information and operating system environment according to the page address information corresponding to the hardware access request to obtain a target operating system environment corresponding to the hardware access request; or
[0068] Determination method 2: determining the target operating system environment corresponding to the hardware access request according to a user instruction.
[0069] For determination method 1, the hardware access request may carry page address information, and the page address information may be in the form of a URL (Uniform Resource Locator).
[0070] In actual applications, the remote server may provide a configuration file, and the configuration file may record the mapping relationship between the page address information and the operating system environment. Generally, a page corresponding to a page address information may correspond to one or more operating system environments. However, when a page corresponding to a page address information corresponds to multiple operating system environments, the configuration file may record an operating system environment with better page loading performance.
[0071] Referring to Table 1, an example of a mapping relationship between page address information and an operating system environment according to an embodiment of the present application is shown.
[0072] Table 1
[0073] Page address information Operating system environment URL1 First operating system environment URL2 First operating system environment URL3 Second operating system environment URL4 Second operating system environment … …
[0074] For determination method 2, the user instruction may be used to determine the target operating system environment corresponding to the hardware access request.
[0075] For example, the current operating system environment and the switch plug-in may be presented to the user. If the current operating system environment does not meet the user's requirements, the user may switch the current operating system environment based on the switch plug-in, whereby the user instruction for the switch plug-in may be used to determine the target operating system environment corresponding to the hardware access request.
[0076] Of course, the switching plug-in is only an example of implementing user instructions. In fact, the embodiment of the present application can also provide options corresponding to the first operating system environment and the second operating system environment, respectively, for the user to choose. If the user selects the option corresponding to the first operating system environment, the target operating system environment can be the first operating system environment; or, if the user selects the option corresponding to the second operating system environment, the target operating system environment can be the second operating system environment.
[0077] Reference Figure 2 , showing a flow chart of determining the target operating system environment corresponding to a hardware access request according to an embodiment of the present application. Among them, the remote server can provide a configuration file; the service website can send a hardware access request; the target device can determine the target operating system environment corresponding to the hardware access request based on the configuration file. It can be understood that when the current operating system environment is the same as the target operating system environment, the current operating system environment can be kept unchanged; or, when the current operating system environment is different from the target operating system environment, the current operating system environment can be switched to the target operating system environment.
[0078] In step 103, the target operating system environment is provided, and the hardware access request can be processed in the target operating system environment.
[0079] In practical applications, the above-mentioned providing method for providing the target operating system environment may specifically include:
[0080] Providing mode 1: when the target operating system environment is a second operating system environment, providing the second operating system environment according to the compatibility layer software of the second operating system; or
[0081] Providing method 2: when the target operating system environment is the first operating system environment, providing the first operating system environment by using the first operating system.
[0082] For providing mode 1, the compatibility layer software is a compatibility layer that can run the application of the second operating system on multiple first operating systems that comply with the POSIX standard. Examples of the compatibility layer software may include: Wine, etc. In the case where the second operating system is a Windows system, the compatibility layer software can translate the Windows API (Application Program Interface) call into a dynamic POSIX call, thereby enabling the Windows application to run in the first operating system outside the Windows system.
[0083] For providing mode 2, since the target device runs on the first operating system, the first operating system environment can be provided by using the first operating system.
[0084] In step 104, a target browser kernel corresponding to the target operating system environment may be called, and the target browser kernel processes the hardware access request.
[0085] Examples of target browser kernels can include:
[0086] When the target operating system environment is a first operating system environment, the target browser kernel includes: a first browser kernel; or
[0087] The target operating system environment is a second operating system environment, and the target browser kernel includes: a second browser kernel and / or a third browser kernel.
[0088] For example, when the target operating system environment is a Linux environment, the first browser kernel may include: a Linux Chrome kernel (a kernel of Google browser in a Linux environment, a chrome kernel) or other browser kernels suitable for running in a Linux environment.
[0089] For another example, when the target operating system environment is a Windows environment, the second browser kernel or the third browser kernel may include: Windows Chrome kernel (Google browser kernel in Windows environment, Chrome kernel), IE (Internet Explorer) kernel, etc., which are browser kernels suitable for running in Windows environment. When the target browser kernel includes: Windows Chrome kernel and IE kernel at the same time, the function of a dual-core browser can be provided.
[0090] In the case where there are multiple target browser kernels, the embodiment of the present application can select a target browser kernel from the multiple target browser kernels according to the page characteristics of the service website.
[0091] The page features of the service website may include: plug-in features, etc. In one implementation, the matching degree between the plug-in features of the service website and the target browser kernel may be determined, and a target browser kernel may be selected from a plurality of target browser kernels according to the matching degree. For example, a first matching degree between the plug-in features of the service website and a first target browser kernel may be determined, and a second matching degree between the plug-in features of the service website and a second target browser kernel may be determined, the first matching degree and the second matching degree may be compared, and the target browser kernel corresponding to the larger of the first matching degree and the second matching degree may be selected.
[0092] For example, service website A is developed based on IE browser, contains some web page features unique to IE, and uses ActiveX plug-ins, so the IE kernel can be used for service website A. For another example, if business website B is more friendly to the Chrome kernel and uses NPAPI (Netscape Plugin Application Programming Interface) plug-ins, the Windows Chrome kernel can be used.
[0093] In actual application, the target browser kernel processes the hardware access request, including: processing the hardware access request according to the access mode corresponding to the target browser kernel.
[0094] Different target browser kernels may correspond to the same or different access methods. For example, the access method corresponding to the first browser kernel may include: a network protocol access method, or a first plug-in access method. For another example, the access method corresponding to the second browser kernel may include: a network protocol access method, or a second plug-in access method. Alternatively, the access method corresponding to the third browser kernel may include: a network protocol access method, or a third plug-in access method.
[0095] The network protocol access method can utilize the network protocol to communicate with the hardware. The network protocol access method may include: Websocket access method, etc. The network protocol access method may provide a first interface for the browser kernel to call.
[0096] The first plug-in access mode or the second plug-in access mode can use a plug-in to access the hardware. The hardware can provide a first plug-in or a second plug-in, the first plug-in or the second plug-in can provide a second interface, and the browser kernel can call the second interface to access the hardware. The first plug-in may include: an NPAPI plug-in corresponding to the Windows Chrome kernel. The second plug-in may include: an ActiveX plug-in corresponding to the IE kernel, etc.
[0097] In a specific implementation, the process of the target browser kernel processing the hardware access request may specifically include: the target browser kernel loading the page corresponding to the hardware access request, and accessing the hardware corresponding to the hardware access request. In actual applications, the hardware corresponding to the hardware access request may be accessed to obtain a corresponding access result, which may include: hardware name, hardware status, etc. In actual applications, the access result may be a part of the page and loaded into the page.
[0098] In actual applications, the target browser kernel processes the hardware access request, which may specifically include: when the target operating system environment is a second operating system environment, determining a first interface call request corresponding to the hardware access request; converting the first interface call request into a second interface call request adapted to the first operating system environment according to the compatibility layer software of the second operating system, and executing the second interface call request.
[0099] The first interface call request may be a call request corresponding to the second operating system environment, which may be a call request of the Windows API. The embodiment of the present application may utilize compatibility layer software to convert the first interface call request into a second interface call request adapted to the first operating system environment. The second interface call request may be executed by the first operating system to access the corresponding hardware.
[0100] In actual applications, the first interface call request or the second interface call request may be matched with a corresponding access method. For example, the first interface call request or the second interface call request may be related to a first interface provided by a network protocol access method, or the first interface call request or the second interface call request may be related to a second interface provided by a plug-in access method.
[0101] When the target operating system environment is the first operating system environment, a third interface call request corresponding to the hardware access request may be determined and executed, wherein the third interface call request may be adapted to the first operating system environment.
[0102] The processing result of the target browser kernel processing the hardware access request may include: a page loaded on the browser, the page may include the hardware access result, and the user may further access the hardware based on the page and the access result included in the page.
[0103] In summary, the hardware access method of the embodiment of the present application, when receiving a hardware access request, will first determine the target operating system environment corresponding to the hardware access request, then provide the target operating system environment, and call the target browser kernel corresponding to the target operating system environment, and the target browser kernel will process the hardware access request.
[0104] In the case where the target operating system environment is the second operating system environment, the embodiment of the present application can provide the second operating system environment under the first operating system, and call the target browser kernel corresponding to the second operating system environment, and the target browser kernel processes the hardware access request. Since the embodiment of the present application can provide the second operating system environment under the first operating system and call the target browser kernel corresponding to the second operating system environment to process the hardware access request, the embodiment of the present application can run the service program corresponding to the second operating system environment under the first operating system. Therefore, the embodiment of the present application can save the cost of migrating the service program from the second operating system to the first operating system.
[0105] It should be noted that, for the method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited by the described order of actions, because according to the embodiments of the present application, 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 application.
[0106] Device Example 1
[0107] Based on the above embodiment, this embodiment further provides a hardware access device, which can be applied to the first operating system; Figure 3 The device may specifically include: a request receiving module 301, a system environment determining module 302, a system environment providing module 303 and a kernel calling module 304.
[0108] Wherein, the request receiving module 301 is used to receive a hardware access request;
[0109] A system environment determination module 302 is used to determine a target operating system environment corresponding to the hardware access request; the target operating system environment includes: any one of a first operating system environment and a second operating system environment;
[0110] The system environment providing module 303 is used to provide the target operating system environment;
[0111] The kernel calling module 304 is used to call the target browser kernel corresponding to the target operating system environment, and the target browser kernel processes the hardware access request.
[0112] Optionally, the system environment determination module 302 may specifically include:
[0113] a first system environment determination module, configured to search, according to the page address information corresponding to the hardware access request, in a mapping relationship between the page address information and the operating system environment, so as to obtain a target operating system environment corresponding to the hardware access request; or
[0114] The second system environment determination module is used to determine the target operating system environment corresponding to the hardware access request according to a user instruction.
[0115] Optionally, the system environment providing module 303 may specifically include:
[0116] a first system environment providing module, configured to provide a second operating system environment according to a compatibility layer software of the second operating system when the target operating system environment is a second operating system environment; or
[0117] The second system environment providing module is used to provide the first operating system environment by using the first operating system when the target operating system environment is the first operating system environment.
[0118] Optionally, the target browser kernel processes the hardware access request, which may specifically include:
[0119] The target browser kernel loads a page corresponding to the hardware access request and accesses the hardware corresponding to the hardware access request.
[0120] Optionally, the target browser kernel processes the hardware access request, which may specifically include: processing the hardware access request according to an access mode corresponding to the target browser kernel.
[0121] Optionally, the target operating system environment is a first operating system environment, the target browser kernel may specifically include: a first browser kernel, and the access method may specifically include: a network protocol access method, or a first plug-in access method; or
[0122] The target operating system environment is a second operating system environment, the target browser kernel may specifically include: a second browser kernel, and the access method may specifically include: a network protocol access method, or a second plug-in access method; or
[0123] The target operating system environment is a second operating system environment, the target browser kernel may specifically include: a third browser kernel, and the access method may specifically include: a network protocol access method, or a third plug-in access method.
[0124] Optionally, the target browser kernel processes the hardware access request, which may specifically include:
[0125] In a case where the target operating system environment is a second operating system environment, determining a first interface call request corresponding to the hardware access request;
[0126] According to the compatibility layer software of the second operating system, the first interface call request is converted into a second interface call request adapted to the first operating system environment, and the second interface call request is executed.
[0127] In summary, when the hardware access device of the embodiment of the present application receives a hardware access request, it will first determine the target operating system environment corresponding to the hardware access request, then provide the target operating system environment, and call the target browser kernel corresponding to the target operating system environment, and the target browser kernel will process the hardware access request.
[0128] In the case where the target operating system environment is the second operating system environment, the embodiment of the present application can provide the second operating system environment under the first operating system, and call the target browser kernel corresponding to the second operating system environment, and the target browser kernel processes the hardware access request. Since the embodiment of the present application can provide the second operating system environment under the first operating system and call the target browser kernel corresponding to the second operating system environment to process the hardware access request, the embodiment of the present application can run the service program corresponding to the second operating system environment under the first operating system. Therefore, the embodiment of the present application can save the cost of migrating the service program from the second operating system to the first operating system.
[0129] Device Example 2
[0130] refer to Figure 4, shows a structural diagram of a hardware access device 400 of an embodiment of the present application, which can be applied to a Linux system, and the device can specifically include: a request receiving module 401, a system environment determination module 402, a Linux environment providing module 403, a Linux Chrome kernel module 404, a Windows environment providing module 405, an IE kernel module 406, a Windows Chrome kernel module 407 and a call request conversion module 408.
[0131] In actual applications, the peripherals can be connected to the Linux system and the driver of the peripherals can be installed on the target device. The driver of the peripheral can support one or more access modes.
[0132] When a user loads a service website, a hardware access request may be triggered. The request receiving module 401 may receive the hardware access request; and the system environment determining module 402 may determine the target operating system environment corresponding to the hardware access request.
[0133] The target operating system environment may be determined in an automatic manner or a manual manner. The automatic manner may determine the target operating system environment according to a configuration file, while the manual manner may determine the target operating system environment according to a user instruction.
[0134] When the target operating system environment is a Linux environment, the Linux environment providing module 403 and the Linux Chrome kernel module 404 may be triggered.
[0135] The Linux environment providing module 403 can provide the Linux environment by using the Linux system. The Linux Chrome kernel module 404 loads and displays the page corresponding to the hardware access request, and accesses the peripherals through WebSocket or other access methods under the Linux environment.
[0136] When the target operating system environment is a Windows environment, the Windows environment providing module 405, the IE kernel module 406, the Windows Chrome kernel module 407 and the call request conversion module 408 may be triggered.
[0137] The Windows environment providing module 405 can provide the Windows environment using the compatibility layer software, and according to the actual application requirements, call the IE kernel module 406 or the Windows Chrome kernel module 407. The IE kernel module 406 and the Windows Chrome kernel module 407 can be components of a dual-core browser under the Windows environment.
[0138] If the IE kernel module 406 is called, the IE kernel module 406 can run based on the Windows environment provided by the compatibility layer software, load and display the page corresponding to the hardware access request, and access the peripheral device through access methods such as WebSocket or ActiveX plug-in.
[0139] If Windows Chrome kernel module 407 is called, Windows Chrome kernel module 407 can run based on the Windows environment provided by the compatibility layer software, load and display the page corresponding to the hardware access request, and access the peripherals through access methods such as WebSocket or NPAPI plug-in.
[0140] When the target operating system environment is a Windows environment, the IE kernel module 406 or the Windows Chrome kernel module 407 can determine the first interface call request corresponding to the hardware access request. The call request conversion module 408 can convert the first interface call request into a second interface call request adapted to the Linux environment according to the Windows compatibility layer software, and execute the second interface call request, thereby accessing the peripherals in the Linux environment.
[0141] The embodiment of the present application also provides a non-volatile readable storage medium, which stores one or more modules (programs). When the one or more modules are applied to a device, the device can execute instructions (instructions) of each method step in the embodiment of the present application.
[0142] The present application embodiment provides one or more machine-readable media on which instructions are stored, and when executed by one or more processors, an electronic device executes one or more of the methods described in the above embodiments. In the present application embodiment, the electronic device includes various types of devices such as terminal devices and servers (clusters).
[0143] The embodiments of the present disclosure may be implemented as a device that uses any appropriate hardware, firmware, software, or any combination thereof to perform a desired configuration, and the device may include: electronic devices such as terminal devices and servers (clusters). Figure 5 An exemplary apparatus 1100 that can be used to implement various embodiments described in this application is schematically shown.
[0144] For one embodiment, Figure 5An exemplary apparatus 1100 is shown having one or more processors 1102, a control module (chip set) 1104 coupled to at least one of the (one or more) processors 1102, a memory 1106 coupled to the control module 1104, a non-volatile memory (NVM) / storage device 1108 coupled to the control module 1104, one or more input / output devices 1110 coupled to the control module 1104, and a network interface 1112 coupled to the control module 1104.
[0145] The processor 1102 may include one or more single-core or multi-core processors, and the processor 1102 may include any combination of general-purpose processors or special-purpose processors (such as graphics processors, application processors, baseband processors, etc.). In some embodiments, the device 1100 can be used as a terminal device, server (cluster), etc. described in the embodiments of the present application.
[0146] In some embodiments, the apparatus 1100 may include one or more computer-readable media (e.g., memory 1106 or NVM / storage device 1108) having instructions 1114 and one or more processors 1102 combined with the one or more computer-readable media and configured to execute the instructions 1114 to implement a module to perform the actions described in the present disclosure.
[0147] For one embodiment, the control module 1104 may include any suitable interface controller to provide any suitable interface to at least one of the processor(s) 1102 and / or any suitable device or component in communication with the control module 1104 .
[0148] The control module 1104 may include a memory controller module to provide an interface to the memory 1106. The memory controller module may be a hardware module, a software module, and / or a firmware module.
[0149] The memory 1106 may be used, for example, to load and store data and / or instructions 1114 for the device 1100. For one embodiment, the memory 1106 may include any suitable volatile memory, such as a suitable DRAM. In some embodiments, the memory 1106 may include double data rate type four synchronous dynamic random access memory (DDR4 SDRAM).
[0150] For one embodiment, control module 1104 may include one or more input / output controllers to provide an interface to NVM / storage device 1108 and input / output device(s) 1110 .
[0151] For example, NVM / storage 1108 may be used to store data and / or instructions 1114. NVM / storage 1108 may include any suitable non-volatile memory (e.g., flash memory) and / or may include any suitable non-volatile storage device(s) (e.g., one or more hard disk drives (HDDs), one or more compact disk (CD) drives, and / or one or more digital versatile disk (DVD) drives).
[0152] NVM / storage device 1108 may include storage resources that are physically part of the device on which apparatus 1100 is installed, or it may be accessible to the device without being part of the device. For example, NVM / storage device 1108 may be accessed via input / output device(s) 1110 over a network.
[0153] (One or more) input / output devices 1110 may provide an interface for the apparatus 1100 to communicate with any other appropriate device, and the input / output device 1110 may include a communication component, an audio component, a sensor component, etc. The network interface 1112 may provide an interface for the apparatus 1100 to communicate through one or more networks, and the apparatus 1100 may wirelessly communicate with one or more components of a wireless network according to any of one or more wireless network standards and / or protocols, for example, access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, 5G, etc., or a combination thereof for wireless communication.
[0154] For one embodiment, at least one of the processor(s) 1102 may be packaged together with the logic of one or more controllers (e.g., a memory controller module) of the control module 1104. For one embodiment, at least one of the processor(s) 1102 may be packaged together with the logic of one or more controllers of the control module 1104 to form a system-in-package (SiP). For one embodiment, at least one of the processor(s) 1102 may be integrated on the same die with the logic of one or more controllers of the control module 1104. For one embodiment, at least one of the processor(s) 1102 may be integrated on the same die with the logic of one or more controllers of the control module 1104 to form a system-on-chip (SoC).
[0155] In various embodiments, the device 1100 may be, but is not limited to, a terminal device such as a server, a desktop computing device, or a mobile computing device (e.g., a laptop computing device, a handheld computing device, a tablet computer, a netbook, etc.). In various embodiments, the device 1100 may have more or fewer components and / or a different architecture. For example, in some embodiments, the device 1100 includes one or more cameras, a keyboard, a liquid crystal display (LCD) screen (including a touch screen display), a non-volatile memory port, multiple antennas, a graphics chip, an application-specific integrated circuit (ASIC), and a speaker.
[0156] Among them, the main control chip can be used as a processor or control module in the detection device, sensor data, location information, etc. are stored in a memory or NVM / storage device, the sensor group can be used as an input / output device, and the communication interface may include a network interface.
[0157] 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.
[0158] 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.
[0159] The present application embodiment is described with reference to the flowchart and / or block diagram of the method, terminal device (system) and computer program product according to the embodiment of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, and the combination of the process and / or box 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 produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device produce a device for implementing the function specified in one process or multiple processes in the flowchart and / or one box or multiple boxes in the block diagram.
[0160] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0161] 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 computer-implemented processing, so that the instructions executed on the computer or other programmable terminal device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0162] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.
[0163] 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.
[0164] The above is a detailed introduction to a hardware access method and device, an electronic device and a machine-readable medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A hardware access method, characterized in that: The method is applied to a first operating system, and the method includes: receiving hardware access requests; Determine a target operating system environment corresponding to the hardware access request; the target operating system environment includes: any one of a first operating system environment and a second operating system environment; Providing the target operating system environment; A target browser kernel corresponding to the target operating system environment is called, and the target browser kernel processes the hardware access request.
2. The method according to claim 1, characterized in that The determining the target operating system environment corresponding to the hardware access request includes: searching, according to the page address information corresponding to the hardware access request, in a mapping relationship between the page address information and the operating system environment to obtain a target operating system environment corresponding to the hardware access request; or According to the user instruction, the target operating system environment corresponding to the hardware access request is determined.
3. The method according to claim 1, characterized in that The providing the target operating system environment includes: In the case where the target operating system environment is a second operating system environment, providing the second operating system environment according to the compatibility layer software of the second operating system; or In the case that the target operating system environment is a first operating system environment, the first operating system environment is provided by using the first operating system.
4. The method according to claim 1, characterized in that: The target browser kernel processes the hardware access request, including: The target browser kernel loads a page corresponding to the hardware access request and accesses the hardware corresponding to the hardware access request.
5. The method according to claim 1, characterized in that The target browser kernel processes the hardware access request, including: processing the hardware access request according to the access mode corresponding to the target browser kernel.
6. The method according to claim 5, characterized in that The target operating system environment is a first operating system environment, the target browser kernel includes: a first browser kernel, and the access method includes: a network protocol access method, or a first plug-in access method; or The target operating system environment is a second operating system environment, the target browser kernel includes: a second browser kernel, and the access method includes: a network protocol access method, or a second plug-in access method; or The target operating system environment is a second operating system environment, the target browser kernel includes: a third browser kernel, and the access method includes: a network protocol access method, or a third plug-in access method.
7. The method according to claim 1, characterized in that The target browser kernel processes the hardware access request, including: In a case where the target operating system environment is a second operating system environment, determining a first interface call request corresponding to the hardware access request; According to the compatibility layer software of the second operating system, the first interface call request is converted into a second interface call request adapted to the first operating system environment, and the second interface call request is executed.
8. A hardware access device, characterized in that: The device is applied to a first operating system, and the device includes: A request receiving module, used for receiving a hardware access request; A system environment determination module, used to determine a target operating system environment corresponding to the hardware access request; the target operating system environment includes: any one of a first operating system environment and a second operating system environment; A system environment providing module, used for providing the target operating system environment; The kernel calling module is used to call the target browser kernel corresponding to the target operating system environment, and the target browser kernel processes the hardware access request.
9. An electronic device, characterized in that: include: processor; and A memory having executable codes stored thereon, which, when executed, causes the processor to execute the method according to any one of claims 1 to 7.
10. A machine-readable medium having executable codes stored thereon, which, when executed, causes a processor to perform the method according to any one of claims 1 to 7.