Data interaction method and device based on IOS system and electronic equipment

By creating virtual devices in the IOS system and providing preset interfaces, the problem of low data interaction efficiency in the IOS system is solved, efficient data interaction between application services and the IOS system is realized, and dependence on network packet parsing is avoided.

CN118869847APending Publication Date: 2024-10-29HANGZHOU INFOGO TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410894756.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-04
Publication Date
2024-10-29

AI Technical Summary

Technical Problem

The closed-source characteristics and security policies of the IOS system result in the data interaction between the application service and the IOS system being only achieved through network packet parsing, which is inefficient and requires modification of the business code logic. Direct interaction cannot be achieved through the network interface. .

Method used

By creating virtual devices and providing preset interfaces (such as Open, Write, and Read interfaces) to realize data interaction between application services and IOS systems, it avoids dependence on network packet parsing and improves interaction efficiency.

Benefits of technology

It achieves efficient data interaction between the IOS system and application services, avoids business logic modifications during cross-platform programming and code migration, and improves data interaction efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118869847A_ABST
    Figure CN118869847A_ABST
Patent Text Reader

Abstract

The invention discloses a data interaction method and device based on an IOS system and electronic equipment, and relates to the field of software development.The method comprises the steps that firstly, virtual equipment is created, the virtual equipment at least comprises implementation codes of a preset interface, the preset interface is used for achieving data interaction between an application service and the IOS system, and the implementation codes of the preset interface are used for achieving data interaction between the application service and the IOS system; when the application service needs to carry out data interaction with the IOS system, a first preset interface corresponding to the virtual device is called, the first preset interface is used for writing data in the IOS system into a preset code library of the application service, a second preset interface corresponding to the virtual device is called, the second preset interface is used for writing data in the IOS system into a preset code library of the application service, and the second preset interface is used for writing data in the IOS system into the preset code library of the application service. The second preset interface is used for transmitting the data read from the preset code library to the IOS system. According to the method and the device, the technical problem of low data interaction efficiency in the IOS system caused by the fact that data interaction can be realized only by analyzing the network data packet in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software development, and more specifically, to a data interaction method, device and electronic device based on an IOS system. Background Art

[0002] In the prior art, due to the closed-source characteristics and security policies of the IOS operating system, application services running on the IOS operating system can only achieve data interaction between the IOS system and the application services by obtaining network data packets and deeply analyzing the network data packets. When parsing the network data packets, the business code logic of the application service needs to be modified to achieve the purpose of obtaining the required data, and the data interaction between the IOS system and the application service cannot be achieved in the form of a network interface, which causes a technical problem of low efficiency of data interaction in the IOS system.

[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0004] The present application provides a data interaction method, device and electronic device based on the IOS system, so as to at least solve the technical problem of low data interaction efficiency in the IOS system caused by the prior art that data interaction can only be achieved by parsing network data packets.

[0005] According to one aspect of the present application, a data interaction method based on an IOS system is provided, including: creating a virtual device, wherein the virtual device includes at least an implementation code of a preset interface, and the preset interface is used to implement data interaction between an application service and the IOS system; when the application service needs to interact with the IOS system for data, calling a first preset interface corresponding to the virtual device, wherein the first preset interface is used to write data in the IOS system into a preset code library of the application service; calling a second preset interface corresponding to the virtual device, wherein the second preset interface is used to transmit data read from the preset code library to the IOS system.

[0006] Optionally, the data interaction method based on the IOS system also includes: obtaining the implementation code of the first preset interface, the implementation code of the second preset interface, and the implementation code of the third preset interface, wherein the third preset interface is used to establish a communication channel between the virtual device and the IOS system; packaging the implementation code of the first preset interface, the implementation code of the second preset interface, and the implementation code of the third preset interface in the form of a library to obtain a packaged code file corresponding to the preset interface, wherein the preset interface includes at least the first preset interface, the second preset interface, and the third preset interface; and creating a virtual device based on the packaged code file.

[0007] Optionally, the data interaction method based on the IOS system also includes: when the application service is running, creating a callback function corresponding to the first preset interface, wherein the callback function corresponding to the first preset interface is at least used to determine the operation result of the write operation corresponding to the first preset interface; when the write operation corresponding to the first preset interface fails, generating an alarm message based on the callback function corresponding to the first preset interface.

