CN113507701A - Method, system, terminal and storage medium for simulating Bluetooth peripheral through parameter configuration - Google Patents

Method, system, terminal and storage medium for simulating Bluetooth peripheral through parameter configuration Download PDF

Info

Publication number
CN113507701A
CN113507701A CN202110329960.2A CN202110329960A CN113507701A CN 113507701 A CN113507701 A CN 113507701A CN 202110329960 A CN202110329960 A CN 202110329960A CN 113507701 A CN113507701 A CN 113507701A
Authority
CN
China
Prior art keywords
identification code
characteristic value
attribute
user
peripheral
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.)
Granted
Application number
CN202110329960.2A
Other languages
Chinese (zh)
Other versions
CN113507701B (en
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.)
Xiamenshi C Chip Co ltd
Original Assignee
Xiamenshi C Chip 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 Xiamenshi C Chip Co ltd filed Critical Xiamenshi C Chip Co ltd
Priority to CN202110329960.2A priority Critical patent/CN113507701B/en
Publication of CN113507701A publication Critical patent/CN113507701A/en
Application granted granted Critical
Publication of CN113507701B publication Critical patent/CN113507701B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/06Authentication
    • H04W12/068Authentication using credential vaults, e.g. password manager applications or one time password [OTP] applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/02Arrangements for optimising operational condition
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/08Access restriction or access information delivery, e.g. discovery data delivery
    • H04W48/10Access restriction or access information delivery, e.g. discovery data delivery using broadcasted information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application relates to a method, a system, a terminal and a storage medium for simulating Bluetooth peripheral equipment through parameter configuration, which belong to the field of Bluetooth technology, wherein the method comprises the steps of acquiring a current peripheral equipment identification code and a current service identification code input by a user; according to the current service identification code, obtaining characteristic value information in a local database, wherein the characteristic value information comprises a characteristic value identification code and a characteristic value authority attribute; screening the characteristic value information according to the characteristic value authority attribute to generate a current service class, wherein the current service class is composed of a plurality of screened characteristic value information, and the service identification code corresponding to the current service class is the same as the current service identification code; correspondingly matching the current service class with the current peripheral identification code; acquiring a confirmation request sent by a user; in response to the confirmation request, a connection request including the current peripheral identification code is generated and broadcast for connection by the user. The method and the device have the effects of reducing communication requirements of software and hardware development and improving Bluetooth software development efficiency.

Description

