XFS implementation method and device based on a hon gming system, equipment and a readable storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 深圳市证通金信科技有限公司
- Filing Date
- 2022-07-20
- Publication Date
- 2026-06-12
AI Technical Summary
Existing XFS implementations have low security on Windows systems and low efficiency in communicating with devices on Linux systems, as well as high maintenance difficulty, resulting in low practicality.
The method adopts the XFS implementation based on the HarmonyOS system. The XFS manager connects to the target device through the HarmonyOS system's soft bus, generates a remote object, performs authentication to obtain the device handle, generates control commands through the application layer, and calls the service provider layer to control the target device based on the soft bus.
The security and communication efficiency of the XFS implementation method are improved, the maintenance difficulty is reduced, and thus the practicality is enhanced.
Smart Images

Figure CN115344401B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of financial technology, and in particular to a method, apparatus, device and readable storage medium for implementing XFS based on the HarmonyOS system. Background Technology
[0002] XFS (Extensions for Financial Services) is a software architecture proposed by Microsoft for the global financial industry. Existing XFS implementations rely on Windows or Linux systems. However, XFS implementations based on Windows systems have lower security, while those based on Linux systems have lower efficiency in communicating with various devices and are more difficult to maintain. These shortcomings result in the low practicality of existing XFS implementations.
[0003] Therefore, improving the practicality of XFS implementation methods is an urgent problem to be solved. Summary of the Invention
[0004] The main objective of this invention is to propose an XFS implementation method, apparatus, device, and readable storage medium based on the HarmonyOS system, aiming to solve the problem of how to improve the practicality of the XFS implementation method.
[0005] To achieve the above objectives, this invention provides an XFS implementation method based on the HarmonyOS system. The method is applied to a main control device, which includes an application layer, an XFS manager, and a service provision layer. The method includes the following steps:
[0006] The XFS manager connects to the target device via the HarmonyOS soft bus to generate a remote object for the target device.
[0007] The XFS manager authenticates the target device based on the soft bus to obtain the device handle of the target device, and sends the device handle to the application layer so that the application layer can generate control commands based on the device handle;
[0008] The XFS manager receives the control commands sent by the application layer.
[0009] The XFS manager invokes the service provider layer to control the target device based on the soft bus, according to the control instructions and the remote object.
[0010] Optionally, the step of connecting the XFS manager to the target device via the HarmonyOS soft bus to generate a remote object for the target device includes:
[0011] The application layer sends a connection command to the XFS manager, and the XFS manager determines the target device based on the connection command.
[0012] The XFS manager calls the service provider layer to obtain device information of the target device based on the HarmonyOS system's soft bus;
[0013] The XFS manager connects to the target device via the soft bus based on the device information and a preset configuration information set, in order to generate a remote object corresponding to the target device.
[0014] Optionally, the step of generating a remote object corresponding to the target device by connecting to the target device via the soft bus through the XFS manager based on the device information and a preset configuration information set includes:
[0015] The XFS manager compares the device information with a preset configuration information set.
[0016] If the XFS manager determines that there is preset information in the preset configuration information set that is the same as the device information, then a connection is established with the target device based on the soft bus;
[0017] The XFS manager generates a remote object corresponding to the target device based on the device information.
[0018] Optionally, after the step of generating a remote object corresponding to the target device by connecting to the target device via the soft bus through the XFS manager based on the device information and a preset configuration information set, the method includes:
[0019] The XFS manager binds the device information and the remote object, and stores the bound device information and the remote object in a preset list of available devices.
[0020] Optionally, the step of authenticating the target device via the XFS manager based on the soft bus to obtain the device handle of the target device includes:
[0021] The application layer sends an open command to the XFS manager, and the XFS manager retrieves the device information from the preset available device list according to the open command.
[0022] The XFS manager sends an authentication command to the target device corresponding to the device information based on the device information via the soft bus, and receives the first authentication data sent by the target device. Based on the first authentication data, it determines the second authentication data and the third authentication data.
[0023] The XFS manager sends the second authentication data and the third authentication data to the target device, and receives the first authentication result and the fourth authentication data sent by the target device.
[0024] The XFS manager obtains a second authentication result based on the authentication plaintext data corresponding to the third authentication data and the fourth authentication data. If the authentication is successful based on the first authentication result and the second authentication result, the device handle of the target device is obtained.
[0025] Optionally, if authentication is successful based on the first authentication result and the second authentication result, the step of obtaining the device handle of the target device then includes:
[0026] The XFS manager stores the device handle in the preset available device list and sets the status flag of the remote object corresponding to the device handle in the preset available device list to the open state.
[0027] Optionally, the step of invoking the service provider layer to control the target device based on the soft bus via the XFS manager according to the control instructions and the remote object includes:
[0028] The XFS manager detects the status of the status flag bit of the remote object based on the device handle in the control command;
[0029] If the XFS manager determines that the status flag of the remote object is in the open state, then the service provider layer is invoked to send the control command to the target device through the instruction transmission interface of the remote object via the soft bus, in order to control the target device.
[0030] Furthermore, to achieve the above objectives, the present invention also provides an XFS implementation device based on the HarmonyOS system, the XFS implementation device based on the HarmonyOS system comprising:
[0031] The connection module is used to connect to the target device via the XFS manager based on the HarmonyOS soft bus to generate a remote object of the target device;
[0032] The authentication module is used to authenticate the target device through the XFS manager based on the soft bus to obtain the device handle of the target device, and send the device handle to the application layer so that the application layer can generate control commands based on the device handle;
[0033] A receiving module is configured to receive the control commands sent by the application layer through the XFS manager;
[0034] The control module is used to invoke the service provider layer to control the target device based on the soft bus, according to the control instructions and the remote object, through the XFS manager.
[0035] Furthermore, the connection module is also used for:
[0036] The application layer sends a connection command to the XFS manager, and the XFS manager determines the target device based on the connection command.
[0037] The XFS manager calls the service provider layer to obtain device information of the target device based on the HarmonyOS system's soft bus;
[0038] The XFS manager connects to the target device via the soft bus based on the device information and a preset configuration information set, in order to generate a remote object corresponding to the target device.
[0039] Furthermore, the connection module also includes a comparison module, which is used for:
[0040] The XFS manager compares the device information with a preset configuration information set.
[0041] If the XFS manager determines that there is preset information in the preset configuration information set that is the same as the device information, then a connection is established with the target device based on the soft bus;
[0042] The XFS manager generates a remote object corresponding to the target device based on the device information.
[0043] Furthermore, the connection module also includes a storage module, which is used for:
[0044] The XFS manager binds the device information and the remote object, and stores the bound device information and the remote object in a preset list of available devices.
[0045] Furthermore, the authentication module is also used for:
[0046] The application layer sends an open command to the XFS manager, and the XFS manager retrieves the device information from the preset available device list according to the open command.
[0047] The XFS manager sends an authentication command to the target device corresponding to the device information based on the device information via the soft bus, and receives the first authentication data sent by the target device. Based on the first authentication data, it determines the second authentication data and the third authentication data.
[0048] The XFS manager sends the second authentication data and the third authentication data to the target device, and receives the first authentication result and the fourth authentication data sent by the target device.
[0049] The XFS manager obtains a second authentication result based on the authentication plaintext data corresponding to the third authentication data and the fourth authentication data. If the authentication is successful based on the first authentication result and the second authentication result, the device handle of the target device is obtained.
[0050] Furthermore, the authentication module also includes a storage module, which is used for:
[0051] The XFS manager stores the device handle in the preset available device list and sets the status flag of the remote object corresponding to the device handle in the preset available device list to the open state.
[0052] Furthermore, the control module is also used for:
[0053] The XFS manager detects the status of the status flag bit of the remote object based on the device handle in the control command;
[0054] If the XFS manager determines that the status flag of the remote object is in the open state, then the service provider layer is invoked to send the control command to the target device through the instruction transmission interface of the remote object via the soft bus, in order to control the target device.
[0055] In addition, to achieve the above objectives, the present invention also provides an XFS implementation device based on the HarmonyOS system. The XFS implementation device based on the HarmonyOS system includes: an application layer, an XFS manager, a service providing layer, a memory, a processor, and an XFS implementation program based on the HarmonyOS system stored in the memory and executable on the processor. When the XFS implementation program based on the HarmonyOS system is executed by the processor, it implements the steps of the XFS implementation method based on the HarmonyOS system as described above.
[0056] In addition, to achieve the above objectives, the present invention also provides a readable storage medium, which is a computer-readable storage medium, and stores an XFS implementation program based on the HarmonyOS system. When the XFS implementation program based on the HarmonyOS system is executed by a processor, it implements the steps of the XFS implementation method based on the HarmonyOS system as described above.
[0057] The proposed XFS implementation method based on HarmonyOS involves connecting to the target device via an XFS manager using the HarmonyOS soft bus to generate a remote object for the target device. The XFS manager then authenticates the target device via the soft bus to obtain its device handle, which is sent to the application layer to generate control commands. The XFS manager receives these control commands from the application layer and, based on the control commands and the remote object, invokes a service provider layer to control the target device via the soft bus. This invention reduces maintenance complexity by generating the remote object using the XFS manager, improves security by authenticating the target device via the soft bus, and enhances communication efficiency by using the HarmonyOS soft bus for communication, thus improving the practicality of the XFS implementation method. Attached Figure Description
[0058] Figure 1 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of the present invention;
[0059] Figure 2 This is a flowchart illustrating the first embodiment of the XFS implementation method based on the HarmonyOS system of the present invention;
[0060] Figure 3 This is a schematic diagram illustrating the process of two-way authentication between the main control device and the target device in this invention.
[0061] Figure 4 This is a schematic diagram of the framework of the XFS implementation system based on the HarmonyOS system of this invention.
[0062] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0063] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0064] like Figure 1 As shown, Figure 1 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of the present invention.
[0065] The device in this embodiment of the invention can be a PC or a server.
[0066] like Figure 1As shown, the device may include: a processor 1001, such as a CPU; a network interface 1004; a user interface 1003; a memory 1005; and a communication bus 1002. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0067] Those skilled in the art will understand that Figure 1 The device structure shown does not constitute a limitation on the device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0068] like Figure 1 As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and an XFS implementation program based on the HarmonyOS system.
[0069] The operating system is a program that manages and controls portable storage devices and software resources, and supports the operation of the network communication module, user interface module, XFS implementation program based on HarmonyOS, and other programs or software; the network communication module is used to manage and control the network interface 1002; and the user interface module is used to manage and control the user interface 1003.
[0070] exist Figure 1 In the storage device shown, the storage device calls the XFS implementation program based on the HarmonyOS system stored in the memory 1005 through the processor 1001, and executes the operations in the various embodiments of the XFS implementation method based on the HarmonyOS system described below.
[0071] Based on the above hardware structure, an embodiment of the XFS implementation method based on the HarmonyOS system is proposed.
[0072] Reference Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the XFS implementation method based on the HarmonyOS system of the present invention. The method includes:
[0073] Step S10: Connect the XFS manager to the target device via the HarmonyOS soft bus to generate a remote object for the target device;
[0074] Step S20: The XFS manager authenticates the target device based on the soft bus to obtain the device handle of the target device, and sends the device handle to the application layer so that the application layer can generate control commands based on the device handle.
[0075] Step S30: Receive the control command sent by the application layer through the XFS manager;
[0076] Step S40: The XFS manager invokes the service provider layer to control the target device based on the soft bus according to the control instructions and the remote object.
[0077] This embodiment applies the XFS implementation method based on the HarmonyOS system to devices with the HarmonyOS system. These devices can be PCs, mobile terminals, and other smart terminals. The devices include a master device and slave devices. The master device includes an application layer, an XFS manager, and a service provider layer. Slave devices are controlled by the master device. For ease of description, the master device is used as an example. When a user needs to connect the master device to a target device, the master device sends a connection command to the XFS manager through the application layer, and the XFS manager determines the target device based on the connection command. The master device calls the service provider layer through the XFS manager to obtain the target device information based on the HarmonyOS system's soft bus. The master device connects to the target device through the soft bus based on the device information and a preset configuration information set, generating a remote object corresponding to the target device. After the master device connects to the target device, the master device sends an open command to the XFS manager through the application layer, and the XFS manager determines the target device based on the open command. The system retrieves device information from the available device list. The master device, through the XFS manager, sends authentication information to the target device corresponding to the device information via the soft bus, and receives the authentication response information from the target device. The master device, through the XFS manager, authenticates the target device based on the authentication response information. If authentication is successful, it obtains the device handle of the target device and sends it to the application layer. When a user needs to control the target device using the master device, the master device generates control commands based on the device handle through the application layer and sends the control commands to the XFS manager. The master device, through the XFS manager, invokes the service provider layer to control the target device via the soft bus based on the control commands and the remote object.
[0078] It should be noted that the application layer is the AP layer, where AP stands for Application Programming, and users interact with the main control device through the application layer. The XFS manager is a background financial service program under the HarmonyOS system, where XFS stands for Extensions for Financial Services. The service provider layer is the SP layer, where SP stands for Service Provider. The XFS management layer provides the application programming interface (API) to the application layer, and the service provider layer provides the device management interface (SPI) to the XFS manager. The main control device runs the HarmonyOS system and connects the application layer, XFS manager, and service provider layer through the HarmonyOS system's soft bus.
[0079] This embodiment of the XFS implementation method based on the HarmonyOS system connects to the target device via the XFS manager using the HarmonyOS system's soft bus to generate a remote object for the target device. The XFS manager then authenticates the target device via the soft bus to obtain its device handle, which is then sent to the application layer. The XFS manager receives control commands from the application layer via the soft bus. Based on the control commands and the remote object, the XFS manager invokes the service provider layer to control the target device via the soft bus. This invention reduces maintenance difficulty by generating the remote object for the target device using the XFS manager, improves security by authenticating the target device via the soft bus using the XFS manager, and enhances communication efficiency by communicating via the HarmonyOS system's soft bus, thereby improving the practicality of the XFS implementation method.
[0080] The following will provide a detailed explanation of each step:
[0081] Step S10: Connect the XFS manager to the target device via the HarmonyOS soft bus to generate a remote object for the target device;
[0082] In this embodiment, when a user needs to connect the main control device to the target device, the user performs corresponding operations at the application layer of the main control device. The main control device sends a connection command to the XFS manager through the application layer based on the HarmonyOS soft bus. The XFS manager then connects to the target device through the HarmonyOS soft bus, thereby generating a remote object of the target device. It should be noted that the remote object is a virtual device corresponding to the target device generated in the main control device, which transforms the target device into a local device corresponding to the main control device. The user can control the remote object through the main control device and control the corresponding target device to perform corresponding operations, greatly expanding the functionality of the main control device.
[0083] Specifically, step S10 includes:
[0084] Step a: Send a connection command to the XFS manager through the application layer, and determine the target device through the XFS manager based on the connection command;
[0085] In this step, the user performs corresponding operations at the application layer of the main control device. This causes the main control device to send connection commands to the XFS manager via the application layer. The main control device then uses the XFS manager to determine the target device based on the connection commands. For example, after the main control device starts up, it searches for connectable devices in the current space and displays them at the application layer. The user can then see which devices the main control device can connect to at the application layer. When the user clicks on the corresponding device at the application layer of the main control device, the application layer generates a connection command and sends it to the XFS manager. The main control device then uses the XFS manager to determine the target device based on the connection command. The target device is the device that the user clicked at the application layer. It should be noted that the target device includes, but is not limited to, external devices and distributed devices. External devices, also known as peripherals, cannot perform functions independently and require the main control device to complete their functions, such as mice and keyboards. Distributed devices can perform functions independently or through the control of the main control device, such as printers, card readers, and ATMs. Preferably, the target device is a device running the HarmonyOS operating system.
[0086] Step b: The XFS manager calls the service provider layer to obtain the device information of the target device based on the HarmonyOS system's soft bus;
[0087] In this step, the main control device calls the service provider layer through the XFS manager to obtain the device information of the target device based on the HarmonyOS soft bus. It can be understood that the target device is equipped with the HarmonyOS system, and the main control device can obtain the device information of the target device using wireless communication technologies such as Bluetooth and WiFi based on the HarmonyOS soft bus.
[0088] Step c: The XFS manager connects to the target device via the soft bus based on the device information and the preset configuration information set to generate a remote object corresponding to the target device.
[0089] In this step, after the main control device starts up, it reads the preset configuration file through the XFS manager. Based on the preset configuration file, it determines the set of preset configuration information, such as the IDs and names of the devices that can be connected. Then, it calls the log interface through the XFS manager to output the set of preset configuration information read. After obtaining the device information of the target device, the main control device connects to the target device via the soft bus based on the device information and the preset configuration information set through the XFS manager to generate a remote object corresponding to the target device. It can be understood that the target device runs the HarmonyOS system. When the main control device determines that the target device meets the connection conditions, it connects to the target device via wireless communication technologies such as Bluetooth and WiFi through the soft bus. It should be noted that the preset configuration file is pre-set in the XFS manager of the main control device by relevant configuration personnel. For example, if the main control device needs to be used in a bank lobby, the relevant configuration personnel can pre-set the preset configuration file in the XFS manager of the main control device based on the device information of the devices that the main control device can connect to in the bank lobby.
[0090] Further, step c includes:
[0091] Step c1: The device information is compared with a preset configuration information set by the XFS manager;
[0092] Step c2: If the XFS manager determines that there is preset information in the preset configuration information set that is the same as the device information, then a connection is established with the target device based on the soft bus.
[0093] Step c3: The XFS manager generates a remote object corresponding to the target device based on the device information.
[0094] In steps c1 to c3, after obtaining the device information of the target device, the master control device compares the device information with each preset configuration information in the preset configuration information set to obtain a comparison result. If the comparison result obtained by the master control device through the XFS manager indicates that there is a preset information in the preset configuration information set that matches the device information, then the master control device connects to the target device via the soft bus. If the comparison result obtained by the master control device through the XFS manager indicates that there is no preset information in the preset configuration information set that matches the device information, then the master control device calls the log interface through the XFS manager to record the inconsistency of device information and does not connect to the target device. After the master control device connects to the target device via the soft bus through the XFS manager, it generates a remote object corresponding to the target device based on the device information through the XFS manager. It can be understood that by setting a preset configuration file in the XFS manager, comparing the received device information of the target device with the preset configuration information set corresponding to the preset configuration file, and then determining whether the target can be connected, the target device is not easily connected by other devices, and the master control device is not allowed to connect to unauthorized devices, thus improving connection security.
[0095] Further, after step S10, the following is included:
[0096] The XFS manager binds the device information and the remote object, and stores the bound device information and the remote object in a preset list of available devices.
[0097] In this step, after generating the remote object corresponding to the target device, the master device binds the device information of the target device and the remote object through the XFS manager, and stores the bound device information and remote object in the preset available device list. It can be understood that the preset available device list is set in the XFS manager of the master device in advance. When the master device starts up, no information is stored in the preset available device list. After the master device connects with the target device, the device information and remote object of the target device are stored in the preset available device list, which helps to improve the efficiency of the master device in controlling the corresponding target device in the future.
[0098] Step S20: The XFS manager authenticates the target device based on the soft bus to obtain the device handle of the target device, and sends the device handle to the application layer so that the application layer can generate control commands based on the device handle.
[0099] In this embodiment, after the master control device connects to the target device through the XFS manager, it authenticates the target device through the soft bus of the HarmonyOS system via the XFS manager to obtain the device handle of the target device. Then, it sends the device handle to the application layer through the XFS manager, so that the application layer can generate control commands based on the device handle when it receives user operations. Optionally, the master control device performs bidirectional authentication of the target device through the XFS manager based on the soft bus of the HarmonyOS system. That is, the master control device authenticates the target device, and the target device also authenticates the master control device. Only when the master control device successfully authenticates the target device and the target device also successfully authenticates the master control device can the master control device obtain the device handle of the target device and send the device handle to the application layer.
[0100] Specifically, step S20 includes:
[0101] Step d: Send an open command to the XFS manager through the application layer, and obtain the device information from the preset available device list through the XFS manager according to the open command;
[0102] In this step, the master device sends an open command to the XFS manager through the application layer, and the XFS manager searches for the device information corresponding to the open command in the preset available device list. If the XFS manager cannot find the corresponding device information in the preset available device list, it returns a device opening failure message to the application layer and calls the log interface to record the device opening failure. If the XFS manager finds the corresponding device information in the preset available device list, it retrieves the corresponding device information from the preset available device list.
[0103] Step e: The XFS manager sends an authentication command to the target device corresponding to the device information based on the device information via the soft bus, and receives the first authentication data sent by the target device. Based on the first authentication data, the second authentication data and the third authentication data are determined.
[0104] Step f: Send the second authentication data and the third authentication data to the target device through the XFS manager, and receive the first authentication result and the fourth authentication data sent by the target device;
[0105] Step g: The XFS manager obtains the second authentication result based on the authentication plaintext data corresponding to the third authentication data and the fourth authentication data. If the authentication is successful based on the first authentication result and the second authentication result, the device handle of the target device is obtained.
[0106] In steps e to g, the master control device sends an authentication command to the target device corresponding to the device information via the XFS manager based on the device information and the HarmonyOS soft bus. When the target device receives the authentication command, it generates first authentication data and sends it to the master control device via the soft bus. After receiving the first authentication data sent by the target device, the master control device determines the second and third authentication data based on the first authentication data via the XFS manager and sends the second and third authentication data to the target device via the soft bus. After receiving the second and third authentication data, the target device compares the second authentication data with the first authentication plaintext data corresponding to the first authentication data to obtain the first authentication result, and generates fourth authentication data based on the third authentication data. It then sends the first authentication result and the fourth authentication data to the master control device via the soft bus. After receiving the first and fourth authentication results, the master control device obtains the second authentication result via the XFS manager based on the second authentication plaintext data and the fourth authentication data corresponding to the third authentication data. If the authentication is successful based on the first and second authentication results, the device handle of the target device is obtained.
[0107] In one feasible embodiment, such as Figure 3As shown, the master control device sends an authentication command to the target device via the XFS manager using a soft bus. Upon receiving the authentication command, the target device generates first authentication plaintext data T_DATA, which includes a first random number and date / time data. The target device obtains the public key PK, master control device ID, and key identifier HID from the security management center, and encrypts the first authentication plaintext data T_DATA using the SM9 algorithm to obtain first authentication data TAC_0, where TAC_0 = SM9(PK, ID, HID, T_DATA). The target device then sends the first authentication data TAC_0 to the master control device via the soft bus. Upon receiving the first authentication data TAC_0, the master control device, through the XFS manager, decrypts the first authentication data TAC_0 using the SM9 algorithm based on the master control device ID and private key, generating the second authentication data TAC_1. Simultaneously, it generates the second authentication plaintext data S_DATA through the XFS manager, where S_DATA includes a second random number and date / time data. Furthermore, it obtains the public key PK, target device ID, and key identifier HID from the security management center through the XFS manager, encrypts S_DATA using the SM9 algorithm, and obtains the third authentication data SAC_0 = SM9(PK, ID, HID, ...).The master device sends the second authentication data TAC_1 and the third authentication data SAC_0 to the target device via the XFS manager and soft bus. Upon receiving the second authentication data TAC_1 and the third authentication data SAC_0, the target device compares the first authentication plaintext data T_DATA corresponding to the first authentication data TAC_0 with the second authentication data TAC_1 to determine the first authentication result. If the first authentication plaintext data T_DATA and the second authentication data TAC_1 are the same, the first authentication result is considered successful; otherwise, the first authentication result is considered unsuccessful. Simultaneously, the target device decrypts the third authentication data SAC_0 using the SM9 algorithm based on the target device ID and private key, generating the fourth authentication data SAC_1. The system transmits the first authentication result and the fourth authentication data SAC_1 to the master device via the soft bus. Upon receiving these data, the master device compares the second authentication plaintext data S_DATA (corresponding to the third authentication data SAC_0) with the fourth authentication data SAC_1 to determine the second authentication result. If the second authentication plaintext data S_DATA and the fourth authentication data SAC_1 are the same, the second authentication result is considered successful. If they are different, the second authentication result is considered unsuccessful. Based on the first and second authentication results, if either the first or second authentication result is deemed unsuccessful, the authentication is considered unsuccessful. If both the first and second authentication results are deemed successful, the authentication is considered successful. After confirming successful authentication, the master device obtains the device handle of the target device via the XFS manager using the HarmonyOS soft bus.
[0108] Further, after step S20, the following steps are included:
[0109] The XFS manager stores the device handle in the preset available device list and sets the status flag of the remote object corresponding to the device handle in the preset available device list to the open state.
[0110] In this step, after obtaining the device handle of the target device, the master device stores the device handle in a preset list of available devices through the XFS manager, and sets the status flag of the remote object corresponding to the device handle in the preset list of available devices to the open state.
[0111] Furthermore, if the master device fails to authenticate the target device, or the target device fails to authenticate the master device, the master device calls the log interface through the XFS manager to record the authentication failure.
[0112] Step S30: Receive the control command sent by the application layer through the XFS manager;
[0113] In this embodiment, the master control device obtains the device handle of the target device through the XFS manager and sends the device handle to the application layer. The user then performs corresponding operations on the master control device. The master control device generates corresponding control commands based on the device handle through the application layer and sends the control commands to the XFS manager based on the HarmonyOS soft bus or the API interface provided by the XFS manager.
[0114] Step S40: The XFS manager invokes the service provider layer to control the target device based on the soft bus according to the control instructions and the remote object.
[0115] Specifically, step S40 includes:
[0116] Step h: The XFS manager detects the status of the status flag bit of the remote object according to the device handle in the control command;
[0117] Step i: If the XFS manager determines that the status flag of the remote object is in the open state, then the service provider layer is invoked to send the control command to the target device through the instruction transmission interface of the remote object via the soft bus, so as to control the target device.
[0118] In steps h to i, when the XFS manager receives a control command, the master device determines the target device based on the device handle in the control command through the XFS manager, and checks the status of the status flag bit of the remote object corresponding to the target device in the preset available device list. If the XFS manager determines that the status flag bit of the remote object is not in the open state, the XFS manager returns the information that the device is not open to the application layer based on the soft bus of the HarmonyOS system. If the XFS manager determines that the status flag bit of the remote object is in the open state, the XFS manager calls the service provider layer to send the control command to the target device through the instruction transmission interface of the remote object based on the soft bus, so as to control the target device.
[0119] In one feasible embodiment, assuming the target device is a card reader in a bank, when a user (i.e., a bank employee) needs to control the card reader to collect payments, the application layer of the main control device generates and sends a payment instruction to the XFS manager based on the device handle of the card reader. The XFS manager determines the card reader based on the device handle in the payment instruction and checks the status of the status flag bit of the remote object corresponding to the card reader in the preset list of available devices. If the XFS manager determines that the status flag bit of the remote object corresponding to the card reader is in the open state, the XFS manager calls the service provider layer to send the payment instruction to the card reader via the instruction transmission interface of the remote object through the soft bus. The card reader can then prompt the payer to swipe the card to make the payment.
[0120] It should be noted that the main control device can also use the above methods to query the status information of the target device and control the switching on and off of the target device, etc., which will not be elaborated here.
[0121] In this embodiment, the master control device sends a connection command to the XFS manager through the application layer, and the XFS manager determines the target device based on the connection command. The master control device calls the service provider layer through the XFS manager to obtain the device information of the target device based on the HarmonyOS soft bus. The master control device connects with the target device through the soft bus based on the device information and a preset configuration information set, thereby generating a remote object corresponding to the target device. After the master control device connects with the target device, the master control device sends an open command to the XFS manager through the application layer, and the XFS manager obtains the device information from the preset available device list based on the open command. The device, through the XFS manager, sends authentication information to the target device corresponding to the device information via a soft bus based on the device information, and receives authentication response information from the target device. The master device, through the XFS manager, authenticates the target device based on the authentication response information. If authentication is successful, it obtains the device handle of the target device and sends the device handle to the application layer. When the user needs to control the target device using the master device, the master device generates control commands based on the device handle through the application layer and sends the control commands to the XFS manager. The master device, through the XFS manager, invokes the service provider layer to control the target device via the soft bus based on the control commands and the remote object. This invention reduces maintenance difficulty by generating the remote object of the target device through the XFS manager, improves security by authenticating the target device through the soft bus using the XFS manager, and improves communication efficiency by communicating via the HarmonyOS soft bus, thereby enhancing the practicality of the XFS implementation method.
[0122] In specific implementation, such as Figure 3 As shown, Figure 3This is a schematic diagram of the framework of an XFS-based system under HarmonyOS. The main control device includes an application layer, an XFS management layer, and a service provider layer. The application layer communicates with the XFS management layer via the HarmonyOS soft bus or API interface, issuing commands to the XFS management layer. The XFS management layer communicates with the service provider layer via the SPI interface on the HarmonyOS soft bus, issuing commands from the application layer to the service provider layer. The XFS management layer includes preset configuration files for connecting to and authenticating external devices. The service provider layer communicates with external or distributed devices via the HarmonyOS soft bus, issuing commands from the XFS management layer to these devices. Remote invocation is used to control external or distributed devices, implementing the XFS specification on the HarmonyOS soft bus. The main control device, through the XFS manager on the HarmonyOS soft bus, treats external or distributed devices as local devices, extending its functionality. The main control device initiates authentication requests through the XFS manager on the HarmonyOS soft bus to authenticate the accessed external or distributed devices, expanding functionality while improving the security of accessed devices and the overall system security. The implementation of XFS based on the HarmonyOS system's soft bus reduces maintenance difficulty, improves security and communication efficiency, and thus enhances the practicality of the XFS implementation method.
[0123] This invention also provides an XFS implementation device based on the HarmonyOS system. The XFS implementation device based on the HarmonyOS system of this invention includes:
[0124] The connection module is used to connect to the target device via the XFS manager based on the HarmonyOS soft bus to generate a remote object of the target device;
[0125] The authentication module is used to authenticate the target device through the XFS manager based on the soft bus to obtain the device handle of the target device, and send the device handle to the application layer so that the application layer can generate control commands based on the device handle;
[0126] A receiving module is configured to receive the control commands sent by the application layer through the XFS manager;
[0127] The control module is used to invoke the service provider layer to control the target device based on the soft bus, according to the control instructions and the remote object, through the XFS manager.
[0128] Furthermore, the connection module is also used for:
[0129] The application layer sends a connection command to the XFS manager, and the XFS manager determines the target device based on the connection command.
[0130] The XFS manager calls the service provider layer to obtain device information of the target device based on the HarmonyOS system's soft bus;
[0131] The XFS manager connects to the target device via the soft bus based on the device information and a preset configuration information set, in order to generate a remote object corresponding to the target device.
[0132] Furthermore, the connection module also includes a comparison module, which is used for:
[0133] The XFS manager compares the device information with a preset configuration information set.
[0134] If the XFS manager determines that there is preset information in the preset configuration information set that is the same as the device information, then a connection is established with the target device based on the soft bus;
[0135] The XFS manager generates a remote object corresponding to the target device based on the device information.
[0136] Furthermore, the connection module also includes a storage module, which is used for:
[0137] The XFS manager binds the device information and the remote object, and stores the bound device information and the remote object in a preset list of available devices.
[0138] Furthermore, the authentication module is also used for:
[0139] The application layer sends an open command to the XFS manager, and the XFS manager retrieves the device information from the preset available device list according to the open command.
[0140] The XFS manager sends an authentication command to the target device corresponding to the device information based on the device information via the soft bus, and receives the first authentication data sent by the target device. Based on the first authentication data, it determines the second authentication data and the third authentication data.
[0141] The XFS manager sends the second authentication data and the third authentication data to the target device, and receives the first authentication result and the fourth authentication data sent by the target device.
[0142] The XFS manager obtains a second authentication result based on the authentication plaintext data corresponding to the third authentication data and the fourth authentication data. If the authentication is successful based on the first authentication result and the second authentication result, the device handle of the target device is obtained.
[0143] Furthermore, the authentication module also includes a storage module, which is used for:
[0144] The XFS manager stores the device handle in the preset available device list and sets the status flag of the remote object corresponding to the device handle in the preset available device list to the open state.
[0145] Furthermore, the control module is also used for:
[0146] The XFS manager detects the status of the status flag bit of the remote object based on the device handle in the control command;
[0147] If the XFS manager determines that the status flag of the remote object is in the open state, then the service provider layer is invoked to send the control command to the target device through the instruction transmission interface of the remote object via the soft bus, in order to control the target device.
[0148] The present invention also provides an XFS implementation device based on the HarmonyOS system.
[0149] The XFS implementation device based on HarmonyOS includes: an application layer, an XFS manager, a service provision layer, a memory, a processor, and an XFS implementation program based on HarmonyOS stored on the memory and executable on the processor. When the XFS implementation program based on HarmonyOS is executed by the processor, it implements the steps of the XFS implementation method based on HarmonyOS as described above.
[0150] The method implemented when the XFS implementation program based on HarmonyOS running on the processor is executed can be referred to in various embodiments of the XFS implementation method based on HarmonyOS of the present invention, and will not be repeated here.
[0151] The present invention also provides a readable storage medium.
[0152] The readable storage medium is a computer-readable storage medium, on which an XFS implementation program based on the HarmonyOS system is stored. When the XFS implementation program based on the HarmonyOS system is executed by the processor, it implements the steps of the XFS implementation method based on the HarmonyOS system as described above.
[0153] The method implemented when the XFS implementation program based on HarmonyOS running on the processor is executed can be referred to in various embodiments of the XFS implementation method based on HarmonyOS of the present invention, and will not be repeated here.
[0154] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0155] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0156] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0157] The above are merely preferred embodiments of the present invention and do not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A method for implementing XFS based on the HarmonyOS system, characterized in that, The method is applied in a master control device, which includes an application layer, an extended financial services XFS manager, and a service provision layer. The method includes the following steps: The XFS manager connects to the target device via the HarmonyOS soft bus to generate a remote object for the target device; the remote object is a virtual device corresponding to the target device generated in the host device. The XFS manager authenticates the target device based on the soft bus to obtain the device handle of the target device, and sends the device handle to the application layer so that the application layer can generate control commands based on the device handle; The XFS manager receives the control commands sent by the application layer. The XFS manager invokes the service provider layer to control the target device based on the soft bus, according to the control instructions and the remote object.
2. The XFS implementation method based on HarmonyOS as described in claim 1, characterized in that, The step of connecting to the target device via the XFS manager using the HarmonyOS soft bus to generate a remote object for the target device includes: The application layer sends a connection command to the XFS manager, and the XFS manager determines the target device based on the connection command. The XFS manager calls the service provider layer to obtain device information of the target device based on the HarmonyOS system's soft bus; The XFS manager connects to the target device via the soft bus based on the device information and a preset configuration information set, in order to generate a remote object corresponding to the target device.
3. The XFS implementation method based on HarmonyOS as described in claim 2, characterized in that, The step of connecting to the target device via the soft bus through the XFS manager based on the device information and a preset configuration information set to generate a remote object corresponding to the target device includes: The XFS manager compares the device information with a preset configuration information set. If the XFS manager determines that there is preset information in the preset configuration information set that is the same as the device information, then a connection is established with the target device based on the soft bus; The XFS manager generates a remote object corresponding to the target device based on the device information.
4. The XFS implementation method based on HarmonyOS as described in claim 2, characterized in that, After the step of connecting with the target device via the soft bus through the XFS manager based on the device information and a preset configuration information set to generate a remote object corresponding to the target device, the following steps are included: The XFS manager binds the device information and the remote object, and stores the bound device information and the remote object in a preset list of available devices.
5. The XFS implementation method based on HarmonyOS as described in claim 4, characterized in that, The step of authenticating the target device via the XFS manager based on the soft bus to obtain the device handle of the target device includes: The application layer sends an open command to the XFS manager, and the XFS manager retrieves the device information from the preset available device list according to the open command. The XFS manager sends an authentication command to the target device corresponding to the device information based on the device information via the soft bus, and receives the first authentication data sent by the target device. Based on the first authentication data, it determines the second and third authentication data. Specifically, this step includes: after receiving the authentication command, the target device generates first authentication plaintext data including a first random number and date / time data; the target device uses the SM9 algorithm to encrypt the pre-acquired public key of the security management center, the master control device ID, the key identifier, and the first authentication plaintext data to obtain the first authentication data; after receiving the first authentication data sent by the target device, the master control device decrypts the first authentication data using the XFS manager and based on the master control device ID and private key using the SM9 algorithm to obtain the second authentication data; the master control device generates second authentication plaintext data including a second random number and date / time data through the XFS manager; the master control device obtains the public key of the security management center, the target device ID, and the key identifier through the XFS manager; the master control device uses the SM9 algorithm to encrypt the second authentication plaintext data, the public key, the target device ID, and the key identifier to obtain the third authentication data. The XFS manager sends the second authentication data and the third authentication data to the target device, and receives the first authentication result and the fourth authentication data sent by the target device. Specifically, this step includes: after receiving the second authentication data and the third authentication data, the target device compares the first authentication plaintext data corresponding to the first authentication data with the second authentication data; if the first authentication plaintext data and the second authentication data are different, the first authentication result is authentication failure; the target device then decrypts the third authentication data using the SM9 algorithm based on the target device ID and private key to generate the fourth authentication data. The XFS manager obtains a second authentication result based on the authentication plaintext data corresponding to the third authentication data and the fourth authentication data. If the authentication is successful based on the first authentication result and the second authentication result, the device handle of the target device is obtained.
6. The XFS implementation method based on HarmonyOS as described in claim 5, characterized in that, The step of obtaining the device handle of the target device after determining that authentication is successful based on the first authentication result and the second authentication result includes: The XFS manager stores the device handle in the preset available device list and sets the status flag of the remote object corresponding to the device handle in the preset available device list to the open state.
7. The XFS implementation method based on HarmonyOS as described in any one of claims 1-6, characterized in that, The step of invoking the service provider layer to control the target device based on the soft bus via the XFS manager according to the control command and the remote object includes: The XFS manager detects the status of the status flag bit of the remote object based on the device handle in the control command; If the XFS manager determines that the status flag of the remote object is in the open state, then the service provider layer is invoked to send the control command to the target device through the instruction transmission interface of the remote object via the soft bus, in order to control the target device.
8. An XFS implementation device based on the HarmonyOS system, characterized in that, The XFS implementation device based on the HarmonyOS system includes: The connection module is used to connect to the target device via the XFS manager based on the HarmonyOS soft bus to generate a remote object of the target device; the remote object is a virtual device corresponding to the target device generated in the host device; The authentication module is used to authenticate the target device through the XFS manager based on the soft bus to obtain the device handle of the target device, and send the device handle to the application layer so that the application layer can generate control commands based on the device handle; A receiving module is configured to receive the control commands sent by the application layer through the XFS manager; The control module is used to invoke the service provider layer to control the target device based on the soft bus, according to the control instructions and the remote object, through the XFS manager.
9. A device for implementing XFS based on the HarmonyOS system, characterized in that, The XFS implementation device based on HarmonyOS includes: an application layer, an XFS manager, a service providing layer, a memory, a processor, and an XFS implementation program based on HarmonyOS stored in the memory and executable on the processor. When the XFS implementation program based on HarmonyOS is executed by the processor, it implements the steps of the XFS implementation method based on HarmonyOS as described in any one of claims 1 to 7.
10. A readable storage medium, characterized in that, The readable storage medium is a computer-readable storage medium, and the computer-readable storage medium stores an XFS implementation program based on the HarmonyOS system. When the XFS implementation program based on the HarmonyOS system is executed by a processor, it implements the steps of the XFS implementation method based on the HarmonyOS system as described in any one of claims 1 to 7.