CN112527526A - Information processing method and device and computer equipment - Google Patents

Information processing method and device and computer equipment Download PDF

Info

Publication number
CN112527526A
CN112527526A CN202011483233.3A CN202011483233A CN112527526A CN 112527526 A CN112527526 A CN 112527526A CN 202011483233 A CN202011483233 A CN 202011483233A CN 112527526 A CN112527526 A CN 112527526A
Authority
CN
China
Prior art keywords
bluetooth
component
data
data type
native
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011483233.3A
Other languages
Chinese (zh)
Inventor
周异成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An International Smart City Technology Co Ltd
Original Assignee
Ping An International Smart City Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An International Smart City Technology Co Ltd filed Critical Ping An International Smart City Technology Co Ltd
Priority to CN202011483233.3A priority Critical patent/CN112527526A/en
Publication of CN112527526A publication Critical patent/CN112527526A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/547Messaging middleware
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The embodiment of the invention relates to the technical field of data processing, and provides an information processing method, which comprises the following steps: when Bluetooth initialization is carried out, information of a low-power Bluetooth manager is obtained, and the low-power Bluetooth manager is set as an intermediate receptor for data interaction between a read component and a Native component; establishing a forwarding mechanism of a Bluetooth data type in a Native component; when the Native component receives the Bluetooth data, pushing the data type corresponding to the Bluetooth data to the fact component in a message form based on the forwarding mechanism and the low-power Bluetooth manager; and the React component determines the data type of the Bluetooth data received by the Native component according to the received message so as to execute the operation corresponding to the data type. The embodiment of the invention can realize the processing of the Bluetooth data received by Native at the React side, and facilitates the development of project integration Bluetooth function modules.

Description