Method, system, terminal and storage medium for simulating Bluetooth peripheral through parameter configuration
Technical Field
The present application relates to the field of bluetooth technology, and in particular, to a method, system, terminal and storage medium for simulating a bluetooth peripheral through parameter configuration.
Background
At present, along with the continuous development of science and technology, smart home gradually enters people's life. In order to realize the centralized control and remote control functions of household appliances, the household intelligent gateway controls the household appliances or lighting equipment by means of an external expansion module in a wired or wireless mode according to a specific communication protocol. Bluetooth is a low-cost short-distance wireless connection mode and is also a communication mode of intelligent household appliances.
In the prior art, in the process of software development, development and debugging are required to be carried out by matching with hardware, and parameters of software are adjusted according to the actual condition of hardware equipment.
The related art described above has the following drawbacks: the debugging of software development is based on hardware development, so the development speed of software is restricted by the development speed of hardware, and if the hardware development is delayed due to an unexpected reason, the debugging of software is delayed, so that the Bluetooth software development efficiency is low.
Disclosure of Invention
In order to reduce the communication requirements of software and hardware development and improve the efficiency of Bluetooth software development, the application provides a method, a system, a terminal and a storage medium for simulating Bluetooth peripheral equipment through parameter configuration.
In a first aspect, the present application provides a method for simulating a bluetooth peripheral device through parameter configuration, which adopts the following technical scheme:
a method for simulating a bluetooth peripheral through parameter configuration, comprising:
acquiring a current peripheral identification code and a current service identification code input by a user;
according to the current service identification code, obtaining characteristic value information in a local database, wherein the characteristic value information comprises a characteristic value identification code and a characteristic value authority attribute;
screening the characteristic value information according to the characteristic value authority attribute to generate a current service class, wherein the current service class is composed of a plurality of characteristic value information, and a service identification code corresponding to the current service class is the same as the current service identification code;
correspondingly matching the current service class with the current peripheral identification code;
acquiring a confirmation request sent by a user;
and responding to the confirmation request, and generating and broadcasting a connection request comprising the current peripheral identification code for the user to connect.
By adopting the technical scheme, after the characteristic value information under the current service identification code input by the user is screened according to the characteristic value identification code, the characteristic value information is bound with the current simulation peripheral equipment, one simulation peripheral equipment can be bound with a plurality of service classes, the characteristic value screened from the local database by each service class is used for simulating the Bluetooth peripheral equipment and carrying out simulation interaction with software developers, the developers of the software can conveniently adjust parameters, the development progress of the hardware is not required to be waited, and the development efficiency of the Bluetooth software is improved.
Optionally, before the obtaining the current peripheral identification code and the current service identification code input by the user, the method further includes:
acquiring characteristic value information input by a user, and storing the characteristic value information to a local database, wherein the characteristic value information comprises a service identification code of a service class to which the characteristic value information belongs;
acquiring attribute information selected by a user, wherein the attribute information comprises an attribute identification code;
acquiring a protocol header input by a user;
and generating a local instruction on the basis of the protocol header according to the attribute identification code, the service identification code and the characteristic value identification code, and storing the local instruction in a local database.
By adopting the technical scheme, the service identification code and the characteristic value identification code can be manually input after being communicated with hardware developers, so that the types of service and characteristic values are increased, and the diversified requirements of users are met; different instructions can be defined and generated by manually inputting different protocol heads by a user, and a foundation is laid for interactive response.
Alternatively, the attribute information may be manually input by a user.
By adopting the technical scheme, the user can manually input attributes such as brightness, electric quantity and temperature, so that the generated simulated Bluetooth peripheral can meet the actual parameter requirements of software developers.
Optionally, the local instruction includes a protocol header, an attribute identifier, and a feature value identifier;
the generating and broadcasting a connection request including the current peripheral identification code in response to the confirmation request for a user to connect further comprises:
acquiring a modification instruction sent by a user through a Bluetooth link established after the user is connected, wherein the modification instruction comprises an attribute identification code to be modified, a characteristic value identification code to be modified and a modification protocol header;
judging whether a local instruction with a protocol head identical to the modified protocol head, a characteristic value identification code identical to the characteristic value identification code to be modified and an attribute identification code identical to the attribute identification code to be modified exists in a local database;
if the local instruction meeting the requirements exists, acquiring a corresponding attribute length according to the local instruction;
generating a new attribute value according to the attribute length and the correction instruction;
and updating the corresponding attribute value in the local database by using the new attribute value.
By adopting the technical scheme, after the Bluetooth link is established, the user sends a modification instruction to the simulated Bluetooth equipment, then the modification instruction is compared with the local instruction in the local database, and the corresponding attribute value in the modification instruction is modified and updated, so that the interaction between the user and the simulated Bluetooth peripheral equipment is realized.
Optionally, after the updating the corresponding attribute value in the local database with the new attribute value, the method further includes:
judging whether the characteristic value authority attribute of the characteristic value information also comprises 'notifiable' and whether a local instruction of a protocol head of which the corresponding protocol head is a peripheral receiving instruction protocol head exists in a local database;
and if the characteristic value authority attribute also comprises 'notifiable' and the local instruction exists in a local database, acquiring the local instruction and sending the local instruction to a user side.
By adopting the technical scheme, after the attribute value is modified through the instruction, if the corresponding characteristic value information comprises the characteristic value authority attribute which can be notified, the response instruction is fed back to the user so as to notify the user of the current signal transmission condition, thereby improving the use experience of the user.
Optionally, the determining, in the local database, whether there is a local instruction whose protocol header is the same as the modified protocol header, whose feature value identifier is the same as the feature value identifier to be modified, and whose attribute identifier is the same as the attribute identifier to be modified further includes:
and if the local instruction does not exist, acquiring the local instruction with the protocol head as the alarm protocol head from a local database according to the attribute identification code to be modified and the characteristic value identification code to be modified, and sending the local instruction to the user side.
By adopting the technical scheme, when the local instruction corresponding to the modification instruction does not exist in the local database, the attribute value cannot be modified, and at the moment, the alarm instruction is sent to indicate that the modification fails, so that developers are timely reminded of completing the supplement.
In a second aspect, the present application provides a system for simulating a bluetooth peripheral device through parameter configuration, which adopts the following technical solution:
a system for emulating bluetooth peripherals through parameter configuration, comprising:
the user input sub-module is used for acquiring a current peripheral identification code and a current service identification code input by a user;
the peripheral matching submodule is used for acquiring characteristic value information in a local database according to the current service identification code, wherein the characteristic value information comprises a characteristic value identification code and a characteristic value authority attribute; screening the characteristic value information according to the characteristic value authority attribute to generate a current service class, wherein the current service class is composed of a plurality of characteristic value information, and a service identification code corresponding to the current service class is the same as the current service identification code; correspondingly matching the current service class with the current peripheral identification code;
the confirmation broadcasting submodule is used for acquiring a confirmation request sent by a user; and responding to the confirmation request, and generating and broadcasting a connection request comprising the current peripheral identification code for the user to connect.
By adopting the technical scheme, after the user inputs the current peripheral identification code and the current service identification code, the characteristic value under the service can be screened, then the current service class is generated according to the screening result, and the current service class is matched with the current peripheral identification code, so that the simulation peripheral with the attribute and the communication channel is generated, software developers can directly communicate with the simulation peripheral and adjust the parameters, the time is saved, and the software development efficiency is improved.
In a third aspect, the present application provides an intelligent terminal, which adopts the following technical scheme:
an intelligent terminal comprising a memory and a processor, said memory having stored thereon a computer program that can be loaded by the processor and that executes the method according to the first aspect.
By adopting the technical scheme, the service and the characteristic value are obtained from the local database and are bound with the current peripheral identification code to generate the simulated Bluetooth peripheral, so that software developers can communicate and adjust parameters of the Bluetooth software and the simulated Bluetooth peripheral without matching with hardware development, time is saved, and software development efficiency is improved.
In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solutions:
a computer readable storage medium comprising a computer program stored thereon which is loadable by a processor and adapted to carry out the method of the first aspect.
By adopting the technical scheme, the required service can be manually matched for the simulated Bluetooth peripheral, so that the simulated Bluetooth peripheral can approach the real required Bluetooth peripheral function, software developers can adjust parameters based on the simulated Bluetooth peripheral, communication with hardware development is reduced, software development time is saved, and efficiency is improved.
In summary, the present application includes at least one of the following beneficial technical effects:
1. the service containing the characteristic value is matched and bound with the peripheral identification code, so that the service becomes a simulation peripheral with a communication channel, developers can directly communicate with the simulation peripheral and adjust parameters, time is saved, and software development efficiency is improved;
2. after the attribute value is modified through the instruction, if the corresponding characteristic value information includes the characteristic value authority attribute of 'notifiable', the local instruction for response is fed back to the user to notify the user of the current signal transmission condition, so that the use experience of the user is improved.
Drawings
Fig. 1 is a schematic flowchart of a method for simulating a bluetooth peripheral through parameter configuration according to an embodiment of the present application.
Fig. 2 is a flow diagram illustrating the substeps S100 of digitizing a bluetooth peripheral and S200 of generating an analog bluetooth peripheral from the data according to an embodiment of the present application.
Fig. 3 is a flowchart illustrating sub-steps of S300 for interacting with an analog peripheral according to an embodiment of the present application.
Fig. 4 is a block diagram illustrating an exemplary system for simulating a bluetooth peripheral through parameter configuration according to an embodiment of the present disclosure.
Description of reference numerals: 1. a local data generation module; 2. a simulated peripheral generation module; 21. a user input sub-module; 22. a peripheral matching sub-module; 23. a broadcast confirmation submodule; 3. and the instruction data interaction module.
Detailed Description
The present application is described in further detail below with reference to figures 1-4.
The embodiment of the application discloses a method for simulating Bluetooth peripheral equipment through parameter configuration. Referring to fig. 1, the method for simulating a bluetooth peripheral through parameter configuration includes:
s100: and acquiring the characteristic value information, the service class, the attribute information and the protocol header input by the user, generating a corresponding local instruction, and storing the local instruction in a local database.
The user refers to a software developer, the software developer can communicate with a hardware developer in advance, specific values of characteristic value information, service types, attribute information and the like are manually input, and the specific values are integrated to generate the simulated Bluetooth peripheral, so that functions of the actual peripheral are simulated, and development requirements of the user are met. Specifically, in connection with fig. 2, S100 includes the following sub-steps:
s101: and acquiring the characteristic value information and the service class input by the user.
The service class is corresponding to a service identification code which is a unique identifier of the service class, different service classes are corresponding to different service identification codes, in addition, each service class is composed of a plurality of feature value information related to functions, and the feature value information comprises the feature value identification code. It should be noted that the service identifier and the eigenvalue identifier are both UUID codes.
Specifically, on the interface of the analog peripheral end, the user can manually input the characteristic value identification code and the service identification code in the input box, or the user can import the characteristic value identification code and the service identification code into the analog peripheral end, and the analog peripheral end can be a mobile phone terminal with a bluetooth module or a computer terminal with a bluetooth module. It should be noted that the specific values of the feature value identification code and the service identification code input by the user are determined and obtained according to actual requirements after the software developer communicates with the hardware developer in advance.
S102: and acquiring attribute information selected by a user.
The attribute information includes an attribute identification code and an attribute length, and different attribute identification codes correspond to different attributes, such as brightness, electric quantity, temperature, and the like. Specifically, the user can manually input the attribute identification code and the attribute length on the interface of the analog peripheral end, and select certain required attribute information on the interface through the selection box.
S103: and acquiring a protocol header input by a user.
Wherein specific values OF different headers are preset, and different headers represent different instruction meanings, for example, the header OF the OF01 may represent a modified instruction, the header OF the OF02 may represent a responded instruction, etc.
S104: and generating a local instruction on the basis of the protocol header according to the attribute information, the characteristic value information and the service class.
Specifically, the local instruction sequentially includes, from high order to low order, a peripheral identification code, a service identification code, a characteristic value identification code, a protocol header, and an attribute identification code. The peripheral identification code is empty temporarily, and the service identification code, the characteristic value identification code, the protocol header and the attribute identification code correspond to the service identification code, the characteristic value identification code, the protocol header and the attribute identification code which are input by the user before respectively. And finally, storing the generated local instruction into a local database.
S200: and according to the service identification code input by the user, screening out characteristic value information from the local database and binding the characteristic value information with the peripheral identification code input by the user, and generating and broadcasting a confirmation request.
Specifically, a user can input a peripheral identification code and a service identification code, bind a corresponding service class with the analog peripheral end, complete generation of the analog bluetooth peripheral according to a local database, and then perform broadcast waiting connection and interaction, with reference to fig. 2, S200 includes the following substeps:
s201: and acquiring the current peripheral identification code input by the user.
The peripheral identification code is a unique identification of the analog peripheral, so that different analog peripherals are corresponding to different peripheral identification codes for the convenience of user distinction. Specifically, the user can manually input the current peripheral identification code in a peripheral input box of the display interface of the analog peripheral end.
S202: and acquiring the current service identification code input by the user.
Specifically, the user may manually input the current service identifier in the peripheral input box of the analog peripheral display interface, where the current service identifier is one of a plurality of service identifiers pre-stored in the local database.
S203: and acquiring the characteristic value information in the local database according to the current service identification code.
The characteristic value information also comprises a service identification code of the service class to which the characteristic value belongs. Specifically, the user may click a virtual button on a display interface of the analog peripheral, send a request for confirmation of the current service identifier, and after receiving the request, the system searches for and acquires feature value information having the same service identifier as the current service identifier from the local database.
S204: and binding and matching the characteristic value information with the current peripheral identification code.
The characteristic value information also comprises an external identification code, and the external identification code describes the external correspondingly matched with the characteristic value information. Specifically, the current peripheral identification code input by the user is filled into the peripheral identification codes of the characteristic value information under the current service class, and the peripheral identification codes of all the characteristic value information are preset to be null before binding and matching. After that, the user may select to continue inputting other service identification codes on the interface of the debugging terminal, add a plurality of service classes to the current analog peripheral, that is, return to S202, and obtain the current service identification code input by the user again.
S205: and acquiring a confirmation request sent by a user.
Specifically, after the user completes a plurality of service classes for the current configuration of the analog peripheral, a virtual button may be clicked on the interface of the analog peripheral, and a confirmation request for indicating completion of the configuration of the analog peripheral may be sent.
S206: in response to the confirmation request, a connection request is generated and broadcast for the user to connect.
Wherein the connection request includes the current peripheral identification code. Specifically, after receiving the confirmation request sent by the user, the connection request is generated, and the program sdk is called to broadcast, so as to wait for the user to perform bluetooth connection.
S300: and according to the modification instruction sent by the user, acquiring a corresponding local instruction from the local database and sending the local instruction to the user side.
Wherein, the user side can be the terminal that cell-phone APP etc. can carry out the interaction with the bluetooth peripheral hardware in the reality. Specifically, the user side is connected with the analog peripheral side through the Bluetooth, and the interaction process with the analog peripheral side is realized through the exchange of instruction data. It should be noted that the peripheral identification code included in the attribute information, the feature value information, and the local instruction in this step are all the same as the peripheral identification code in the connection request, that is, the interaction of data is completed by calling the feature value information, the attribute information, and the local instruction under the service class bound to the current analog peripheral.
Specifically, in connection with fig. 3, S300 includes the following sub-steps:
s301: in response to the connection request, a bluetooth link is established.
Specifically, the software developer opens the bluetooth function of the user side, receives a connection request broadcast by the analog peripheral side, and establishes a bluetooth link for transmitting data between the user side and the analog peripheral side in response to the connection request to prepare for exchanging instruction data.
S302: and acquiring a modification instruction sent by a user.
The data structure of the modification instruction is the same as that of the local instruction part, the attribute identification code of the modification instruction is an attribute identification code to be modified, the characteristic value identification code of the modification instruction is a characteristic value identification code to be modified, and the protocol header of the modification instruction is a modification protocol header. For example, the modification protocol header of the modification instruction may be determined to be 0F01, and the identifier of the attribute to be modified may be an identifier of the attribute of brightness, and the modification instruction represents modification of the value of the attribute of brightness of the analog peripheral.
S303: and judging whether a local instruction meeting the instruction condition exists according to the correction protocol header, the identification code of the characteristic value to be modified and the identification code of the attribute to be modified.
It should be noted that the characteristic value information further includes characteristic value authority attributes, and the characteristic value authority attributes include three types, i.e., "readable", "writable", and "notifiable". In this embodiment, the "readable" feature value authority corresponds to "0", the "writable" feature value authority corresponds to "1", and the "notifiable" feature value authority corresponds to "2".
The condition of meeting the instruction is that the protocol header is the same as the correction protocol header, the characteristic value identification code is the same as the characteristic value identification code to be corrected, and the attribute identification code is the same as the attribute identification code to be corrected. Specifically, first, feature value information that a feature value identification code is equal to a feature value identification code to be modified and a feature value authority attribute is "1" (writable) is acquired from a local database, a channel is provided for modification of a corresponding attribute value, then, whether a local instruction meeting an instruction condition exists in the local database is judged, and if the local instruction meeting the instruction condition exists in the local database, the operation jumps to S304; if no local instruction meeting the instruction condition exists in the local database, the process goes to S309.
S304: and acquiring the corresponding attribute length according to the local instruction.
Specifically, the local database is searched for attribute information having the same attribute identification code as the modification identification code, and then the attribute length in the attribute information is acquired.
S305: and generating a new attribute value from the correction instruction according to the acquired attribute length.
Wherein, the modification instruction also comprises a modification attribute value. Specifically, starting from a preset starting point in the correction instruction, a character string with the length equal to the attribute length is obtained, and the character string is defined as a new attribute value.
S306: and updating the corresponding attribute value in the local database by using the new attribute value.
Specifically, the obtained new attribute value is used to replace the attribute value in the corresponding attribute information in the local database, so as to update the attribute value.
S307: and judging whether the characteristic value information and the local instruction meet the response condition.
The condition that the response is met means that the characteristic value authority attribute of the characteristic value information further includes '2' (informed), meanwhile, the characteristic value identification code existing in the local database is a modified characteristic identification code, the attribute identification code is an attribute identification code to be modified, and the protocol header is a local instruction of the peripheral acceptance instruction protocol header. Specifically, the feature value information with the feature value identification code being the same as the feature value identification code to be modified is obtained, whether the feature value information and the local instruction meet the response condition is judged, if the feature value information and the local instruction meet the response condition, the process jumps to S308, and if the feature value information and the local instruction do not meet the response condition, the process jumps to S309.
S308: and acquiring a local instruction and sending the local instruction to the user side.
Specifically, the local instruction meeting the response condition is acquired and sent to the user side through the bluetooth link, so that the user is informed that the modification action on the corresponding attribute is completed.
S309: and according to the characteristic value information and the attribute identification code to be modified, acquiring a local instruction comprising an alarm protocol header, and sending the local instruction to the user side.
Specifically, in the local database, the characteristic value identification code is searched and obtained as a modification characteristic identification code, the attribute identification code is an attribute identification code to be modified, the protocol header is a local instruction of the alarm protocol header, and finally the local instruction is sent to the user side through the bluetooth link, so that an alarm prompt is given to the user, and the user is informed that the modification action on the corresponding attribute cannot be completed.
The implementation principle is as follows: firstly, the characteristic value information, the service class, the attribute information and the protocol header input by a user are obtained and stored in a local database, and then corresponding local instructions are generated according to the selection and the input of the user and are also stored in the local database. And then, acquiring a current service identification code and a current peripheral identification code input by a user, and matching a plurality of service classes for the simulation peripheral so that the simulation peripheral can simulate the functions of the real peripheral. After the Bluetooth link is established between the analog peripheral and the user side, instruction data are transmitted and responded between the analog peripheral and the user side, so that software developers can connect and adjust parameters of developed software on the premise of not needing matched hardware development, the speed of hardware development does not need to be considered, and the efficiency and the autonomy of software development are improved.
Based on the method, the embodiment of the application also discloses a system for simulating the Bluetooth peripheral equipment through parameter configuration. Referring to fig. 4, the simulated bluetooth peripheral system configured by parameters includes a local data generating module 1, a simulated peripheral generating module 2, and an instruction data interacting module 3.
The local data generation module 1 is configured to obtain characteristic value information, a service class, attribute information, and a protocol header input by a user, generate a local instruction, and store the local instruction and the input into a local database.
And the simulation peripheral generation module 2 is used for binding the service class with the peripheral identification code according to the input of the user, acquiring the current peripheral identification code input by the user, calling the corresponding service identification code and the corresponding characteristic value identification code to generate the simulation peripheral and broadcasting the simulation peripheral. Specifically, the module further includes a user input sub-module 21, a peripheral matching sub-module 22, and a confirmation broadcasting sub-module 23:
and the user input submodule 21 is used for acquiring the current peripheral identification code and the current service identification code input by the user.
And the peripheral matching submodule 22 is configured to screen and generate feature value information from a local database according to the current service identification code, select and generate a current service class from the feature value information according to the feature value authority attribute of the feature value information, and match the current service class with the peripheral identification code correspondingly.
And the confirmation broadcasting sub-module 23 is configured to obtain a confirmation request sent by the user, generate a connection request including the current peripheral identification code, and broadcast the connection request for the user to connect.
The instruction data interaction module 3 is used for acquiring a modification instruction sent by a user, judging whether a local instruction meeting instruction conditions exists according to the modification instruction, if so, updating an attribute value according to the corresponding attribute length, and sending the local instruction including a peripheral acceptance instruction protocol header to a user side when the characteristic value authority comprises 'notifiable'; and if the local instruction meeting the instruction condition does not exist, generating a local instruction containing an alarm protocol header to the user side.
The embodiment of the application also discloses an intelligent terminal, which comprises a memory and a processor, wherein the memory is stored with a computer program which can be loaded by the processor and can execute the method for simulating the Bluetooth peripheral through parameter configuration.
The embodiment of the present application further discloses a computer readable storage medium, which stores a computer program that can be loaded by a processor and execute the method for simulating the bluetooth peripheral through parameter configuration as described above, and the computer readable storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above examples are only used to illustrate the technical solutions of the present application, and do not limit the scope of protection of the application. It is to be understood that the embodiments described are only some of the embodiments of the present application and not all of them. All other embodiments, which can be derived by a person skilled in the art from these embodiments without making any inventive step, are within the scope of the present application.

