Search

CN-121985290-A - Electronic fence channel construction method and electronic equipment

CN121985290ACN 121985290 ACN121985290 ACN 121985290ACN-121985290-A

Abstract

A channel construction method and electronic equipment of an electronic fence relate to the technical field of electronics and are used for establishing a channel between an upper application and an electronic fence driving. The method for constructing the channel of the electronic fence comprises the steps that the electronic fence driver scans the electronic fence according to characteristic information of the electronic fence, a first event or a second event is sent to the AIDL module, the first event indicates that electronic equipment enters the electronic fence, the second event indicates that the electronic equipment leaves the electronic fence, the AIDL module determines a first callback function of MSDP according to identification, a fourth mapping relation and a first mapping relation of the electronic fence in the first event or the second event, and the first callback function determines a second callback function applied at an upper layer according to the identification, a third mapping relation and the second mapping relation of the electronic fence in the first event or the second event. And responding to the first event, calling the service corresponding to the entering electronic fence by the second callback function, or ending the service corresponding to the entering electronic fence by responding to the second event.

Inventors

  • DONG HAO
  • CHE YUFENG

Assignees

  • 荣耀终端股份有限公司

Dates

Publication Date
20260505
Application Date
20241025

Claims (10)

  1. 1. The channel construction method of the electronic fence is characterized by being applied to electronic equipment, wherein the electronic equipment comprises an upper application layer, a multimode sensor data platform MSDP, an android interface definition language AIDL module, a hardware abstraction layer HAL module and an electronic fence driver, and the method comprises the following steps: The MSDP registers a first callback function to the AIDL module, and the AIDL module establishes a first mapping relation between the first callback function and the identifier of the MSDP; The MSDP establishes a second mapping relation between the second callback function and the identifier of the upper layer application; The upper layer application configures characteristic information of the electronic fence to the MSDP, and the characteristic information of the electronic fence is indexed through the identification of the electronic fence; the MSDP establishes a third mapping relation between the characteristic information of the electronic fence and the identifier of the upper-layer application; the MSDP configures the characteristic information of the electronic fence to the AIDL module, and the AIDL module establishes a fourth mapping relation between the characteristic information of the electronic fence and the identifier of the MSDP; the AIDL module drives and configures characteristic information of the electronic fence to the electronic fence through a hardware abstraction layer HAL module; The electronic fence driver scans the electronic fence according to the characteristic information of the electronic fence and sends a first event or a second event to the AIDL module through the HAL module, wherein the first event indicates that the electronic equipment enters the electronic fence, and the second event indicates that the electronic equipment leaves the electronic fence; the AIDL module determines a first callback function of the MSDP according to the identification of the electronic fence in the first event or the second event, the fourth mapping relation and the first mapping relation, and triggers the MSDP to execute the first callback function, wherein the first event or the second event is used as an entry of the first callback function; The first callback function of the MSDP determines a second callback function of the upper-layer application according to the identification of the electronic fence in the first event or the second event, the third mapping relation and the second mapping relation, and triggers the upper-layer application to execute the second callback function, wherein the first event or the second event is used as an entry of the second callback function; And responding to the first event, calling a second callback function of the upper-layer application to enter a service corresponding to the electronic fence, or ending entering the service corresponding to the electronic fence by the second callback function of the upper-layer application.
  2. 2. The method of claim 1, wherein the AIDL module determining the first callback function of the MSDP based on the identification of the electronic fence in the first event or the second event, the fourth mapping relationship, and the first mapping relationship comprises: the AIDL module obtains the identifier of the MSDP according to the identifier of the electronic fence in the first event or the second event and the fourth mapping relation; and the AIDL module determines a first callback function corresponding to the identifier of the MSDP according to the identifier of the MSDP and the first mapping relation.
  3. 3. The method of claim 1, wherein the determining, by the first callback function of the MSDP, the second callback function of the upper layer application according to the identifier of the electronic fence in the first event or the second event, the third mapping relationship, and the second mapping relationship comprises: the MSDP obtains the identifier of the upper layer application according to the identifier of the electronic fence in the first event or the second event and the third mapping relation; And the MSDP determines a second callback function corresponding to the identifier of the upper layer application according to the identifier of the upper layer application and the second mapping relation.
  4. 4. A method according to any one of claims 1-3, further comprising: The AIDL module registers detection of an electronic fence driving crash event through the HAL module, and if the electronic fence driving crash event occurs, the AIDL module establishes connection with the electronic fence driving through the HAL module again, and registers detection of the electronic fence driving crash event again.
  5. 5. The method of any one of claims 1-4, further comprising: And the MSDP registers the detection of the event of the breakdown of the AIDL module, if the event of the breakdown of the AIDL module occurs, the MSDP establishes connection with the AIDL module again, registers the first callback function with the AIDL module again, registers the detection of the event of the breakdown of the AIDL module again, and configures the characteristic information of the electronic fence with the AIDL module again.
  6. 6. The method of any one of claims 1-5, further comprising: The AIDL module registers detection of an MSDP crash event, and if the MSDP crash event occurs, the AIDL module clears the first callback function and the first mapping relation.
  7. 7. The method of any one of claims 1-6, further comprising: And the MSDP registers the detection of an upper layer application crash event, and if the upper layer application crash event occurs, the MSDP clears the second callback function and the second mapping relation.
  8. 8. An electronic device comprising a memory and one or more processors; The memory having stored therein computer program code comprising computer instructions which, when executed by the processor, cause the electronic device to perform the method of any of claims 1-7.
  9. 9. A computer readable storage medium comprising instructions which, when run on an electronic device, cause the electronic device to perform the method of any of claims 1-7.
  10. 10. A computer program product comprising instructions which, when run on an electronic device, cause the electronic device to perform the method of any of claims 1-7.

