Unlock instant, AI-driven research and patent intelligence for your innovation.

Sensor interface processing method and apparatus

A technology of sensor interface and processing method, applied in multi-channel programming device, program control device, electrical digital data processing and other directions, can solve the problems of simple function, poor flexibility, and inability to meet other sensors.

Active Publication Date: 2016-02-17
ALIBABA (CHINA) CO LTD
View PDF4 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] The problem with the solutions in the prior art is that the private API of a specific sensor can only meet the needs of its own sensor, but cannot meet the needs of other sensors; while the general API has simple functions and only meets some of the characteristics of the sensor. , such as environmental pressure events, environmental humidity events, etc.
[0005] Therefore, when the existing mobile terminal browsers use the above two sensor APIs to implement some functions, the implementation solutions are limited, and the implemented functions are generally relatively simple, and have poor flexibility and cannot be expanded.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Sensor interface processing method and apparatus
  • Sensor interface processing method and apparatus
  • Sensor interface processing method and apparatus

Examples

Experimental program
Comparison scheme
Effect test

example 1

[0092] Example 1: Assume that the sensor needs to be called to realize the vibration function.

[0093] The function is: the phone vibrates (Vibrate) for 1 second, stops for 0.5 seconds, and then vibrates for 2 seconds: (the fourth parameter is an array)

[0094] Executed JavaScript code:

[0095] window.getSensorData("Vibrate", "vibrate", false, [1000,500,2000]);

[0096] The get function means to obtain the data of the vibration sensor.

[0097] The execution flow of this application example is as follows: image 3 shown, including:

[0098] Step 301, the browser executes the JS code, and when the getSensorDataDirect function in the code is executed, the 4 passed parameters ("Vibrate", "vibrate", false, [1000, 500, 2000]) are obtained.

[0099] Step 302 , according to the obtained parameter 1 "Vibrate", look up the parameter comparison table, and find the operation set for acquiring or setting data corresponding to the sensor that Vibrate needs to operate.

[0100] Step...

example 2

[0105] Example 2: Assume that the sensor needs to be called to realize the event of changing the discharge time of the registered power supply and display it: (callback parameter)

[0106] In this example, the charging attribute is used to indicate whether it is currently charging, 0 indicates charging, and 1 indicates discharging. Time represents the charging or discharging time. When charging is 0, time indicates the charging time; when it is 1, time indicates the time required for discharging. ondischargingtimechange indicates an event that is triggered when the battery level changes. showDischargingtime is the function called after the event is triggered, that is, the registered callback function.

[0107] Executed JavaScript code: functionshowDischargingtime(param) / / Realize the event of changing the discharge time of the registered power supply and display it

[0108]

[0109] The execution flow of this application example is as follows: Figure 4 shown, including:...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The present invention discloses a sensor interface processing method. The method comprises: when a sensor operation function is executed in a code execution process, acquiring parameters in the sensor operation function, wherein the parameters comprise at least a sensor name and a callback identifier; searching a preset data table for a corresponding sensor according to the sensor name in the parameters; determining that an operation mode of an API of the found sensor is a callback mode or a direct acquisition mode according to the callback identifier in the parameters; and performing corresponding processing according to the determined operation mode of the API. The present invention correspondingly provides a processing apparatus. The technical scheme provided by the present invention can meet various operation requirements of various sensors, so that a browser can use a sensor more conveniently and more flexibly.

Description

technical field [0001] The present invention relates to the technical field of mobile communication, and more specifically, to a sensor interface processing method and device. Background technique [0002] A sensor is a detection device that can feel the measured information, and can convert the detected information into electrical signals or other required forms of information output according to certain rules, so as to meet the needs of information transmission, processing, storage, display, recording and control requirements. Sensors are the primary link to realize automatic detection and automatic control. [0003] API (Application Programming Interface, application programming interface) is some predefined functions, the purpose is to provide applications and developers with the ability to access a set of routines based on certain software or hardware without accessing source code or understanding the internal working mechanism detail. At present, there are generally...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/44G06F9/46G06F17/30
Inventor 王永光
Owner ALIBABA (CHINA) CO LTD