[0008] Optionally, the data interaction method based on the IOS system also includes: parsing the network data packet in the IOS system to obtain first data, wherein the first data is the network data to be written into a preset code library; writing the first data into the cache of the virtual device through the input channel of the virtual device; running the implementation code of the first preset interface, and transmitting the first data in the cache to the receiving thread through the callback function corresponding to the first preset interface, wherein the receiving thread is a thread in the application service for receiving the first data.

[0009] Optionally, the data interaction method based on the IOS system also includes: running the implementation code of the second preset interface, and reading the second data corresponding to the write thread of the application service through the input channel, wherein the write thread is a thread in the application service for writing network data to a preset code library, and the second data is the network data that has been written to the preset code library.

[0010] Optionally, the data interaction method based on the IOS system also includes: running the implementation code of the third preset interface.

[0011] Optionally, the data interaction method based on the IOS system also includes: detecting the system type of the operating system with which the application service needs to interact with data; when the system type is a preset type, realizing data exchange between the application service and the operating system through a preset strategy, wherein the preset type is a PC operating system type, and the preset strategy is used to realize data exchange through file descriptors and / or tunnel network cards.

[0012] According to another aspect of the present application, a data interaction device based on the IOS system is also provided, including: a first creation unit, used to create a virtual device, wherein the virtual device at least includes an implementation code of a preset interface, and the preset interface is used to realize data interaction between the application service and the IOS system; a first calling unit, used to call the first preset interface corresponding to the virtual device when the application service needs to interact with the IOS system for data, wherein the first preset interface is used to write the data in the IOS system into the preset code library of the application service; a second calling unit, used to call the second preset interface corresponding to the virtual device, wherein the second preset interface is used to transmit the data read from the preset code library to the IOS system.

[0013] According to another aspect of the present application, a computer program product is also provided, in which a computer program is stored, wherein when the computer program is running, the computer program product is controlled to execute any one of the above-mentioned data interaction methods based on the IOS system.

[0014] According to another aspect of the present application, an electronic device is also provided, wherein the electronic device includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement any one of the above-mentioned data interaction methods based on the IOS system.

[0015] In the present application, a virtual device is first created, wherein the virtual device includes at least an implementation code of a preset interface, and the preset interface is used to implement data interaction between the application service and the IOS system; when the application service needs to interact with the IOS system for data, the first preset interface corresponding to the virtual device is called, wherein the first preset interface is used to write data in the IOS system into a preset code library of the application service; and the second preset interface corresponding to the virtual device is called, wherein the second preset interface is used to transmit data read from the preset code library to the IOS system.

[0016] From the above content, it can be seen that the present application provides a method for realizing data interaction in an IOS system through a preset interface. The virtual device created by the present application includes at least a first preset interface and a second preset interface. The first preset interface is used to write data in the IOS system into a preset code library of an application service, and the second preset interface is used to transmit data read from the preset code library to the IOS system. Therefore, the present application achieves the purpose of providing a compatible network device access interface through a virtual device by creating a virtual device in the IOS system, thereby avoiding the need to modify business code logic during cross-platform programming or migrating code to IOS, thereby improving the efficiency of data interaction in the IOS system.

[0017] It can be seen that the technical solution of the present application achieves the purpose of realizing data interaction between the IOS system and the application service through the preset interface in the virtual device by pre-creating a virtual device, thereby achieving the technical effect of improving the efficiency of data interaction between the IOS system and the application service, and further solving the technical problem of low data interaction efficiency in the IOS system caused by the prior art that data interaction can only be realized by parsing network data packets. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0019] Figure 1 is a flowchart of an optional data interaction method based on an IOS system according to an embodiment of the present application;

[0020] Figure 2 is a schematic diagram of an optional method of providing a preset interface through a virtual device according to an embodiment of the present application;

[0021] Figure 3 This is a framework diagram of data interaction in an optional IOS system according to an embodiment of the present application;

[0022] Figure 4 is a schematic diagram of an optional data interaction device based on an IOS system according to an embodiment of the present application;

[0023] Figure 5 is a schematic diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0026] It should also be noted that the relevant information (including but not limited to information for display and analysis) and data (including but not limited to data required for interaction between the IOS system and the application service) involved in this application are all information and data authorized by the user or fully authorized by all parties. For example, an interface is set up between this system and the relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or organization.

[0027] In addition, the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant information and data involved in this application comply with the relevant laws, regulations and standards of the relevant regions, and necessary confidentiality measures have been taken and do not violate public order and good morals. In addition, this application provides corresponding operation entrances for users to choose to agree to authorization or refuse authorization. If the user chooses to refuse authorization, he / she will enter the corresponding expert decision-making process.

