METHOD AND APPARATUS FOR EXECUTING USER ACTION COMMANDS
CROSS-REFERENCES TO RELATED APPLICATIONS
[0001] This application claims priority of Chinese Patent Application No.
201210351824.4, filed on September 20, 2012, the entire contents of which are incorporated by reference herein.
FIELD OF THE INVENTION
[0002] The present invention generally relates to computer technologies and, more particularly, to a method and system for executing user action commands.
BACKGROUND
[0003] Two-dimensional (2D) barcode is a new information bearer developed on the basis of the one-dimensional barcode, but can record more data and is more complex than the one-dimensional barcode, such as for recording images, web links, etc. The 2D barcode has been widely used in commercial activities, especially in high-tech, storage and transportation, and ID document management, etc. With the development of mobile phones, especially smart phones, the 2D barcode are being used by more and more people. However, currently, most of the 2D barcode applications only concern direct presentation of the information carried by the 2D barcode after scanning the 2D barcode.
[0004] Under current technologies, applications running on mobile phones are implemented by calling the Application Programming Interface (API) openly provided by the operating system on the mobile phones. While the mobile applications call the system APIs on the mobile phone, a mobile application itself provides its own APIs, calling which can utilize the
corresponding functions provided by the mobile application. Alternatively, Near Field
Communication (NFC) technology may be used to call APIs, allowing a device (typically a mobile phone) within a limited range to collect data from another device or an NFC tag.
[0005] However, under the current technologies, when calling the open APIs of the mobile phone operating system, the application corresponding to the API often requires the user to download and install the application, and to run the application calling the API. Thus, it may require interactions with backend servers to complete the user authentication and authorization, and the process to achieve the corresponding function on mobile phones is more complex.
Further, when calling API through NFC, because the NFC communication standards are not unified, such technology has not yet been widely accepted, resulting less NFC equipment on the market and higher operating cost. Further, NFC uses radio frequency identification (RFID), which may be read by an unauthorized party, and the secret key may be easily broken, causing security concerns.
[0006] The disclosed method and system are directed to solve one or more problems set forth above and other problems.
BRIEF SUMMARY OF THE DISCLOSURE
[0007] One aspect of the present disclosure includes a method for performing action commands on a mobile terminal. The method includes reading a 2D barcode to obtain 2D barcode information. The 2D barcode information includes at least an action command identifier and a call instruction for calling an application program interface (API) corresponding to the action command. The method also includes calling the API corresponding to the action command and completing execution of the action command.
[0008] Another aspect of the present disclosure includes an action command execution system. The system includes a reading unit configured to read a 2D barcode to obtain 2D barcode information. The 2D barcode information includes at least an action command identifier and a call instruction for calling an application program interface (API) corresponding to the action command. The system also includes a call unit configured to call the API corresponding to the action command and an execution unit configured to complete execution of the action command.
[0009] Other aspects of the present disclosure can be understood by those skilled in the art in light of the description, the claims, and the drawings of the present disclosure.
BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 illustrates a flow diagram of an exemplary action command operation process consistent with the disclosed embodiments;
[0011] Figure 2 illustrates a flow diagram of another exemplary action command operation process consistent with the disclosed embodiments;
[0012] Figure 3 illustrates a block diagram of an exemplary action command execution system consistent with the disclosed embodiments;
[0013] Figure 4 illustrates a block diagram of another exemplary action command execution system consistent with the disclosed embodiments; and
[0014] Figure 5 illustrates a block diagram of an exemplary mobile terminal consistent with the disclosed embodiments.
DETAILED DESCRIPTION
[0015] Reference will now be made in detail to exemplary embodiments of the invention, which are illustrated in the accompanying drawings.
[0016] A two-dimensional (2D) barcode may be used to carry not only data but also commands to perform certain actions on a mobile terminal. Especially, the mobile terminal may be equipped with a 2D barcode scanner/reader, or a camera with image recognition software to scan and/or read the 2D barcode to execute certain actions automatically.
[0017] Figure 5 illustrates an exemplary mobile terminal 500 for implementing the disclosed methods and apparatus. A mobile terminal may include any appropriate type of mobile computing devices, such as mobile phones, smart phones, tablets, notebook computers, or any type of mobile computing platform. A mobile terminal may be controlled by an operating system and may support various application software, i.e., one or more clients, to provide certain functionalities. For example, the client may include a browser, a calendar application, a user application, etc. Any type of client software may run on the mobile terminal 500 as supported by the operating system, which may include a set of APIs for the mobile applications.
[0018] As shown in Figure 5, mobile terminal 500 may include a processor 502, a storage medium 504, a monitor 506, a communication module 508, a database 510, and peripherals 512. Certain devices may be omitted and other devices may be included.
[0019] Processor 502 may include any appropriate processor or processors. Further, processor 502 can include multiple cores for multi-thread or parallel processing. Storage medium 504 may include memory modules, such as Read-only memory (ROM), Random Access Memory (RAM), flash memory modules, and erasable and rewritable memory, and mass
storages, such as CD-ROM, U-disk, and hard disk, etc. Storage medium 504 may store computer programs for implementing various processes, when executed by processor 502.
[0020] Further, peripherals 512 may include I/O devices, such as keyboard, mouse, camera, video camera, and/or barcode scanner/reader, etc. Monitor 506 may include any appropriate screen for displaying various information to a user. The communication module 508 may include network devices for establishing connections through the communication network. Database 510 may include one or more databases for storing certain data and for performing certain operations on the stored data, such as database searching.
[0021] In operation, the mobile terminal 500 may provide certain action command execution functionalities to a user of the mobile terminal 500 to carry out actions requested by the user or actions provided for the user. Figure 1 illustrates a flow diagram of an exemplary action command operation process consistent with the disclosed embodiments.
[0022] As shown in Figure 1 , the action command operation process may include the following steps.
[0023] Step 101, reading 2D barcode information from a 2D barcode. The 2D barcode information includes an action command identifier and a call instruction for calling an API corresponding to the action command. The 2D barcode information may also include multiple action command identifiers each corresponding to an API containing in the call instruction.
[0024] The mobile terminal may start a module for scanning 2D barcode, and may read the scanned 2D barcode using 2D barcode scanning software in the module to read the 2D barcode information. The 2D barcode information may include: action command identifier and the call instruction for calling an API corresponding to the action command. The action
command identifier may be used to indicate that the 2D barcode is a 2D action command barcode, and the content of the action command. The call instruction is used to call the API corresponding to the action command.
[0025] The mobile terminal may scan the 2D barcode using a 2D barcode reader or scanner. Or the mobile terminal may take a photo of the 2D barcode and perform image recognition to detect and read the barcode. Alternatively, the mobile terminal may receive the 2D barcode by other means, such as by an email, a text, an IM (instant message), etc.
[0026] Step 102, calling or invoking the API (application programming interface). That is, based on the call instruction in the 2D barcode indicating the API corresponding to the action command, calling the API to access a software routine(s) corresponding to the API.
[0027] A routine is similar to a function, but with more complete meaning. A routine is computer program code. On a mobile terminal, in general, a routine is used to carry out certain actions, and such routine may be an application routine to be used directly or may be providing services for other routines. That is, the routine may be provided by a user application or by system software on the mobile terminal.
[0028] Step 103, executing the action command corresponding to the action command identifier. That is, completing the execution of the action command. The action command identifier determines what type of action command(s) is in the 2D barcode, and the action command information may be realized by action command identifier statement(s). When the action command identifier statement is read, the action command indicated by the action command identifier is carried out.
[0029] Thus, the mobile terminal reads the 2D barcode information and, according to the call instruction indicating an API corresponding to an action command in the 2D barcode, calls the API to carry out the action command based on the action command identifier in the 2D barcode. That is, by only scanning the 2D barcode once, the API corresponding to the action command can be called to carry out the action command. The corresponding functions of the mobile terminal can thus be realized without having to interact with the backend server for mutual authentication. The action command can be executed only on the mobile terminal unilaterally, without the need to download and install related program. The user operating time can be reduced, and the cost for using the mobile terminal functionalities can also be reduced.
[0030] Figure 2 illustrates another exemplary user action command operation process consistent with the disclosed embodiments. As shown in Figure 2, the user action command operation process may include the following steps.
[0031] Step 201, receiving information of a user-defined action command and sending the user-defined action command information to a 2D barcode generator to generate a corresponding 2D barcode.
[0032] That is, the mobile terminal may generate a 2D barcode required by the user according to the user's instruction. The mobile terminal may provide a user interface to receive from the user a user-defined action command, and sends the user-defined action command information to the 2D barcode generator to generate the corresponding 2D barcode. In other words, after receiving the user instruction, the mobile terminal may generate a user-defined action command, and sends the user-defined action command to the 2D barcode generator together with other information associated with the user-defined action command.
[0033] For example, when the user requires certain actions that can be periodically repeated on the mobile terminal, the user can define a 2D barcode for such actions. Because the 2D barcode can carry certain complex information, and can interact with mobile terminals naturally, it may be an excellent way for the user to use 2D barcode to carry out a series of actions. Especially for those repetitive and/or tedious operations, the user may write action commands into the corresponding 2D barcode, so that the user can have personalized and practical 2D barcode.
[0034] Step 202, reading the 2D barcode information. The 2D barcode information includes action command identifier, call instruction indicating the API corresponding to the action command, and parameters for the action corresponding to the action command, etc.
[0035] Further, the action command identifier may be a single action command (i.e., indicating a single action) or may be a combined action command for performing a series of actions. The combined action command is used to execute multiple action commands as if executing a single action command, i.e., a batch execution. Because some action commands can be effectively executed in batch, with a high repetitive rate, such action commands can executed automatically in sequence to implement effective actions. Thus, these action commands can be grouped into a combined action command, such that the combined action command can be executed without individually executing the series of action commands separately. Alternatively, one action command may include multiple call instructions each calling an API for performing a different function. Thus, mobile terminal repetitive operations can be avoided, reducing the time to perform an action. The 2D barcode may include both a single action command and a combined action command.
[0036] In addition, the mobile terminal can read any appropriate types of 2D barcodes. That is, besides reading the user-defined 2D barcode information to perform user action commands, the mobile terminal may also read 2D barcodes generated by manufacturers, operators, and/or other third parties, such that the mobile terminal can perform the action commands preconfigured by the manufacturers, operators, and/or other third parties, such as mobile application developers.
[0037] To read the 2D barcode, the mobile terminal may start the module for scanning 2D barcode, and may read the scanned 2D barcode using 2D scanning software in the module to read the 2D barcode information. The 2D barcode information includes: an action command identifier, the call instruction for calling an API corresponding to the action command, and action parameter information corresponding to the action command identifier. The action command identifier may be used to indicate that the 2D barcode is a 2D action command barcode, and also indicate the content of the action command. The call instruction is used to call the API corresponding to the action command, and the action parameter information
corresponding to the action command identifier includes parameters required for performing the action command, such as user name, password, authentication information, and user information recorded in the past or system information, etc.
[0038] Step 203, calling the API by using the call instruction. That is, based on the call instruction corresponding to the action command in the 2D barcode, call the API corresponding to the call instruction.
[0039] Step 204, carrying out the action command corresponding to the action command identifier. The action command identifier determines what type of action command(s) is in the 2D barcode, and the action command information may be realized by action command identifier
statement(s). When an action command identifier statement is read, the action command indicated by the action command identifier is carried out, and the next action command identifier statement is read, until all action command identifier statements are carried out.
[0040] The followings are a use scenario for illustrative purposes. A business creates a 2D barcode, and the 2D barcode contains a single action command identifier. For example, the business adds a 2D barcode on a receipt for its customer, and the 2D barcodes provide WIFI wireless network service to its customer.
[0041] The customer uses his/her mobile phone to scan the 2D barcode on the receipt to access the WIFI service. More specifically, the mobile phone scans the 2D barcode on the receipt and read the 2D barcode information. The 2D barcode information includes: an action command identifier, a call instruction corresponding to the API to connect the WIFI network, and parameter information for connecting the WIFI function, such as the ID or name of the hotspot of the business's WIFI network and password. Using the 2D barcode, the mobile phone automatically connects to the business's WIFI network. That is, the mobile phone only needs to scan a 2D barcode, without interaction to any server or downloading any application program, to achieve actions on the mobile terminals unilaterally.
[0042] Another use scenario is described below based on user-defined 2D barcode. The user can define the user's own 2D barcode, and the 2D barcode can contain a combined action command identifier. For example, the user may open multiple browser windows when the user opens the mobile browser daily. The browser service provider can provide a service to the user for customizing 2D barcodes, such that the user can define a 2D barcode on his/her own.
[0043] The mobile terminal receives the user-defined action command information, and sends the user-defined action command information to the 2D barcode generator. The 2D
barcode generator generates the corresponding 2D barcode, which may contain user-defined 2D barcode information such as user-defined actions command identifier, a call instruction to call the API for opening the browser, and the action parameters corresponding to the call instruction opening the browser.
[0044] The user-defined action command identifier indicates a user-defined 2D barcode for a combination of action commands, the content of the action command is to open the browser. The call instruction calls the API for opening the browser to invoke the browser application. The action parameter information includes parameters for opening the browser, such as universal resource locators (URLs) of the multiple windows commonly used by the user. Thus, the mobile terminal only needs to read or scan the user-defined 2D barcode once to open the mobile browser with multiple often- visited windows open.
[0045] Thus, the mobile terminal reads the user-defined 2D barcode information and, according to the call instruction indicating an API corresponding to a user action command in the 2D barcode, calls the API to carry out the user action command based on the action command identifier in the 2D barcode and the action parameters corresponding to the action command identifier. That is, by only scanning the 2D barcode once, the API corresponding to the action command can be called to carry out the action command.
[0046] Thus, the corresponding functions of the mobile terminal can be realized without having to interact with the backend server for mutual authentication. The action command can be executed only on the mobile terminal unilaterally, without the need to download and install related program. The user operating time can be reduced, and the cost for using the mobile terminal functionalities can also be reduced. Further, authentication and/or authorization
information may be added in the action parameter information to increase the security of the action command execution.
[0047] Figure 3 illustrates an exemplary action command execution system consistent with the disclosed embodiments. As shown in Figure 3, the action command execution system may include a reading unit 301, a call unit 302, and an execution unit 303.
[0048] The reading unit 301 is provided for reading the 2D barcode information, and the 2D barcode information includes an action command identifier and a call instruction for calling an API corresponding to the action command. The call unit 302 is used to call the API, and the execution unit 303 is provided for executing or carrying out the action command corresponding to the action command identifier.
[0049] Figure 4 illustrates another exemplary action command execution system consistent with the disclosed embodiments. As shown in Figure 4, the action command execution system may include a reading unit 401, a call unit 402, and an execution unit 403.
[0050] The reading unit 401 is provided for reading the 2D barcode information, and the 2D barcode information includes at least an action command identifier and a call instruction for calling an API corresponding to the action command. Further, the action command identifier may be a single action command (i.e., indicating a single action) or may be a combined action command for performing a series of actions. The combined action command is used to execute multiple action commands as if executing a single action command, i.e., a batch execution.
[0051] The call unit 402 is used to call the API corresponding to the call instruction read by the reading unit 401, and the execution unit 403 is provided for executing or carrying out the action command corresponding to the action command identifier.
[0052] Further, the action command execution system may also include a receiving unit 404, and a sending unit 405.
[0053] The receiving unit 404 is provided for receiving user-defined action command information, and the sending unit 405 is used to send the user-defined action command to the 2D barcode generator, and the 2D barcode generator generates a corresponding user-defined 2D barcode.
[0054] Further, the 2D barcode information read by the reading unit 401 may include action parameter information corresponding to the action command identifier, and the execution unit 404 executes the action command based on the action parameters.
[0055] Thus, the receiving unit 404 receives the user-defined action command information, and the sending unit sends the user-defined action command information to the 2D barcode generator to generate the user-defined 2D barcode. The reading unit 401 reads the user- defined 2D barcode information and, according to the call instruction indicating an API corresponding to a user action command in the 2D barcode read by the reading unit 401, the call unit 403 calls the API. Based on the action parameter information corresponding to the action command identifier read by the reading unit 401, the execution unit 404 executes or carries out the action command corresponding to the action command identifier. That is, by only scanning the 2D barcode once, the API corresponding to the action command can be called to carry out the action command. The corresponding functions of the mobile terminal can thus be realized without having to interact with the backend server for mutual authentication. The action command can be executed only on the mobile terminal unilaterally, without the need to download and install related program. The user operating time can be reduced, and the cost for using the mobile terminal functionalities can also be reduced. Further, authentication and/or
authorization information may be added in the action parameter information to increase the security of the action command execution
[0056] Those skilled in the art should understand that all or part of the steps in the above method may be executed by relevant hardware instructed by a program, and the program may be stored in a computer-readable storage medium such as a read only memory, a magnetic disk, a Compact Disc (CD), and so on.
[0057] The embodiments disclosed herein are exemplary only and not limiting the scope of this disclosure. Without departing from the spirit and scope of this invention, other modifications, equivalents, or improvements to the disclosed embodiments are obvious to those skilled in the art and are intended to be encompassed within the scope of the present disclosure.
INDUSTRIAL APPLICABILITY AND ADVANTAGEOUS EFFECTS
[0058] Without limiting the scope of any claim and/or the specification, examples of industrial applicability and certain advantageous effects of the disclosed embodiments are listed for illustrative purposes. Various alternations, modifications, or equivalents to the technical solutions of the disclosed embodiments can be obvious to those skilled in the art and can be included in this disclosure.
[0059] By using the disclosed methods and system for executing action commands in the 2D barcode, the mobile terminal reads the 2D barcode information and, according to the call instruction indicating an API corresponding to an action command in the 2D barcode, calls the API to carry out the action command based on the action command identifier in the 2D barcode. That is, by only scanning the 2D barcode once, the API corresponding to the action command can be called to carry out the action command. The corresponding functions of the mobile
terminal can thus be realized without having to interact with the backend server for mutual authentication. The action command can be executed only on the mobile terminal unilaterally, without the need to download and install related program. The user operating time can be reduced, and the cost for using the mobile terminal functionalities can also be reduced.