Information processing method and device and computer equipment
Technical Field
The embodiment of the invention relates to the technical field of data processing, in particular to an information processing method, an information processing device and computer equipment.
Background
The fact Native is a technology for allowing a developer to build a Native application program by using a front-end language, and the principle is to encapsulate a Native User Interface (UI) component so as to achieve the purpose of using javascript to allocate the Native UI component to construct an Interface. The built native application program has the flexibility of multiplication and division of the webpage application and has the advantage of good interaction experience.
Usually, when the smart hardware is used, a communication protocol is needed to realize communication between the mobile phone and the smart hardware, at present, a protocol used by most of the smart hardware is a Bluetooth Low Energy (BLE) protocol, and when a near field communication protocol is used in read Native application, a set of BLE Bluetooth protocols are often packaged in an iOS platform and an android platform grid respectively. Because the android and the iOS operating system platforms are different, the interface exposed to the fact and the interface calling process are often different, and meanwhile, the fact side cannot read or store real-time bluetooth data, a method for realizing bluetooth data processing based on fact Native is needed to be researched to solve the technical problems in the prior art.
Disclosure of Invention
In view of the above, an object of the embodiments of the present invention is to provide an information processing method, an information processing apparatus, a computer device, and a computer-readable storage medium, which are used to overcome the problem that the existing read side cannot read or store real-time bluetooth data.
In order to achieve the above object, an embodiment of the present invention provides an information processing method, where the computer device is configured with a bluetooth low energy manager, and the information processing method includes:
when Bluetooth initialization is carried out, information of the low-power Bluetooth manager is obtained, and the low-power Bluetooth manager is set as an intermediate receptor for data interaction between a read component and a Native component;
establishing a forwarding mechanism of a Bluetooth data type in the Native component;
when the Native component receives Bluetooth data, pushing a data type corresponding to the Bluetooth data to the fact component in a message form based on the forwarding mechanism and the low-power Bluetooth manager; and
and when the React component receives the message pushed by the low-power-consumption Bluetooth manager, determining the data type of the Bluetooth data received by the Native component according to the message so as to execute the operation corresponding to the data type.
Optionally, after the step of setting the bluetooth low energy manager as an intermediate recipient for data interaction between the read component and the Native component, the method further includes:
and drawing out the Bluetooth functional module contained in the Native component.
Optionally, the step of setting the bluetooth low energy manager as an intermediate recipient for data interaction between the read component and the Native component includes:
and a bridge is established between the React component and the low-power-consumption Bluetooth manager, so that data interaction is performed between the React component and the Native component sequentially through the bridge and the low-power-consumption Bluetooth manager.
Optionally, the information processing method further includes:
a snoop mechanism is established in the React component that snoops the bridge.
Optionally, the information processing method further includes:
acquiring a communication method exposed by the Native component;
and controlling the React component to initiate data interaction with the Native component based on the communication method.
Optionally, the data types include a first data type and a second data type, and the step of executing the operation corresponding to the data type includes:
if the data type of the Bluetooth data received by the Native component is a first data type, performing interactive operation corresponding to the Bluetooth data on a React page;
and if the data type of the Bluetooth data received by the Native component is a second data type, storing the Bluetooth data in a real database.
Optionally, the information processing method further includes:
acquiring code implementation logic for data interaction between the React component and the Native component; and
and packaging the code implementation logic into a Bluetooth static library, and issuing the Bluetooth static library to a specified warehouse.
In order to achieve the above object, an embodiment of the present invention further provides an information processing apparatus, which is applied to a computer device configured with a bluetooth low energy manager, and the information processing apparatus includes:
the acquisition module is used for acquiring the information of the low-power Bluetooth manager during Bluetooth initialization so as to set the low-power Bluetooth manager as an intermediate receptor for data interaction between a read component and a Native component;
the establishing module is used for establishing a forwarding mechanism of a Bluetooth data type in the Native component;
the pushing module is used for pushing the data type corresponding to the Bluetooth data to the React in a message form based on the forwarding mechanism and the low-power Bluetooth manager when the Native component receives the Bluetooth data; and
and the execution module is used for determining the data type of the Bluetooth data received by the Native component according to the message when the React component receives the message pushed by the low-power-consumption Bluetooth manager so as to execute the operation corresponding to the data type.
To achieve the above object, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the steps of the information processing method described above when executing the computer program.
To achieve the above object, an embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, and the computer program is executable by at least one processor to cause the at least one processor to execute the steps of the information processing method described above.
According to the information processing method, the information processing device, the computer equipment and the computer readable storage medium, when Bluetooth initialization is carried out, information of a low-power Bluetooth manager of the computer equipment is obtained, so that the low-power Bluetooth manager is set as an intermediate receptor for data interaction between a read component and a Native component; establishing a forwarding mechanism of a Bluetooth data type in the Native component; when the Native component receives Bluetooth data, pushing a data type corresponding to the Bluetooth data to the fact component in a message form based on the forwarding mechanism and the low-power Bluetooth manager; and when the React component receives the message pushed by the low-power-consumption Bluetooth manager, determining the data type of the Bluetooth data received by the Native component according to the message so as to execute the operation corresponding to the data type. According to the embodiment of the invention, the low-power-consumption Bluetooth manager is set as an intermediate receptor for data interaction between the read component and the Native component, and a Bluetooth data type forwarding mechanism is established in the Native component, so that the data type corresponding to the Bluetooth data received by the Native component can be pushed to the read component in a message form based on the forwarding mechanism and the low-power-consumption Bluetooth manager, and the read component can determine the data type according to the message to execute the operation corresponding to the data type, so that the Bluetooth data received by the Native component can be processed at the read side. Furthermore, code implementation logic for data interaction between the React component and the Native component can be obtained, the code implementation logic is packaged into a Bluetooth static library, and the Bluetooth static library is issued to a specified warehouse, so that when Bluetooth data needs to be processed, the Bluetooth data can be directly downloaded from the specified warehouse and integrated into a project for use, an interface does not need to be appointed for different operating system platforms, and the workload of Bluetooth data transfer is reduced.
Drawings
FIG. 1 is a flowchart illustrating steps of an information processing method according to an embodiment of the present invention.
Fig. 2 is an interaction diagram of a fact and a bluetooth low energy manager performing data communication according to an embodiment of the present invention.
FIG. 3 is a flowchart illustrating steps of another embodiment of an information processing method according to the present invention.
Fig. 4 is a schematic diagram of program modules of an information processing apparatus according to an embodiment of the present invention.
Fig. 5 is a schematic diagram of program modules of an information processing apparatus according to another embodiment of the present invention.
Fig. 6 is a schematic diagram of a hardware structure of a computer device according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
The advantages of the invention are further illustrated in the following description of specific embodiments in conjunction with the accompanying drawings.
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The terminology used in the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present disclosure. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
In the description of the present invention, it should be understood that the numerical references before the steps do not identify the order of performing the steps, but merely serve to facilitate the description of the present invention and to distinguish each step, and thus should not be construed as limiting the present invention.
Referring to fig. 1, a flowchart of an information processing method according to a first embodiment of the invention is shown. It is to be understood that the flow charts in the embodiments of the present method are not intended to limit the order in which the steps are performed. The following description is exemplarily made with an information processing apparatus as an execution subject, and the information processing apparatus may be applied to a computer device, which may be a mobile phone, a tablet personal computer (tablet personal computer), a laptop computer (laptop computer), a server, or the like having a data transmission function. The computer device is configured with a bluetooth low energy manager. The method comprises the following specific steps:
and step S10, when Bluetooth initialization is carried out, acquiring the information of the low-power Bluetooth manager, so that the low-power Bluetooth manager is set as an intermediate receptor for data interaction between the read component and the Native component.
In one embodiment, the fact Native is a derivative product of the open-source JS framework fact on the Native mobile application platform, and supports both iOS and android platforms. The real Native is composed of a real component and a Native component. The React component may refer to a JAVASCRIPT library used to build a user interface, which may be used to build pages and data processing. The Native component can be used for providing a Bluetooth communication function.
Specifically, when the read component calls the Native Bluetooth initialization instruction to perform Bluetooth initialization, information of a Bluetooth Low Energy Manager (Bluetooth Manager) may be acquired, and then the Bluetooth Low Energy Manager may be set as an intermediate recipient for performing data interaction between the read component and the Native component.
As shown in fig. 2, a Bridge (Bridge) may be established between the fact component and the bluetooth low energy manager, so that data interaction between the fact component and the Native component sequentially passes through the Bridge and the bluetooth low energy manager. For example, the reach component may send a message to the Bridge, and the Bridge sends the message to the bluetooth low energy manager, and the bluetooth low energy manager performs data interaction with the Native component.
In an embodiment, after the step of setting the bluetooth low energy manager as an intermediate recipient for data interaction between the read component and the Native component, the bluetooth function module included in the Native component may be extracted, so that materialization instructions between the read component and the Native component may be reduced as much as possible, and only basic bluetooth communication logic may be reserved.
And step S11, establishing a forwarding mechanism of the Bluetooth data type in the Native component.
Specifically, a forwarding mechanism of the bluetooth data type is established in the Native component, so that after receiving bluetooth data, the Native component can push a data type corresponding to the bluetooth data to the Bridge in a message form through the low-power-consumption bluetooth manager, and the Bridge notifies the reach component again, so that the reach component can receive a message notification of the data type of the bluetooth data received by the Native component.
It can be understood that, because the existing read Native framework processes the bluetooth data through the Native component, there is no need to establish a forwarding mechanism for the bluetooth data type. In an embodiment of the application, a code in an existing Native component may be modified, so that the Native component has a function of forwarding a bluetooth data type, that is, when the Native component receives bluetooth data, the Native component may have a function of forwarding the bluetooth data type to a low power consumption bluetooth manager.
Step S12, when the Native component receives bluetooth data, pushing a data type corresponding to the bluetooth data to the fact in a form of a message based on the forwarding mechanism and the low power consumption bluetooth manager.
In an embodiment, when the Native component receives the bluetooth data, the Native component may notify the bluetooth low energy manager of the data type corresponding to the bluetooth data based on the forwarding mechanism, and the bluetooth low energy manager notifies the fact component of the data type corresponding to the bluetooth data in a message form. The basic functions of native bluetooth may refer to bluetooth connection state management and basic bluetooth data transceiving.
In an embodiment, when the read component and the Native component perform data interaction, the communication method exposed by the Native component can be obtained, and the read component is controlled to initiate data interaction with the Native component based on the communication method, so that the read component can know which communication methods are exposed by the Native component to perform data interaction with the Native component through the communication methods. For example, the Native component exposes a communication method "void) disconnect { }", and when the read component and the Native component perform data interaction, the communication method "void) disconnect { }" exposed by the Native component can be acquired, and the read component is controlled to initiate data interaction with the Native component based on the communication method "void) disconnect { }".
Step S13, when the React component receives the message pushed by the low-power consumption Bluetooth manager, determining the data type of the Bluetooth data received by the Native component according to the message, so as to execute the operation corresponding to the data type.
In an embodiment, the operation corresponding to the data type may refer to operations of refreshing a read page, reading data (reading data from a real database), storing data (storing data to a real database), and the like. The data types include a first data type and a second data type. The first data type may be an interactive type and the second data type may be a large data volume type. In other embodiments, the first data type and the second data type may be other types, which are not illustrated here.
In one embodiment, if the data type of the bluetooth data received by the Native component is a first data type, performing interactive operation corresponding to the bluetooth data on a read page; and if the data type of the Bluetooth data received by the Native component is a second data type, storing the Bluetooth data in a real database.
Specifically, if the data type is the interactive type, the operation of updating the React page corresponding to the Bluetooth data is executed on the React page. For example, if the React component receives Bluetooth data of an interaction type that successfully connects to a smart device, the Bluetooth connection status of the React page is updated from "not connected" to "connected". If the data type is a large data volume type, the Bluetooth data is stored in the real database based on the data characteristics of the Bluetooth data, so that the React component can conveniently trace back historical Bluetooth data, the Bluetooth data received by the Native component is forwarded to the React component for processing, the Bluetooth data does not need to be processed differently on the Native side according to different operating system platforms, the workload of Bluetooth data transfer is reduced, and the method is more convenient to perform information processing compared with the method of simply using the Native component.
In one embodiment, the data characteristics include log characteristics and user characteristics. For example, when the data characteristic of the received bluetooth data is the log characteristic, the fact component may store the bluetooth data in a form of the log characteristic to a real database so as to check a bluetooth operation log of the computer device in the following; when the data characteristics of the received Bluetooth data are the user characteristics, the React component can store the Bluetooth data into the Realm database according to the form of the user characteristics so as to check the data related to the user in the following. The data relating to the user may include user physiological data, motion data, and the like.
In an embodiment, a monitoring mechanism for monitoring the bridge may be established in the read component, so as to receive a message pushed by the low-power-consumption bluetooth manager through the bridge in time, and determine a data type of bluetooth data received by the Native component according to the message, so as to execute an operation corresponding to the data type, and achieve the purpose of receiving, sending, and processing the bluetooth data.
In the embodiment of the invention, when Bluetooth initialization is carried out, information of a low-power Bluetooth manager of computer equipment is obtained, so that the low-power Bluetooth manager is set as an intermediate receptor for data interaction between a read component and a Native component; establishing a forwarding mechanism of a Bluetooth data type in the Native component; when the Native component receives Bluetooth data, pushing a data type corresponding to the Bluetooth data to the fact component in a message form based on the forwarding mechanism and the low-power Bluetooth manager; and when the React component receives the message pushed by the low-power-consumption Bluetooth manager, determining the data type of the Bluetooth data received by the Native component according to the message so as to execute the operation corresponding to the data type. According to the embodiment of the invention, the low-power-consumption Bluetooth manager is set as an intermediate receptor for data interaction between the read component and the Native component, and a Bluetooth data type forwarding mechanism is established in the Native component, so that the data type corresponding to the Bluetooth data received by the Native component can be pushed to the read component in a message form based on the forwarding mechanism and the low-power-consumption Bluetooth manager, and the read component can determine the data type according to the message to execute the operation corresponding to the data type, so that the Bluetooth data received by the Native component can be processed at the read side.
In an exemplary implementation, referring to fig. 3, a flowchart of another information processing method according to an embodiment of the present invention is shown. In this embodiment, the information processing method is used in a computer device configured with a bluetooth low energy manager, and includes:
and step S20, when Bluetooth initialization is carried out, acquiring the information of the low-power Bluetooth manager, so that the low-power Bluetooth manager is set as an intermediate receptor for data interaction between a read component and a Native component.
Step S21, establishing a forwarding mechanism of Bluetooth data type in the Native component;
step S22, when the Native component receives Bluetooth data, pushing the data type corresponding to the Bluetooth data to the React component in the form of message based on the forwarding mechanism and the low-power Bluetooth manager;
step S23, when the React component receives the message pushed by the low-power consumption Bluetooth manager, determining the data type of the Bluetooth data received by the Native component according to the message, so as to execute the operation corresponding to the data type.
Specifically, the steps S20-S23 are the same as the steps S10-S13 in the above embodiment, and are not repeated in this embodiment.
And step S24, acquiring code implementation logic for data interaction between the React component and the Native component.
Specifically, a code implementation logic for data interaction between the read component and the Native component may be obtained, so that the code implementation logic is packaged into a bluetooth static library.
And step S25, packaging the code implementation logic into a Bluetooth static library, and issuing the Bluetooth static library to a specified warehouse.
Specifically, the specified warehouse may be an Npm warehouse. And the code implementation logic is packaged into a Bluetooth static library, and the Bluetooth static library is issued to the Npm warehouse, so that when a Bluetooth module is required to be integrated in a project developed based on a real Native framework, a preset instruction can be input into a preset console to download the Bluetooth static library, and the Bluetooth static library is integrated into the project developed based on the real Native framework for use, thereby reducing the project development workload and greatly reducing the bug occurrence probability.
In an embodiment, the default console may be a shell tool of a programming environment, and the default instruction may be "npm inactive-native-ble".
In an embodiment, after an item is downloaded from the Npm repository and the integration of the bluetooth static repository is completed, a monitoring mechanism for monitoring the bridge may be established in the read component, so that a message pushed by the low power consumption bluetooth manager is received through the bridge, and a data type of bluetooth data received by the Native component is determined according to the message, so as to execute an operation corresponding to the data type, thereby achieving the purpose of receiving, sending, and processing the bluetooth data.
In the embodiment of the invention, when Bluetooth initialization is carried out, information of a low-power Bluetooth manager of computer equipment is obtained, so that the low-power Bluetooth manager is set as an intermediate receptor for data interaction between a read component and a Native component; establishing a forwarding mechanism of a Bluetooth data type in the Native component; when the Native component receives Bluetooth data, pushing a data type corresponding to the Bluetooth data to the fact component in a message form based on the forwarding mechanism and the low-power Bluetooth manager; and when the React component receives the message pushed by the low-power-consumption Bluetooth manager, determining the data type of the Bluetooth data received by the Native component according to the message so as to execute the operation corresponding to the data type. According to the embodiment of the invention, the low-power-consumption Bluetooth manager is set as an intermediate receptor for data interaction between the read component and the Native component, and a forwarding mechanism of a Bluetooth data type is established in the Native component, so that the data type corresponding to the Bluetooth data received by the Native component can be pushed to the read component in a message form based on the forwarding mechanism and the low-power-consumption Bluetooth manager, and the read component can determine the data type according to the message to execute the operation corresponding to the data type, so that the Bluetooth data received by the Native component can be processed at the read side. Furthermore, code implementation logic for data interaction between the React component and the Native component can be obtained, the code implementation logic is packaged into a Bluetooth static library, and the Bluetooth static library is issued to a specified warehouse, so that when Bluetooth data needs to be processed, the Bluetooth data can be directly downloaded from the specified warehouse and integrated into a project for use, an interface does not need to be appointed for different operating system platforms, and the workload of Bluetooth data transfer is reduced.
Referring to fig. 4, a schematic diagram of program modules of an information processing apparatus 300 according to an embodiment of the invention is shown. The information processing apparatus 300 may be applied to a computer device, which may be a mobile phone, a tablet personal computer (tablet personal computer), a laptop computer (laptop computer), a server, or the like having a data transmission function. The computer device is configured with a bluetooth low energy manager. In the present embodiment, the information processing apparatus 300 may include or be divided into one or more program modules, and the one or more program modules are stored in a storage medium and executed by one or more processors to implement the present invention and realize the above-described information processing method. The program module referred to in the embodiments of the present invention refers to a series of computer program instruction segments capable of performing specific functions, and is more suitable than the program itself for describing the execution process of the information processing method in the storage medium. In this embodiment, the information processing apparatus 300 includes an obtaining module 301, a creating module 302, a pushing module 303, and an executing module 304. The following description will specifically describe the functions of the program modules of the present embodiment:
the obtaining module 301 is configured to obtain information of a low power consumption bluetooth manager when bluetooth initialization is performed, so as to set the low power consumption bluetooth manager as an intermediate recipient for performing data interaction between a read component and a Native component.
Specifically, when the read component calls the Native bluetooth initialization instruction to perform bluetooth initialization, the obtaining module 301 may obtain information of the low power consumption bluetooth manager, so as to set the low power consumption bluetooth manager as an intermediate recipient for performing data interaction between the read component and the Native component.
As shown in fig. 2, a Bridge (Bridge) may be established between the fact component and the bluetooth low energy manager, so that data interaction between the fact component and the Native component sequentially passes through the Bridge and the bluetooth low energy manager. For example, the reach component may send a message to the Bridge, and the Bridge sends the message to the bluetooth low energy manager, and the bluetooth low energy manager performs data interaction with the Native component.
In an embodiment, after the step of setting the bluetooth low energy manager as an intermediate recipient for data interaction between the read component and the Native component, the bluetooth function module included in the Native component may be extracted, so that materialization instructions between the read component and the Native component may be reduced as much as possible, and only basic bluetooth communication logic is reserved.
A building module 302, configured to build a forwarding mechanism of a bluetooth data type in the Native component.
Specifically, a forwarding mechanism of bluetooth data types is established in the Native component, so that after receiving bluetooth data, the Native component can push a data type corresponding to the bluetooth data to the Bridge in a message form through the low-power-consumption bluetooth manager, and the Bridge notifies the reach component again, so that the reach component can receive a message notification of the data type of the bluetooth data received by the Native component.
It can be understood that, because the existing read Native framework processes the bluetooth data through the Native component, there is no need to establish a forwarding mechanism for the bluetooth data type. In an embodiment of the application, a code in an existing Native component may be modified, so that the Native component has a function of forwarding a bluetooth data type, that is, when the Native component receives bluetooth data, the Native component may have a function of forwarding the bluetooth data type to a low power consumption bluetooth manager.
A pushing module 303, configured to, when the Native component receives bluetooth data, push a data type corresponding to the bluetooth data to the fact component in a form of a message based on the forwarding mechanism and the low power consumption bluetooth manager.
In an embodiment, when the Native component receives bluetooth data, the Native component may notify the data type corresponding to the bluetooth data to the bluetooth low energy manager based on the forwarding mechanism, and the bluetooth low energy manager notifies the reach component of the data type corresponding to the bluetooth data in a message form. The basic functions of native bluetooth may refer to bluetooth connection state management and basic bluetooth data transceiving.
In an embodiment, when the read component and the Native component perform data interaction, the communication method exposed by the Native component can be obtained, and the read component is controlled to initiate data interaction with the Native component based on the communication method, so that the read component can know which communication methods are exposed by the Native component to perform data interaction with the Native component through the communication methods. For example, the Native component exposes a communication method "(void) disconnect { }", and when the read component and the Native component perform data interaction, the communication method "(void) disconnect { }" exposed by the Native component can be acquired, and the read component is controlled to initiate data interaction with the Native component based on the communication method "(void) disconnect { }".
An executing module 304, configured to determine, when the read component receives the message pushed by the bluetooth low energy manager, a data type of the bluetooth data received by the Native component according to the message, so as to execute an operation corresponding to the data type.
In an embodiment, the operation corresponding to the data type may refer to operations of refreshing a read page, reading data (reading data from a real database), storing data (storing data to a real database), and the like. The data types include a first data type and a second data type. The first data type may be an interactive type and the second data type may be a large data volume type. In other embodiments, the first data type and the second data type may be other types, which are not illustrated here.
In one embodiment, if the data type of the bluetooth data received by the Native component is the first data type, performing interactive operation corresponding to the bluetooth data on a read page; and if the data type of the Bluetooth data received by the Native component is the second data type, storing the Bluetooth data in a real database.
Specifically, if the data type is the interactive type, the operation of updating the React page corresponding to the Bluetooth data is executed on the React page. For example, if the React component receives Bluetooth data of an interaction type that successfully connects to a smart device, the Bluetooth connection status of the React page is updated from "not connected" to "connected". If the data type is a large data volume type, the Bluetooth data is stored in a real database based on the data characteristics of the Bluetooth data, so that the React component can conveniently trace back historical Bluetooth data, the Bluetooth data received by the Native component is forwarded to the React component for processing, the Bluetooth data does not need to be processed differently on the Native side according to different operating system platforms, the workload of Bluetooth data transfer is reduced, and the method is more convenient to perform information processing compared with the method of simply using the Native component.
In one embodiment, the data characteristics include log characteristics and user characteristics. For example, when the data characteristic of the received bluetooth data is the log characteristic, the fact component may store the bluetooth data in a form of the log characteristic to a real database so as to view an operation log of the computer device in the following; when the data characteristics of the received Bluetooth data are the user characteristics, the React component can store the Bluetooth data into a Realm database according to the form of the user characteristics so as to check the data related to the user in the following process. The data relating to the user may include user physiological data, motion data, and the like.
In the embodiment of the invention, when Bluetooth initialization is carried out, information of a low-power Bluetooth manager of computer equipment is obtained, so that the low-power Bluetooth manager is set as an intermediate receptor for data interaction between a read component and a Native component; establishing a forwarding mechanism of a Bluetooth data type in the Native component; when the Native component receives Bluetooth data, pushing a data type corresponding to the Bluetooth data to the fact component in a message form based on the forwarding mechanism and the low-power Bluetooth manager; and when the React component receives the message pushed by the low-power-consumption Bluetooth manager, determining the data type of the Bluetooth data received by the Native component according to the message so as to execute the operation corresponding to the data type. According to the embodiment of the invention, the low-power-consumption Bluetooth manager is set as an intermediate receptor for data interaction between the read component and the Native component, and the forwarding mechanism of the Bluetooth data type is established in the Native component, so that the data type corresponding to the Bluetooth data received by the Native component can be pushed to the read component in the form of a message based on the forwarding mechanism and the low-power-consumption Bluetooth manager, and the read component can determine the data type according to the message to execute the operation corresponding to the data type, so that the Bluetooth data received by the Native component can be processed on the read side.
Referring to fig. 5, a schematic diagram of program modules of an information processing apparatus 300 according to another embodiment of the invention is shown. Compared with fig. 4, the information processing apparatus 300 further includes a code logic module 305 and a packaging module 306.
And a code logic module 305, configured to obtain a code implementation logic for performing data interaction between the read component and the Native component.
Specifically, a code implementation logic for data interaction between the read component and the Native component may be obtained, so that the code implementation logic is packaged into a bluetooth static library.
And the encapsulating module 306 is configured to encapsulate the code implementation logic into a bluetooth static library, and issue the bluetooth static library to a specified repository.
Specifically, the specified warehouse may be an Npm warehouse. And the code implementation logic is packaged into a Bluetooth static library, and the Bluetooth static library is issued to the Npm warehouse, so that when a Bluetooth module is required to be integrated in a project developed based on a real Native framework, a preset instruction can be input into a preset console to download the Bluetooth static library, and the Bluetooth static library is integrated into the project developed based on the real Native framework for use, thereby reducing the project development workload and greatly reducing the bug occurrence probability.
In an embodiment, the default console may be a shell tool of a programming environment, and the default instruction may be "npm inactive-native-ble".
In an embodiment, after an item is downloaded from the Npm repository and the integration of the bluetooth static repository is completed, a monitoring mechanism for monitoring the bridge may be established in the read component, so that a message pushed by the low power consumption bluetooth manager is received through the bridge, and a data type of bluetooth data received by the Native component is determined according to the message, so as to execute an operation corresponding to the data type, thereby achieving the purpose of receiving, sending, and processing the bluetooth data.
According to the embodiment of the invention, the low-power-consumption Bluetooth manager is set as an intermediate receptor for data interaction between the React component and the Native component, and a Bluetooth data type forwarding mechanism is established in the Native component, so that the data type corresponding to the Bluetooth data received by the Native component can be pushed to the React component in a message form based on the forwarding mechanism and the low-power-consumption Bluetooth manager, and the React component can determine the data type according to the message to execute the operation corresponding to the data type, so that the Bluetooth data received by the Native component can be processed on the React side. Furthermore, code implementation logic for data interaction between the React component and the Native component can be obtained, the code implementation logic is packaged into a Bluetooth static library, and the Bluetooth static library is issued to a specified warehouse, so that when Bluetooth data needs to be processed, the Bluetooth data can be directly downloaded from the specified warehouse and integrated into a project for use, an interface does not need to be appointed for different operating system platforms, and the workload of Bluetooth data transfer is reduced.
Fig. 6 is a schematic diagram of a hardware architecture of a computer device 400 according to an embodiment of the present invention. In the present embodiment, the computer device 400 is a device capable of automatically performing numerical calculation and/or information processing according to an instruction set or stored in advance. As shown, the computer apparatus 400 includes, but is not limited to, at least a memory 401, a processor 402, and a network interface 403, which may be communicatively coupled to each other via a device bus. Wherein:
in this embodiment, the memory 401 includes at least one type of computer-readable storage medium including a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the storage 401 may be an internal storage unit of the computer device 400, such as a hard disk or a memory of the computer device 400. In other embodiments, the memory 401 may also be an external storage device of the computer device 400, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, provided on the computer device 400. Of course, the memory 401 may also include both internal and external storage devices for the computer device 400. In this embodiment, the memory 401 is generally used to store an operating device installed in the computer apparatus 400 and various types of application software, such as a program code of the information processing apparatus 300. Further, the memory 401 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 402 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 402 is generally used to control the overall operation of the computer device 400. In this embodiment, the processor 402 is configured to execute the program code stored in the memory 401 or process data, for example, execute the information processing apparatus 300, so as to implement the information processing method in each of the above embodiments.
The network interface 403 may include a wireless network interface or a wired network interface, and the network interface 403 is generally used for establishing a communication connection between the computer apparatus 400 and other electronic devices. For example, the network interface 403 is used to connect the computer device 400 to an external terminal through a network, establish a data transmission channel and a communication connection between the computer device 400 and the external terminal, and the like. The network may be a wireless or wired network such as an Intranet (Intranet), the Internet (Internet), a Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G network, Bluetooth (Bluetooth), Wi-Fi, and the like.
It is noted that fig. 6 only shows the computer device 400 having components 401 and 403, but it is understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead.
In this embodiment, the information processing apparatus 300 stored in the memory 401 may be further divided into one or more program modules, and the one or more program modules are stored in the memory 401 and executed by one or more processors (in this embodiment, the processor 402) to implement the information processing method of the present invention.
The present embodiment also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application mall, etc., on which a computer program is stored, which when executed by a processor implements corresponding functions. The computer readable storage medium of the embodiment is used for storing the information processing apparatus 300 to realize the information processing method of the present invention when being executed by a processor.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. An information processing method used in a computer device, wherein the computer device is configured with a bluetooth low energy manager, the information processing method comprising:
when Bluetooth initialization is carried out, information of the low-power Bluetooth manager is obtained, and the low-power Bluetooth manager is set as an intermediate receptor for data interaction between a read component and a Native component;
establishing a forwarding mechanism of a Bluetooth data type in the Native component;
when the Native component receives Bluetooth data, pushing a data type corresponding to the Bluetooth data to the fact component in a message form based on the forwarding mechanism and the low-power Bluetooth manager; and
and when the React component receives the message pushed by the low-power-consumption Bluetooth manager, determining the data type of the Bluetooth data received by the Native component according to the message so as to execute the operation corresponding to the data type.
2. The information processing method of claim 1, wherein the step of setting the bluetooth low energy manager as an intermediate recipient for data interaction between a read component and a Native component further comprises:
and drawing out the Bluetooth functional module contained in the Native component.
3. The information processing method of claim 1, wherein the step of setting the bluetooth low energy manager as an intermediate recipient for data interaction between a read component and a Native component comprises:
and a bridge is established between the React component and the low-power-consumption Bluetooth manager, so that data interaction is performed between the React component and the Native component sequentially through the bridge and the low-power-consumption Bluetooth manager.
4. The information processing method according to claim 3, wherein the information processing method further comprises:
a snoop mechanism is established in the React component that snoops the bridge.
5. The information processing method according to claim 1, wherein the information processing method further comprises:
acquiring a communication method exposed by the Native component;
and controlling the React component to initiate data interaction with the Native component based on the communication method.
6. The information processing method according to claim 1, wherein the data type includes a first data type and a second data type, and the step of executing the operation corresponding to the data type includes:
if the data type of the Bluetooth data received by the Native component is a first data type, performing interactive operation corresponding to the Bluetooth data on a React page;
and if the data type of the Bluetooth data received by the Native component is a second data type, storing the Bluetooth data in a real database.
7. The information processing method according to claim 1, wherein the information processing method further comprises:
acquiring code implementation logic for data interaction between the React component and the Native component; and
and packaging the code implementation logic into a Bluetooth static library, and issuing the Bluetooth static library to a specified warehouse.
8. An information processing apparatus applied to a computer device, wherein the computer device is configured with a bluetooth low energy manager, the information processing apparatus comprising:
the acquisition module is used for acquiring the information of the low-power Bluetooth manager during Bluetooth initialization so as to set the low-power Bluetooth manager as an intermediate receptor for data interaction between a read component and a Native component;
the establishing module is used for establishing a forwarding mechanism of a Bluetooth data type in the Native component;
the pushing module is used for pushing the data type corresponding to the Bluetooth data to the React component in a message form based on the forwarding mechanism and the low-power Bluetooth manager when the Native component receives the Bluetooth data; and
and the execution module is used for determining the data type of the Bluetooth data received by the Native component according to the message when the React component receives the message pushed by the low-power-consumption Bluetooth manager so as to execute the operation corresponding to the data type.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the information processing method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which is executable by at least one processor to cause the at least one processor to perform the steps of the information processing method according to any one of claims 1 to 7.
CN202011483233.3A 2020-12-15 2020-12-15 Information processing method and device and computer equipment Pending CN112527526A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011483233.3A CN112527526A (en) 2020-12-15 2020-12-15 Information processing method and device and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011483233.3A CN112527526A (en) 2020-12-15 2020-12-15 Information processing method and device and computer equipment

