CN113886070A - Device information management method, device and computer readable storage medium - Google Patents

Device information management method, device and computer readable storage medium Download PDF

Info

Publication number
CN113886070A
CN113886070A CN202111081648.2A CN202111081648A CN113886070A CN 113886070 A CN113886070 A CN 113886070A CN 202111081648 A CN202111081648 A CN 202111081648A CN 113886070 A CN113886070 A CN 113886070A
Authority
CN
China
Prior art keywords
device information
information
calling
display
card
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
CN202111081648.2A
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.)
Hangzhou Douku Software Technology Co Ltd
Original Assignee
Hangzhou Douku Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Douku Software Technology Co Ltd filed Critical Hangzhou Douku Software Technology Co Ltd
Priority to CN202111081648.2A priority Critical patent/CN113886070A/en
Publication of CN113886070A publication Critical patent/CN113886070A/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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)

Abstract

The application discloses a device information management method, a device and a computer readable storage medium, wherein the device information management method comprises the following steps: the device management application calls a first process to receive device information of the external device; calling a second process to acquire the equipment information received by the first process; and calling a second process to display the equipment information. By means of the mode, the memory occupation of the electronic equipment can be reduced.

Description

Device information management method, device and computer readable storage medium
Technical Field
The present application relates to the field of information management technologies, and in particular, to a method, an apparatus, a device, and a computer-readable storage medium for managing device information.
Background
With the increasing popularity of electronic devices, electronic devices have become indispensable social tools and entertainment tools in people's daily life, and people have increasingly high requirements for electronic devices. Among them, how to reduce the memory occupation of electronic devices has become a research direction of general attention in the industry.
Disclosure of Invention
In a first aspect, an embodiment of the present application provides an apparatus information management method, where the method includes: the device management application calls a first process to receive device information of the external device; calling a second process to acquire the equipment information received by the first process; and calling a second process to display the equipment information.
In a second aspect, an embodiment of the present application provides an apparatus for managing device information, where the apparatus includes: a device management application, the device management application comprising: the receiving module is used for calling a first process to receive equipment information of the external equipment; the acquisition module is used for calling a second process to acquire the equipment information received by the first process; and the display module is used for calling the second process to display the equipment information.
In a third aspect, an embodiment of the present application provides an electronic device, where the electronic device includes a processor and a memory connected to the processor, where the memory is used to store program data, and the processor is used to execute the program data to implement the foregoing device information management method.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where program data are stored, and when the program data are executed by a processor, the program data are used to implement the foregoing device information management method.
The beneficial effect of this application is: different from the prior art, the method and the device for displaying the device information are characterized in that the device management application calls the first process to receive the device information of the external device, then calls the second process to obtain the device information received by the first process, and finally calls the second process to display the device information.
Drawings
In order to more clearly illustrate the technical solutions in the present application, the drawings required in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings described below are only some embodiments of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive labor. Wherein:
fig. 1 is a schematic flowchart of an embodiment of a device information management method provided in the present application;
fig. 2 is a schematic flowchart of another embodiment of a device information management method provided in the present application;
FIG. 3 is a diagram of an exemplary display interface of a target electronic device of the present application;
FIG. 4 is a schematic flow chart diagram illustrating one embodiment of step S27 in FIG. 2;
FIG. 5 is a schematic flow chart diagram illustrating another embodiment of step S27 in FIG. 2;
FIG. 6 is a block diagram of an embodiment of an apparatus for managing device information provided by the present application;
FIG. 7 is a block diagram of an embodiment of an electronic device provided herein;
FIG. 8 is a block diagram of an embodiment of a computer-readable storage medium provided herein.
Detailed Description
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, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first" and "second" in this application are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless explicitly specifically limited otherwise. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
At present, communication connection can be established between different electronic devices to realize information interaction. Taking a mobile phone as an example, the mobile phone may establish a communication connection with an external device (e.g., a smart watch, a smart bracelet, a bluetooth headset, etc.), and then acquire device information of the external device to display, so that a user may know the device information of the external device through the mobile phone, and the user may also directly control the external device through the mobile phone. The display of the device information linked to the mobile phone usually requires two applications to process, the first application is in communication connection with the external device so as to acquire the device information of the external device and store the device information in the database, and the second application is responsible for acquiring the device information from the database and displaying the device information on the user interface.
Research shows that in the process of displaying the equipment information, the memory occupation is larger when the two applications run simultaneously; in addition, data transmission between two applications needs to be realized, fields and analysis of data need to be unified, certain dependency exists, the problem of compatibility among multiple versions can also exist, and the maintenance cost is high. For example, after version upgrade is performed on one application, another application also needs to perform version upgrade, otherwise, accuracy of data transmission cannot be guaranteed, and thus the compatibility problem between the two applications is caused.
Therefore, the application provides a device information management method, which realizes the display of device information in a mode of one application in different processes, and only one application needs to be operated in the display process, so that the memory occupation of the electronic device can be reduced; in addition, version updating or device information expansion can be completed in one application, so that the compatibility problem existing when two applications are adopted is avoided.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the specification. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
In the method provided by the embodiment of the application, the execution subject of each step may be the target electronic device. For example, the target electronic device may be a mobile phone, a tablet computer, an e-book reader, a multimedia player, a PDA (Personal Digital Assistant), a wearable device, and the like. In one embodiment, the target electronic device is a mobile terminal based on an Android (Android) operating system. Of course, the embodiment of the present invention does not limit the operating system of the target electronic device to be an iOS operating system, a Windows operating system, or other operating systems. The target electronic device has at least one display panel for providing at least one display interface. The display interface may display device information of the external device.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating an embodiment of a device information management method according to the present application.
As shown in fig. 1, the device information management method may include the steps of:
s11: the device management application calls a first process to receive device information of the external device.
The electronic device assists the user in completing desired functions, such as shopping, social interaction, games, etc., by installing an application. An application (also called an application program) refers to software written for a certain application purpose of a user, and is a computer program for performing one or more specific tasks. The application program has a visual user interface in the electronic equipment, and a user can interact with the electronic equipment through the user interface of the application program. In this embodiment, the device management application is an application program for managing device information. Wherein, the electronic device installed with the device management application is marked as a target electronic device.
In this embodiment, the device management application can acquire the device information of the external device and display the device information on the display interface of the target electronic device. Further, the user can know the state of the external device based on the device information displayed on the display interface, and then can control the external device through the target electronic device through interaction with the target electronic device. Wherein, the external device can be electronic equipment, for example intelligent wrist-watch, intelligent bracelet, smart television, bluetooth headset and bluetooth speaker etc.. Namely, the external device and the target electronic device are two independent electronic devices.
In this embodiment, the device management application may include a first process and a second process, where the first process and the second process both have independent memory spaces, and the first process and the second process may communicate with each other.
In some embodiments, the device information may be sent by the external device to the first process of the device management application. The first process is used for establishing communication connection with one or more external devices to receive device information sent by the external devices and cache the device information. The second process is used for acquiring the equipment information sent by the external equipment from the first process and displaying the equipment information on the display interface. The manner of establishing the connection between the first process and the external device is not limited, and may be, for example, WiFi (Wireless Fidelity), bluetooth, or the like. Specifically, the first process may communicate with an application program on the external device that manages the device information, thereby acquiring the device information.
In other embodiments, the device information may be stored in the target electronic device in advance, and when the device information needs to be displayed, the device management application may directly send the stored device information to the first process for processing. In still other embodiments, the external device may transmit the device information to the server, the server may store the device information of the plurality of external devices, and the server may transmit the device information to the first process when the device management application requires the device information, whereby the device management application may call the first process to receive the device information transmitted by the server.
In the present embodiment, the device information is not limited to include basic information of the external device, a remaining power of the external device, and a connection state of the external device with the target electronic device. The basic information of the external device may include a name, a model, a manufacturer, and the like. The remaining power of the external device may be represented in percentage, for example, the range of the remaining power is 0% to 100%, or the remaining power may be represented in numerical values, icons, and the like, where the numerical values are, for example, 2000 milliamperes (mA), and the icons corresponding to the remaining power may be displayed in a graphic rendering manner, for example, when the remaining power is larger, the area of the corresponding displayed icons is larger. In this embodiment, the connection state may include connected and unconnected, and in other embodiments, the connection state may also include connected.
In an implementation scenario, when the device management application determines that the first process receives a preset instruction sent by the second process, the device management application executes a step of calling the first process to receive device information sent by the external device. The second process may send a preset instruction to the first process through a command prompt (cmd), where the preset instruction may be used to instruct the first process to acquire the device information. In another implementation scenario, the device management application may also directly invoke the first process to receive device information sent by the external device.
The sending of the device information to the first process by the external device may be active sending or passive sending. For example, the external device may send the device information to the first process to update the device information cached by the first process when detecting that the device information changes, or the external device may send the device information to the first process at intervals of a preset time period. The specific numerical value of the preset time period can be configured during application development or set by a user; the preset time period is, for example, 5 minutes, half an hour. For example, the external device sends the device information to the first process only when receiving an acquisition instruction of the device information sent by the device management application calling the first process.
S12: and calling a second process to acquire the equipment information received by the first process.
In this embodiment, the device information is cached in a cache (e.g., a flash cache), and the device management application may invoke the second process to directly obtain the device information received by the first process from the cache, so that the second process can obtain the device information more quickly, thereby improving the display efficiency of the device information. In other embodiments, the device information may also be stored in a database or a file system, which is not limited herein. In some embodiments, the first process may be called to cache the received device information in the cache region and backup the device information to the database or the file system, and after the device information is successfully acquired by the second process, the device information that is successfully acquired in the cache region may be cleared to release the storage space of the cache region, and the device information is backed up to the reliable database or the file system, so that the device information can be permanently stored, and traceability of data is provided.
S13: and calling a second process to display the equipment information.
And after the device management application calls the second process to obtain the device information, continuing to call the second process to display the device information. Specifically, a second process is called to draw the device information to the display interface.
In a specific embodiment, the target electronic device is, for example, a mobile phone, the external device is, for example, a smart watch, a device management application is installed on the mobile phone, and the device management application can be in communication connection with the smart watch, and then obtain device information of the smart watch and display the device information on a display interface of the mobile phone. In other embodiments, the external device may further include an intelligent bracelet, an intelligent television, a bluetooth headset, and a bluetooth speaker, and the device management application may manage device information of the plurality of external devices at the same time, where the device information of the plurality of external devices may be displayed on the same display interface or on different display interfaces.
According to the device information management method provided by the embodiment of the application, the device management application calls the first process to receive the device information of the external device, then calls the second process to obtain the device information received by the first process, and finally calls the second process to display the device information.
Referring to fig. 2 to 5, fig. 2 is a schematic flowchart illustrating another embodiment of a device information management method provided by the present application, fig. 3 is an exemplary diagram illustrating a display interface of a target electronic device of the present application, fig. 4 is a schematic flowchart illustrating an implementation manner of step S27 in fig. 2, and fig. 5 is a schematic flowchart illustrating another implementation manner of step S27 in fig. 2.
As shown in fig. 2, the device information management method may include the steps of:
s21: the device management application calls a first process to receive the device information sent by the external device.
For the description of step S21, please refer to the corresponding position in the above embodiments, which is not described herein again.
S22: and calling an android interface definition language to realize the communication between the first process and the second process.
The AIDL (Android Interface definition language) is one of IPCs (Inter-Process Communication) in Android. In the Android system, one process generally cannot access the memory of another process. The equipment management application can define a communication interface between Android processes through the AIDL file, and realizes communication between the first process and the second process so as to receive/send data. The communication between the first process and the second process is realized through the AIDL file, and the method has the advantages of high speed, stable performance, high efficiency and the like.
Specifically, a second process may be called to create a Service and an aid file, where the first process may be called to initiate a connection request to the second process to bind the Service, and call a method of an interface defined in the aid file according to a type to which the aid interface belongs, and correspondingly, the Service of the second process is used to monitor the connection request of the first process, and implement the interface method defined by the aid file in the Service.
In other examples, the device management application may also invoke other IPC manners to implement the communication between the first process and the second process, such as half-duplex Unix pipes, FIFOs (named pipes), message queues, semaphores, shared memories, network sockets, and the like, which is not limited herein.
S23: and calling a first process to convert the format of the equipment information based on the data class of the equipment information.
Before the second process is called to obtain the device information received by the first process, the first process can be called first to perform format conversion on the device information based on the data class of the device information so as to convert the device information into a preset data format, so that confusion and unrecognizability can be avoided in the process of device information transmission, and the method is quicker and more convenient. In other embodiments, if the format of the device information is already the preset data format, no format conversion is needed, or no format conversion may be performed.
As an example, the preset data format is JSON (JavaScript Object Notation), which is a lightweight data exchange format, and stores and represents data in a text format completely independent of a programming language, and has a concise and clear hierarchical structure. JSON objects have three data formats, object type, array/set type, and hybrid type (including object type and array type). The syntax of the object type is { name: value, name: value. }, wherein name is a character string type, and value is any type; the syntax of an array/set type is [ value, value. ] or [ { }, { }. ], where value is any type (such as a js object or an array); the syntax of the mixed type is { name: [ ]. }, where nested object types and array types are reasonably wrapped.
Specifically, the device management application may invoke the first process to convert the device information into a JSON object based on the data class of the device information.
In this embodiment, the data class of the device information may include at least one of basic information of the external device, a card identifier, a card title, a card subtitle, a remaining power amount, a shortcut button, a load link of a picture, and an event behavior. It will be appreciated that a data class is often used in programming languages, and is a collection of entities having some common characteristics, and is also an abstract data type, which is an abstraction of entities having the same characteristics. Here, the data class of the device information may be customized by a user during application development or update, and the device information refers to information related to the external device, and is an entity, including specific data content, for example, 60% and 50% are both used to represent the remaining power of the external device, so that the combination of the entities of 60% and 50% can be regarded as a data class "remaining power". For the description of the basic information and the remaining power of the external device, reference may be made to the corresponding positions in the above embodiments, which are not described herein again. The use of the data corresponding to the other data classes will be explained below.
The target electronic device provides a display interface 20, and the display interface 20 includes one or more card areas 30, and each card area 30 correspondingly displays device information of an external device. As shown in fig. 2, a display interface 20 includes 4 card sections 30, namely, a first card section 301, a second card section 302, a third card section 303, and a fourth card section 304.
The card identifier (id) is used to indicate a card area to which the device information corresponds. As an example, the value range of the card identifier may be a positive integer, for example, when id is 1, the corresponding card area is the first card area 301, when id is 2, the corresponding card area is the second card area 302, and so on. In some approaches, the card identifier (id) is used to uniquely identify the external device, such as being the MAC address of the external device.
In some embodiments, the display interface 20 may be a Desktop (Desktop) of the target electronic device, where the Desktop refers to the area of the display home screen that is seen after the computer is opened and successfully logs into the system, and is the starting point for application operations. In other embodiments, the display interface 20 may be one other than a desktop. In an application scene, a user can delete a card area on a display interface according to actual requirements so as to reduce the card area on the display interface and only reserve the card area concerned by the user, thereby simplifying the display interface. Specifically, the device management application may pop up a dialog box in response to a preset operation for the card area (for example, pressing a blank area of the card area for a long time), confirm to the user whether to delete the card area, and delete the card area if the user confirms deletion.
The card title is a title of the card area, is displayed in the card area, and is used for identifying the external equipment corresponding to the card area. The card subtitle is a subtitle of the card edge area, is displayed in the card area and is used for assisting the card subtitle to mark the card area. In some embodiments, the title of the card may be the name of the external device, and the subtitle of the card may be the model or manufacturer of the external device, the function of the external device, and the like.
The loading link of the picture is the loading link of the picture displayed in the card area, wherein the picture can be an actual appearance diagram of the external device or other pictures which can be used for representing the external device. The user can quickly and intuitively know the external equipment corresponding to each card area according to the pictures displayed in the card areas. The picture may be in the form of a still picture (e.g., JPEG) or a moving picture (e.g., gif).
In some embodiments, the pictures in the card area can also be used for synchronously displaying the display pictures on the display interface of the external equipment. For example, the external device may upload a display screen on a display interface thereof to the server, and the server returns a corresponding load link to the external device, so that the external device may send the load link of the picture to the device management application, and thus, when the second process displays the device information on the display interface, the second process may acquire the display screen on the display interface of the corresponding external device from the server in real time through the load link, and may perform synchronous display on the display screen in the card area. The device management application can store the loading link of the picture of the external device after obtaining the loading link of the picture of the external device for the first time, so that the display picture of the external device can be synchronously displayed following the loading link in the following process.
The shortcut buttons may be directly displayed in the card area. The device management application can respond to the preset operation of the user on the shortcut button to correspondingly control the external device. Shortcut buttons such as a power button, a music switch button, a volume adjustment button, etc. The number of the shortcut buttons can be set according to actual conditions, for example, 1 or 2. The preset operation is, for example, a click operation, a slide operation, or a press operation. It is understood that the preset operation of the terminal device by the user may be performed by a finger, a stylus pen, or a mouse, which is not particularly limited.
Event behaviors may include, but are not limited to: acquisition of device information, connection or disconnection of an external device (i.e., connection status), renaming of an external device, and the like. Specifically, the event behavior may be displayed on the display interface in a text or icon manner, and the device management application may respond to a preset operation of the user on the text or icon to execute the corresponding event behavior. For example, when the user clicks the "rename" icon, the display interface may pop up an input box, the second process of the device management application may obtain the content in the input box, rename the card title or the card subtitle, and then the second process may send the renamed card title or card subtitle to the first process, and the first process displays the renamed card title or card subtitle.
In some embodiments, the device information of some external devices is not comprehensive, for example, when some external devices do not support certain shortcut buttons or event behaviors, which may result in incomplete device information. For these external devices, the device management application may not display the missing device information when displaying the device information, or may display default content corresponding to the device management application, which indicates that the external device does not provide some device information or does not support some function. For example, when the device information of the external device includes a power button, it is described that the external device supports the power button function, so that when the power button is displayed, the color of the power button may be displayed as green to indicate that the external device supports the power button function, and when the device information of the external device does not include a power button, the color of the power button may be displayed as gray by default to indicate that the external device does not support the power button function, and the displayed power button is not available to a user. Therefore, when the device information is incomplete, the device information can be displayed in different modes through color differentiation, so that more information is provided for the user (for example, the user is made to know the functions supported by the external device, and the user can be made to know the functions not supported by the external device).
In some specific embodiments, as shown in fig. 3, the name of the device management application is "my device", the user may enter the display interface 20 by clicking "my device", the display interface 20 further displays a return key "←", and the user may exit the current display interface 20 by clicking the return key, at this time, the device management application also enters the background running state, and the display interface 20 may further display information such as the number of paired external devices, and the first card area 301, the second card area 302, the third card area 303, and the fourth card area 304. The external devices corresponding to the first card area 301 to the fourth card area 304 are a bluetooth headset, a smart television, a smart watch and a smart bracelet. All show picture, card title, residual capacity, connection status in four card regions 30, wherein, first card region 301 has still shown a card subtitle, and the specific content XXX of card subtitle can set up according to actual conditions. A shortcut button, namely a power button 3021, is also displayed in the second card area 302, and the user can turn off or on the smart television by directly clicking the power button on the current display interface 20.
It can be understood that, in this embodiment, there is no certain precedence relationship between step S22 and step S23, and the steps of invoking the android interface definition language to establish communication between the first process and the second process and invoking the first process to perform format conversion on the device information may be performed simultaneously or sequentially, which is not limited herein.
In the above embodiment, the step S12 of invoking the second process to acquire the device information received by the first process may include steps S24 to S25.
S24: and calling a second process to acquire the equipment information after the format conversion of the first process.
Specifically, the second process may send an acquisition instruction of the device information to the first process, and when the first process receives the acquisition instruction, send the device information after format conversion to the second process.
S25: and calling a second process to restore the format of the equipment information based on the data class of the equipment information.
In some embodiments, the second process can obtain a data class of the device information and perform a format reduction on the device information based on the data class of the device information. Specifically, the second process can restore the JSON object after the device information format conversion to the device information in the original format according to the data class of the device information. For example, a string-type data format may be restored.
In some embodiments, when the target electronic device is connected to multiple external devices at the same time, the device management application may invoke the first process to package the device information after format conversion into one data packet, so that the data packet may transmit the multiple device information to the second process at the same time for the next operation, thereby saving data transmission time and consuming fewer network resources. Correspondingly, when the second process acquires the data packet, the second process needs to be called to decompose the data packet into single device information after format conversion, and then the second process is called to restore the format of the device information based on the data class of the device information.
S26: and calling a second process to display the equipment information.
Specifically, the invoking of the second process to display the device information may be invoking of the second process to display the device information in a card area corresponding to the display interface according to the card identifier.
S27: and when the device management application is in the background running state, closing the second process.
The running of the application program comprises two running states: one is a foreground running state, namely, the foreground running state runs on a window or an interface displayed on a screen directly, a current interface for program running is presented, and a user can interact with the interface displayed by the electronic equipment; the other mode is a background running state, namely the screen does not present a running interface of the application program, but the application program continues to provide services and can be switched to a foreground at any time and displayed. In this embodiment, the device management application implements display of the device information in a split-process manner, where a first process is used to provide data and perform some behavior processing (for description of the behavior processing, see description below), and a second process is mainly responsible for display of the device information, so that the second process is closed when other interfaces or a screen is closed and the device information does not need to be displayed, so that a memory occupied by the second process can be released, and an available memory of the system is improved. Generally, the second process for UI interface display occupies more memory resources, sometimes several times as much as the first process.
Specifically, whether the device management application is in a background running state or not can be judged, if yes, the second process is closed, and otherwise, the foreground running of the second process is kept. The device management application may call a system function system.
In some embodiments, to avoid frequent shutdown and restart of the second process, a determination condition may be set before the second process is shutdown. In some embodiments, as shown in fig. 4, step S27 may further include:
s371: and judging whether the device management application is in a background running state.
If the device management application is in the background running state, step S372 is executed.
If the device management application is not in the background running state, which indicates that the device management application is in the foreground running state at this time, the device management application can continue to keep running in the foreground, so that the second process needs to provide display of the device information and cannot close the device information.
S372: and judging whether the total duration of the device management application in the background running state reaches a preset duration or not.
If yes, go to step S373.
Otherwise, the step S372 is continued.
S373: the second process is shut down.
The preset duration can be configured in advance in the development process of the equipment management application, and can also be set by a user. For example, the preset time period may be 10 seconds, 1 minute, or the like. It can be understood that, when counting the total duration of the device management application in the background running state, specifically, the timing is started when the device management application is switched to the background running state, the timing can be stopped when the device management application does not reach the preset duration and is switched to the foreground running state, and the timing of the next round is started when the device management application is switched to the background running state again.
In other embodiments, as shown in fig. 5, step S27 may further include:
s471: and judging whether the device management application is in a background running state.
If yes, go to step S472.
If the device management application is not in the background running state, which indicates that the device management application is in the foreground running state at this time, the device management application can continue to keep running in the foreground, so that the second process needs to provide display of the device information and cannot close the device information.
S472: and judging whether the available memory of the current system is smaller than a preset memory threshold value.
If yes, go to step S473.
Otherwise, the execution continues to step S472.
S473: the second process is shut down.
In addition, in step S473, it may also be determined whether the available memory ratio of the current system is smaller than the preset memory ratio.
The preset memory threshold and/or the preset memory proportion can be configured in advance in the device management application development process, and can also be set by a user. For example, the preset memory threshold may be 500M or 1 GB. The predetermined memory ratio is, for example, 20% or 50%.
In some embodiments, after the second process is closed, if the device management application is switched from the background running state to the foreground running state, the second process is restarted. It can be understood that when the device management application returns to the foreground state, it indicates that the current user needs to view the device, and therefore the second process needs to be re-established, so that the device information is displayed on the display interface by using the second process.
In other embodiments, different from the foregoing embodiments, when the device management application is in the background running state, the second process may be compressed first, and then the storage area of the second process is moved from the memory area to a cache area, such as a flash cache area, and the compressed second process does not occupy the memory of the electronic device any more, which may increase the available memory of the electronic device. Secondly, the memory space occupied by the compressed second process is smaller than the memory space occupied by the compressed second process, so that the cache space occupied in the cache region is not too large. And when the equipment management application is switched to the foreground running state, the equipment management application moves the second process from the cache region to the memory region and carries out decompression operation on the second process, so that the second process can run normally.
In some embodiments, to avoid the second process being compressed frequently, a determination condition may be set, and when the determination condition is satisfied, the second process is compressed, and then the storage area of the second process is moved from the memory area to the cache area. For the description of the determination condition, reference may be made to the description of the determination condition where the second process is closed, and details are not described here.
In some embodiments, step S26 may be followed by:
s28: and calling a second process to obtain a preset instruction, and sending the preset instruction to the first process.
The device management application can generate a preset instruction according to preset operation of a user, then call the second process to obtain the preset instruction, send the preset instruction to the first process, and process the preset instruction by the first process. The preset operation can be generated by the device management application in response to the operation of the user on the card area. The preset operation is, for example, a click operation, a slide operation, or a press operation. It is understood that the specific operation of the terminal device by the user may be performed by a finger, a stylus pen, or a mouse, which is not particularly limited.
In other embodiments, the device management application may also automatically generate the preset instruction without performing operations according to a user, which is not described herein.
It is understood that, in the present embodiment, there is no certain precedence relationship between the steps S27 and S28. The step S27 is executed when the device management application is in the background running state, and the step S28 is executed when the device management application is in the foreground running state, which do not affect each other.
S29: and calling a first process to execute corresponding preset operation according to the preset instruction, wherein the preset operation comprises at least one of acquiring equipment information, connecting or disconnecting the external equipment and renaming the external equipment.
In an application scenario, a user may press a display area near a card title for a long time to rename the card title. Correspondingly, the equipment management application detects that the user presses the card title for a long time, so that a renamed first preset instruction is generated, the second process obtains the first preset instruction, and sends the first preset instruction to the first process, so that the card title is renamed by the first process. After renaming, the updated device information is updated, so that the first process can be called to send the updated device information to the second process, and the second process can display the updated device information.
In the embodiment, the communication between the first process and the second process is realized through the android interface definition language, and the method is high in speed, stable in performance and high in efficiency. When processes communicate, the service capability can be expanded by increasing the types of command prompts (Cmd) without defining more AIDL interfaces. Secondly, after format conversion is carried out on the equipment information, the equipment information is transmitted among processes, so that the validity of data can be guaranteed, and the method is quick and convenient. In addition, two processes are divided in the same application, the first process can be closed at any time when in a background running state, the memory is released, and the memory occupation of the whole equipment management application is reduced. The second process generally needs to be resident, and in some embodiments, the second process may also be closed according to a user's selection to release more memory.
Referring to fig. 6, fig. 6 is a schematic diagram of a framework of an embodiment of an apparatus information management device provided in the present application.
As shown in fig. 6, in the present embodiment, the device information management apparatus 600 includes a device management application 610. The device management application 610 includes a receiving module 611, an obtaining module 612, and a displaying module 613, where the receiving module 611 is configured to invoke a first process to receive device information of an external device, the obtaining module 612 is configured to invoke a second process to obtain the device information received by the first process, and the displaying module 613 is configured to invoke the second process to display the device information.
In some embodiments, the receiving module 611 is further configured to invoke an android interface definition language to implement communication between the first process and the second process before invoking the second process to obtain the device information received by the first process.
In some embodiments, the obtaining module 612 is further configured to, before invoking the second process to obtain the device information received by the first process, invoke the first process to perform format conversion on the device information based on the data class of the device information, invoke the second process to obtain the device information after the format conversion of the first process, and invoke the second process to perform format restoration on the device information based on the data class of the device information.
In some embodiments, the data class of the device information includes at least one of basic information of the external device, a card identifier, a card title, a card subtitle, a remaining power amount, a shortcut button, a load link of a picture, and an event behavior.
In some embodiments, the display module 613 is further configured to invoke a second process to display the device information in a card area corresponding to the display interface according to the card identifier, where the display interface includes one or more card areas.
In some embodiments, the obtaining module 612 is further configured to invoke the second process to obtain a preset instruction, and send the preset instruction to the first process; and calling the first process to execute corresponding preset operation according to the preset instruction, wherein the preset operation comprises at least one of acquiring equipment information, connecting or disconnecting the external equipment and renaming the external equipment.
In some embodiments, the display module 613 is further configured to close the second process when the second process is in a background running state.
It can be understood that, for the description of each step corresponding to each module, reference may be made to a corresponding position in the foregoing method embodiment, and details are not described here.
Referring to fig. 7, fig. 7 is a schematic diagram of a frame of an embodiment of an electronic device provided in the present application.
In this embodiment, the electronic device 700 comprises a processor 780 and a memory 720 connected to the processor 780, the memory 720 being adapted to store program data, the processor 780 being adapted to execute the program data to implement the steps of any of the above-described method embodiments.
In some embodiments, electronic device 700 may include RF (Radio Frequency) circuitry 710, memory 720 including one or more computer-readable storage media, input unit 730, display unit 740, sensor 750, audio circuitry 760, WiFi (wireless fidelity) module 770, processor 780 including one or more processing cores, and power supply 790, among other components. Those skilled in the art will appreciate that the terminal structure shown in fig. 7 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
RF circuit 710 may be used for receiving and transmitting signals during a message transmission or call, and in particular, for receiving downlink information from a base station and processing the received downlink information by one or more processors 780; in addition, data relating to uplink is transmitted to the base station. In general, RF circuit 710 includes, but is not limited to, an antenna, at least one Amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, and the like. In addition, the RF circuit 710 may also communicate with networks and other devices via wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), email, SMS (Short Messaging Service), etc.
The memory 720 may be used to store program data and modules, and the processor 780 performs various functional applications and data processing by operating the program data and modules stored in the memory 720. The memory 720 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the electronic device 700, and the like. Further, the memory 720 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, memory 720 may also include a memory controller to provide access to memory 720 by processor 780 and input unit 730.
The input unit 730 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. Specifically, the input unit 730 may include an image input device 731 and other input devices 732. The image input device 731 may be a camera or a photo scanning device. The input unit 730 may include other input devices 732 in addition to the image input device 731. In particular, other input devices 732 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 740 may be used to display information input by or provided to the user and various graphical user interfaces of the electronic device 700, which may be made up of graphics, text, icons, video, and any combination thereof. The Display unit 740 may include a Display panel 741, and optionally, the Display panel 741 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like.
The electronic device 700 may also include at least one sensor 750, such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 741 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 741 and/or a backlight when the electronic device 700 is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when the mobile phone is stationary, and can be used for applications of recognizing the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which may be further configured to the electronic device 700, detailed descriptions thereof are omitted.
The audio circuit 760, speaker 761, and microphone 762 may provide an audio interface between a user and the electronic device 700. The audio circuit 760 can transmit the electrical signal converted from the received audio data to the speaker 761, and the electrical signal is converted into a sound signal by the speaker 761 and output; on the other hand, the microphone 762 converts the collected sound signal into an electric signal, converts the electric signal into audio data after being received by the audio circuit 760, processes the audio data by the audio data output processor 780, and transmits the processed audio data to, for example, another terminal via the RF circuit 710, or outputs the audio data to the memory 720 for further processing. The audio circuitry 760 may also include an earbud jack to provide communication of a peripheral headset with the electronic device 700.
WiFi belongs to short-range wireless transmission technology, and the electronic device 700 can help the user send and receive e-mails, browse web pages, access streaming media, etc. through the WiFi module 770, and it provides wireless broadband internet access for the user. Although fig. 7 shows the WiFi module 770, it is understood that it does not belong to the essential constitution of the electronic device 700, and may be omitted entirely within the scope not changing the essence of the invention as needed.
The processor 780 is a control center of the electronic device 700, connects various parts of the entire mobile phone using various interfaces and lines, and performs various functions of the electronic device 700 and processes data by operating or executing program data and/or modules stored in the memory 720 and calling data stored in the memory 720, thereby integrally monitoring the mobile phone. Optionally, processor 780 may include one or more processing cores; preferably, the processor 780 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 780.
The electronic device 700 also includes a power supply 790 (e.g., a battery) for powering the various components, which may preferably be logically coupled to the processor 780 via a power management system that may be configured to manage charging, discharging, and power consumption. The power supply 790 may also include any component including one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Although not shown, the electronic device 700 may further include a bluetooth module or the like, which is not described in detail herein.
In some embodiments, electronic device 700 is not limited to including televisions, desktop computers, laptop computers, handheld computers, wearable devices, head-mounted displays, reader devices, portable music players, portable gaming devices, notebook computers, ultra-mobile personal computers (UMPCs), netbooks, and cicada-phone, Personal Digital Assistants (PDAs), Augmented Reality (AR), Virtual Reality (VR) devices.
Referring to fig. 8, fig. 8 is a block diagram illustrating an embodiment of a computer-readable storage medium according to the present application.
As shown in fig. 8, the computer readable storage medium 800 stores program data 810, and the program data 810 is used for implementing the steps of any of the above method embodiments when executed by the processor.
The computer-readable storage medium 800 may be a medium that can store a computer program, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, or may be a server that stores the computer program, and the server may send the stored computer program to another device for running or may run the stored computer program by itself.
In the several embodiments provided in the present application, it should be understood that the disclosed method and apparatus may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a module or a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some interfaces, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings, or which are directly or indirectly applied to other related technical fields, are intended to be included within the scope of the present application.