[0028] According to an embodiment of the present application, an embodiment of a data interaction method based on an IOS system is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0029] The present application provides an IOS-based data interaction system (hereinafter referred to as a data interaction system) for executing the IOS-based data interaction method in the present application. Figure 1 is a flow chart of an optional data interaction method based on an IOS system according to an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:

[0030] Step S101, creating a virtual device.

[0031] In step S101, the virtual device at least includes implementation code of a preset interface, where the preset interface is used to implement data interaction between the application service and the IOS system.

[0032] Optionally, the virtual device runs in the IOS operating system (i.e., the IOS system), and the preset interfaces provided by the virtual device include at least: an Open interface, a Write interface, and a Read interface, wherein the Open interface is used to establish communication between the IOS operating system and the application service, the Write interface is used to write data in the IOS system into a preset code library of the application service, and the Open interface is used to transmit data read from the preset code library to the IOS system.

[0033] Step S102: When the application service needs to perform data interaction with the IOS system, a first preset interface corresponding to the virtual device is called.

[0034] In step S102, the first preset interface is used to write data in the IOS system into a preset code library of the application service.

[0035] Optionally, the first preset interface is a Write interface, and the data interaction system can write the data in the IOS system into a preset code library of the application service through the Write interface provided by the virtual device.

[0036] Step S103: calling a second preset interface corresponding to the virtual device.

[0037] In step S103, the second preset interface is used to transmit the data read from the preset code library to the IOS system.

[0038] Optionally, the second preset interface is a Read interface, and the data interaction system can transmit the data read from the preset code library to the IOS system through the Read interface provided by the virtual device.

[0039] Optionally, when the application service needs to interact with the IOS system for data, before the data interaction system calls the Write interface and the Read interface, the data interaction system first calls the Open interface, thereby achieving the purpose of establishing communication between the IOS operating system and the application service.

[0040] From the above content, it can be seen that the present application provides a method for realizing data interaction in an IOS system through a preset interface. The virtual device created by the present application includes at least a first preset interface and a second preset interface. The first preset interface is used to write data in the IOS system into a preset code library of an application service, and the second preset interface is used to transmit data read from the preset code library to the IOS system. Therefore, the present application achieves the purpose of providing a compatible network device access interface through a virtual device by creating a virtual device in the IOS system, thereby avoiding the need to modify business code logic during cross-platform programming or migrating code to IOS, thereby improving the efficiency of data interaction in the IOS system.

[0041] It can be seen that the technical solution of the present application achieves the purpose of realizing data interaction between the IOS system and the application service through the preset interface in the virtual device by pre-creating a virtual device, thereby achieving the technical effect of improving the efficiency of data interaction between the IOS system and the application service, and further solving the technical problem of low data interaction efficiency in the IOS system caused by the prior art that data interaction can only be realized by parsing network data packets.

[0042] In an optional embodiment, the data interaction system first obtains the implementation code of the first preset interface, the implementation code of the second preset interface, and the implementation code of the third preset interface, wherein the third preset interface is used to establish a communication channel between the virtual device and the IOS system. Afterwards, the data interaction system packages the implementation code of the first preset interface, the implementation code of the second preset interface, and the implementation code of the third preset interface in the form of a library to obtain a packaged code file corresponding to the preset interface, wherein the preset interface includes at least the first preset interface, the second preset interface, and the third preset interface. Finally, the data interaction system creates a virtual device based on the packaged code file.

[0043] Optionally, the first preset interface is an Open interface.

[0044] Optionally, the data interaction system packages the implementation code of the preset interface into a library, which can achieve the following technical effects:

[0045] (1) Improve code reuse: Packaging the implementation code into a library makes the implementation code of the preset interface easier to manage. Developers can encapsulate commonly used code in the library and run the corresponding implementation code through interface calls when needed, thereby improving the reusability of the implementation code of the preset interface.

[0046] (2) Hiding the implementation details of the code: The data interaction system packages the implementation code of the preset interface into a library, hiding the implementation details corresponding to the implementation code of the preset interface. When the preset interface is called, the implementation code corresponding to the preset interface will not be exposed. This packaging and encapsulation operation improves the security of the implementation code of the preset interface.