Claims (9)

1. A method for simulating Bluetooth peripheral equipment through parameter configuration is characterized by comprising the following steps:
acquiring a current peripheral identification code and a current service identification code input by a user;
according to the current service identification code, obtaining characteristic value information in a local database, wherein the characteristic value information comprises a characteristic value identification code and a characteristic value authority attribute;
screening the characteristic value information according to the characteristic value authority attribute to generate a current service class, wherein the current service class is composed of a plurality of characteristic value information, and a service identification code corresponding to the current service class is the same as the current service identification code;
correspondingly matching the current service class with the current peripheral identification code;
acquiring a confirmation request sent by a user;
and responding to the confirmation request, and generating and broadcasting a connection request comprising the current peripheral identification code for the user to connect.
2. The method of claim 1, wherein the obtaining the current peripheral identification code and the current service identification code inputted by the user further comprises:
acquiring characteristic value information input by a user, and storing the characteristic value information to a local database, wherein the characteristic value information comprises a service identification code of a service class to which the characteristic value information belongs;
acquiring attribute information selected by a user, wherein the attribute information comprises an attribute identification code;
acquiring a protocol header input by a user;
and generating a local instruction on the basis of the protocol header according to the attribute identification code, the service identification code and the characteristic value identification code, and storing the local instruction in a local database.
3. The method of claim 2, wherein the attribute information is manually entered by a user.
4. The method of claim 2, wherein the native command comprises a protocol header, an attribute identifier, and a feature value identifier;
the generating and broadcasting a connection request including the current peripheral identification code in response to the confirmation request for a user to connect further comprises:
acquiring a modification instruction sent by a user through a Bluetooth link established after the user is connected, wherein the modification instruction comprises an attribute identification code to be modified, a characteristic value identification code to be modified and a modification protocol header;
judging whether a local instruction with a protocol head identical to the modified protocol head, a characteristic value identification code identical to the characteristic value identification code to be modified and an attribute identification code identical to the attribute identification code to be modified exists in a local database;
if the local instruction meeting the requirements exists, acquiring a corresponding attribute length according to the local instruction;
generating a new attribute value according to the attribute length and the correction instruction;
and updating the corresponding attribute value in the local database by using the new attribute value.
5. The method of claim 4, wherein the updating the corresponding attribute value in the local database with the new attribute value further comprises:
judging whether the characteristic value authority attribute of the characteristic value information also comprises 'notifiable' and whether a local instruction of a protocol head of which the corresponding protocol head is a peripheral receiving instruction protocol head exists in a local database;
and if the characteristic value authority attribute also comprises 'notifiable' and the local instruction exists in a local database, acquiring the local instruction and sending the local instruction to a user side.
6. The method of claim 4, wherein the determining whether there is a local command in the local database that has a protocol header identical to the modified protocol header, a feature value identifier identical to the feature value identifier to be modified, and an attribute identifier identical to the attribute identifier to be modified further comprises:
and if the local instruction does not exist, acquiring the local instruction with the protocol head as the alarm protocol head from a local database according to the attribute identification code to be modified and the characteristic value identification code to be modified, and sending the local instruction to the user side.
7. A system for simulating Bluetooth peripheral equipment through parameter configuration is characterized by comprising,
the user input submodule (21) is used for acquiring a current peripheral identification code and a current service identification code input by a user;
the peripheral matching submodule (22) is used for acquiring characteristic value information in a local database according to the current service identification code, and the characteristic value information comprises a characteristic value identification code and a characteristic value authority attribute; screening the characteristic value information according to the characteristic value authority attribute to generate a current service class, wherein the current service class is composed of a plurality of characteristic value information, and a service identification code corresponding to the current service class is the same as the current service identification code; correspondingly matching the current service class with the current peripheral identification code;
a confirmation broadcasting submodule (23) for acquiring a confirmation request sent by a user; and responding to the confirmation request, and generating and broadcasting a connection request comprising the current peripheral identification code for the user to connect.
8. An intelligent terminal, comprising a memory and a processor, the memory having stored thereon a computer program that can be loaded by the processor and that executes the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, in which a computer program is stored which can be loaded by a processor and which executes the method of any one of claims 1 to 6.
CN202110329960.2A 2021-03-29 2021-03-29 Method, system, terminal and storage medium for simulating Bluetooth peripheral through parameter configuration Active CN113507701B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110329960.2A CN113507701B (en) 2021-03-29 2021-03-29 Method, system, terminal and storage medium for simulating Bluetooth peripheral through parameter configuration

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110329960.2A CN113507701B (en) 2021-03-29 2021-03-29 Method, system, terminal and storage medium for simulating Bluetooth peripheral through parameter configuration