Claims (10)

1. An apparatus information management method, comprising:
the device management application calls a first process to receive device information of the external device;
calling a second process to acquire the equipment information received by the first process;
and calling the second process to display the equipment information.
2. The method of claim 1, wherein before the invoking the second process to obtain the device information received by the first process, further comprising:
and calling an android interface definition language to realize the communication between the first process and the second process.
3. The method of claim 1, wherein before the invoking the second process to obtain the device information received by the first process, further comprising:
calling the first process to convert the format of the equipment information based on the data class of the equipment information;
the calling the second process to acquire the device information received by the first process includes:
calling the second process to acquire the equipment information after the format conversion of the first process;
and calling the second process to restore the format of the equipment information based on the data class of the equipment information.
4. The method according to any one of claims 1 to 3,
the data class of the device information includes at least one of basic information of the external device, a card identifier, a card title, a card subtitle, a remaining power amount, a shortcut button, a loading link of a picture, and an event behavior.
5. The method of claim 4, wherein said invoking the second process to display the device information comprises:
and calling the second process to display the equipment information in a card area corresponding to a display interface according to the card identifier, wherein the display interface comprises one or more card areas.
6. The method of claim 1, further comprising:
calling the second process to obtain a preset instruction, and sending the preset instruction to the first process;
and calling the first process to execute corresponding preset operation according to the preset instruction, wherein the preset operation comprises at least one of acquiring the equipment information, connecting or disconnecting the external equipment and renaming the external equipment.
7. The method of claim 1, further comprising:
and when the second process is in a background running state, closing the second process.
8. A device information management apparatus comprising a device management application, the device management application comprising:
the receiving module is used for calling a first process to receive equipment information of the external equipment;
the acquisition module is used for calling a second process to acquire the equipment information received by the first process;
and the display module is used for calling the second process to display the equipment information.
9. An electronic device, comprising a processor and a memory coupled to the processor,
the memory is for storing program data, and the processor is for executing the program data to implement the method of any one of claims 1-7.
10. A computer-readable storage medium, in which program data are stored which, when being executed by a processor, are adapted to carry out the method according to any one of claims 1-7.
CN202111081648.2A 2021-09-15 2021-09-15 Device information management method, device and computer readable storage medium Pending CN113886070A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111081648.2A CN113886070A (en) 2021-09-15 2021-09-15 Device information management method, device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111081648.2A CN113886070A (en) 2021-09-15 2021-09-15 Device information management method, device and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN113886070A true CN113886070A (en) 2022-01-04

Family

ID=79009401

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111081648.2A Pending CN113886070A (en) 2021-09-15 2021-09-15 Device information management method, device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113886070A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116880792A (en) * 2023-09-07 2023-10-13 荣耀终端有限公司 Data calling method of bottom device and electronic equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1641589A (en) * 2004-01-15 2005-07-20 雅马哈株式会社 Remote control method of external devices
CN104461559A (en) * 2014-12-19 2015-03-25 北京奇虎科技有限公司 Method for communication between browser and mobile terminal and browser device
CN107608744A (en) * 2017-09-05 2018-01-19 珠海格力电器股份有限公司 Application process management method and device and mobile terminal
CN109101326A (en) * 2018-06-06 2018-12-28 三星电子(中国)研发中心 A kind of background process management method and device
CN110188211A (en) * 2019-04-25 2019-08-30 深圳市布谷鸟科技有限公司 A method of applied to the quick loading multimedia list of application of Android onboard system
WO2019184631A1 (en) * 2018-03-29 2019-10-03 Oppo广东移动通信有限公司 Information processing method and apparatus, computer-readable storage medium, and terminal
CN112698907A (en) * 2021-03-25 2021-04-23 湖北亿咖通科技有限公司 Application display control method and electronic equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1641589A (en) * 2004-01-15 2005-07-20 雅马哈株式会社 Remote control method of external devices
CN104461559A (en) * 2014-12-19 2015-03-25 北京奇虎科技有限公司 Method for communication between browser and mobile terminal and browser device
CN107608744A (en) * 2017-09-05 2018-01-19 珠海格力电器股份有限公司 Application process management method and device and mobile terminal
WO2019184631A1 (en) * 2018-03-29 2019-10-03 Oppo广东移动通信有限公司 Information processing method and apparatus, computer-readable storage medium, and terminal
CN109101326A (en) * 2018-06-06 2018-12-28 三星电子(中国)研发中心 A kind of background process management method and device
CN110188211A (en) * 2019-04-25 2019-08-30 深圳市布谷鸟科技有限公司 A method of applied to the quick loading multimedia list of application of Android onboard system
CN112698907A (en) * 2021-03-25 2021-04-23 湖北亿咖通科技有限公司 Application display control method and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116880792A (en) * 2023-09-07 2023-10-13 荣耀终端有限公司 Data calling method of bottom device and electronic equipment
CN116880792B (en) * 2023-09-07 2024-03-08 荣耀终端有限公司 Data calling method of bottom device and electronic equipment

Similar Documents

Publication Publication Date Title
CN110312985B (en) Electronic device and method for displaying screen thereof
US11137876B2 (en) Information display method, device and terminal for displaying progress on application icon
CN108549519B (en) Split screen processing method and device, storage medium and electronic equipment
CN107734616B (en) Application program closing method and device, storage medium and electronic equipment
JP2023506936A (en) MULTI-SCREEN COOPERATION METHOD AND SYSTEM AND ELECTRONIC DEVICE
CN110058850B (en) Application development method and device and storage medium
CN106502608B (en) Display methods, device and terminal device
CN110399195B (en) Desktop icon dynamic replacement method, equipment and computer readable storage medium
CN110837327A (en) Message viewing method and terminal
CN113313804B (en) Image rendering method and device, electronic equipment and storage medium
CN110300047B (en) Animation playing method and device and storage medium
CN110865837A (en) Method and terminal for upgrading system
CN111309325A (en) Method and device for reference of third-party library and mobile terminal
CN107908527B (en) Application icon display method and device
CN109857300A (en) Multimedia service providing method and device
CN112000408B (en) Mobile terminal and display method thereof
CN113886070A (en) Device information management method, device and computer readable storage medium
CN116594616A (en) Component configuration method and device and computer readable storage medium
CN108833659B (en) Application installation method and terminal
CN111273961A (en) Advertisement display method and device and electronic equipment
CN106681845B (en) Method and device for managing communication messages
CN108280798B (en) Method and device for rendering and displaying browser kernel
CN116541188B (en) Notification display method, terminal device and storage medium
CN111414142B (en) Mobile terminal and display method of application interface thereof
WO2024078306A1 (en) Banner notification message display method and electronic device

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