Disclosure of Invention
The present disclosure provides a service discovery method and apparatus, an electronic device, and a storage medium to solve the deficiencies of the related art.
According to a first aspect of embodiments of the present disclosure, there is provided a service discovery method, applicable to a server, the method including:
acquiring a target request, wherein the target request contains target application parameters preset in a client;
searching the target application parameters in an application parameter registration list to obtain a searching result which indicates whether the target application parameters are found;
generating target response data which contains the search result and is matched with the target request;
And feeding back the target response data to the client so that the client interacts data with the server after the target response data characterizes and discovers target application parameters.
Optionally, the target application parameters include services, inclusion, and features.
Optionally, when the target application parameter comprises a service, the target response data comprises a service response, wherein the service response comprises an operation code, an attribute type, result data and attribute authority;
The operation code is a second operation code, the attribute type is a first attribute type, and the result data indicates whether the service is in the registration list.
Optionally, when the target application parameter comprises an inclusion, the target response data comprises an inclusion response, the inclusion response comprising an opcode, an attribute type, and result data;
The opcode is a second opcode and the attribute type is a second attribute type, and the result data indicates whether this inclusion is within the registry.
Optionally, when the target application parameter includes a feature, the target response data includes a feature response, where the feature response includes an operation code, an attribute type, an attribute authority, a feature UUID, and a feature handle, the operation code is a second operation code, the attribute type is a third attribute type, the attribute authority indicates a data operation type, the feature handle indicates an object of a message to be transmitted, and the feature UUID indicates an identification code of the feature.
Optionally, the method further comprises:
and when receiving a link establishment request sent by a client, establishing a Bluetooth link with the client.
Optionally, the method further comprises:
and stopping the searching process after the target application parameters are searched.
According to a second aspect of embodiments of the present disclosure, there is provided a service discovery method, applicable to a client, the method including:
Acquiring target application parameters preset in a client;
Generating a target request containing the target application parameters and sending the target request to a server, so that the server responds to the target request to search an application parameter registration list and returns target response data which indicates whether the search result of the target application parameters is found;
and after the target response data represent that the target application parameters are found, the data are interacted with the server according to the target application parameters.
Optionally, the target application parameters include services, inclusion, and features.
Optionally, when the target application parameter includes a service, the target request includes a service request, the service request includes an operation code, an attribute type and a service parameter UUID, the operation code is a first operation code, and the attribute type is a first attribute type.
Optionally, when the target application parameter includes an inclusion, the target request includes an inclusion request, the inclusion request includes an operation code, an attribute type and an attribute authority, the operation code is a first operation code, and the attribute type is a second attribute type.
Optionally, when the target application parameter includes a feature, the target request includes a feature request, the feature request includes an operation code, an attribute type, and a feature UUID, the operation code is a first operation code, and the attribute type is a third attribute type.
Optionally, the method further comprises:
and sending a link establishment request to enable the server side to establish a Bluetooth link with the client side in response to the link establishment request.
According to a third aspect of embodiments of the present disclosure, there is provided a service discovery apparatus, adapted to a service side, the apparatus including:
the target request acquisition module is used for acquiring a target request, wherein the target request contains target application parameters preset in a client;
the search result acquisition module is used for searching the target application parameters in the application parameter registration list to obtain a search result which indicates whether the target application parameters are found;
The target response acquisition module is used for generating target response data which contains the search result and is matched with the target request;
And the target response feedback module is used for feeding back the target response data to the client so that the client interacts data with the server after the target response data characterize and discover target application parameters.
Optionally, the target application parameters include services, inclusion, and features.
Optionally, when the target application parameter comprises a service, the target response data comprises a service response, wherein the service response comprises an operation code, an attribute type, result data and attribute authority;
The operation code is a second operation code, the attribute type is a first attribute type, and the result data indicates whether the service is in the registration list.
Optionally, when the target application parameter comprises an inclusion, the target response data comprises an inclusion response, the inclusion response comprising an opcode, an attribute type, and result data;
The opcode is a second opcode and the attribute type is a second attribute type, and the result data indicates whether this inclusion is within the registry.
Optionally, when the target application parameter includes a feature, the target response data includes a feature response, where the feature response includes an operation code, an attribute type, an attribute authority, a feature UUID, and a feature handle, the operation code is a second operation code, the attribute type is a third attribute type, the attribute authority indicates a data operation type, the feature handle indicates an object of a message to be transmitted, and the feature UUID indicates an identification code of the feature.
Optionally, the apparatus further comprises:
and the Bluetooth link establishment module is used for establishing Bluetooth link with the client when receiving the link establishment request sent by the client.
Optionally, the apparatus further comprises:
and the searching and stopping module is used for stopping the searching process after the target application parameters are searched.
According to a fourth aspect of embodiments of the present disclosure, there is provided a service discovery apparatus adapted for use in a client, the apparatus comprising:
the target parameter acquisition module is used for acquiring target application parameters preset in the client;
The target request generation module is used for generating a target request containing the target application parameters and sending the target request to the server side so that the server side responds to the target request to search an application parameter registration list and returns target response data which indicates whether the search result of the target application parameters is found;
And the data interaction module is used for interacting data with the server according to the target application parameters after the target response data indicates that the target application parameters are found.
Optionally, the target application parameters include services, inclusion, and features.
Optionally, when the target application parameter includes a service, the target request includes a service request, the service request includes an operation code, an attribute type and a service parameter UUID, the operation code is a first operation code, and the attribute type is a first attribute type.
Optionally, when the target application parameter includes an inclusion, the target request includes an inclusion request, the inclusion request includes an operation code, an attribute type and an attribute authority, the operation code is a first operation code, and the attribute type is a second attribute type.
Optionally, when the target application parameter includes a feature, the target request includes a feature request, the feature request includes an operation code, an attribute type, and a feature UUID, the operation code is a first operation code, and the attribute type is a third attribute type.
Optionally, the apparatus further comprises:
And the link request sending module is used for sending a link establishment request so that the server side responds to the link establishment request and establishes a Bluetooth link with the client side.
According to a fifth aspect of embodiments of the present disclosure, there is provided an electronic device, comprising:
A memory and a processor;
the memory is used for storing a computer program executable by the processor;
the processor is configured to execute the computer program in the memory to implement the method as described above.
According to a sixth aspect of embodiments of the present disclosure, there is provided a non-transitory computer readable storage medium, which when executed by a processor, is capable of carrying out a method as described above.
The technical scheme provided by the embodiment of the disclosure can comprise the following beneficial effects:
According to the scheme provided by the embodiment of the disclosure, a target request can be acquired, the target request contains target application parameters preset in a client, then the target application parameters are searched in an application parameter registration list to obtain a search result which indicates whether the target application parameters are found, then target response data which contains the search result and is matched with the target request is generated, and finally the target response data is fed back to the client so that the client interacts data with the server after the target application parameters are found by the target response data. In this way, in the embodiment, the target application parameters can be searched in the application parameter registration list without traversing all the application parameters in the application parameter registration list, so that the searching time is reduced, the data interaction time of two electronic devices through Bluetooth links is shortened, and the data interaction efficiency is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The embodiments described by way of example below are not representative of all embodiments consistent with the present disclosure. Rather, they are merely examples of apparatus consistent with some aspects of the disclosure as detailed in the accompanying claims. The features of the following examples and embodiments may be combined with each other without any conflict.
In order to solve the technical problems, embodiments of the present disclosure provide a service discovery method and apparatus, an electronic device, and a storage medium. The service discovery method may be applied to an electronic device with bluetooth function, and the electronic device may include, but is not limited to, a smart phone, a smart watch, smart glasses, a vehicle device, etc., and may be selected according to a specific scenario, which is not limited herein. Considering that data interaction involves two electronic devices, one of which is a Client (Client) and the other is a Server (Server). In order to facilitate understanding of the solution of the present disclosure, the present disclosure describes the solution of the service discovery method with the client and the server as execution subjects, respectively.
Fig. 1 is a flowchart of a service discovery method according to an exemplary embodiment, referring to fig. 1, and the service discovery method is applied to a server and includes steps 11 to 14.
In step 11, a target request is obtained, where the target request contains target application parameters preset in the client.
In this embodiment, the server may establish a bluetooth link (i.e. BLE link) with the client. For example, the client may generate a link establishment request and broadcast. The server can monitor the broadcast signals of the surrounding space, can detect the local pairing information after receiving the link establishment request, and can establish Bluetooth link with the client when the identification code of the client in the link establishment request is positioned in the paired equipment list in the server, so that the server and the client finish the pairing and connection work.
In this embodiment, the server may communicate with the client through the bluetooth link, so as to obtain the target request. The target request contains target application parameters preset in the client. In one example, the target application parameters Include services (Service), inclusion (Include), and features (feature). It can be appreciated that the bluetooth link is established based on the GATT protocol, and the relationship of the target application parameters configured in the GATT protocol is shown in fig. 2. The server and client may Include at least one Service (Service) composition, each (Service) comprising a plurality of Include (Include) and a plurality of feature (feature) compositions.
In an example, when the target application parameter includes a Service (Service), the target Request includes a Service Request (TARGET SERVICE Request). The Service request includes an opcode (1 byte), an attribute type (AttributeType, 2 bytes), and a Service parameter UUID (Service UUID,2bytes, or 16 bytes).
In this example, the operation code is a first operation code, which is used to identify the type of command issued by the opposite terminal. In the GATT protocol, the opcode is 1 byte, and 0x01 to 0x23, 0x51 and 0xD2 are occupied, so that the reserved bytes in the opcode are adopted as the first operation code, for example, the value of the first operation code is 0x25, 0x26 or 0x27, and the schemes are described by taking the value of the first operation code as 0x25 as an example.
In this example, the attribute type is a first attribute type (0 x 2801) used to identify the type of application parameter sent by the peer, i.e. the service type. In the GATT protocol, 0x2801 is Service,0x2802 is Include, and 0x2803 is feature characacteristic. In this example, the value of the first attribute type is 0x2801. In this example, the frame format of the service request is shown in table 1.
Table 1 frame format of service Request (TARGET SERVICE Request)
| opcode(1byte) |
AttributeType(2bytes) |
Service UUID (2 bytes or 16 bytes) |
| 0x25 |
0x2801 |
|
In one example, when the target application parameter includes an Include (Include), the target request includes an Include request (Target Include Request). The Include request includes an opcode (1 byte), an attribute type (AttributeType, 2 bytes), and a Include parameter UUID (Include UUID,2bytes, or 16 bytes).
In this example, the operation code included in the request is the first operation code, and the specific content may refer to the content of the operation code of the service request, which is not described herein.
In this example, the attribute type is a second attribute type, which is used to identify the type of the application parameter sent by the peer, i.e. the inclusion type. In this example, the second attribute type has a value of 0x2802.
In this example, the frame format containing the request (Target Include Request) is shown in table 2.
Table 2 contains the requested frame format
| opcode(1byte) |
AttributeType(2bytes) |
Include UUID (2 bytes or 16 bytes) |
| 0x25 |
0x2802 |
|
In one example, when the target application parameter includes a feature (charcteristic), the target Request includes a feature Request (TARGET CHARACTERISTIC Request). The feature request includes an opcode (1 byte), an attribute type (AttributeType, 2 bytes), and a feature parameter UUID (CHARACTERISTIC UUID,2bytes, or 16 bytes).
In this example, the operation code in the feature request is the first operation code, and the specific content may refer to the content of the operation code of the service request, which is not described herein.
In this example, the attribute type is a third attribute type, which is used to identify the type of the application parameter sent by the peer, i.e. the feature type. In this example, the third attribute type has a value of 0x2803.
In this example, the frame format of the feature Request (TARGET CHARACTERISTIC Request) is shown in table 3.
Table 3 frame format of feature request
| opcode(1byte) |
AttributeType(2bytes) |
charACTERISTIC UUID (2 bytes or 16 bytes) |
| 0x25 |
0x2803 |
|
In this embodiment, after obtaining the target request, the server may obtain the target application parameter in the target request, that is, obtain the operation code corresponding to the target application parameter.
In step 12, the target application parameter is searched in an application parameter registration list, and a search result indicating whether the target application parameter is found is obtained.
In this embodiment, the server registers three application parameters including and characteristic to the system, so as to store the three application parameters in the corresponding application parameter registration list. Or, the service end is provided with an application parameter registration list, such as a service registration list, a containing registration list and a feature registration list.
In this embodiment, the server may search the target application parameter in the application parameter registration list, so as to obtain a search result indicating whether the target application parameter is found.
For example, the server may determine the command type according to the operation code in the service request, that is, the first operation code 0x25 indicates a discovery command or a search command. The server may then determine which object (Service, inclusion or feature) to look up based on the attribute type in the Service request, i.e., the first attribute type is 0x2801 to indicate that the Service (Service) is looked up, and may determine whether the UUID of the Service in the Service request is located in the Service registration list. When the UUID of the service is not in the service registration list, the service end can obtain the search result of the undiscovered service.
As another example, the server may determine the command type from the opcode contained in the request, i.e., the first opcode is 0x25 indicating a discovery command or a lookup command. The server may determine which object (service, inclusion or feature) to find based on the attribute type in the inclusion request, i.e., a second attribute type of 0x2802 indicates that the inclusion (Include) is found. The server may determine whether the containment UUID in the containment request is located within the containment registration list. When the UUID is not located in the registration list, the server side can obtain the finding result of not finding the inclusion.
For another example, the server may determine the command type based on the opcode in the feature request, i.e., the first opcode is 0x25 indicating a discovery command or a lookup command. The server may determine which object (service, inclusion or feature) to find based on the attribute type in the feature request, i.e., a third attribute type of 0x2803 indicates that the search contains (Include). The server may determine whether the UUID contained in the feature request is located within the feature registration list. When the feature UUID is not in the feature registration list, the server side can obtain the search result of the undiscovered feature.
In step 13, target response data is generated that contains the lookup result and matches the target request.
In this embodiment, the server may generate target response data that includes the search result and matches the target request.
For example, when the target application parameter includes a service, the target response data includes a service response including an operation code (opcode, 1 byte), an attribute type (AttributeType, 2 bytes), result data (result, 1 byte), and attribute authority (Attribute Permission,1 byte). Wherein the operation code of the service response is a second operation code (0 x 26) used for indicating that the command type is a response type. The attribute type of the service response is a first attribute type (0 x 2801) for indicating the service type, the result data of the service response indicates whether the service is located within the registration list (e.g., 0x00 indicates presence, 0x01 indicates absence), the attribute authority of the service response indicates the data interaction type (e.g., 0x00 indicates readability, 0x01 indicates writeability, 0x02 indicates readability and writeability, etc.)
In this example, the frame format of the service Response (TARGET SERVICE Response) is shown in table 4.
Table 4 frame format of service response
| opcode(1byte) |
AttributeType(2bytes) |
result(1byte) |
| 0x26 |
0x2801 |
0x00/0x01 |
For another example, when the target application parameter includes an include, the target response data includes an include response including an operation code (opcode, 1 byte), an attribute type (AttributeType, 2 bytes), result data (result, 1 byte), and attribute rights (Attribute Permission,1 byte). The operation code containing the response is a second operation code (0 x 26) used for indicating that the command type is the response type. The attribute type of the containment response is a second attribute type (0 x 2802) representing the containment type. The result data for the response is included to indicate whether the inclusion is within the registration list (e.g., 0x00 indicates present, 0x01 indicates absent).
In this example, the frame format containing the response (Target Include Response) is shown in table 5.
Table 5 contains the frame format of the response
| opcode(1byte) |
AttributeType(2bytes) |
result(1byte) |
| 0x26 |
0x2802 |
0x00/0x01 |
For another example, when the target application parameter includes a feature, the target response data includes a feature response including an operation code (opcode, 1 byte), a property type (AttributeType, 2 bytes), a property right (Attribute Permission,1 byte), a feature trait (CHARCTERISTIC PERPERTIES,1byte, or 2 byte), a property UUID (CHARCTERISTIC UUID,1 byte), and a feature handle (CHARACTERISTIC HANDLE,2 bytes). The operation code of the characteristic response is a second operation code (0 x 26) and is used for indicating that the command type is the response type. The attribute type containing the response is a third attribute type (0 x 2803) for representing the feature type. Attribute rights indicate the type of data operation (e.g., 0x00 indicates readable, 0x01 indicates writable, 0x02 indicates readable and writable, etc.), feature handle indicates the object of the message to be transmitted, and feature UUID indicates the identification code of the feature
In this example, the frame format of the characteristic Response (TARGET CHARACTERISTIC Response) is shown in table 6.
Table 6 frame format of characteristic response
In step 14, the target response data is fed back to the client, so that the client interacts data with the server after the target response data characterizes the discovery of the target application parameters.
In this embodiment, the server may feed back the target response data to the client. And the client can acquire the service, the inclusion and the characteristics after receiving the target response data, then establishes a data transmission channel according to the service, the inclusion and the characteristics, and further establishes the data transmission channel according to the data transmission channel. In this way, the server and the client can interact data through the data transmission channel.
In this embodiment, the server may stop the search process after the target application parameters are searched, without traversing all registered application parameters.
The method comprises the steps of obtaining a target request, wherein the target request comprises target application parameters preset in a client, searching the target application parameters in an application parameter registration list to obtain a searching result which indicates whether the target application parameters are found, generating target response data which comprises the searching result and is matched with the target request, and finally feeding back the target response data to the client so that the client interacts data with the server after the target application parameters are found by the target response data. In this way, in the embodiment, the target application parameters can be searched in the application parameter registration list without traversing all the application parameters in the application parameter registration list, so that the searching time is reduced, the data interaction time of two electronic devices through Bluetooth links is shortened, and the data interaction efficiency is improved.
Fig. 3 is a flowchart of a service discovery method according to an exemplary embodiment, referring to fig. 3, and the service discovery method is applied to a client, and includes steps 31 to 33.
In step 31, target application parameters preset in the client are obtained.
In this embodiment, referring to fig. 4, the client may establish a bluetooth link (i.e., BLE link) with the server. For example, the client may generate a link establishment request and broadcast. The server can monitor the broadcast signals of the surrounding space, can detect the local pairing information after receiving the link establishment request, and can establish Bluetooth link with the client when the identification code of the client in the link establishment request is positioned in the paired equipment list in the server, so that the server and the client finish the pairing and connection work.
In this embodiment, the client may obtain a target application parameter preset in the client. In one example, the target application parameters Include services (Service), inclusion (Include), and features (feature). The client may sequentially acquire a Service (Service), an inclusion (Include), and a feature (feature), specifically, the client may acquire the Service first, acquire the inclusion when determining that the Service has been registered with the server, and acquire the feature when determining that the inclusion has been registered with the server.
In step 32, a target request containing the target application parameter is generated and sent to a server, so that the server responds to the target request to search an application parameter registration list and returns target response data indicating whether the search result of the target application parameter is found.
In this embodiment, with continued reference to fig. 4, the client may generate and send a target request containing the target application parameters to the server. The target request may refer to the relevant content of step 11, which is not described herein.
In this embodiment, after receiving the target request, the server may search the application parameter registration list for a corresponding application parameter, such as a service, an inclusion or a feature, and generate target response data. The solution for searching the application parameters and generating the target response data may refer to the relevant content of step 12 and step 13, which will not be described herein.
In step 33, after the target response data indicates that the target application parameter is found, data is interacted with the server according to the target application parameter.
In this embodiment, after receiving the target response data, the client may determine to discover the service after sequentially determining the service, the inclusion and the feature in the target application parameter. At this time, the client and the server can perform interaction data according to the service characteristics.
It should be noted that, in the related art, the following process needs to be completed before the client interacts with the server data, see fig. 5, including:
The client sends a set TYPE request (att_read_by_group_type_req) to the server, requesting the server to return to the primary service that is currently registered (PRIMARY SERVICE). After receiving the request of the collection type, the server searches the service in the service registration list according to the preset size, so that a search result is returned, namely, one frame of data is returned. By analogy, after searching through all registered services, the server searches for a maximum of 65535 registered services, typically much less than 65535, and returns the search results. Accordingly, the client receives several frames of service responses, for example, 4-10 frames. In receiving the service response, the client may determine whether the service UUID is a service registered within the server. When the service UUID is a registered service, the client side re-discovers the inclusion (Include) in the service, that is, sends an Include reading instruction (att_read_by_type_req) and inquires about the process TYPE of the service, and the server side searches for the registered inclusion in the service and returns an inclusion response according to a preset size until all the inclusion registration lists are searched, so that the client side receives a plurality of frames of inclusion response data. After determining the corresponding inclusion, the client sends a READ feature instruction (att_read_by_type_req) to return the server to the registered feature. After determining the characteristics of the service, the client and the server can perform data interaction according to the characteristics of the service. Based on the above process analysis, before the client performs data interaction with the server, the client needs to receive multi-frame response data (service response, including response and feature response) in three stages, so that more time is consumed. In this embodiment, the client and the server can implement data interaction through 4 request processes and receive 4 frames of response data, so that the service search time is reduced to one fourth of the original time.
The method and the device for achieving the target application parameters can acquire target application parameters preset in the client, generate a target request containing the target application parameters and send the target request to the server, enable the server to respond to the target request to search an application parameter registration list and return target response data representing whether search results of the target application parameters are found or not, and interact data with the server according to the target application parameters after the target response data represent that the target application parameters are found. Thus, in the embodiment, the client can only send the request for 4 times and receive the response data for 4 times to interact data with the server, so that the data interaction time is shortened, and the data interaction efficiency is improved.
On the basis of the service discovery method provided by the embodiment of the present disclosure, the present disclosure further provides a service discovery device, which is applicable to a service end, and referring to fig. 6, the device includes:
A target request obtaining module 61, configured to obtain a target request, where the target request contains a target application parameter preset in a client;
A search result obtaining module 62, configured to search the application parameter registration list for the target application parameter, to obtain a search result that indicates whether the target application parameter is found;
A target response obtaining module 63, configured to generate target response data that includes the search result and matches the target request;
And the target response feedback module 64 is configured to feed back the target response data to the client, so that the client interacts data with the server after the target response data characterizes and discovers the target application parameters.
Optionally, the target application parameters include services, inclusion, and features.
Optionally, when the target application parameter comprises a service, the target response data comprises a service response, wherein the service response comprises an operation code, an attribute type, result data and attribute authority;
The operation code is a second operation code, the attribute type is a first attribute type, and the result data indicates whether the service is in the registration list.
Optionally, when the target application parameter comprises an inclusion, the target response data comprises an inclusion response, the inclusion response comprising an opcode, an attribute type, and result data;
The opcode is a second opcode and the attribute type is a second attribute type, and the result data indicates whether this inclusion is within the registry.
Optionally, when the target application parameter includes a feature, the target response data includes a feature response, where the feature response includes an operation code, an attribute type, an attribute authority, a feature UUID, and a feature handle, the operation code is a second operation code, the attribute type is a third attribute type, the attribute authority indicates a data operation type, the feature handle indicates an object of a message to be transmitted, and the feature UUID indicates an identification code of the feature.
Optionally, the apparatus further comprises:
and the Bluetooth link establishment module is used for establishing Bluetooth link with the client when receiving the link establishment request sent by the client.
Optionally, the apparatus further comprises:
and the searching and stopping module is used for stopping the searching process after the target application parameters are searched.
On the basis of the service discovery method provided by the embodiment of the present disclosure, the present disclosure further provides a service discovery device, which is applicable to a client, and referring to fig. 7, the device includes:
A target parameter obtaining module 71, configured to obtain target application parameters preset in the client;
a target request generating module 72, configured to generate a target request containing the target application parameter and send the target request to a server, so that the server searches an application parameter registration list in response to the target request and returns target response data that indicates whether the search result of the target application parameter is found;
and the data interaction module 73 is configured to interact data with the server according to the target application parameter after the target response data indicates that the target application parameter is found.
Optionally, the target application parameters include services, inclusion, and features.
Optionally, when the target application parameter includes a service, the target request includes a service request, the service request includes an operation code, an attribute type and a service parameter UUID, the operation code is a first operation code, and the attribute type is a first attribute type.
Optionally, when the target application parameter includes an inclusion, the target request includes an inclusion request, the inclusion request includes an operation code, an attribute type and an attribute authority, the operation code is a first operation code, and the attribute type is a second attribute type.
Optionally, when the target application parameter includes a feature, the target request includes a feature request, the feature request includes an operation code, an attribute type, and a feature UUID, the operation code is a first operation code, and the attribute type is a third attribute type.
Optionally, the apparatus further comprises:
And the link request sending module is used for sending a link establishment request so that the server side responds to the link establishment request and establishes a Bluetooth link with the client side.
It should be noted that, the embodiment of the apparatus shown in this embodiment is matched with the content of the embodiment of the method, and reference may be made to the content of the embodiment of the method, which is not described herein again.
On the basis of the service discovery method provided by the embodiment of the disclosure, the embodiment of the disclosure also provides a service discovery system which comprises vehicle equipment and electronic equipment, wherein the vehicle equipment responds to the detection of the triggering operation of the vehicle equipment to display a screen-throwing identification code used by the screen throwing, the vehicle equipment plays an audio file carrying the screen-throwing identification code at least once, the electronic equipment starts a screen-throwing application program and starts an audio acquisition function of the electronic equipment, an acoustic wave signal carrying the screen-throwing identification code is acquired based on the audio acquisition function to obtain the acoustic wave file, a screen-throwing link is established with the vehicle equipment according to the screen-throwing identification code in the acoustic wave signal, and the vehicle equipment shares the current display content of the electronic equipment according to the screen-throwing link.
It should be noted that, the system embodiment shown in the present embodiment is matched with the content of the method embodiment, and reference may be made to the content of the method embodiment shown above, which is not described herein again.
Fig. 8 is a block diagram of an electronic device, according to an example embodiment. For example, the electronic device 800 may be a smart phone, a computer, a digital broadcast terminal, a tablet device, a medical device, an exercise device, a personal digital assistant, etc., as well as the above-described vehicle devices, etc.
Referring to FIG. 8, an electronic device 800 may include one or more of a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, a communication component 816, and an image acquisition component 818.
The processing component 802 generally controls overall operation of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 802 can include one or more processors 820 to execute computer programs. Further, the processing component 802 can include one or more modules that facilitate interactions between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the electronic device 800. Examples of such data include computer programs, contact data, phonebook data, messages, pictures, videos, and the like for any application or method operating on electronic device 800. The memory 804 may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
The power supply component 806 provides power to the various components of the electronic device 800. The power components 806 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the electronic device 800. The power supply assembly 806 may include a power chip and the controller may communicate with the power chip to control the power chip to turn on or off the switching device to power the motherboard circuit with or without the battery.
The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the target object. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input information from a target object. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or sliding action, but also the duration and pressure associated with the touch or sliding operation.
The audio component 810 is configured to output and/or input audio file information. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio file information when the electronic device 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio file information may be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio file information.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be a keyboard, click wheel, keys, etc.
The sensor assembly 814 includes one or more sensors for providing status assessment of various aspects of the electronic device 800. For example, the sensor assembly 814 may detect an on/off state of the electronic device 800, a relative positioning of the components, such as a display and keypad of the electronic device 800, the sensor assembly 814 may also detect a change in position of the electronic device 800 or one of the components, the presence or absence of a target object in contact with the electronic device 800, an orientation or acceleration/deceleration of the electronic device 800, and a change in temperature of the electronic device 800. In this example, the sensor assembly 814 may include a magnetic force sensor, a gyroscope, and a magnetic field sensor, wherein the magnetic field sensor includes at least one of a hall sensor, a thin film magneto-resistive sensor, a magnetic liquid acceleration sensor.
The communication component 816 is configured to facilitate communication between the electronic device 800 and other devices, either wired or wireless. The electronic device 800 may access a wireless network based on a communication standard, such as WiFi,2G, 3G, 4G, 5G, or a combination thereof. In one exemplary embodiment, the communication component 816 receives broadcast information or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 800 can be implemented by one or more Application Specific Integrated Circuits (ASICs), digital information processors (DSPs), digital information processing devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic elements.
In an exemplary embodiment, there is also provided an electronic device including:
A memory and a processor;
the memory is used for storing a computer program executable by the processor;
the processor is configured to execute the computer program in the memory to implement the method as described above.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such as memory 804 including instructions, the executable computer program being executable by a processor. The readable storage medium may be, among other things, ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.