Publications (2)

Publication Number Publication Date
CN113507701A true CN113507701A (en) 2021-10-15
CN113507701B CN113507701B (en) 2023-11-21

Family

ID=78008420

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110329960.2A Active CN113507701B (en) 2021-03-29 2021-03-29 Method, system, terminal and storage medium for simulating Bluetooth peripheral through parameter configuration

Country Status (1)

Country Link
CN (1) CN113507701B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103176899A (en) * 2011-12-26 2013-06-26 希姆通信息技术(上海)有限公司 Mobile phone emulator and method for emulating mobile phone functions on host machine
US20140075420A1 (en) * 2012-06-04 2014-03-13 Google Inc. Generating hardware profiles by a software development environment
CN107195131A (en) * 2017-04-13 2017-09-22 深圳怡化电脑股份有限公司 A kind of method and device of analog hardware equipment
US20190034318A1 (en) * 2017-07-26 2019-01-31 Western Digital Technologies, Inc. Hardware-Software Co-Verification for Debugging Firmware on a Hardware Simulator

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103176899A (en) * 2011-12-26 2013-06-26 希姆通信息技术(上海)有限公司 Mobile phone emulator and method for emulating mobile phone functions on host machine
US20140075420A1 (en) * 2012-06-04 2014-03-13 Google Inc. Generating hardware profiles by a software development environment
CN107195131A (en) * 2017-04-13 2017-09-22 深圳怡化电脑股份有限公司 A kind of method and device of analog hardware equipment
US20190034318A1 (en) * 2017-07-26 2019-01-31 Western Digital Technologies, Inc. Hardware-Software Co-Verification for Debugging Firmware on a Hardware Simulator

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
N水瓶座菜虫: "iso设备app作为蓝牙外设端", Retrieved from the Internet <URL:https://www.jianshu.com/p/6c7c334f7c0f> *