Publications (1)

Publication Number Publication Date
CN112527526A true CN112527526A (en) 2021-03-19

Family

ID=75000513

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011483233.3A Pending CN112527526A (en) 2020-12-15 2020-12-15 Information processing method and device and computer equipment

Country Status (1)

Country Link
CN (1) CN112527526A (en)

Similar Documents

Publication Publication Date Title
CN110647471B (en) Interface test case generation method, electronic device and storage medium
CN107133064B (en) Page hot updating method and device for native application
CN107370804B (en) Software application processing method and device
CN108900627B (en) Network request method, terminal device and storage medium
CN111782304A (en) Logic control method and device for paging loading data, computer equipment and medium
CN109582377A (en) BIOS option amending method, device, equipment and storage medium
CN113127361A (en) Application program development method and device, electronic equipment and storage medium
CN106952426B (en) Data processing method and device
CN110109684B (en) Block chain link point management proxy service installation method, electronic device and storage medium
CN112422450A (en) Computer equipment, and flow control method and device for service request
CN106095886B (en) Data processing method and device
CN113254014A (en) Sketch plug-in-based interface development method, device and system
CN112818270A (en) Data cross-domain transfer method and device and computer equipment
CN107147732A (en) Image processing method, device, client and service end
CN112527526A (en) Information processing method and device and computer equipment
CN112181440A (en) Method and device for deploying ios installation package in server and storage medium
CN112001707A (en) Business workflow generation method and system based on business data
CN103838575A (en) Plug-in type page customization implementation method based on EXTJS frame
CN116112457A (en) Method, device, computer equipment and storage medium for notifying message
CN112672187B (en) Page generation method and device, computer equipment and readable storage medium
CN113746932B (en) Network request merging method, device, electronic device and computer program product
CN107092601B (en) Resource file construction method, resource file application method and device
CN114356507A (en) Method, device and equipment for processing document based on browser and storage medium
CA3033837A1 (en) Techniques for event driven scheduling in a welding or cutting system
CN109683981B (en) Method and device for refreshing HTML5 page based on android application program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination