CN114546616A - Device management method, device, electronic device and storage medium - Google Patents

Device management method, device, electronic device and storage medium Download PDF

Info

Publication number
CN114546616A
CN114546616A CN202210156598.8A CN202210156598A CN114546616A CN 114546616 A CN114546616 A CN 114546616A CN 202210156598 A CN202210156598 A CN 202210156598A CN 114546616 A CN114546616 A CN 114546616A
Authority
CN
China
Prior art keywords
electronic device
electronic equipment
service information
service
connection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210156598.8A
Other languages
Chinese (zh)
Inventor
李�荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202210156598.8A priority Critical patent/CN114546616A/en
Publication of CN114546616A publication Critical patent/CN114546616A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/18Multiprotocol handlers, e.g. single devices capable of handling multiple protocols

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The application discloses a device management method and device, electronic equipment and a storage medium, and relates to the technical field of electronic equipment. The method is applied to a connection management module of first electronic equipment, wherein the connection management module provides a target interface, and the target interface is obtained by encapsulating interfaces corresponding to a plurality of connection protocols respectively. The method comprises the following steps: responding to the calling of the application program of the first electronic equipment to the target interface, acquiring a service request of the application program to the second electronic equipment, acquiring service information of the second electronic equipment, and processing a service indicated by the service request based on the service information of the second electronic equipment so that the application program and the second electronic equipment work cooperatively. According to the application, the target interface provided by the connection management module is set for calling the application program, so that unified management of the protocol can be realized, the protocols of the application programs are not required to be adapted respectively, and the development efficiency of the application programs can be improved.

Description

Device management method, device, electronic device and storage medium
Technical Field
The present application relates to the field of electronic device technologies, and in particular, to a device management method and apparatus, an electronic device, and a storage medium.
Background
With the development of science and technology, electronic equipment is more and more widely used and has more and more functions, and the electronic equipment becomes one of the necessary things in daily life of people. At present, an electronic device may install a plurality of applications, each of the plurality of applications needs to maintain a set of connection management services, and also needs to adapt to all connection protocols of a lower layer, which results in low development efficiency of the applications.
Disclosure of Invention
In view of the above problems, the present application provides a device management method, apparatus, electronic device, and storage medium to solve the above problems.
In a first aspect, an embodiment of the present application provides an apparatus management method, which is applied to a connection management module of a first electronic apparatus, where the connection management module provides a target interface, and the target interface is obtained by encapsulating interfaces corresponding to multiple connection protocols, where the method includes: responding to the calling of the application program of the first electronic equipment to the target interface, and acquiring a service request of the application program to the second electronic equipment; acquiring service information of the second electronic equipment; and processing the service indicated by the service request based on the service information of the second electronic equipment so as to enable the application program to work with the second electronic equipment.
In a second aspect, an embodiment of the present application provides an apparatus for device management, where the apparatus is applied to a connection management module of a first electronic device, where the connection management module provides a target interface, and the target interface is obtained by encapsulating interfaces corresponding to multiple connection protocols, where the apparatus includes: the service request acquisition module is used for responding to the calling of the application program of the first electronic equipment to the target interface and acquiring the service request of the application program to the second electronic equipment; the service information acquisition module is used for acquiring the service information of the second electronic equipment; and the service processing module is used for processing the service indicated by the service request based on the service information of the second electronic equipment so as to enable the application program to work with the second electronic equipment.
In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor, the memory being coupled to the processor, the memory storing instructions, and the processor performing the above method when the instructions are executed by the processor.
In a fourth aspect, the present application provides a computer-readable storage medium, in which a program code is stored, and the program code can be called by a processor to execute the above method.
The device management method, device, electronic device and storage medium provided by the embodiment of the application are applied to a connection management module of a first electronic device, the connection management module provides a target interface obtained by encapsulating interfaces corresponding to the plurality of connection protocols, acquires a service request of an application program for the second electronic device in response to a call of the application program of the first electronic device to the target interface, acquires service information of the second electronic device, and based on the service information of the second electronic device, processing the service indicated by the service request to enable the application program to work with the second electronic equipment, therefore, the target interface provided by the connection management module is set for calling the application program, so that the unified management of the protocol can be realized, the protocols of the application programs are not required to be adapted respectively, and the development efficiency of the application programs can be improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart illustrating a device management method according to an embodiment of the present application;
fig. 2 is a schematic diagram illustrating communication between a first electronic device and a second electronic device provided by an embodiment of the present application;
fig. 3 is a flowchart illustrating a device management method according to an embodiment of the present application;
fig. 4 is a flowchart illustrating a device management method according to an embodiment of the present application;
fig. 5 is a flowchart illustrating a device management method according to an embodiment of the present application;
fig. 6 is a schematic diagram illustrating data transmission of a first electronic device and a second electronic device provided by an embodiment of the present application;
fig. 7 shows a block diagram of a device management apparatus provided in an embodiment of the present application;
fig. 8 is a block diagram of an electronic device for executing a device management method according to an embodiment of the present application;
fig. 9 illustrates a storage unit for storing or carrying a program code for implementing the device management method according to the embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
At present, a plurality of applications can be installed on an electronic device, and the applications use respective connection management services to perform functions such as independent device discovery, pairing, connection, and the like, and establish respective independent connection channels with a discovered specific device, so that a plurality of connection management services are distributed on one electronic device, which results in low development efficiency and performance, and is very inconvenient for a newly added application.
Even if a plurality of connection protocols exist below the application layer, the developer of each application program needs to be familiar with the interface and the use mode of each connection protocol of the lower layer, because when the application program of the electronic equipment communicates with the application programs of other electronic equipment, the developer needs to perform different adaptation of the corresponding interfaces according to different used connection protocols, otherwise, the application program of the electronic equipment cannot communicate with the application programs of other electronic equipment, and the maintenance cost is high.
Based on this, all applications on each electronic device need to maintain a set of connection management services separately and also need to adapt all connection protocols of the lower layer. When the service is used, the connection protocols specified by the lower layer are respectively called to perform discovery, pairing and connection processing, so that the overhead is very high. If different connection protocols are used simultaneously, the use of different connection protocols also requires differential adaptation, which is very inconvenient.
In view of the above problems, the inventors have found and proposed a device management method, an apparatus, an electronic device, and a storage medium provided in the embodiments of the present application through long-term research, and by setting a target interface provided by a connection management module for application program invocation, unified management of protocols can be achieved, and respective adaptation protocols of application programs are not required, so that development efficiency of application programs can be improved. The specific device management method is described in detail in the following embodiments.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a device management method according to an embodiment of the present disclosure. The device management method is used for calling the application program by setting the target interface provided by the connection management module, can realize the unified management of the protocol, does not need the respective adaptation protocol of the application program, and can improve the development efficiency of the application program. In a specific embodiment, the device management method is applied to the device management apparatus 200 shown in fig. 7 and a connection management module of the first electronic device 100 (fig. 8) configured with the device management apparatus 200. The specific process of the present embodiment will be described below by taking an electronic device as an example, and it is understood that the electronic device applied in the present embodiment may include a smart phone, a tablet computer, a wearable electronic device, and the like, which is not limited herein. In this embodiment, the connection management module provides a target interface, and the target interface is obtained by encapsulating interfaces corresponding to a plurality of connection protocols, where the plurality of connection protocols may include a smart home connection protocol (HeyThings protocol), a long connection protocol (AF protocol), and the like, different connection protocols correspond to different interfaces, and the interfaces corresponding to the connection protocols are used for the application program to call the connection protocols. As will be described in detail with respect to the flow shown in fig. 1, the device management method may specifically include the following steps:
step S110: and responding to the calling of the application program of the first electronic equipment to the target interface, and acquiring a service request of the application program to the second electronic equipment.
In this embodiment, the first electronic device may include a connection management module, where the connection management module provides a target interface, and the target interface is obtained by encapsulating interfaces corresponding to the plurality of connection protocols. The connection management module can be arranged between an application layer and a connection protocol layer of the first electronic device, and provides functions of unified device discovery, pairing, connection, management and the like for all upper-layer services (application layers), so that memory and power consumption overhead brought by individual maintenance and management services of each application program is reduced, and the performance and the utilization rate of a connection channel are improved.
In some embodiments, the connection management module may serve as a connection management framework, where a service may also be called a function, which may be represented as a unified interconnection management framework service, that is, a function that needs to be implemented between upper layer services is abstracted out to be an independent function module, and each application program may directly call an interface provided by the connection management module. The connection management module can abstract the interfaces corresponding to the connection protocols of the lower layer to obtain a target interface, and an application program can call different protocols to adapt different interfaces without sensing in an application stage, and only the target interface needs to be called.
In some embodiments, the first electronic device may include a plurality of applications, wherein the plurality of applications may include applications installed by the first electronic device and may also include fast applications of the first electronic device. For example, the plurality of applications include, but are not limited to, a PC assistant application, a screen projection application, a video call application, a health class application, a television assistant application, a smart home class application, and the like. As a manner, the application program of the first electronic device may initiate a cooperative operation with the second electronic device, for example, if the application program of the first electronic device is a screen projection application program, the application program of the first electronic device may initiate a screen projection to the second electronic device, and if the application program of the first electronic device is a video call application program, the application program of the first electronic device may initiate a video call to the second electronic device.
Referring to fig. 2, fig. 2 is a schematic diagram illustrating communication between a first electronic device and a second electronic device according to an embodiment of the present application. As shown in fig. 2, the first electronic device may include a business application, a unified connection management framework (connection management module), and a connection protocol. The unified connection management framework is arranged between the service application program and the connection protocol, the connection protocol is sealed at the lower layer, and the target interface is provided to provide unified functions of equipment discovery, pairing, connection, management and the like for the service of the service application program. And, the connection protocol may provide different communication modes to realize data transmission with the device layer (the second electronic device) through different communication modes.
In some embodiments, when the application program of the first electronic device has a service requirement with the second electronic device, for example, the application program of the first electronic device is to initiate screen projection to the second electronic device and to initiate a video call to the second electronic device, the target interface provided by the connection management module may be called. Accordingly, when receiving a call of the target interface provided by the application program of the first electronic device, the connection management module may respond to the call to obtain a service request of the application program for the second electronic device.
The service request may include, but is not limited to, a device discovery request, a device pairing request, a device connection request, a data transceiving request, and the like.
Step S120: and acquiring the service information of the second electronic equipment.
In this embodiment, the connection management module may obtain service information of the second electronic device. In one manner, the service information of the second electronic device may include device information of the second electronic device, may include connection information of the second electronic device, and may also include both the device information and the connection information of the second electronic device. The device information of the second electronic device may include address information of the second electronic device, protocol information of the second electronic device, version information of the second electronic device, and the like, and the connection information of the second electronic device may include that the second electronic device is in a connected state, the second electronic device is not in a connected state, and the like, for example, when the second electronic device is in a connected state, the second electronic device may be connected to the first electronic device, and may also be connected to other electronic devices except the first electronic device.
In some embodiments, the first electronic device may or may not locally store the service information of the second electronic device. When the service information of the second electronic device is stored locally in the first electronic device, the service information of the second electronic device may be directly obtained locally from the first electronic device, for example, the device information and the connection information of the second electronic device may be directly obtained locally from the first electronic device, so as to save time for discovering, pairing and establishing connection by repeated scanning each time, and improve performance. When the service information of the second electronic device is not stored locally in the first electronic device, the service information of the second electronic device may be obtained from the second electronic device in a manner of scanning discovery, device discovery, and establishing a connection with the second electronic device, for example, the device information and the connection information of the second electronic device are obtained from the second electronic device.
Step S130: and processing the service indicated by the service request based on the service information of the second electronic equipment so as to enable the application program to work with the second electronic equipment.
In this embodiment, when the service information of the second electronic device is obtained, the service indicated by the service request may be processed based on the service information of the second electronic device, so that the application may cooperate with the second electronic device (the application of the second electronic device). Therefore, in the embodiment, by using the unified interconnection management framework service, different application programs of the same electronic device can establish independent connection channels without establishing respective management services, and when multiple protocols exist in the electronic device, the upper-layer service (application program) does not need to perform differentiated adaptation of the protocols.
In some embodiments, processing the service indicated by the service request may include: device discovery, device pairing, device connection, device data transceiving, and the like. Therefore, after the connection management module obtains the service information of the second electronic device, the first electronic device (the application program of the first electronic device) may perform operations such as device discovery, device pairing, device connection, device data transceiving, and the like with the second electronic device based on the service information of the second electronic device, so that the application program of the first electronic device may cooperate with the second electronic device.
Here, the service indicated by the service request is taken as an example of device discovery. When the first electronic device performs device scanning and finds surrounding electronic devices, the found device information of the electronic device can be stored locally in the first electronic device, and whether the scanned electronic device is connected or not can be distinguished. When it is determined that the scanned electronic device is not connected, an aging mechanism can be provided, and devices (unconnected devices) which cannot be sensed (such as power-off or remote electronic devices) are deleted in real time, so that the accuracy and timeliness of the scanned electronic device are guaranteed, and services can be found to be available.
Here, the service indicated by the service request is taken as an example of device pairing. When the application program of the first electronic device communicates with the discovered target electronic device (including the second electronic device), a target interface (pairing interface) of the connection management module may be called first, the connection management module may obtain service information (pairing information) of the target electronic device, when the service information of the target electronic device indicates that the target electronic device has been paired, the connection management module may directly enter a connection procedure, and when the service information of the target electronic device indicates that the second electronic device is not paired, the connection management module may initiate the pairing procedure.
Here, the service indicated by the service request is taken as an example of device connection. When the application program of the first electronic device selects the target electronic device (second electronic device) to connect, the connection management module obtains the service information (connection information) of the target electronic device, and when the service information of the target electronic device represents that the target electronic device is connected, the connection operation can not be executed any more, so as to avoid repeated connection.
The device management method provided by an embodiment of the application obtains a service request of an application program for a second electronic device in response to a call of the application program of a first electronic device for a target interface, obtains service information of the second electronic device, and processes a service indicated by the service request based on the service information of the second electronic device, so that the application program and the second electronic device work cooperatively, thereby providing the call of the target interface provided by a connection management module for the application program, realizing uniform management of protocols, avoiding the need for respective protocols adapted to the application program, and improving development efficiency of the application program.
Referring to fig. 3, fig. 3 is a schematic flowchart illustrating a device management method according to an embodiment of the present application. The method is applied to a connection management module of the first electronic device, wherein the connection management module provides a target interface, and the target interface is obtained by encapsulating interfaces corresponding to a plurality of connection protocols respectively. In this embodiment, the service information of the second electronic device includes connection information of the second electronic device. As will be described in detail with respect to the flow shown in fig. 3, the device management method may specifically include the following steps:
step S210: and responding to the calling of the application program of the first electronic equipment to the target interface, and acquiring a service request of the application program to the second electronic equipment.
For details of step S210, please refer to step S110, which is not repeated herein.
Step S220: and searching the service information of the second electronic equipment locally at the first electronic equipment.
In some embodiments, after acquiring the service information from the second electronic device, the connection management module may manage the service information of the second electronic device locally on the first electronic device, that is, the service information of the second electronic device may be stored locally on the first electronic device, and when the subsequent application calls the connection management module again to initiate a service request for the second electronic device, the connection management module may directly acquire the service information of the second electronic device locally on the first electronic device, so as to save time for discovering, pairing, and establishing a connection by repeated scanning each time, and improve performance.
In this embodiment, the service information of the second electronic device may be searched locally in the first electronic device, so as to determine whether the service information of the second electronic device is stored locally in the first electronic device by using a searching method. As one mode, the first electronic device may be provided with a target storage area, where the target storage area is used to store service information of other electronic devices (including the second electronic device), and therefore, whether the target storage area of the first electronic device stores the service information of the second electronic device may be searched, so as to reduce the search workload of the first electronic device and reduce the power consumption of the first electronic device.
Step S230: and when the service information of the second electronic equipment is found locally at the first electronic equipment, acquiring the service information of the second electronic equipment from locally at the first electronic equipment.
When the service information of the second electronic device is found locally in the first electronic device, the service information of the second electronic device is stored locally in the first electronic device, and the stored service information of the second electronic device can be directly acquired locally from the first electronic device, so that the performance of the first electronic device is improved.
Step S240: and processing the service indicated by the service request based on the service information of the second electronic equipment so as to enable the application program to work with the second electronic equipment.
For a detailed description of step S240, please refer to step S130, which is not repeated herein.
Step S250: when the connection information of the second electronic device is changed, the locally stored connection information of the second electronic device of the first electronic device is updated.
In some embodiments, the service information of the second electronic device includes connection information of the second electronic device.
In this embodiment, after the first electronic device stores the connection information of the second electronic device, the first electronic device may monitor the connection information of the second electronic device, where when it is monitored that the connection information of the second electronic device changes, the connection information of the second electronic device stored in the first electronic device is represented as an error, and the connection information of the second electronic device locally stored in the first electronic device may be updated, so as to ensure accuracy and timeliness of the service information of the other electronic devices stored in the first electronic device.
As one mode, after the first electronic device stores the service information of the second electronic device, the service information of the second electronic device is not deleted and is kept stored locally in the first electronic device. As another mode, after the first electronic device stores the service information of the second electronic device, the service information of the second electronic device may be locally deleted from the first electronic device in response to a user operation.
The device management method provided in an embodiment of the present application, in response to a call of an application program of a first electronic device to a target interface, obtains a service request of the application program to a second electronic device, searches service information of the second electronic device locally in the first electronic device, obtains service information of a second current device locally in the first electronic device when the service information of the second electronic device is found locally in the first electronic device, processes a service indicated by the service request based on the service information of the second electronic device, so that the application program and the second electronic device cooperate with each other, and updates connection information of the second electronic device locally stored in the first electronic device when the connection information of the second electronic device is changed. Compared with the device management method shown in fig. 1, in this embodiment, the service information of the electronic device is stored locally through the connection management module, so that the application program can directly obtain the service information of the electronic device from the local, the time for scanning and discovering the device can be saved, the service information can be multiplexed, the performance of the electronic device can be improved, and the power consumption and the memory of the service can be reduced. In addition, the embodiment also updates the connection information of the electronic device, so as to improve the accuracy of the locally stored information.
Referring to fig. 4, fig. 4 is a schematic flowchart illustrating a device management method according to an embodiment of the present disclosure. The method is applied to a connection management module of the first electronic device, wherein the connection management module provides a target interface, and the target interface is obtained by encapsulating interfaces corresponding to a plurality of connection protocols respectively. As will be described in detail with respect to the flow shown in fig. 4, the device management method may specifically include the following steps:
step S310: and responding to the calling of the application program of the first electronic equipment to the target interface, and acquiring a service request of the application program to the second electronic equipment.
For detailed description of step S310, please refer to step S110, which is not described herein again.
Step S320: and searching the service information of the second electronic equipment locally at the first electronic equipment.
For the detailed description of step S320, please refer to step S220, which is not described herein again.
Step S330: and when the service information of the second electronic equipment is not found locally in the first electronic equipment, controlling the first electronic equipment to perform equipment scanning.
When the service information of the second electronic device is not found locally in the first electronic device, it is represented that the service information of the second electronic device is not stored locally in the first electronic device, and the service information of the second electronic device can be acquired from the second electronic device. In some embodiments, when the service information of the second electronic device is not found locally at the first electronic device, the connection management module may control the first electronic device to perform device scanning to attempt to find the second electronic device by means of scan discovery.
Step S340: and when the second electronic equipment is scanned, acquiring the service information of the second electronic equipment, and storing the service information of the second electronic equipment in the local of the first electronic equipment.
In some embodiments, when the second electronic device is scanned, the second electronic device may be paired, connected, and the like to establish a data transmission channel with the second electronic device. After the data transmission channel between the first electronic device and the second electronic device is established, the service information of the second electronic device can be acquired through the data transmission channel, and the acquired service information of the second electronic device is stored in the local of the first electronic device, so that the service information of the second electronic device can be directly acquired from the local of the first electronic device in the following process, the time for discovering, pairing and establishing connection by repeated scanning each time is saved, and the performance is improved.
Step S350: when a third electronic device is scanned, acquiring service information of the third electronic device, and storing the service information of the third electronic device locally in the first electronic device.
When the first electronic device scans, one or more electronic devices may be scanned at the same time, for example, when the first electronic device scans, only the second electronic device may be scanned, or when the first electronic device scans, the second electronic device and the third electronic device may be scanned at the same time.
In some embodiments, when the third electronic device is scanned, the third electronic device may be paired, connected, and the like to establish a data transmission channel with the third electronic device. After a data transmission channel between the first electronic device and the third electronic device is established, the service information of the third electronic device can be acquired through the data transmission channel, and the acquired service information of the third electronic device is stored locally in the first electronic device.
Step S360: and when the third electronic equipment is not connected, deleting the service information of the third electronic equipment from the local of the first electronic equipment.
In some embodiments, after obtaining the service information of the third electronic device, the first electronic device may detect a connection relationship between the first electronic device and the third electronic device. When the first electronic device is detected to be connected with the third electronic device, data transmission between the first electronic device and the third electronic device can be carried out. When it is detected that the first electronic device is not connected to the third electronic device, the service information of the third electronic device can be deleted from the local of the first electronic device, so as to ensure the accuracy and timeliness of the peripheral electronic devices, and the service can be found and used.
As a manner, a device not connected to the first electronic device may temporarily store its service information in a local area of the first electronic device, and design a separate management list, set a timer to calculate time, and when a message of the third electronic device is not received within a preset time period, the third electronic device may be considered to be powered off or far away, and then the service information of the third electronic device may be deleted from the local area of the first electronic device to release the storage space of the first electronic device. The preset duration may be set according to an empirical value, may be set according to an environment where the first electronic device is located, may also be set according to product information corresponding to the first electronic device, and the like, which is not limited herein. For example, when setting is performed according to the environment in which the first electronic device is located, setting may be performed according to the quality of a network in which the first electronic device is located, according to the degree of congestion of the network in which the first electronic device is located, or the like. For example, when the setting is performed according to the product corresponding to the first electronic device, the setting may be performed according to the model corresponding to the first electronic device, the setting may be performed according to the manufacturer corresponding to the first electronic device, and the like, which is not limited herein.
The device management method provided by one embodiment of the application, in response to a call of an application program of a first electronic device to a target interface, obtains a service request of the application program to a second electronic device, searching the service information of the second electronic equipment locally at the first electronic equipment, controlling the first electronic equipment to perform equipment scanning when the service information of the second electronic equipment is searched locally at the first electronic equipment, when the second electronic equipment is scanned, acquiring the service information of the second electronic equipment and storing the service information of the second electronic equipment in the local of the first electronic equipment, when the third electronic device is scanned, acquiring the service information of the third electronic device and storing the service information of the third electronic device locally at the first electronic device, and when the connection with the third electronic equipment is not established, deleting the service information of the third electronic equipment from the local of the first electronic equipment. Compared with the device management method shown in fig. 1, in this embodiment, the scanned service information of the electronic device is stored locally through the connection management module, so that the application program can directly obtain the service information of the electronic device from the local, the time for scanning and discovering the device and multiplexing the service information can be saved, the performance of the electronic device can be improved, and the power consumption and the memory of the service can be reduced. In addition, when the scanned electronic equipment is not connected, the corresponding stored service information is deleted, so that the accuracy and timeliness of the stored service information are ensured.
Referring to fig. 5, fig. 5 is a flowchart illustrating a device management method according to an embodiment of the present application. The method is applied to a connection management module of the first electronic device, wherein the connection management module provides a target interface, and the target interface is obtained by encapsulating interfaces corresponding to a plurality of connection protocols respectively. As will be described in detail with respect to the flow shown in fig. 5, the device management method may specifically include the following steps:
step S410: and responding to the calling of the application program of the first electronic equipment to the target interface, and acquiring a service request of the application program to the second electronic equipment.
Step S420: and acquiring the service information of the second electronic equipment.
For the detailed description of steps S410 to S420, refer to steps S110 to S120, which are not described herein again.
Step S430: and determining a connection protocol corresponding to the application program, and acquiring a communication mode corresponding to the connection protocol.
Different applications correspond to different connection protocols, for example, the application corresponding to the IOT device needs to use the smart home connection protocol (HeyThings protocol), the application corresponding to other rich devices needs to use the long connection protocol (AF protocol), and the like, and certainly, more applications need to use more connection protocols. The first electronic device integrates a plurality of connection protocols into the lower layer of the connection management module, and provides a uniform target interface for the application layer to use through the connection management module, so that the support of the plurality of connection protocols can be realized.
Different connection protocols can correspond to different communication modes, for example, when the connection protocol is a long connection protocol, the connection protocol can correspond to a near field communication mode, for example, a BlueTooth communication mode (BlueTooth, BT), a BlueTooth Low Energy communication mode (BlueTooth Low Energy, BLE), a wireless communication mode (WiFi); when the connection protocol is the smart home connection protocol, a cloud communication mode can be corresponded to the connection protocol.
In some embodiments, when the connection management module receives a call of an application program for a target interface thereof, the connection management module may determine a connection protocol corresponding to the application program, and acquire a communication manner corresponding to the connection protocol. For example, when the connection protocol corresponding to the application program is determined to be a long connection protocol, it may be determined that the connection protocol corresponds to the near field communication mode.
Step S440: and calling the connection protocol, and establishing a data transmission channel between the application program and the second electronic equipment based on the service information of the second electronic equipment and the communication mode so as to enable the application program and the second electronic equipment to work cooperatively.
In some embodiments, when the connection protocol corresponding to the application program is determined and the communication manner corresponding to the connection protocol is determined, the connection protocol may be called, and a data transmission channel between the application program and the second electronic device is established based on the service information of the second electronic device and the determined communication manner, so that the application program and the second electronic device cooperate.
For an upper layer application to communicate with a particular electronic device (e.g., a second electronic device), the primary purpose is to send and receive data, which is abstractly of three types: messages, files, streams. These three types of data, such as in a communication implementation supported by the AF protocol, are supported; the HeyThings protocol, which is connected to smart home devices, also provides for the transmission of data such as files, messages, etc. Smart home devices and other rich ability equipment, the connection protocol that uses between the equipment is different, if have AF, HeyThings, QUICK or other public agreements, originally see at upper application program, when visiting different equipment families, need switch over and the different connection management protocol frame of adaptation, but can keep apart the difference of the different connection protocol of bottom through connection management now, provide general access interface, shielded the difference of lower floor's protocol to application program, reduced APP's adaptation.
Communication pipelines between the devices can be provided by different connection frameworks, for example, a long connection protocol can provide a BT/BLE/WiFi connection channel between the near-field devices, and for example, an intelligent home connection protocol can provide a cloud-end connection channel of a three-party intelligent home.
Referring to fig. 6, fig. 6 is a schematic diagram illustrating data transmission between a first electronic device and a second electronic device according to an embodiment of the present application. As shown in fig. 6, the first electronic device may include a business application, a unified connection management framework (connection management module), and a connection protocol. The data transmission channel between the application program and the device layer can be obtained through the unified connection management framework, and data (such as messages, files and streams) can be transmitted through the unified connection management framework.
In the device management method provided in an embodiment of the present application, in response to a call of an application program of a first electronic device to a target interface, a service request of the application program to a second electronic device is obtained, service information of the second electronic device is obtained, a connection protocol corresponding to the application program is determined, a communication mode corresponding to the connection protocol is obtained, the connection protocol is called, and a data transmission channel between the application program and the second electronic device is established based on the service information and the communication mode of the second electronic device, so that the application program and the second electronic device work cooperatively. Compared with the device management method shown in fig. 1, in the embodiment, the connection management module determines the connection protocol corresponding to the application program and the communication mode corresponding to the connection protocol, so as to establish the data transmission channel between the application program and the second electronic device, so as to implement adaptation of the application program.
Referring to fig. 7, fig. 7 is a block diagram illustrating a device management apparatus according to an embodiment of the present disclosure. The device management apparatus 200 is applied to a connection management module of the first electronic device, where the connection management module provides a target interface, and the target interface is obtained by encapsulating interfaces corresponding to a plurality of connection protocols. As will be explained below with respect to the block diagram shown in fig. 7, the device management apparatus 200 includes: a service request obtaining module 210, a service information obtaining module 220, and a service processing module 230, wherein:
a service request obtaining module 210, configured to obtain a service request of an application program of the first electronic device for a second electronic device in response to a call of the application program for the target interface.
A service information obtaining module 220, configured to obtain service information of the second electronic device.
Further, the service information obtaining module 220 includes: the service information searching submodule and the first service information obtaining submodule, wherein:
and the service information searching submodule is used for searching the service information of the second electronic equipment in the local of the first electronic equipment.
The first service information obtaining sub-module is configured to obtain the service information of the second electronic device from the local of the first electronic device when the service information of the second electronic device is found locally at the first electronic device.
Further, the service information of the second electronic device includes connection information of the second electronic device, and the service information obtaining module 220 includes:
and the connection information updating submodule is used for updating the locally stored connection information of the second electronic equipment of the first electronic equipment when the connection information of the second electronic equipment is changed.
Further, the service information obtaining module 220 includes: the equipment scanning control submodule and the second service information acquisition submodule, wherein:
and the device scanning control sub-module is used for controlling the first electronic device to scan the device when the service information of the second electronic device is not found locally in the first electronic device.
And the second service information acquisition sub-module is used for acquiring the service information of the second electronic equipment when the second electronic equipment is scanned, and storing the service information of the second electronic equipment in the local of the first electronic equipment.
Further, the service information obtaining module 220 includes: a third service information acquisition submodule and a service information deletion submodule, wherein:
and the third service information acquisition sub-module is used for acquiring the service information of the third electronic equipment when the third electronic equipment is scanned, and storing the service information of the third electronic equipment in the local of the first electronic equipment.
And the service information deleting submodule is used for deleting the service information of the third electronic equipment from the local part of the first electronic equipment when the third electronic equipment is not connected.
Further, the service information deletion submodule includes: a service information deleting unit, wherein:
and the service information deleting unit is used for deleting the service information of the third electronic equipment from the local of the first electronic equipment when the message of the third electronic equipment is not received within a preset time length.
And the service processing module 230 is configured to process the service indicated by the service request based on the service information of the second electronic device, so that the application program and the second electronic device work cooperatively.
Further, the service processing module 230 includes: the communication mode acquisition module and the first service processing sub-module, wherein:
and the communication mode acquisition submodule is used for determining a connection protocol corresponding to the application program and acquiring a communication mode corresponding to the connection protocol.
And the first service processing sub-module is used for calling the connection protocol and establishing a data transmission channel between the application program and the second electronic equipment based on the service information of the second electronic equipment and the communication mode so as to enable the application program and the second electronic equipment to work cooperatively.
Further, the service information of the second electronic device includes device information of the second electronic device and connection information of the second electronic device, and the service processing module 230 includes: a second service processing sub-module, wherein:
and the second service processing submodule is used for processing the service indicated by the service request based on the device information of the second electronic device and the connection information of the second electronic device so as to enable the application program to work with the second electronic device.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and modules may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, the coupling between the modules may be electrical, mechanical or other type of coupling.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
Referring to fig. 8, a block diagram of an electronic device 100 according to an embodiment of the present disclosure is shown. The electronic device 100 may be a smart phone, a tablet computer, an electronic book, or other electronic devices capable of running an application. The electronic device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, and one or more applications, wherein the one or more applications may be stored in the memory 120 and configured to be executed by the one or more processors 110, the one or more programs configured to perform a method as described in the aforementioned method embodiments.
Processor 110 may include one or more processing cores, among other things. The processor 110 connects various parts within the overall electronic device 100 using various interfaces and lines, and performs various functions of the electronic device 100 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 120 and calling data stored in the memory 120. Alternatively, the processor 110 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 110 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing the content to be displayed; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 110, but may be implemented by a communication chip.
The Memory 120 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 120 may be used to store instructions, programs, code sets, or instruction sets. The memory 120 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like. The data storage area may also store data created by the electronic device 100 during use (e.g., phone book, audio-video data, chat log data), and the like.
Referring to fig. 9, a block diagram of a computer-readable storage medium according to an embodiment of the present application is shown. The computer-readable medium 300 has stored therein a program code that can be called by a processor to execute the method described in the above-described method embodiments.
The computer-readable storage medium 300 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium 300 includes a non-volatile computer-readable storage medium. The computer readable storage medium 300 has storage space for program code 310 for performing any of the method steps of the method described above. The program code can be read from or written to one or more computer program products. Program code 310 may be compressed, for example, in a suitable form.
In summary, the device management method, apparatus, electronic device and storage medium provided in the embodiments of the present application, the method is applied to a connection management module of a first electronic device, the connection management module providing a target interface, the target interface is obtained by encapsulating interfaces corresponding to the plurality of connection protocols, responds to the calling of an application program of the first electronic equipment to the target interface, obtains a service request of the application program to the second electronic equipment, obtains service information of the second electronic equipment, and based on the service information of the second electronic equipment, processing the service indicated by the service request to enable the application program to work with the second electronic equipment, therefore, the target interface provided by the connection management module is set for calling the application program, so that the unified management of the protocol can be realized, the respective adaptation protocol of the application program is not needed, and the development efficiency of the application program can be improved.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not necessarily depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (11)

1. A device management method applied to a connection management module of a first electronic device, the connection management module providing a target interface, the target interface being obtained by encapsulating interfaces corresponding to respective connection protocols, the method comprising:
responding to the calling of the application program of the first electronic equipment to the target interface, and acquiring a service request of the application program to the second electronic equipment;
acquiring service information of the second electronic equipment;
and processing the service indicated by the service request based on the service information of the second electronic equipment so as to enable the application program to work with the second electronic equipment.
2. The method of claim 1, wherein the obtaining service information of the second electronic device comprises:
searching service information of the second electronic equipment locally at the first electronic equipment;
and when the service information of the second electronic equipment is found locally at the first electronic equipment, acquiring the service information of the second electronic equipment from locally at the first electronic equipment.
3. The method of claim 2, wherein the service information of the second electronic device comprises connection information of the second electronic device, the method further comprising:
when the connection information of the second electronic device is changed, the locally stored connection information of the second electronic device of the first electronic device is updated.
4. The method of claim 2, further comprising:
when the service information of the second electronic equipment is not found locally in the first electronic equipment, controlling the first electronic equipment to perform equipment scanning;
and when the second electronic equipment is scanned, acquiring the service information of the second electronic equipment, and storing the service information of the second electronic equipment in the local of the first electronic equipment.
5. The method of claim 4, further comprising:
when third electronic equipment is scanned, acquiring service information of the third electronic equipment, and storing the service information of the third electronic equipment in the local of the first electronic equipment;
and when the third electronic equipment is not connected, deleting the service information of the third electronic equipment from the local of the first electronic equipment.
6. The method of claim 5, wherein deleting the service information of the third electronic device from the local of the first electronic device when the third electronic device is not connected to the first electronic device comprises:
and when the message of the third electronic equipment is not received within a preset time length, deleting the service information of the third electronic equipment from the local of the first electronic equipment.
7. The method according to any one of claims 1-6, wherein the processing the service indicated by the service request based on the service information of the second electronic device to enable the application to work with the second electronic device comprises:
determining a connection protocol corresponding to the application program, and acquiring a communication mode corresponding to the connection protocol;
and calling the connection protocol, and establishing a data transmission channel between the application program and the second electronic equipment based on the service information of the second electronic equipment and the communication mode so as to enable the application program and the second electronic equipment to work cooperatively.
8. The method according to any one of claims 1 to 6, wherein the service information of the second electronic device includes device information of the second electronic device and connection information of the second electronic device, and the processing the service indicated by the service request based on the service information of the second electronic device to enable the application program to work with the second electronic device comprises:
and processing the service indicated by the service request based on the device information of the second electronic device and the connection information of the second electronic device so as to enable the application program to work with the second electronic device.
9. An apparatus for device management, applied to a connection management module of a first electronic device, the connection management module providing a target interface, where the target interface is obtained by encapsulating interfaces corresponding to a plurality of connection protocols, and the apparatus includes:
the service request acquisition module is used for responding to the calling of the application program of the first electronic equipment to the target interface and acquiring the service request of the application program to the second electronic equipment;
the service information acquisition module is used for acquiring the service information of the second electronic equipment;
and the service processing module is used for processing the service indicated by the service request based on the service information of the second electronic equipment so as to enable the application program to work with the second electronic equipment.
10. An electronic device comprising a memory and a processor, the memory coupled to the processor, the memory storing instructions that, when executed by the processor, the processor performs the method of any of claims 1-8.
11. A computer-readable storage medium, having stored thereon program code that can be invoked by a processor to perform the method according to any one of claims 1 to 8.
CN202210156598.8A 2022-02-21 2022-02-21 Device management method, device, electronic device and storage medium Pending CN114546616A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210156598.8A CN114546616A (en) 2022-02-21 2022-02-21 Device management method, device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210156598.8A CN114546616A (en) 2022-02-21 2022-02-21 Device management method, device, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN114546616A true CN114546616A (en) 2022-05-27