[0047] (3) Improve code portability: The implementation code of the preset interface is packaged into a library. When code migration is required, the code library corresponding to the implementation code of the preset interface can be transplanted to the corresponding environment, thereby achieving the purpose of cross-platform use of the code and improving the portability of the implementation code of the preset interface.

[0048] In an optional embodiment, before calling the first preset interface corresponding to the virtual device, the data interaction system needs to create a callback function corresponding to the first preset interface, and the specific steps are as follows:

[0049] Optionally, when the application service is running, the data interaction system first creates a callback function corresponding to the first preset interface, wherein the callback function corresponding to the first preset interface is at least used to determine the operation result of the write operation corresponding to the first preset interface. Thereafter, when the write operation corresponding to the first preset interface fails, the data interaction system generates an alarm message based on the callback function corresponding to the first preset interface.

[0050] Optionally, before calling the second preset interface corresponding to the virtual device, the data interaction system needs to create a callback function corresponding to the second preset interface.

[0051] Optionally, before calling the third preset interface corresponding to the virtual device, the data interaction system needs to create a callback function corresponding to the third preset interface.

[0052] Optionally, the callback function is a common programming pattern. The callback function can be called when a specific event occurs or a specific condition is met, in order to first perform a specific operation. The callback function can be used in application scenarios such as asynchronous programming and event processing. The data interaction system in this application can create a callback function corresponding to the preset interface through the Lib.callback method provided by the code library.

[0053] In an optional embodiment, in the process of calling the first preset interface corresponding to the virtual device, the data interaction system first parses the network data packet in the IOS system to obtain the first data, wherein the first data is the network data to be written into the preset code library, and then the data interaction system writes the first data into the cache of the virtual device through the input channel of the virtual device, and then the data interaction system runs the implementation code of the first preset interface, and transmits the first data in the cache to the receiving thread through the callback function corresponding to the first preset interface, wherein the receiving thread is the thread in the application service for receiving the first data.

[0054] Optionally, the input channel of the virtual device is an Input Channel, and the data interaction system can implement a cached data write operation through the Input Channel, thereby achieving the following technical effects:

[0055] (1) Reduce the overhead of I / O (Input Output) operations: The caching mechanism allows application services to write data in batches to the Input Channel without having to perform an IO operation each time the data is written. For frequent write scenarios, the caching mechanism can merge multiple small write operations into a few large batch write operations, reducing the number of times the system accesses the storage device, thereby reducing the overall overhead of IO operations.

[0056] (2) Smooth data stream processing: The cache mechanism can ensure smooth data transmission. When there is a large amount of data to be written, the Input Channel can temporarily store all the data to be written in the cache. After that, it can be written in batches according to the preset strategy, thereby avoiding the sudden writing of high data volumes and achieving smooth transmission of data streams. As an intermediate layer, the Input Channel can adjust the data writing rate, so that the IOS system can adapt more flexibly to changes in workloads.

[0057] In an optional embodiment, in the process of calling the second preset interface corresponding to the virtual device, the data interaction system runs the implementation code of the second preset interface, and reads the second data corresponding to the write thread of the application service through the input channel, wherein the write thread is a thread in the application service for writing network data to a preset code library, and the second data is the network data that has been written to the preset code library.

[0058] Optionally, the data interaction system can implement cached data reading operations through the Input Channel, thereby achieving the following technical effects: improving data reading efficiency: the data interaction system can temporarily store frequently accessed data in the Input Channel, avoiding the need to obtain data from a preset code library each time it is read, thereby improving data reading efficiency.

[0059] In an optional embodiment, before calling the first preset interface corresponding to the virtual device, the data interaction system first runs the implementation code of the third preset interface.

[0060] Optionally, before calling the second preset interface corresponding to the virtual device, the data interaction system also needs to first run the implementation code of the third preset interface.

[0061] Optionally, in an operating system, before performing a data read or write operation, it is usually necessary to call an Open interface to open the device or resource to be accessed so that it can be accessed. In different operating systems, the functions of the Open interface are different. The functions of the Open interface include:

[0062] (1) Initializing the device: The Open interface can initialize the hardware status and / or software status of the device. The initialization operation is at least used to implement device parameter settings and memory space allocation.

[0063] (2) Establishing a communication channel: When data exchange is required between systems or devices, the Open interface can pre-establish a communication channel between the two parties that need to exchange data. The process of establishing a communication channel involves operations such as network connection and serial port communication.

