A middleware calling method and system for Android smart devices
By introducing middleware calling methods on Android smart devices, the complex problems of device compatibility and interaction under multi-system, multi-level, and multi-modification languages are solved, cross-language calling and simplified interfaces are realized, and device management and operation and maintenance efficiency is improved. .
Patent Information
- Application Number
- CN202111383151.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-22
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2041-11-22
AI Technical Summary
The prior art cannot realize multi-level and cross-language calls in the case of multi-system, multi-level, and multi-modification languages, resulting in poor device compatibility and complex service operations and device interactions.
Provide a middleware calling method for Android smart devices. It receives client calling instructions through middleware, determines the instruction type according to the preset instruction type standard, and matches the pre-divided accessory type, and calls the corresponding driver for the underlying hardware. data interaction.
It realizes normal data interaction between non-Android clients on Android smart devices, establishes a unified channel and access specification between device drivers and business application platforms, simplifies the call interface, blocks the complexity of business operations and device interaction, and realizes cross-border Language call.
Smart Images

Figure CN114090292B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of self-service terminal services, and in particular to a middleware calling method and system for an Android smart device. Background Art
[0002] With the construction of the power smart business hall, many simple but labor-intensive businesses can be handled through self-service, without the need for manual counter handling. At the same time, through the construction of the smart device outlet information service platform, the working mode of the power smart business hall has a high degree of scalability, especially the conditions for the rapid promotion and application of smart devices. The number of smart devices is increasing. In order to ensure the standardization of smart device access, improve the management of smart devices, and reduce the operation and maintenance costs of smart devices.
[0003] Currently, most VTMs (Video Teller Machines) are based on the Windows system. Figure 1 As shown, communication is performed by calling OCX (Object Linking and Embedding (OLE) Control Extension) driver through JS (JavaScript). Due to insufficient technical capabilities, the self-service equipment for comprehensive power business provided by various enterprises cannot meet the electronic transfer of business, especially in the subsequent upgrade process, due to the replacement or expansion of equipment suppliers, the equipment compatibility is poor, and the hardware function calls of multiple models, multiple versions, and multiple manufacturers are compatible. It is impossible to realize cross-language calls and simplify the calling interface, and shield the complexity of business operations and equipment interactions. At the same time, with the requirements of application scenarios and costs, many VTMs have begun to gradually convert from window systems to Linux and Android systems, which has led to the existence of multiple systems, multiple levels, and multiple mobilization languages in the same network structure. How to realize multi-level cross-language calls is particularly important, and there is no effective way to call. Summary of the invention
[0004] The purpose of the present invention is to propose a middleware calling method and system for Android smart devices to solve the technical problem that the existing methods have multiple systems, multiple levels, and multiple mobilization languages and cannot realize multi-level and cross-language calling.
[0005] On the one hand, a middleware calling method for an Android smart device is provided, comprising:
[0006] The middleware receives a call instruction input by a client; the middleware determines the type of the input call instruction according to a preset instruction type standard;
[0007] The middleware matches the type of the input calling instruction with the pre-classified accessory type. When the match is successful, the corresponding driver called according to the matched accessory type calls the underlying hardware of the Android smart device to realize data interaction.
[0008] Preferably, the middleware determines the type of the input calling instruction according to a preset instruction type standard, specifically including:
[0009] After receiving the input call instruction, by querying the preset instruction type standard table, the corresponding type information found is output as the type of the call instruction;
[0010] The instruction type standard table is used to record instruction parameters, instruction types corresponding to the instruction parameters, and description information corresponding to the instruction parameters.
[0011] Preferably, the middleware matches the type of the input calling instruction with the pre-classified accessory type specifically including:
[0012] Comparing the type of the calling instruction with the pre-classified accessory types;
[0013] When the pre-classified accessory types contain type parameters that are the same as the type of the calling instruction, the matched accessories are obtained, and the underlying hardware of the Android smart device is called through the obtained accessories.
[0014] Preferably, the calling of the underlying hardware of the Android smart device specifically includes:
[0015] Execute corresponding operations through the preset drivers in the matched accessories to obtain execution results;
[0016] When the execution result is successful, the interaction data returned by the Android smart device is obtained and sent to the client to realize data interaction;
[0017] When the execution result is unsuccessful, error information and a corresponding error code are obtained, and a preset error code table is queried according to the error code to determine the error location, and the error information and the error location are returned to the client.
[0018] Preferably, when the match is unsuccessful, a match error message and a match error code are generated, and a preset match error code table is queried according to the match error code to determine the error content, and the error message and the error content are returned to the client.
[0019] On the other hand, a middleware calling system for an Android smart device is also provided to implement the middleware calling method for an Android smart device, including:
[0020] The client is used to receive the calling instruction input by the user and forward the received calling instruction to the middleware;
[0021] The middleware is used to determine the type of the received call instruction according to the preset instruction type standard; match the type of the input call instruction with the pre-classified accessory type. When the match is successful, the corresponding driver called according to the matched accessory type calls the underlying hardware of the Android smart device to realize data interaction.
[0022] Preferably, the middleware is further used to, after receiving the input calling instruction, query a preset instruction type standard table and output the corresponding type information queried as the type of the calling instruction;
[0023] The instruction type standard table is used to record instruction parameters, instruction types corresponding to the instruction parameters, and description information corresponding to the instruction parameters.
[0024] Preferably, the middleware is further used to compare the type of the calling instruction with the pre-classified accessory types;
[0025] When the pre-classified accessory types contain type parameters that are the same as the type of the calling instruction, the matched accessories are obtained, and the underlying hardware of the Android smart device is called through the obtained accessories.
[0026] Preferably, the middleware is also used to execute corresponding operations through a preset driver in the matched accessory to obtain an execution result;
[0027] When the execution result is successful, the interaction data returned by the Android smart device is obtained and sent to the client to realize data interaction;
[0028] When the execution result is unsuccessful, error information and a corresponding error code are obtained, and a preset error code table is queried according to the error code to determine the error location, and the error information and the error location are returned to the client.
[0029] Preferably, the middleware is also used to generate matching error information and matching error code when the matching is unsuccessful, and query a preset matching error code table according to the matching error code to determine the error content, and return the error information and the error content to the client.
[0030] In summary, the implementation of the embodiments of the present invention has the following beneficial effects:
[0031] The middleware calling method and system for Android smart devices provided by the present invention communicate with the client in a unified manner through the middleware, and then match and call the driver of the corresponding Android smart device according to the needs of the client, so as to realize the normal data interaction between the non-Android client and the Android smart device. A unified channel and unified access specification between the device driver and the business application platform are established to realize cross-language calling and simplify the calling interface, and shield the complexity of business operation and device interaction. In the case of multiple systems, multiple levels, and multiple mobilization languages, multi-level and cross-language calling is realized. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, without paying creative labor, other drawings obtained based on these drawings still belong to the scope of the present invention.
[0033] Figure 1 The main flow diagram of a middleware calling method for an Android smart device in an embodiment of the present invention is shown.
[0034] Figure 2 The present invention is a schematic diagram of a middleware calling system for an Android smart device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0035] In order to make the objectives, technical solutions and advantages of the present invention more clear, the present invention will be further described in detail below with reference to the accompanying drawings.
[0036] like Figure 1 FIG. 1 is a schematic diagram of an embodiment of a middleware calling method for an Android smart device provided by the present invention. In this embodiment, the method includes:
[0037] The middleware receives the call instruction input by the client and determines the type of the input call instruction according to the preset instruction type standard. That is, after the middleware establishes a connection with the client (application layer), it receives the request instruction, processes it according to the type of the request instruction, and then feeds back the processing result to the application. The middleware and the client call the public interface opening / closing / status and specific function operations of each accessory in the middle layer according to the websocket interface specification process. Websocket has a one-time handshake, a persistent connection, and dual-channel communication.
[0038] In a specific embodiment, after receiving the input call instruction, the corresponding type information is output as the type of the call instruction by querying the preset instruction type standard table; wherein the instruction type standard table is used to record instruction parameters, instruction types corresponding to the instruction parameters, and description information corresponding to the instruction parameters. That is, according to the request instruction type, the upper layer data packet is unpacked and processed, and corresponding processing submodules (accessories) are divided according to different types.
[0039] Furthermore, the middleware matches the type of the input calling instruction with the pre-classified accessory type, and when the match is successful, the corresponding driver called according to the matched accessory type calls the underlying hardware of the Android smart device to realize data interaction.
[0040] In a specific embodiment, the type of the calling instruction is compared with the pre-classified accessory types; when the pre-classified accessory types contain the same type parameters as the type of the calling instruction, the matched accessories are obtained, and the underlying hardware of the Android smart device is called through the obtained accessories. Different accessories are called and processed according to the accessory types.
[0041] Specifically, the corresponding operation is performed by the preset driver in the matched accessory to obtain the execution result; when the execution result is successful, the interactive data returned by the Android smart device is obtained and sent to the client to realize data interaction; when the execution result is unsuccessful, the error information and the corresponding error code are obtained, and the preset error code table is queried according to the error code to determine the error location, and the error information and the error location are returned to the client. Among them, the middle will follow the "VTM Hardware Interface Specification" with the underlying driver. When the preset driver performs the corresponding operation, the module hardware function call is implemented by using the SO dynamic library call. The so file is a program function library under Linux, that is, the compiled code and data that can be used by other programs. The Android system VTM device is realized through the middleware, and the business layer calls the underlying hardware to specify the information field through the code to obtain the business certification data or information. Establish a unified channel and unified access specification for device drivers and business application platforms to realize cross-language calls and simplify the calling interface, and shield the complexity of business operations and device interactions.
[0042] Furthermore, when the match is unsuccessful, a match error message and a match error code are generated, and a preset match error code table is queried according to the match error code to determine the error content, and the error message and the error content are returned to the client.
[0043] like Figure 2FIG. 1 is a schematic diagram of an embodiment of a middleware calling system for an Android smart device provided by the present invention. In this embodiment, the system is used to implement the middleware calling method for an Android smart device, including:
[0044] The client is used to receive the calling instruction input by the user and forward the received calling instruction to the middleware;
[0045] The middleware is used to determine the type of the received call instruction according to the preset instruction type standard; match the type of the input call instruction with the pre-classified accessory type. When the match is successful, the corresponding driver called according to the matched accessory type calls the underlying hardware of the Android smart device to realize data interaction.
[0046] Specifically, the middleware is also used to, after receiving an input calling instruction, output the corresponding type information queried as the type of the calling instruction by querying a preset instruction type standard table; wherein the instruction type standard table is used to record instruction parameters, the instruction type corresponding to the instruction parameters, and the description information corresponding to the instruction parameters.
[0047] The middleware is also used to compare the type of the calling instruction with the pre-classified accessory types; when the pre-classified accessory types contain type parameters that are the same as the type of the calling instruction, the matched accessories are obtained, and the underlying hardware of the Android smart device is called through the obtained accessories.
[0048] More specifically, the middleware is also used to execute corresponding operations through the preset driver in the matched accessory to obtain an execution result; when the execution result is successful, the interaction data returned by the Android smart device is obtained and sent to the client to realize data interaction; when the execution result is unsuccessful, the error information and the corresponding error code are obtained, and the preset error code table is queried according to the error code to determine the error location, and the error information and the error location are returned to the client.
[0049] The middleware is also used to generate matching error information and matching error code when the matching is unsuccessful, and query a preset matching error code table according to the matching error code to determine the error content, and return the error information and the error content to the client.
[0050] In summary, the implementation of the embodiments of the present invention has the following beneficial effects:
[0051] The middleware calling method and system for Android smart devices provided by the present invention communicate with the client in a unified manner through the middleware, and then match and call the driver of the corresponding Android smart device according to the needs of the client, so as to realize the normal data interaction between the non-Android client and the Android smart device. A unified channel and unified access specification between the device driver and the business application platform are established to realize cross-language calling and simplify the calling interface, and shield the complexity of business operation and device interaction. In the case of multiple systems, multiple levels, and multiple mobilization languages, multi-level and cross-language calling is realized.
[0052] The above disclosure is only the preferred embodiment of the present invention, which certainly cannot be used to limit the scope of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.
Claims
1. A middleware calling method for an Android smart device, characterized in that: include: The middleware receives a calling instruction input by the client; The middleware determines the type of the input calling instruction according to a preset instruction type standard; The middleware matches the type of the input calling instruction with the pre-classified accessory type. When the match is successful, the corresponding driver called according to the matched accessory type calls the underlying hardware of the Android smart device to realize data interaction; The middleware determines the type of the input calling instruction according to the preset instruction type standard, specifically including: After receiving the input call instruction, by querying the preset instruction type standard table, the corresponding type information found is output as the type of the call instruction; The instruction type standard table is used to record instruction parameters, instruction types corresponding to the instruction parameters, and description information corresponding to the instruction parameters; The middleware matches the type of the input calling instruction with the pre-classified accessory type specifically including: Comparing the type of the calling instruction with the pre-classified accessory types; When the pre-classified accessory types contain type parameters that are the same as the type of the calling instruction, the matched accessories are obtained, and the underlying hardware of the Android smart device is called through the obtained accessories.
2. The method according to claim 1, characterized in that The calling of the underlying hardware of the Android smart device specifically includes: Execute corresponding operations through the preset drivers in the matched accessories to obtain execution results; When the execution result is successful, the interaction data returned by the Android smart device is obtained and sent to the client to realize data interaction; When the execution result is unsuccessful, error information and a corresponding error code are obtained, and a preset error code table is queried according to the error code to determine the error location, and the error information and the error location are returned to the client.
3. The method according to claim 1, characterized in that Also includes: When the match is unsuccessful, a match error message and a match error code are generated, and a preset match error code table is queried according to the match error code to determine the error content, and the error message and the error content are returned to the client.
4. A middleware calling system for an Android smart device, used to implement the method according to any one of claims 1 to 3, characterized in that: include: The client is used to receive the calling instruction input by the user and forward the received calling instruction to the middleware; The middleware is used to determine the type of the received call instruction according to a preset instruction type standard; match the type of the input call instruction with the pre-classified accessory type, and when the match is successful, call the corresponding driver called according to the matched accessory type to call the underlying hardware of the Android smart device to realize data interaction; The middleware is also used for, after receiving the input calling instruction, querying a preset instruction type standard table and outputting the corresponding type information obtained as the type of the calling instruction; The instruction type standard table is used to record instruction parameters, instruction types corresponding to the instruction parameters, and description information corresponding to the instruction parameters; The middleware is also used to compare the type of the calling instruction with the pre-classified accessory types; When the pre-classified accessory types contain type parameters that are the same as the type of the calling instruction, the matched accessories are obtained, and the underlying hardware of the Android smart device is called through the obtained accessories.
5. The system according to claim 4, characterized in that The middleware is also used to execute corresponding operations through the preset driver in the matched accessory to obtain the execution result; When the execution result is successful, the interaction data returned by the Android smart device is obtained and sent to the client to realize data interaction; When the execution result is unsuccessful, error information and a corresponding error code are obtained, and a preset error code table is queried according to the error code to determine the error location, and the error information and the error location are returned to the client.
6. The system according to claim 4, characterized in that The middleware is also used to generate matching error information and matching error code when the matching is unsuccessful, and query a preset matching error code table according to the matching error code to determine the error content, and return the error information and the error content to the client.
Citation Information
Patent Citations
Method for supporting cross-platform development of applications and medium
CN112486571A