Also Published As

Publication number Publication date
CN113507701B (en) 2023-11-21

Similar Documents

Publication Publication Date Title
US10284705B2 (en) Method and apparatus for controlling smart device, and computer storage medium
CN110351378A (en) A kind of control method and system of internet of things equipment
CN105162841A (en) Domestic appliance control method and system
CN107391736B (en) Page display method and device
JP6715283B2 (en) Network system and information processing method
CN101931603A (en) Method for realizing remote call on hand-held intelligent terminal
CN114374602B (en) Master control equipment configuration method and device, cloud server and storage medium
CN110457055A (en) A kind of firmware upgrade control method, system and controlling terminal towards fast charge agreement
CN104376711A (en) Method and device for rapidly configuring infrared remote control at mobile terminal
CN112436986A (en) Network distribution method and device, network distribution equipment and computer readable storage medium
CN108259281A (en) Intelligent domestic system based on ZigBee and Raspberry Pi
CN111413876A (en) Method for configuring control page of APP, cloud platform and terminal equipment
CN208001293U (en) Intelligent domestic system based on ZigBee and Raspberry Pi
WO2009057915A2 (en) Teminal and method of providing intelligent service in ubiquitous smart space
CN103049244A (en) Method and device for transmitting operating instructions
CN208188814U (en) A kind of embedded device and its remote update system
CN111399829B (en) Waveform modeling method and terminal based on model driving
CN113507701B (en) Method, system, terminal and storage medium for simulating Bluetooth peripheral through parameter configuration
KR102075381B1 (en) System and Method Things Co-operation Service and the Modeling Tool thereof
US20230143525A1 (en) Electronic device, data usage method, and recording medium
CN106648805A (en) Intelligent device, intelligent system, and method for intelligently installing application
CN110529985A (en) The matching process and device of air-conditioner set and data transmission terminal DTU
CN109525469A (en) The networking method and smart home device of smart home device
CN106210898B (en) Upgrading method and system for television terminal in network-free state
CN110266613A (en) The flow managing method and terminal of 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
GR01 Patent grant
GR01 Patent grant