[0064] (3) Permission check: When data interaction is required between systems or devices, the data interaction system can check the permissions of both parties that need to interact with the data through the Open interface, thereby improving the security of the interactive data.

[0065] In an optional embodiment, the data interaction system first detects the system type of the operating system with which the application service needs to interact with data, and then, when the system type is a preset type, realizes data exchange between the application service and the operating system through a preset strategy, wherein the preset type is a PC operating system type, and the preset strategy is used to realize data exchange through file descriptors and / or tunnel network cards.

[0066] Optionally, the PC operating system type includes at least a Windows operating system type, a Linux operating system type, and a Mac operating system type.

[0067] Optionally, when the system type is an IOS operating system type, the data interaction system implements data exchange between the application service and the operating system through a preset interface.

[0068] In an optional embodiment, Figure 2 is a schematic diagram of providing a preset interface through a virtual device according to an optional embodiment of the present application, such as Figure 2 As shown: Virtual device (ie Figure 2 The Virtual Device in the code library at least includes the implementation codes of the Open interface, the Write interface, and the Read interface, and the implementation codes in the virtual device are all packaged in the form of Lib. When the application service is started, a series of corresponding callback interfaces (i.e. Figure 2 The Data2IOS callback interface is used to write data into the network data packet of the IOS system, and the virtual device can implement the data writing operation with a cache mechanism through the Input Channel.

[0069] In addition, Figure 2 In the example, the implementation code of the virtual device's Write interface is used to call the Data2IOS callback interface, thereby achieving the purpose of writing data to the receiving thread of the application service; the implementation code of the virtual device's Read interface is used to read data in the virtual device's input channel Input Channel.

[0070] In an optional embodiment, Figure 3 is a framework diagram of data interaction in an optional IOS system according to an embodiment of the present application, such as Figure 3As shown in the figure: Lib is the preset code library, APP is the application service running in the IOS operating system. First, the system type of the operating system is identified through Lib. When the operating system is of PC type, data interaction in the operating system is realized through Tun Device or FD Device. Among them, Tun Device is used to open the network interface through the tunnel network card (Tun) to exchange network data with the operating system, and FD Device is used to open the network interface through the file descriptor (FD) to exchange network data with the operating system. Network data represents Figure 3 The data in the network data packet obtained through the Packet Flow method.

[0071] Optionally, when the operating system is of IOS type, data interaction in the operating system is implemented through the preset interface provided by Virtual Device (i.e. virtual device). Specifically, the APP writes the network data obtained from the Packet Flow in the IOS operating system into Lib through the Write interface; the APP writes the network data obtained from Lib into the Packet Flow of IOS through the Read interface.

[0072] In the present application, a virtual device is first created, wherein the virtual device includes at least an implementation code of a preset interface, and the preset interface is used to implement data interaction between the application service and the IOS system; when the application service needs to interact with the IOS system for data, the first preset interface corresponding to the virtual device is called, wherein the first preset interface is used to write data in the IOS system into a preset code library of the application service; and the second preset interface corresponding to the virtual device is called, wherein the second preset interface is used to transmit data read from the preset code library to the IOS system.

[0073] From the above content, it can be seen that the present application provides a method for realizing data interaction in an IOS system through a preset interface. The virtual device created by the present application includes at least a first preset interface and a second preset interface. The first preset interface is used to write data in the IOS system into a preset code library of an application service, and the second preset interface is used to transmit data read from the preset code library to the IOS system. Therefore, the present application achieves the purpose of providing a compatible network device access interface through a virtual device by creating a virtual device in the IOS system, thereby avoiding the need to modify business code logic during cross-platform programming or migrating code to IOS, thereby improving the efficiency of data interaction in the IOS system.

[0074] It can be seen that the technical solution of the present application achieves the purpose of realizing data interaction between the IOS system and the application service through the preset interface in the virtual device by pre-creating a virtual device, thereby achieving the technical effect of improving the efficiency of data interaction between the IOS system and the application service, and further solving the technical problem of low data interaction efficiency in the IOS system caused by the prior art that data interaction can only be realized by parsing network data packets.

[0075] According to another aspect of the embodiment of the present application, there is also provided a data interaction device based on an IOS system (hereinafter referred to as an interaction device), Figure 4 is a schematic diagram of an optional data interaction device based on an IOS system according to an embodiment of the present application, such as Figure 4 As shown, the data interaction device based on the IOS system includes: a first creating unit 401, a first calling unit 402 and a second calling unit 403.

[0076] Optionally, a first creation unit is used to create a virtual device, wherein the virtual device includes at least an implementation code of a preset interface, and the preset interface is used to implement data interaction between the application service and the IOS system; a first calling unit is used to call a first preset interface corresponding to the virtual device when the application service needs to interact with the IOS system for data, wherein the first preset interface is used to write data in the IOS system into a preset code library of the application service; and a second calling unit is used to call a second preset interface corresponding to the virtual device, wherein the second preset interface is used to transmit data read from the preset code library to the IOS system.

[0077] In an optional embodiment, the creation unit includes: a first acquisition subunit, a packaging subunit and a creation subunit.

[0078] Optionally, a first acquisition sub-unit is used to obtain the implementation code of the first preset interface, the implementation code of the second preset interface and the implementation code of the third preset interface, wherein the third preset interface is used to establish a communication channel between the virtual device and the IOS system; a packaging sub-unit is used to package the implementation code of the first preset interface, the implementation code of the second preset interface and the implementation code of the third preset interface in the form of a library to obtain a packaged code file corresponding to the preset interface, wherein the preset interface includes at least the first preset interface, the second preset interface and the third preset interface; a creation sub-unit is used to create a virtual device based on the packaged code file.

[0079] In an optional embodiment, the data interaction device based on the IOS system further includes: a second creation unit and a first generation unit.

[0080] Optionally, the second creation unit is used to create a callback function corresponding to the first preset interface when the application service is running, wherein the callback function corresponding to the first preset interface is at least used to determine the operation result of the write operation corresponding to the first preset interface; the first generation unit is used to generate an alarm message according to the callback function corresponding to the first preset interface when the write operation corresponding to the first preset interface fails.

[0081] In an optional embodiment, the first calling unit includes: a parsing subunit, a writing subunit and a first running subunit.

[0082] Optionally, a parsing subunit is used to parse the network data packet in the IOS system to obtain first data, wherein the first data is the network data to be written into a preset code library; a writing subunit is used to write the first data into the cache of the virtual device through the input channel of the virtual device; a first running subunit is used to run the implementation code of the first preset interface, and transmit the first data in the cache to the receiving thread through the callback function corresponding to the first preset interface, wherein the receiving thread is a thread in the application service for receiving the first data.

[0083] In an optional embodiment, the second calling unit includes: a second running subunit.

[0084] Optionally, the second running sub-unit is used to run the implementation code of the second preset interface, and read the second data corresponding to the write thread of the application service through the input channel, wherein the write thread is a thread in the application service used to write network data to the preset code library, and the second data is the network data that has been written to the preset code library.

[0085] In an optional embodiment, the data interaction device based on the IOS system further includes: an interface operation unit.

[0086] Optionally, the interface running unit is used to run the implementation code of the third preset interface.

[0087] In an optional embodiment, the data interaction device based on the IOS system further includes: a detection unit and a data exchange unit.

[0088] Optionally, the detection unit is used to detect the system type of the operating system with which the application service needs to interact with data; the data exchange unit is used to realize data exchange between the application service and the operating system through a preset strategy when the system type is a preset type, wherein the preset type is a PC operating system type, and the preset strategy is used to realize data exchange through file descriptors and / or tunnel network cards.

[0089] From the above content, it can be seen that the interactive device provides a method for realizing data interaction in the IOS system through a preset interface. The virtual device created by the interactive device includes at least a first preset interface and a second preset interface. The first preset interface is used to write data in the IOS system into a preset code library of the application service, and the second preset interface is used to transmit the data read from the preset code library to the IOS system. Therefore, the interactive device achieves the purpose of providing a compatible network device access interface through a virtual device by creating a virtual device in the IOS system, thereby avoiding the need to modify the business code logic during cross-platform programming or migrating code to IOS, thereby improving the efficiency of data interaction in the IOS system.

[0090] It can be seen that the interactive device achieves the purpose of realizing data interaction between the IOS system and the application service through the preset interface in the virtual device by pre-creating a virtual device, thereby achieving the technical effect of improving the efficiency of data interaction between the IOS system and the application service, and further solving the technical problem of low data interaction efficiency in the IOS system caused by the prior art that data interaction can only be realized by parsing network data packets.

[0091] According to another aspect of an embodiment of the present application, a computer program product is also provided, the computer program product comprising a stored computer program, wherein when the computer program is running, the computer program product is controlled to execute any one of the above-mentioned data interaction methods based on the IOS system.

[0092] According to another aspect of an embodiment of the present application, an electronic device is also provided, including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned IOS system-based data interaction methods by executing the executable instructions.

[0093] Optionally, Figure 5 is a schematic diagram of an optional electronic device according to an embodiment of the present application, such as Figure 5 As shown, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor, and when the processor executes the program, any one of the above-mentioned data interaction methods based on the IOS system is implemented.

[0094] Optionally, the processor can implement the following steps when executing the program: create a virtual device, wherein the virtual device includes at least an implementation code of a preset interface, and the preset interface is used to implement data interaction between the application service and the IOS system; when the application service needs to interact with the IOS system for data, call a first preset interface corresponding to the virtual device, wherein the first preset interface is used to write data in the IOS system into a preset code library of the application service; call a second preset interface corresponding to the virtual device, wherein the second preset interface is used to transmit data read from the preset code library to the IOS system.

[0095] Optionally, when the processor executes the program, it can implement the following steps: obtain the implementation code of the first preset interface, the implementation code of the second preset interface, and the implementation code of the third preset interface, wherein the third preset interface is used to establish a communication channel between the virtual device and the IOS system; package the implementation code of the first preset interface, the implementation code of the second preset interface, and the implementation code of the third preset interface in the form of a library to obtain a packaged code file corresponding to the preset interface, wherein the preset interface includes at least the first preset interface, the second preset interface, and the third preset interface; and create a virtual device based on the packaged code file.

[0096] Optionally, the processor can implement the following steps when executing the program: when the application service is running, create a callback function corresponding to the first preset interface, wherein the callback function corresponding to the first preset interface is at least used to determine the operation result of the write operation corresponding to the first preset interface; when the write operation corresponding to the first preset interface fails, generate an alarm message based on the callback function corresponding to the first preset interface.

[0097] Optionally, the processor can implement the following steps when executing the program: parse the network data packet in the IOS system to obtain first data, wherein the first data is the network data to be written into a preset code library; write the first data into the cache of the virtual device through the input channel of the virtual device; run the implementation code of the first preset interface, and transmit the first data in the cache to the receiving thread through the callback function corresponding to the first preset interface, wherein the receiving thread is a thread in the application service for receiving the first data.

[0098] Optionally, when the processor executes the program, it can implement the following steps: run the implementation code of the second preset interface, and read the second data corresponding to the write thread of the application service through the input channel, wherein the write thread is a thread in the application service used to write network data to a preset code library, and the second data is the network data that has been written to the preset code library.

[0099] Optionally, when the processor executes the program, the following steps can be implemented: running the implementation code of the third preset interface.

[0100] Optionally, when the processor executes the program, it can implement the following steps: detecting the system type of the operating system with which the application service needs to interact with data; when the system type is a preset type, implementing data exchange between the application service and the operating system through a preset strategy, wherein the preset type is a PC operating system type, and the preset strategy is used to implement data exchange through file descriptors and / or tunnel network cards.

[0101] From the above content, it can be seen that the present application provides a method for realizing data interaction in an IOS system through a preset interface. The virtual device created by the present application includes at least a first preset interface and a second preset interface. The first preset interface is used to write data in the IOS system into a preset code library of an application service, and the second preset interface is used to transmit data read from the preset code library to the IOS system. Therefore, the present application achieves the purpose of providing a compatible network device access interface through a virtual device by creating a virtual device in the IOS system, thereby avoiding the need to modify business code logic during cross-platform programming or migrating code to IOS, thereby improving the efficiency of data interaction in the IOS system.

[0102] It can be seen that the technical solution of the present application achieves the purpose of realizing data interaction between the IOS system and the application service through the preset interface in the virtual device by pre-creating a virtual device, thereby achieving the technical effect of improving the efficiency of data interaction between the IOS system and the application service, and further solving the technical problem of low data interaction efficiency in the IOS system caused by the prior art that data interaction can only be realized by parsing network data packets.

[0103] The above-mentioned embodiments or examples disclosed in the present application are not exhaustive, but are only illustrative of some embodiments or examples, and are not intended to be specific limitations on the scope of protection disclosed in the present application. In the absence of contradiction, each step in a certain embodiment or example in the present application can be implemented as an independent example, and the steps can be combined arbitrarily. For example, the scheme after removing some steps in a certain embodiment or example can also be implemented as an independent example, and the order of the steps in a certain embodiment or example can be arbitrarily exchanged. In addition, the optional methods or optional examples in a certain embodiment or example can be combined arbitrarily; in addition, the various embodiments or examples can be combined arbitrarily, for example, some or all steps of different embodiments or examples can be combined arbitrarily, and a certain embodiment or example can be combined arbitrarily with the optional methods or optional examples of other embodiments or examples.

[0104] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0105] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes 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 device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0106] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0107] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0108] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory. The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0109] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0110] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or 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, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0111] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0112] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A data interaction method based on an IOS system, characterized in that: include: Creating a virtual device, wherein the virtual device at least includes implementation code of a preset interface, and the preset interface is used to implement data interaction between the application service and the IOS system; When the application service needs to interact with the IOS system for data, calling a first preset interface corresponding to the virtual device, wherein the first preset interface is used to write the data in the IOS system into a preset code library of the application service; A second preset interface corresponding to the virtual device is called, wherein the second preset interface is used to transmit the data read from the preset code library to the IOS system.