Description

Electronic fence channel construction method and electronic equipment Technical Field The embodiment of the application relates to the technical field of electronics, in particular to a channel construction method of an electronic fence and electronic equipment. Background The electronic fence technology is widely applied to various service scenes, such as service scenes of collecting payment, riding subways, collecting express and the like. The electronic fence refers to a virtual area, when a user carries the electronic equipment to enter the electronic fence, the electronic equipment can automatically call corresponding services, such as automatically opening a payment code (or sweeping) in a store, automatically opening a subway card in a subway station, automatically reminding that an express delivery is to be picked up in an express delivery post station, and the like. The software of the electronic device is hierarchical, and different layers of software modules perform different functions. The electronic fence driver of the scanning electronic fence is located at the bottom layer of the software, and the upper application for calling the service according to the electronic equipment entering the electronic fence is located at the top layer of the software, and the upper application cannot directly communicate with the electronic fence driver. Disclosure of Invention The application provides a channel construction method of an electronic fence and electronic equipment, which are used for establishing a channel between an upper application and an electronic fence driving. In order to achieve the above purpose, the application adopts the following technical scheme: In a first aspect, a method for constructing a channel of an electronic fence is provided, and the method is applied to an electronic device, wherein the electronic device comprises an upper layer application, a multimode sensor data platform (multimodal sensor data platform, MSDP), An interface definition language (Android interface definition language, AIDL) module, a hardware abstraction layer (hardware abstraction layer, HAL) module, an electronic fence driver, the method comprising the MSDP registering a first callback function with the AIDL module; the AIDL module establishes a first mapping relation between a first callback function and an identifier of the MSDP, the upper layer application registers a second callback function to the MSDP, the MSDP establishes a second mapping relation between the second callback function and the identifier of the upper layer application, the upper layer application configures characteristic information of the electronic fence to the MSDP, the characteristic information of the electronic fence is indexed through the identifier of the electronic fence, the MSDP establishes a third mapping relation between the characteristic information of the electronic fence and the identifier of the upper layer application, the MSDP configures the characteristic information of the electronic fence to the AIDL module, the AIDL module establishes a fourth mapping relation between the characteristic information of the electronic fence and the identifier of the MSDP, the AIDL module performs a callback function to the electronic fence through a hardware abstraction layer HAL module, the electronic fence driver scans the electronic fence according to the characteristic information of the electronic fence and sends a first event or a second event to the AIDL module through the HAL module, the first event indicates that the electronic equipment enters the electronic fence, the second event indicates that the electronic equipment leaves the electronic fence, the AIDL module determines the characteristic information of the electronic fence, the fourth mapping relation and the first mapping relation in the electronic fence, the first application in the first event, the AIDL module determines the first callback function is triggered by the first callback function, the first callback function is triggered by the first callback function is executed by the first callback function, and the first callback function is triggered by the first callback function in the first layer, or in response to the second event, the second callback function of the upper layer application finishes entering the service corresponding to the electronic fence. The channel construction method of the electronic fence provided by the embodiment of the application is characterized in that for an upper software module and a lower software module which are positioned on two adjacent layers, on one hand, the upper software module registers a callback function to the lower software module, the lower software module establishes a mapping relation between the callback function and the upper software module, and on the other hand, the upper software module configures characteristic information of the electronic fence to the lower software module, and the lower soft