Abstract:
The disclosure provides a networking method and device via network interface of data card equipment, wherein the method includes: loading a user application module, a control instruction library and a driver of the data card equipment in a computer configured with a Mac operating system; creating a virtual network interface matched with equipment attributes according to the equipment attributes reported by the data card equipment; sending a control instruction to the control instruction library; the control instruction library preliminarily packing and outputting the control instruction; an upper driver analyzing the data packet that is input by the control instruction library and that contains the control instruction, and encapsulating the control instruction in a communication control protocol format and then forwarding the control instruction; and a lower driver sending the data packet containing the control instruction to the data card equipment via a communication pipe. According to the invention, the problem that the Mac operating system is unable to network via the network interface of data card equipment can be effectively solved, and the rate bottleneck problem caused when the data card networks via a serial port at present also can be solved well.

Description:
FIELD OF THE INVENTION 
       [0001]    The disclosure relates to the technical field of communications. and in particular to a networking method and device via network interface of data card equipment. 
       BACKGROUND OF THE INVENTION 
       [0002]    With continuous development of information technology, higher requirements are proposed to wireless data terminal equipment. Voice, short message and some additional functions are required more and more, and requirements on the uplink and downlink rate of networking are increasingly proposed, rate is the most important performance index of wireless data card equipment. 
         [0003]    There are two ways of networking the wireless data card equipment onto a computer, one is traditional networking by virtual serial port, and the other one is networking by virtual network interface (Ethernet Adaptor). The traditional networking by virtual serial port has been achieved on a plurality of platforms such as Windows, Mac and Linux, but it has bottlenecks in terms of Internet wideband and rate, the uplink and downlink rate could not meet demands of users. In order to improve the rate of the wireless data card equipment, there is a growing tendency to employ the second way. In Windows operating system, networking by virtual network interface has been achieved, while such networking way has not been yet achieved in Mac, Linux and other operating systems, the development of related products is constrained largely. However, among global computer users, Mac users have a large market share, more and more wireless data card equipment are definitely required to be able to support the Mac operating system. 
         [0004]    Therefore, it is necessary to provide a networking method or device via network interface of the wireless data card equipment in the Mac operating system. 
       SUMMARY OF THE INVENTION 
       [0005]    Therefore, the disclosure provides a networking method and device via network interface of data card equipment, in order to achieve operations such as data interaction and networking between the Mac operating system and the data card equipment. 
         [0006]    To solve the above technical problem, the technical solutions of the disclosure are implemented as follows: 
         [0007]    a networking method via network interface of data card equipment comprises the following steps: 
         [0008]    loading a user application module, a control instruction library and a driver of the data card equipment in a computer configured with a Mac operating system, wherein the control instruction library provides an Application Programming Interface (API), and the user application module comprises a browser and an instruction sending module; 
         [0009]    creating a virtual network interface matched with equipment attributes according to the equipment attributes reported by the data card equipment when the data card equipment is connected with the computer and the driver is loaded successfully; 
         [0010]    the user application module sending a control instruction to the control instruction library via the API; 
         [0011]    the control instruction library preliminarily packing the control instruction, and outputting the data packet via an IOUserClient class interface in the computer; 
         [0012]    an upper driver analyzing the data packet that is input by the control instruction library and that contains the control instruction, and encapsulating the control instruction in a communication control protocol format and then forwarding the control instruction; and 
         [0013]    a lower driver sending the data packet containing the control instruction to the data card equipment via a communication pipe. 
         [0014]    The lower driver sending the data packet containing the control instruction to the data card equipment via a communication pipe comprises: the lower driver sorting the control instruction and data streams, and performing data interaction with the data card equipment via a control pipe and a data streams input/output pipe respectively. 
         [0015]    After the lower driver sending the data packet containing the control instruction to the data card equipment via a communication pipe, the method further comprises: after networking, the user application module communicating with the upper driver via a Transfer Control Protocol (TCP)/User Datagram Protocol (UDP) transport layer and network layer in the Mac operating system, and transporting data streams in a network to the upper driver via the network layer; and the upper driver packing and forwarding the data streams in the network to the lower driver. 
         [0016]    The method further comprises: displaying a networking control identifier and a data traffic statistics identifier in a User Interface (UI), accepting networking operation of the user, and performing the statistics of data traffic during the data interaction process. 
         [0017]    Before creating a virtual network interface matched with equipment attributes according to the equipment attributes reported by the data card equipment when the data card equipment is connected with the computer and the driver is loaded successfully, the method further comprises: judging whether to load a driver according to the equipment attributes reported by the data card equipment; if so, loading the driver for the data card equipment. 
         [0018]    A networking device via network interface of data card equipment comprising: 
         [0019]    a UI, configured to load a user application module, a control instruction library and a driver of the data card equipment in a computer configured with a Mac operating system; 
         [0020]    an upper driver, configured to create a virtual network interface matched with equipment attributes according to the equipment attributes reported by the data card equipment when the data card equipment is connected with the computer and the driver is loaded successfully; further configured to analyze the data packet that is input by the control instruction library and that contains the control instruction, and encapsulate the control instruction in a communication control protocol format and then forward the control instruction; 
         [0021]    a user application module, configured to send a control instruction to the control instruction library via an API; 
         [0022]    a control instruction library, configured to preliminarily pack the control instruction, and output the data packet via an IOUserClient class interface in the computer; and 
         [0023]    a lower driver, configured to send the data packet containing the control instruction to the data card equipment via a communication pipe. 
         [0024]    The lower driver is further configured to sort the control instruction and data streams, and perform data interaction with the data card equipment via a control pipe and a data streams input/output pipe respectively. 
         [0025]    The user application module is further configured to: after networking, communicate with the upper driver via a TCP/UDP transport layer and network layer in the Mac operating system, and transport data streams in a network to the upper driver via the network layer; and the upper driver is further configured to pack and forward the data streams in the network to the lower driver. 
         [0026]    The device further comprises: a network processing module, configured to display a networking control identifier and a data traffic statistics identifier in the UI, accept the networking operation of the user, and perform the statistics of data traffic during the data interaction process. 
         [0027]    The lower driver is further configured to judge whether to load a driver according to the equipment attributes reported by the data card equipment; if so, load the driver for the data card equipment. 
         [0028]    According to the networking method or device via network interface of data card equipment provided in the disclosure, by setting the upper driver and the lower driver and loading the control instruction library, the user application module and the driver of the data card equipment in the Mac operating system, data interaction between the Mac operating system and the data card equipment can be achieved, networking operation can be performed via the data card equipment, the gap in the conventional art is filled. In the disclosure, networking is achieved via the network interface of the data card equipment, compared with the primary networking way by a serial port, the downlink rate is improved greatly, and demands of users can be met better. Besides, due to the separated upper driver and lower driver, the constructed system has high stability, low complexity, good fault tolerance and high function separation degree, which is convenient to add control instructions new functions related to Universal Serial Bus (USB) protocol. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0029]      FIG. 1  is a flowchart of a networking method via a network interface of data card equipment according to an embodiment of the disclosure; 
           [0030]      FIG. 2  is a flowchart of data interaction after networking according to another embodiment of the disclosure; 
           [0031]      FIG. 3  is a structure diagram of a networking device via a network interface of data card equipment according to an embodiment of the disclosure; 
           [0032]      FIG. 4  is a flowchart of networking by a networking device via a network interface of data card equipment according to an embodiment of the disclosure; and 
           [0033]      FIG. 5  is a flowchart of data interaction by a networking device via a network interface of data card equipment according to an embodiment of the disclosure. 
       
    
    
     DETAILED DESCRIPTION OF THE EMBODIMENTS 
       [0034]    The implementation of purposes, function features and advantages of the disclosure will be further described below with reference to drawings and embodiments. It should be noted that, specific embodiments described here are just used for explaining the disclosure, but not for limiting the disclosure. 
         [0035]      FIG. 1  is a flowchart of a networking method via a network interface of data card equipment according to an embodiment of the disclosure, and the method includes the following steps. 
         [0036]    S 10 : a user application module, a control instruction library and a driver of the data card equipment are loaded in a computer configured with a Mac operating system; 
         [0037]    the control instruction library may provide an API; the user application module includes a browser and an instruction sending module. The user application module may be a user application program that can send control instructions such as networking, disconnection, statistics of data streams and webpage browsing or the like. Loading a user application program and a database in a computer is well known to those skilled in the field and will not be described again here. 
         [0038]    S 20 : a virtual network interface matched with equipment attributes is created according to the equipment attributes reported by the data card equipment when the data card equipment is connected with the computer and the driver is loaded successfully; 
         [0039]    in one embodiment, when the data card equipment is connected with a computer, it can be judged whether a driver needs to be loaded, if so, the driver is loaded for data interaction between the computer and the data card equipment. The virtual network interface may be specifically Ethernet Adaptor and is displayed in the user configurable network. 
         [0040]    S 30 : the user application module sends a control instruction to the control instruction library via the API; the control instruction includes USB protocol communication instruction and QUALCOMM MSM Interface (OMI) instruction; by the USB protocol communication instruction, data interaction between the computer and the data card equipment can be achieved; by the OMI instruction, connection to network can be achieved. 
         [0041]    S 40 : the control instruction library preliminarily packs the control instruction, and outputs the data packet via an IOUserClient class interface in the computer; 
         [0042]    the control instruction library may be a function library containing a plurality of control instructions, besides, the control instruction library further may provide an API for the Mac operating system, in order to receive an instruction sent by the user application module, and pack and forward the instruction. 
         [0043]    S 50 : an upper driver analyzes the data packet that is input by the control instruction library and that contains the control instruction, and encapsulates the control instruction in a communication control protocol format and then forwards the control instruction; 
         [0044]    the upper driver needs to achieve two aspects of functions: one aspect of inheriting IOUserClient class of the system and being responsible for communicating with User Interface (UI) and processing data streams related to control instructions (for example, the QMI instruction), the other aspect of inheriting IQEthernetController class of the system and processing data streams related to network. 
         [0045]    S 60  a lower driver sends the data packet containing the control instruction to the data card equipment via a communication pipe; 
         [0046]    the lower driver may provide a communication pipe for communication between the upper driver and the data card equipment, in one embodiment, the lower driver may respectively perform data interaction with the data card equipment via a control pipe and a data input/output pipe, in order to achieve the purpose of communication between the computer and the data card equipment. 
         [0047]    It should be noted that, in embodiments of the disclosure, the data card equipment may be specifically wireless data card equipment with a network interface by which the wireless data card equipment can be connected to a computer, all control instructions and network data related to the network interface in the Mac operating system are interacted with the data card equipment via this interface. 
         [0048]    According to the implementation ways of the disclosure, by setting the upper driver and the lower driver and loading the control instruction library, the user application module and the driver of the data card equipment in the Mac operating system, data interaction between the Mac operating system and the data card equipment can be achieved, networking operation can be performed via the data card equipment, the gap in the conventional art is filled. Furthermore, compared with the primary networking way by a serial port, the downlink rate is greatly improved. The downlink rate of one of high-speed data card equipment can reach 21 Mb/s, the downloading rate of the primary networking method by a serial port can only reach 9.5 Mb/s, under same conditions, when the method provided in the disclosure is used, the downloading rate can reach 19 Mb/s that basically meets the rate requirement of equipment, so that demands of users can be met well. 
         [0049]    In one embodiment, if the data card equipment has been connected to network via a control instruction, S 60  as shown in  FIG. 2  may specifically include the following steps. 
         [0050]    S 61  After networking, the user application module communicates with the upper driver via a TCP/UDP transport layer and network layer in the Mac operating system, and transports data streams in the network to the upper driver via the network layer. 
         [0051]    S 62 : The upper driver packs and forwards the data streams in the network to the lower driver. 
         [0052]    S 63 : The control instruction and the data streams are sorted, and data interaction is performed with the data card equipment via a control pipe and a data streams input/output pipe respectively. 
         [0053]    The method flow may further include a step of displaying a networking control identifier and a data traffic statistics identifier in the UI, accepting the networking operation of the user, and performing the statistics of data traffic during the data interaction process. An operable and graphical interface may be provided to the user in the UI, in one embodiment, a network networking control and data statistics function module may be added in the UI to provide networking operation and to obtain statistics information, in order to perform operations, such as parameter setup, state display and networking via the Mac operating system application program or the like. 
         [0054]    Besides, the above method flow in the disclosure may further include: by using a power module, a thread module and a data synchronous management module or the like, performing power management for the data card equipment and performing synchronization and thread scheduling management for data streams interacted between the Mac operating system and the data card equipment, wherein power management may include a power-on mode when in normal use and low-power model when in dormant state, or the like. 
         [0055]    The disclosure provides a networking device via network interface of data card equipment, which can achieve the above method flow. With reference to  FIG. 3 , the networking device via the network interface of data card equipment includes: 
         [0056]    a UI  10 , configured to load a user application module  30 , a control instruction library  40  and a driver of the data card equipment in a computer configured with a Mac operating system: the control instruction library  40  can provide an API; the user application module  30  includes a browser and an instruction sending module; the user application module  30  specifically may be a user application program that can send control instructions such as networking, disconnection, statistics of data streams and webpage browsing or the like. Loading a user application program and a database in a computer is well known to those skilled in the field and will not be described again here. 
         [0057]    an upper driver  20 , configured to create a virtual network interface matched with equipment attributes according to the equipment attributes reported by the data card equipment  50  when the data card equipment  50  is connected with the computer and the driver is loaded successfully; the upper driver  20  is further configured to analyze the data packet that is input by the control instruction library and that contains the control instruction, and encapsulate the control instruction in a communication control protocol format and then forward the control instruction; in one embodiment, when the data card equipment  50  is connected with a computer, it can be judged whether a driver needs to be loaded, if so, the driver is loaded for data interaction between the computer and the data card equipment  50 ; the virtual network interface may be Ethernet Adaptor and is displayed in the user configurable network. 
         [0058]    a user application module  30 , configured to send a control instruction to the control instruction library  40  via an API; the control instruction includes USB protocol communication instruction and QMI instruction; by the USB protocol communication instruction, data interaction between the computer and the data card equipment  50  can be achieved; by the QMI instruction, connection to network can be achieved. 
         [0059]    a control instruction library  40 , configured to preliminarily pack the control instruction, and output the data packet via an IOUserClient class interface in the computer; the control instruction library  40  may be a function library containing a plurality of control instructions and further may provide an API; the user application module  30  includes a browser and an instruction sending module; the control instruction library  40  further may provide an API for the Mac operating system, in order to receive an instruction sent by the user application module  30 , and pack and forward the instruction. 
         [0060]    a lower driver  60 , configured to send the data packet containing the control instruction to the data card equipment  50  via a communication pipe. the lower driver  60  may provide a communication pipe for communication between the upper driver  20  and the data card equipment  50 , in one embodiment, the lower driver  60  may respectively perform data interaction with the data card equipment  50  via a control pipe and a data input/output pipe, in order to achieve the purpose of communication between the computer and the data card equipment  50 . 
         [0061]    In one embodiment, the user application module  30  is further configured to: after networking, communicate with the upper driver via a TCP/UDP transport layer and network layer in the Mac operating system, and transport data streams in the network to the upper driver  20  via the network layer. The upper driver  20  is further configured to pack and forward the data streams in the network to the lower driver  60 . The lower driver  60  is further configured to sort the control instruction and the data streams, and perform data interaction with the data card equipment  50  via a control pipe and a data streams input/output pipe respectively. 
         [0062]    In one embodiment, the device may further include a network processing module, configured to display a networking control identifier and a data traffic statistics identifier in the UI, accept the networking operation of the user, and perform the statistics of data traffic during the data interaction process. A network processing module may be added in the UI to provide networking operation and to obtain statistics information, in order to perform operations, such as parameter setup, state display and networking via the Mac operating system application program or the like. 
         [0063]    Besides, the device may further include a power module, a thread module and a data synchronous management module or the like, to perform power management for the data card equipment and to perform synchronization and thread scheduling management for data streams interacted between the Mac operating system and the data card equipment, wherein power management may include a power-on mode when in normal use and low-power model when in dormant state, or the like. 
         [0064]    With reference to  FIG. 4 ,  FIG. 4  is a flowchart of networking operation by a networking device via a network interface of data card equipment according to an embodiment of the disclosure, and the method includes the following steps: 
         [0065]    S 101 : The data card equipment is inserted into a computer; before this step, the network interface driver, function library and user application program have been installed in the computer, when the data card equipment with a network interface function is inserted into the computer which installed with the Mac operating system, the network interface judges whether to load a driver according to the reported equipment attributes, if the network interface driver can be loaded successfully, S 102  is executed, if the network interface driver cannot be loaded successfully, S 106  is executed. 
         [0066]    S 102 : It is judged whether the equipment driver is loaded successfully; if the equipment driver is loaded successfully, one virtual network interface (Ethernet Adaptor) is created according to the condition reported by the data card equipment and displayed in the user configurable network, simultaneously, S 103  is executed; if the equipment driver cannot be loaded successfully, S 106  is executed. 
         [0067]    S 103 : The user application module sends a control instruction to the data card equipment via the control instruction library and judges whether the networking is successful; for example, the user application program communicates with the upper driver via the function library, further to access the data card equipment for networking operation, if connection to the network via the control instruction is successful, S 105  is executed, if failed, S 104  is executed. 
         [0068]    S 104 : It is checked whether the data card equipment and the used network are abnormal, if the abnormality is appropriately configured and repaired, S 103  is executed again for networking. 
         [0069]    S 105 : The user application module performs data interaction with the data card equipment via the upper driver and the lower driver, to meet various surfing demands of the user. If the user disconnects from the network or plugs the data card equipment out from the computer, S 106  is executed. 
         [0070]    S 106 : The equipment driver releases automatically, and the virtual network interface disappears automatically. So far, the flow ends. 
         [0071]    With reference to  FIG. 5 ,  FIG. 5  is a flowchart of data card network interface data interaction by a networking device via a network interface of data card equipment according to an embodiment of the disclosure, arrow in the drawing only shows a flow-out direction that data flows into the data card equipment from the computer, the flow-in direction is contrary to the flow-out direction, it can be understood reversely. The flow includes the following specific steps: 
         [0072]    S 201 : The user application module sends a control instruction to the API; for example, the user application program invokes the API related to the control instruction, for example, the API includes a function interface such as networking and data statistics or the like, and sends a QMI instruction to the control instruction library. S 202  is then executed. 
         [0073]    S 202 : The control instruction library preliminarily packs the control instruction; for example, a control instruction interacted with the data card equipment enters the function library, and the function library preliminarily packs the instruction to be interacted, and invokes the system IOKitlib interface to access the upper driver. S 203  is then executed. 
         [0074]    S 203 : The upper driver analyzes the data packet containing the control instruction, and encapsulates and forwards the control instruction to the lower driver; one part of the upper driver inherits IOUserClient class, receives data coming from the control instruction function library, encapsulates data in a control protocol format, and continuously sends the data to the lower driver. S 204  is then executed. 
         [0075]    S 204 : The lower driver sorts data from the upper driver into control instructions and network data streams, and performs data interaction with the data card equipment via a control pipe and a input/output pipe respectively, in order to achieve the purpose of communication between the computer and the data card equipment. If the data card equipment has been connected to the network via the control instruction, S 205  is then executed. 
         [0076]    S 205 : The user application module transfers data streams via the TCP/UDP transport layer and network layer in the Mac operating system; the user application program in the system, for example, browser, communicates with the upper driver via the TCP/UDP transport layer and network layer in the Mac OS. S 206  is then executed. 
         [0077]    S 206 : The upper driver processes the network data streams. For network-related data streams from the network layer, one part of the upper driver inherits IOEthernetController class, is responsible for processing network-related data streams, and packs and submits data to the lower driver for processing. S 204  is then executed. 
         [0078]    The above contents just describe preferred embodiments of the disclosure and are not intended to limit the patent scope of the disclosure. Any equivalent structures or equivalent flow transformations made by using contents in the specification and drawings of the disclosure, or direct or indirect applications in other related technical fields should be included within the patent protection scope of the disclosure.