2. The data interaction method based on the IOS system according to claim 1 is characterized in that: Create a virtual device, including: Obtaining an implementation code of the first preset interface, an implementation code of the second preset interface, and an implementation code of a third preset interface, wherein the third preset interface is used to establish a communication channel between the virtual device and the IOS system; The implementation code of the first preset interface, the implementation code of the second preset interface, and the implementation code of the third preset interface are packaged in the form of a library to obtain a packaged code file corresponding to the preset interface, wherein the preset interface at least includes the first preset interface, the second preset interface, and the third preset interface; The virtual device is created according to the packaged code file.

3. The data interaction method based on the IOS system according to claim 1 is characterized in that: Before calling the first preset interface corresponding to the virtual device, the data interaction method based on the IOS system further includes: When the application service is running, creating a callback function corresponding to the first preset interface, wherein the callback function corresponding to the first preset interface is at least used to determine an operation result of a write operation corresponding to the first preset interface; When the write operation corresponding to the first preset interface fails, an alarm message is generated according to the callback function corresponding to the first preset interface.

4. The data interaction method based on the IOS system according to claim 3 is characterized in that: In the process of calling the first preset interface corresponding to the virtual device, the data interaction method based on the IOS system also includes: Parsing a network data packet in the IOS system to obtain first data, wherein the first data is network data to be written into the preset code library; Writing the first data into a cache of the virtual device through an input channel of the virtual device; The implementation code of the first preset interface is run, and the first data in the cache is transmitted to a receiving thread through a callback function corresponding to the first preset interface, wherein the receiving thread is a thread in the application service for receiving the first data.