Family

ID=81676224

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210156598.8A Pending CN114546616A (en) 2022-02-21 2022-02-21 Device management method, device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN114546616A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109873837A (en) * 2019-04-12 2019-06-11 广东工业大学 Central apparatus and multi-protocols adaptation system based on android system
CN111405042A (en) * 2020-03-16 2020-07-10 北京奇艺世纪科技有限公司 Discovery method and device of electronic equipment, computer readable storage medium and electronic device
CN111711940A (en) * 2020-04-29 2020-09-25 杭州涂鸦信息技术有限公司 Intelligent device data interaction method, intelligent device and storage device
US11050850B1 (en) * 2019-01-07 2021-06-29 Allstate Insurance Company System and methods for application programming interface validation and testing
CN113490194A (en) * 2021-08-02 2021-10-08 Oppo广东移动通信有限公司 Bluetooth-based equipment connection method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11050850B1 (en) * 2019-01-07 2021-06-29 Allstate Insurance Company System and methods for application programming interface validation and testing
CN109873837A (en) * 2019-04-12 2019-06-11 广东工业大学 Central apparatus and multi-protocols adaptation system based on android system
CN111405042A (en) * 2020-03-16 2020-07-10 北京奇艺世纪科技有限公司 Discovery method and device of electronic equipment, computer readable storage medium and electronic device
CN111711940A (en) * 2020-04-29 2020-09-25 杭州涂鸦信息技术有限公司 Intelligent device data interaction method, intelligent device and storage device
CN113490194A (en) * 2021-08-02 2021-10-08 Oppo广东移动通信有限公司 Bluetooth-based equipment connection method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
WO2019024604A1 (en) Method and device for associating application with network slice, and communication system
CN111818669B (en) Mobile terminal and data transmission method thereof
TWI406535B (en) Method and system for utilizing standardized interface in a wireless device to discover and use local and remote resources
CN109271327B (en) Memory management method and device
WO2019071612A1 (en) Method for supporting both voice service and data service and terminal
WO2020223854A1 (en) Device network configuration method and apparatus, electronic device and storage medium
US11172530B2 (en) Communication establishment method and terminal
EP4013003A1 (en) Communication protocol switching method, apparatus and system
WO2021017894A1 (en) Method for using remote sim module, and electronic apparatus
EP2784661B1 (en) Computer program product, information processing method, and information processing apparatus
CN114629932B (en) Cooperative method between electronic devices, electronic device and storage medium
CN113766477A (en) Device connection method, device, electronic device and computer readable medium
US20100291913A1 (en) Remote control method between mobile phones
CN114461240A (en) Software upgrading method, software upgrading system and electronic equipment
EP4195870B1 (en) Data transmission method and terminal
CN109495769B (en) Video communication method, terminal, smart television, server and storage medium
WO2020228033A1 (en) Sdk plug-in loading method and apparatus, and mobile terminal and storage medium
EP1796354A1 (en) Method and mobile terminal for log management during Bluetooth communication
US9112917B2 (en) Controller system and method therefor
CN113849321A (en) Device data processing method and device, electronic device and storage medium
CN114546616A (en) Device management method, device, electronic device and storage medium
CN112953992A (en) Network system, communication and networking method, device and storage medium
CN114679752B (en) Method for sharing wireless communication capability by double systems and terminal equipment
CN115665671A (en) Audio data sharing method and device, electronic equipment and storage medium
CN114007202A (en) Method for establishing binding relationship and related equipment

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