5. The data interaction method based on the IOS system according to claim 4 is characterized in that: In the process of calling the second preset interface corresponding to the virtual device, the data interaction method based on the IOS system also includes: Run the implementation code of the second preset interface, and read the second data corresponding to the write thread of the application service through the input channel, wherein the write thread is a thread in the application service used to write network data to the preset code library, and the second data is the network data that has been written to the preset code library.

6. The data interaction method based on the IOS system according to claim 2 is characterized in that: Before calling the first preset interface corresponding to the virtual device, the data interaction method based on the IOS system further includes: Run the implementation code of the third preset interface.

7. The data interaction method based on the IOS system according to claim 1 is characterized in that: Before calling the first preset interface in the virtual device, the data interaction method based on the IOS system further includes: Detecting the system type of the operating system with which the application service needs to interact with data; When the system type is a preset type, data exchange between the application service and the operating system is achieved through a preset strategy, wherein the preset type is a PC operating system type, and the preset strategy is used to achieve the data exchange through file descriptors and / or tunnel network cards.

8. A data interaction device based on an IOS system, characterized in that: include: A first creation unit is used to create a virtual device, wherein the virtual device at least includes an implementation code of a preset interface, and the preset interface is used to implement data interaction between the application service and the IOS system; A first calling unit, configured to call a first preset interface corresponding to the virtual device when the application service needs to interact with the IOS system for data, wherein the first preset interface is used to write data in the IOS system into a preset code library of the application service; The second calling unit is used to call a second preset interface corresponding to the virtual device, wherein the second preset interface is used to transmit the data read from the preset code library to the IOS system.

9. A computer program product, characterized in that The computer program product comprises a computer program, wherein when the computer program is running, the computer program product is controlled to execute the IOS system-based data interaction method according to any one of claims 1 to 7.

10. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the IOS system-based data interaction method as described in any one of claims 1 to 7.