Binder management system and method, client and server
By setting up the Binder management unit on the client and server, using Binder proxy objects and count value statistics, the problem of Binder resources not being released in cross-end interaction scenarios is solved, and the automatic release of Binder resources and the stability of cross-end interaction is realized.
Patent Information
- Application Number
- CN202310822282.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-05
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2043-07-05
AI Technical Summary
The existing system cannot automatically clean up the Binder resources of the service collaboration module used in cross-end interactive scenarios, resulting in the Binder resources being unable to be released.
By setting up Binder management units on the client and server, using the Binder proxy object and Binder identifier for cross-end collaboration, and sending a release instruction to release the corresponding Binder resources after the Binder proxy object is released, and counting statistics are used to prevent Binder from being used to prevent Binder from being used to prevent Binder from being used to determine the value of the Binder. The proxy object is released in advance.
It realizes the automatic release of cross-end Binder resources to prevent resource leakage and ensures the normal execution of cross-end interaction work.
Smart Images

Figure CN119271425A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of device management, and in particular to a Binder management system, method, client, and server. Background Art
[0002] Binder is a tool used in electronic devices for inter-process communication. Applications in different processes use different Binders for inter-process communication. In some current application scenarios, cross-end interaction between different electronic devices is required to complete the business together. For example, electronic device 1 cross-end calls the microphone of electronic device 2 to collect audio data, and electronic device 1 cross-end accesses the document stored in electronic device 2 to modify the document.
[0003] See also Figure 1 , is a schematic diagram of a cross-end interaction scenario provided in an embodiment of the present application, and the figure includes an electronic device 1 and an electronic device 2 for cross-end interaction. The electronic device 1 and the electronic device 2 for cross-end interaction are respectively configured with a service collaboration module 1 and a service collaboration module 2. During the cross-end interaction between application 1 in electronic device 1 and application 2 in electronic device 2, application 1 and service collaboration module 1 transmit information to each other, application 2 and service collaboration module 2 transmit information to each other, and service collaboration module 1 and service collaboration module 2 transmit messages to each other, thereby realizing the cross-end interactive collaboration between application A and application B. In this process, each application 1 and service collaboration module 1 run in different processes, and application 2 and service collaboration module 2 run in different processes. Application 1 performs inter-process communication based on Binder (proxy1), service collaboration module 1 performs inter-process communication based on Binder (proxy1'), service collaboration module 2 performs inter-process communication based on Binder (proxy2), and application 2 performs inter-process communication based on Binder (proxy2').
[0004] Among them, proxy1, proxy1', proxy2, and proxy2' are all Binder proxy objects (BpBinder, BinderProxy Binder), proxy1 references binder_ref1, proxy1' references binder_ref1', proxy2 references binder_ref2, and proxy2' references binder_ref2', binder_ref1, binder_ref1', binder_ref2, and binder_ref2' are all Binder reference objects (Binder_ref, Binder_Reference), binder_ref1 and binder_ref1' reference binder_node1, binder_ref2 and binder_ref2' reference binder_node2, binder_node1 is the Binder entity object of the service corresponding to application 1, and binder_node2 is the Binder entity object (binder_node) of the service corresponding to service collaboration module 2.
[0005] binder_ref1, binder_ref1' and binder_node1 are located in the Binder driver in the client, and binder_ref2, binder_ref2' and binder_node2 are located in the Binder driver in the server.
[0006] However, in the above scenario, if the application stops working, the system can release the Binder corresponding to the application based on the lifecycle mechanism. However, the current system cannot automatically clean up the Binder of the service collaboration module that is only used in the cross-end interaction scenario, resulting in the inability to release the Binder resources. Summary of the invention
[0007] In view of this, the present application provides a Binder management system, method, client, and server to manage Binder, complete Binder cleanup, and release Binder resources.
[0008] In a first aspect, an embodiment of the present application provides a Binder management system, the system comprising a client and a server, the client running a first application and a first service collaboration module, the server running a second application and a second service collaboration module, the client and the server working together through the first service collaboration module and the second service collaboration module, the first service collaboration module including a first Binder management unit, the second service collaboration module including a second Binder management unit;
[0009] The first application sends a first Binder proxy object of the first application to the first Binder management unit;
[0010] The first Binder management unit obtains a second Binder proxy object that references the same Binder entity object as the first Binder proxy object, and allocates a Binder identifier to the second Binder proxy object;
[0011] The first Binder management unit sends the Binder identifier to the second Binder management unit;
[0012] The second Binder management unit creates a third Binder proxy object after receiving the Binder identifier, and records the association relationship between the third Binder proxy object and the Binder identifier;
[0013] The second Binder management unit sends the third Binder proxy object to the second application;
[0014] The second application obtains a fourth Binder proxy object that references the same Binder entity object as the third Binder proxy object;
[0015] After the second Binder management unit determines that the fourth Binder proxy object is released, it releases the third Binder proxy object, determines the Binder identifier corresponding to the third Binder proxy object according to the recorded association relationship, and sends a Binder release instruction carrying the Binder identifier to the first Binder management unit;
[0016] The first Binder management unit releases the Binder proxy object indicated by the Binder identifier in response to the Binder release instruction.
[0017] From the above, it can be seen that after the fourth Binder proxy object of the second application in the server side is released in the solution provided by the embodiment of the present application, the second Binder management unit can not only release the third Binder proxy object in the server side, but also release another electronic device across the end, that is, the second Binder proxy object in the client, thereby realizing the release of the Binder of the service collaboration module.
[0018] In one embodiment of the present application, the second Binder management unit is further used to:
[0019] After each sending of the third Binder proxy object to a second application, adding 1 to the count value currently corresponding to the third Binder proxy object;
[0020] After the second Binder management unit determines that the fourth Binder proxy object is released, releasing the third Binder proxy object includes:
[0021] After the second Binder management unit determines that a fourth Binder proxy object of a second application is released, it subtracts 1 from the count value currently corresponding to the third Binder proxy object; after determining that the count value corresponding to the third Binder proxy object drops to 0, the third Binder proxy object is released.
[0022] From the above, it can be seen that the solution provided in the embodiment of the present application uses a count value to count the number of fourth Binder proxy objects associated with the third Binder proxy object. The third Binder proxy object will be released only after the count value corresponding to the third Binder proxy object drops to 0, that is, all fourth Binder proxy objects related to the third Binder proxy object are released. This can prevent the third Binder proxy object from being released prematurely and affecting the normal execution of cross-end interaction work.
[0023] In a second aspect, an embodiment of the present application provides a Binder management method, which is applied to a client, wherein a first application and a first service collaboration module are run in the client, and the first service collaboration module includes a first Binder management unit. The method includes:
[0024] The first application sends a first Binder proxy object of the first application to the first Binder management unit;
[0025] The first Binder management unit obtains a second Binder proxy object that references the same Binder entity object as the first Binder proxy object, and allocates a Binder identifier to the second Binder proxy object;
[0026] The first Binder management unit sends the Binder identifier to the second Binder management unit of the server, so that the second Binder management unit creates a third Binder proxy object, records the association relationship between the third Binder proxy object and the Binder identifier, and sends the third Binder proxy object to the second application, so that the second application obtains a fourth Binder proxy object that references the same Binder entity object as the third Binder proxy object. The second application and the second service collaboration module are run in the server, the second Binder management unit is included in the second service collaboration module, and the client and the server work in collaboration with the second service collaboration module through the first service collaboration module;
[0027] Receive a Binder release instruction sent by the second Binder management unit, where the Binder release instruction is sent after the second Binder management unit determines that the fourth Binder proxy object is released and releases the third Binder proxy object, and the Binder release instruction carries a Binder identifier corresponding to the third Binder proxy object;
[0028] The first Binder management unit releases the Binder proxy object indicated by the Binder identifier in response to the Binder release instruction.
[0029] From the above, it can be seen that after the fourth Binder proxy object of the second application in the server side is released in the solution provided by the embodiment of the present application, the second Binder management unit can not only release the third Binder proxy object in the server side, but also release another electronic device across the end, that is, the second Binder proxy object in the client, thereby realizing the release of the Binder of the service collaboration module.
[0030] In one embodiment of the present application, the Binder release instruction is sent by the second Binder management unit after releasing the third Binder proxy object when the count value corresponding to the third Binder proxy object drops to 0;
[0031] The count value corresponding to the third Binder proxy object is updated by the second Binder management unit in the following manner: after the second Binder management unit sends the third Binder proxy object to a second application, the count value currently corresponding to the third Binder proxy object is added by 1; after the second Binder management unit determines that the fourth Binder proxy object of a second application is released, the count value currently corresponding to the third Binder proxy object is subtracted by 1.
[0032] From the above, it can be seen that the solution provided in the embodiment of the present application uses a count value to count the number of fourth Binder proxy objects associated with the third Binder proxy object. The third Binder proxy object will be released only after the count value corresponding to the third Binder proxy object drops to 0, that is, all fourth Binder proxy objects related to the third Binder proxy object are released. This can prevent the third Binder proxy object from being released prematurely and affecting the normal execution of cross-end interaction work.
[0033] In a third aspect, an embodiment of the present application provides a Binder management method, which is applied to a server, wherein a second application and a second service collaboration module are run in the server, and the second service collaboration module includes a second Binder management unit. The method includes:
[0034] The second Binder management unit receives a Binder identifier sent by a first Binder management unit in a client, wherein a first application is run in the client to the first service collaboration module, the first service collaboration module includes the first Binder management unit, the Binder identifier is allocated by the first Binder management unit to the second Binder proxy object, the second Binder proxy object is obtained by the first Binder management unit after receiving the first Binder proxy object sent by the first application, and references the same Binder entity object as the first Binder proxy object;
[0035] The second Binder management unit creates a third Binder proxy object after receiving the Binder identifier, and records the association relationship between the third Binder proxy object and the Binder identifier;
[0036] The second Binder management unit sends the third Binder proxy object to the second application;
[0037] The second application obtains a fourth Binder proxy object that references the same Binder entity object as the third Binder proxy object;
[0038] After the second Binder management unit determines that the fourth Binder proxy object is released, it releases the third Binder proxy object, determines the Binder identifier corresponding to the third Binder proxy object according to the recorded association relationship, and sends a Binder release instruction carrying the Binder identifier to the first Binder management unit, so that the first Binder management unit releases the Binder proxy object indicated by the Binder identifier in response to the Binder release instruction.
[0039] From the above, it can be seen that after the fourth Binder proxy object of the second application in the server side is released in the solution provided by the embodiment of the present application, the second Binder management unit can not only release the third Binder proxy object in the server side, but also release another electronic device across the end, that is, the second Binder proxy object in the client, thereby realizing the release of the Binder of the service collaboration module.
[0040] In one embodiment of the present application, the method further includes:
[0041] After the second Binder management unit sends the third Binder proxy object to a second application, the count value currently corresponding to the third Binder proxy object is increased by 1;
[0042] After the second Binder management unit determines that the fourth Binder proxy object is released, releasing the third Binder proxy object includes:
[0043] After the second Binder management unit determines that a fourth Binder proxy object of a second application is released, it subtracts 1 from the count value currently corresponding to the third Binder proxy object; after determining that the count value corresponding to the third Binder proxy object drops to 0, the third Binder proxy object is released.
[0044] From the above, it can be seen that the solution provided in the embodiment of the present application uses a count value to count the number of fourth Binder proxy objects associated with the third Binder proxy object. The third Binder proxy object will be released only after the count value corresponding to the third Binder proxy object drops to 0, that is, all fourth Binder proxy objects related to the third Binder proxy object are released. This can prevent the third Binder proxy object from being released prematurely and affecting the normal execution of cross-end interaction work.
[0045] In a fourth aspect, an embodiment of the present application provides a client, comprising a memory for storing computer program instructions and a processor for executing program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute the method described in the second aspect.
[0046] In a fifth aspect, an embodiment of the present application provides a server, comprising a memory for storing computer program instructions and a processor for executing program instructions, wherein, when the computer program instructions are executed by the processor, the electronic device is triggered to execute any one of the methods described in the third aspect.
[0047] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute the method described in the second aspect or the third aspect.
[0048] Beneficial effects of the embodiments of the present application:
[0049] An embodiment of the present application provides a Binder management system, the system includes a client and a server, the client runs a first application and a first service collaboration module, the server runs a second application and a second service collaboration module, the client and the server can work together through the first service collaboration module and the second service collaboration module, in the process of collaborative work, the first application and the second service collaboration module in the client, the second application and the second service collaboration module in the server all have corresponding Binder proxy objects, and each Binder proxy object is used together to complete the collaborative work process. Therefore, after the fourth Binder proxy object corresponding to the second application is released, the collaborative work stops, and the Binder proxy object corresponding to the above-mentioned service collaboration module is no longer needed. Therefore, the second Binder management unit can first release the third Binder proxy object that is in the server with the second application, and send a Binder release instruction to the first Binder management unit to instruct the first Binder management unit to release the second Binder proxy object whose Binder identifier is associated with the third Binder proxy object. From the above, it can be seen that after the fourth Binder proxy object of the second application in the server side is released in the solution provided by the embodiment of the present application, the second Binder management unit can not only release the third Binder proxy object in the server side, but also release another electronic device across the end, that is, the second Binder proxy object in the client, thereby realizing the release of the Binder of the service collaboration module. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 A schematic diagram of a cross-terminal interaction scenario provided in an embodiment of the present application;
[0051] Figure 2 A schematic diagram of the structure of a client provided in an embodiment of the present application;
[0052] Figure 3 A schematic diagram of the structure of a server provided in an embodiment of the present application;
[0053] Figure 4 A schematic diagram of the software architecture of a Binder management system provided in an embodiment of the present application;
[0054] Figure 5 A schematic diagram of an application scenario provided for an embodiment of the present application;
[0055] Figure 6 A schematic diagram of the first Binder management process provided in the embodiment of the present application;
[0056] Figure 7 A schematic diagram of the second Binder management process provided in the embodiment of the present application;
[0057] Figure 8 A schematic diagram of an application scenario in the related technology;
[0058] Fig. 9 A flowchart of a Binder management method applied to a client provided in an embodiment of the present application;
[0059] Fig.10 A flow chart of a Binder management method applied to a server provided in an embodiment of the present application.
[0060] Specific implementation method
[0061] In order to better understand the technical solution of the present application, the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0062] In order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first" and "second" are used to distinguish the same items or similar items with substantially the same functions and effects. For example, the first instruction and the second instruction are to distinguish different user instructions, and their order is not limited. Those skilled in the art can understand that the words "first" and "second" do not limit the quantity and execution order, and the words "first" and "second" do not necessarily limit them to be different.
[0063] It should be noted that, in this application, words such as "exemplarily" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplarily" or "for example" in this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.
[0064] The client and the server in the embodiments of the present application can be tablet computers, personal computers (PCs), personal digital assistants (PDAs), smart watches, netbooks, wearable electronic devices, augmented reality (AR) devices, virtual reality (VR) devices, vehicle-mounted devices, smart cars, robots, smart glasses, smart TVs and other electronic devices.
[0065] like Figure 2 As shown, Figure 2 A schematic diagram of a client provided in an embodiment of the present application, Figure 2 The client shown may include a processor 210, external memory interfaces 1-N220, an internal memory 221, a Universal Serial Bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, a button 290, a motor 291, an indicator 292, cameras 1-N293, a display screen 1-N294, and a Subscriber Identity Module (SIM) card interface 1-N 295, etc. Among them, the sensor module 280 may include a pressure sensor 280A, a touch sensor 280B, etc.
[0066] It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the client. In other embodiments of the present application, the client may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0067] The processor 210 may include one or more processing units, for example, the processor 210 may include an application processor (AP), a modem, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0068] The processor 210 can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0069] The processor 210 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. The memory may store instructions or data that the processor 210 has just used or cyclically used. If the processor 210 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 210, and thus improves the efficiency of the system.
[0070] In some embodiments, the processor 210 may include one or more interfaces. The interface may include an Inter-Integrated Circuit (I2C) interface, an Inter-Integrated Circuit Sound (I2S) interface, a Pulse Code Modulation (PCM) interface, a Universal Asynchronous Receiver / Transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a General-Purpose Input / Output (GPIO) interface, and a Subscriber Identity Module (SIM) interface.
[0071] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 210 may include multiple groups of I2C buses. The processor 210 may be coupled to the touch sensor 280B, the charger, the flash, the camera 293, etc. through different I2C bus interfaces. For example: the processor 210 may be coupled to the touch sensor 280B through the I2C interface, so that the processor 210 communicates with the touch sensor 280B through the I2C bus interface to realize the touch function of the client.
[0072] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 210 and the wireless communication module 260. For example, the processor 210 communicates with the Bluetooth module in the wireless communication module 260 through the UART interface to implement the Bluetooth function.
[0073] The MIPI interface can be used to connect the processor 210 with peripheral devices such as the display screen 294 and the camera 293. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some embodiments, the processor 210 and the camera 293 communicate via the CSI interface to implement the shooting function of the client. The processor 210 and the display screen 294 communicate via the DSI interface to implement the display function of the client.
[0074] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the client. In other embodiments of the present application, the client may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0075] The wireless communication function of the client can be implemented through antenna 1, antenna 2, mobile communication module 250, wireless communication module 260, modem processor and baseband processor.
[0076] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the client can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0077] The mobile communication module 250 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied on the client. In some embodiments, the mobile communication module 250 can be used to transmit call data between two electronic devices. For example, when acting as a called device, the downlink audio stream data from the calling device can be obtained, and the uplink audio stream data can be transmitted to the calling device.
[0078] The wireless communication module 260 can provide wireless communication solutions including WLAN (Wireless Local Area Networks), BT (Bluetooth), GNSS (Global Navigation Satellite System), FM (Frequency Modulation), NFC (Near Field Communication), IR (infrared), etc. applied on the client.
[0079] In some embodiments, the antenna 1 of the client is coupled to the mobile communication module 250, and the antenna 2 is coupled to the wireless communication module 260, so that the client can communicate with the network and other devices through wireless communication technology. In one embodiment of the present application, the client can achieve local area network connection with another electronic device through the wireless communication module 260. Wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division-Synchronous Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the Beidou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or the Satellite Based Augmentation System (SBAS), etc.
[0080] The display screen 294 is used to display images, videos, etc. The display screen 294 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light-emitting diode or an active matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), MiniLED, MicroLED, Micro-OLED, and a quantum dot light-emitting diode (QLED). In some embodiments, the client may include 1 or N display screens 294, where N is a positive integer greater than 1.
[0081] The external memory interface 220 can be used to connect an external memory card, such as a Micro Secure Digital Memory (SD) card, to expand the storage capacity of the client. The external memory card communicates with the processor 210 through the external memory interface 220 to implement a data storage function. For example, files such as music, video, and recording files are stored in the external memory card.
[0082] The internal memory 221 can be used to store computer executable program codes, and the executable program codes include instructions. The internal memory 221 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, and at least one application required for a function (such as a sound playback function, an image playback function, and a recording function, etc.). The data storage area may store data created during the use of the client (such as uplink audio data, downlink audio data, and a phone book, etc.). In addition, the internal memory 221 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash memory (Universal FlashStorage, UFS), etc. The processor 210 executes various functional applications and data processing of the client by running instructions stored in the internal memory 221 and / or instructions stored in a memory provided in the processor 210.
[0083] The pressure sensor 280A is used to sense the pressure signal and convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 280A can be set on the display screen 294. In some embodiments, when the user clicks and presses the answer key on the display screen 294, the manual answering function can be realized, and when the user clicks and presses the hang-up key on the display screen 294, the manual hang-up function can be realized.
[0084] The touch sensor 280B is also called a "touch device". The touch sensor 280B can be set on the display screen 294, and the touch sensor 280B and the display screen 294 form a touch screen, also called a "touch screen". The touch sensor 280B is used to detect touch operations acting on or near it. The touch sensor 280B can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 294. In other embodiments, the touch sensor 280B can also be set on the surface of the client, which is different from the position of the display screen 294.
[0085] The key 290 includes a power button, a volume button, etc. The key 290 can be a mechanical key or a touch key. The client can receive the key input and generate a key signal input related to the user settings and function control of the client.
[0086] Motor 291 can generate vibration prompts. Motor 291 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 294, motor 291 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0087] The SIM card interface 295 is used to connect the SIM card. The SIM card can be connected to and separated from the client by inserting it into the SIM card interface 295 or pulling it out from the SIM card interface 295. The client can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 295 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 295 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 295 can also be compatible with different types of SIM cards. The SIM card interface 295 can also be compatible with external memory cards. The client interacts with the network through the SIM card to realize functions such as calls and data communications. In some embodiments, the client uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the client and cannot be separated from the client.
[0088] like Figure 3 As shown, Figure 3 A schematic diagram of a server provided in an embodiment of the present application, Figure 3 The server shown may include a processor 310, an external memory interface 1'-N'320, an internal memory 321, a Universal Serial Bus (USB) interface 330, a charging management module 340, a power management module 341, a battery 342, an antenna 1', an antenna 2', a mobile communication module 350, a wireless communication module 360, a button 390, a motor 391, an indicator 392, a camera 1'-N'393, a display screen 1'-N'394, and a Subscriber Identity Module (SIM) card interface 1'-N'395, etc. Among them, the sensor module 380 may include a pressure sensor 380A, a touch sensor 380B, etc.
[0089] It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the server. In other embodiments of the present application, the server may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0090] The processor 310 may include one or more processing units, for example, the processor 310 may include an application processor (AP), a modem, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0091] The processor 310 can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0092] The processor 310 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 310 is a cache memory. The memory may store instructions or data that the processor 310 has just used or cyclically used. If the processor 310 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 310, and thus improves the efficiency of the system.
[0093] In some embodiments, the processor 310 may include one or more interfaces. The interface may include an Inter-Integrated Circuit (I2C) interface, an Inter-Integrated Circuit Sound (I2S) interface, a Pulse Code Modulation (PCM) interface, a Universal Asynchronous Receiver / Transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a General-Purpose Input / Output (GPIO) interface, and a Subscriber Identity Module (SIM) interface.
[0094] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 310 may include multiple groups of I2C buses. The processor 310 may be coupled to the touch sensor 380B, the charger, the flash, the camera 393, etc. through different I2C bus interfaces. For example: the processor 310 may be coupled to the touch sensor 380B through the I2C interface, so that the processor 310 communicates with the touch sensor 380B through the I2C bus interface to realize the touch function of the server.
[0095] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 310 and the wireless communication module 360. For example, the processor 310 communicates with the Bluetooth module in the wireless communication module 360 through the UART interface to implement the Bluetooth function.
[0096] The MIPI interface can be used to connect the processor 310 with peripheral devices such as the display screen 394 and the camera 393. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some embodiments, the processor 310 and the camera 393 communicate via the CSI interface to implement the shooting function of the server. The processor 310 and the display screen 394 communicate via the DSI interface to implement the display function of the server.
[0097] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the server. In other embodiments of the present application, the server may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0098] The wireless communication function of the server can be realized by antenna 1', antenna 2', mobile communication module 350, wireless communication module 360, modem processor and baseband processor.
[0099] Antenna 1' and antenna 2' are used to transmit and receive electromagnetic wave signals. Each antenna in the server can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1' can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0100] The mobile communication module 350 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied on the server side. In some embodiments, the mobile communication module 350 can be used to transmit call data between two electronic devices. For example, when acting as a called device, the downlink audio stream data from the calling device can be obtained, and the uplink audio stream data can be transmitted to the calling device.
[0101] The wireless communication module 360 can provide wireless communication solutions including WLAN (Wireless Local Area Networks), BT (Bluetooth), GNSS (Global Navigation Satellite System), FM (Frequency Modulation), NFC (Near Field Communication), IR (infrared), etc. applied on the server side.
[0102] In some embodiments, the antenna 1' of the server is coupled to the mobile communication module 350, and the antenna 2' is coupled to the wireless communication module 360, so that the server can communicate with the network and other devices through wireless communication technology. In one embodiment of the present application, the server can achieve local area network connection with another electronic device through the wireless communication module 360. Wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division-Synchronous Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the Beidou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or the Satellite Based Augmentation System (SBAS), etc.
[0103] The display screen 394 is used to display images, videos, etc. The display screen 394 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light-emitting diode or an active matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), MiniLED, MicroLED, Micro-OLED, and a quantum dot light-emitting diode (QLED). In some embodiments, the server may include 1 or N' display screens 394, where N' is a positive integer greater than 1.
[0104] The external memory interface 320 can be used to connect an external memory card, such as a Micro Secure Digital Memory (SD) card, to expand the storage capacity of the server. The external memory card communicates with the processor 310 through the external memory interface 320 to implement a data storage function. For example, files such as music, video, and recording files can be stored in the external memory card.
[0105] The internal memory 321 can be used to store computer executable program codes, and the executable program codes include instructions. The internal memory 321 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, and at least one application required for a function (such as a sound playback function, an image playback function, and a recording function, etc.). The data storage area may store data created during the use of the service client (such as uplink audio data, downlink audio data, and a phone book, etc.). In addition, the internal memory 321 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash memory (Universal Flash Storage, UFS), etc. The processor 310 executes various functional applications and data processing of the server by running instructions stored in the internal memory 321 and / or instructions stored in a memory provided in the processor 310.
[0106] The pressure sensor 380A is used to sense the pressure signal and convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 380A can be set on the display screen 394. In some embodiments, when the user clicks and presses the answer key on the display screen 394, the manual answering function can be realized, and when the user clicks and presses the hang-up key on the display screen 394, the manual hang-up function can be realized.
[0107] The touch sensor 380B is also called a "touch device". The touch sensor 380B can be set on the display screen 394, and the touch sensor 380B and the display screen 394 form a touch screen, also called a "touch screen". The touch sensor 1080B is used to detect touch operations acting on or near it. The touch sensor 380B can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 394. In other embodiments, the touch sensor 380B can also be set on the surface of the server, which is different from the position of the display screen 394.
[0108] The key 390 includes a power button, a volume button, etc. The key 390 can be a mechanical key or a touch key. The server can receive the key input and generate key signal input related to the user settings and function control of the server.
[0109] Motor 391 can generate vibration prompts. Motor 391 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 394, motor 391 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0110] The SIM card interface 395 is used to connect the SIM card. The SIM card can be connected and separated with the server by inserting it into the SIM card interface 395 or pulling it out from the SIM card interface 395. The server can support 1 or N' SIM card interfaces, where N' is a positive integer greater than 1. The SIM card interface 395 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 395 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 395 can also be compatible with different types of SIM cards. The SIM card interface 395 can also be compatible with external memory cards. The server interacts with the network through the SIM card to realize functions such as calls and data communications. In some embodiments, the server uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the server and cannot be separated from the server.
[0111] In order to solve the problem that Binder resources cannot be released in the related art, an embodiment of the present application provides a Binder management system.
[0112] The above-mentioned Binder management system includes a client and a server. The first application and the first service collaboration module are run in the above-mentioned client, and the second application and the second service collaboration module are run in the above-mentioned server. The above-mentioned client and the above-mentioned server work in collaboration through the above-mentioned first service collaboration module and the above-mentioned second service collaboration module. The above-mentioned first service collaboration module includes a first Binder management unit, and the above-mentioned second service collaboration module includes a second Binder management unit.
[0113] See also Figure 4 , which is a software architecture diagram of a Binder management system provided in an embodiment of the present application, and includes software modules in the client and software modules in the server. As can be seen from the figure, the client includes a first application and a first service collaboration module, the server includes a second application and a second service collaboration module, the first service collaboration module includes a first Binder management unit, and the second service collaboration module includes a second Binder management unit. The first application and the second application belong to the application layer, the first service collaboration module and the second service collaboration module belong to the service collaboration layer, and the figure also includes a driver layer, which includes a Binder driver, which includes a Binder reference object and a Binder entity object.
[0114] Corresponds to Figure 1 In the application scenario shown, the client is electronic device 1, the first application is application 1, the first service collaboration module is service collaboration module 1, the server is electronic device 2, the second application is application 2, and the second service collaboration module is service collaboration module 2.
[0115] See also Figure 5 , is a schematic diagram of an application scenario provided in an embodiment of the present application, in Figure 5 In the application scenario shown, the client is a PC or a tablet computer, the first application is a note-taking application, the server is a mobile phone, and the second application is a camera application. The note-taking application sends a request to shoot the blackboard to the second service collaboration module through the first service collaboration module. After the second service collaboration module instructs the camera application to shoot the blackboard, the blackboard image is written into the note document corresponding to the note application, thereby realizing cross-end image data collection and recording.
[0116] In addition, the first Binder management unit and the second Binder management unit are both composed of a BinderManager (Binder management) subunit and a Binder proxy subunit. The BinderManager subunit is used to implement data processing within the Binder management unit, and the Binder proxy subunit is used to interact with the application for data.
[0117] This application scenario is only one application scenario applicable to the above-mentioned Binder management system, and this application does not limit the specific application scenario.
[0118] See also Figure 6 , which is a schematic diagram of the first Binder management process provided in an embodiment of the present application, may include the following steps: S601-S612.
[0119] S601: The first application sends a first Binder proxy object of the first application to the first Binder management unit.
[0120] Corresponds to Figure 1 In the application scenario shown, the first Binder proxy object is proxy1.
[0121] The first Binder proxy object is created by a Client process in the user space of the client.
[0122] S602: The first Binder management unit obtains a second Binder proxy object that references the same Binder entity object as the first Binder proxy object.
[0123] Corresponds to Figure 1 In the application scenario shown, the second Binder proxy object is proxy1'.
[0124] After the second Binder proxy object is created by the Client process in the user space of the client, the first Binder management unit can obtain the second Binder proxy object.
[0125] Specifically, the way in which the Client process creates a Binder proxy object is a related technology and will not be described in detail in the embodiments of the present application.
[0126] The second Binder proxy object is derived from the first Binder proxy object. The two refer to different Binder reference objects, corresponding to Figure 1 In the application scenario shown, proxy1 references binder_ref1, proxy1' references binder_ref1', and the two Binder reference objects referenced by both reference the same Binder entity object, corresponding to Figure 1 In the application scenario shown, binder_ref1 and binder_ref1' reference binder_node1.
[0127] The Binder entity object corresponds to the service provided by the first application. In addition, the Binder entity object references a Binder local object, which is created by a Server process in the client user space.
[0128] S603: The first Binder management unit allocates a Binder identifier to the second Binder proxy object.
[0129] The above-mentioned Binder identifier can be represented in the form of numbers, characters, strings, etc. It should be noted that there may be multiple applications running in the client, and each application may send a Binder proxy object to the first Binder management unit. The first Binder management unit obtains different second Binder proxy objects in response to different Binder proxy objects, and assigns different Binder identifiers to different second Binder proxy objects.
[0130] In one embodiment of the present application, multiple different Binder identifiers may be pre-recorded in the first Binder management unit. Whenever a Binder proxy object is obtained, a Binder identifier that is not assigned to other Binder proxy objects is selected from the pre-recorded Binder identifiers and assigned to the second Binder proxy object.
[0131] In another embodiment of the present application, the first Binder management unit may also generate a new Binder identifier different from the Binder identifiers of other Binder proxy objects after acquiring the second Binder proxy object, and assign the generated Binder identifier to the second Binder proxy object.
[0132] S604: The first Binder management unit sends the Binder identifier to the second Binder management unit.
[0133] S605: The second Binder management unit creates a third Binder proxy object after receiving the Binder identifier.
[0134] The second Binder management unit receives the Binder identifier and determines that the client has a need for cross-end interactive work, and then creates a third Binder proxy object to perform inter-process communication within the server to complete the cross-end interactive work.
[0135] The third Binder proxy object is generated by the second Binder management unit after receiving the second Binder proxy object. Both of them are used to realize cross-end interactive work. It can be considered that there is an association relationship between the third Binder proxy object and the second Binder proxy object.
[0136] Specifically, the method of constructing the third Binder proxy object is a related technology, and the embodiment of the present application will not be described in detail.
[0137] S606: The second Binder management unit records the association relationship between the third Binder proxy object and the Binder identifier.
[0138] In one embodiment of the present application, the association relationship between the third Binder proxy object and the Binder identifier can be recorded in a table. The table contains two columns, one column records the identifier of the third Binder proxy object constructed by the second Binder management unit, and the other column records the Binder identifier received by the second Binder management unit. There is an association relationship between the third Binder proxy object and the Binder identifier in the same row.
[0139] In another embodiment of the present application, other methods may be used to record the association relationship between the third Binder proxy object and the Binder identifier. For example, the Binder identifier with an associated relationship and the identifier of the third Binder proxy object are stored in the same storage space to indicate that there is an association relationship between the two.
[0140] In addition, corresponding to the above Figure 1 In the application scenario, the third Binder proxy object is proxy2 in the figure.
[0141] S607: The second Binder management unit sends the third Binder proxy object to the second application.
[0142] S608: The second application obtains a fourth Binder proxy object that references the same Binder entity object as the third Binder proxy object.
[0143] Specifically, the fourth Binder proxy object may be created by a Client process in the server. The manner in which a Client process creates a Binder proxy object is a related technology and will not be described in detail in the embodiments of the present application.
[0144] The third Binder proxy object and the fourth Binder proxy object are both Binder proxy objects used in the server to implement cross-end collaborative work. The fourth Binder proxy object is generated in response to the third Binder proxy object, and it can be considered that there is an association relationship between the two.
[0145] Corresponding to the above Figure 1 In the application scenario, the fourth Binder proxy object is proxy2' in the figure.
[0146] The fourth Binder proxy object is derived from the third Binder proxy object. The two refer to different Binder reference objects, corresponding to Figure 1 In the application scenario shown, proxy2 references binder_ref2, proxy2' references binder_ref2', and the two Binder reference objects referenced by both reference the same Binder entity object, corresponding to Figure 1 In the application scenario shown, binder_ref2 and binder_ref2' reference binder_node2.
[0147] The Binder entity object corresponds to the collaborative service provided by the first service collaborative module. In addition, the Binder entity object references a Binder local object, which is created by a Server process in the user space of the server.
[0148] S609: After determining that the fourth Binder proxy object is released, the second Binder management unit releases the third Binder proxy object.
[0149] Specifically, the fourth Binder proxy object may be released by the server operating system itself, and the second application may send information that the fourth Binder proxy object is released to the second Binder management unit to notify the second Binder management unit that the fourth Binder proxy object is released.
[0150] Alternatively, the second Binder management unit may monitor the state of the fourth Binder proxy object to determine whether the fourth Binder proxy object is released.
[0151] As shown above, the third Binder proxy object and the fourth Binder proxy object are associated with each other. After the fourth Binder proxy object is released, the third Binder proxy object related thereto does not need to be used anymore, so the third Binder proxy object can be released accordingly.
[0152] S610: The second Binder management unit determines a Binder identifier corresponding to the third Binder proxy object according to the recorded association relationship.
[0153] Specifically, the association relationship related to the third Binder proxy object can be found from each group of association relationships recorded by the second Binder management unit. The Binder identifier recorded in the association relationship is the Binder identifier corresponding to the third Binder proxy object.
[0154] S611: The second Binder management unit sends a Binder release instruction carrying the Binder identifier to the first Binder management unit.
[0155] Among them, the above-mentioned third Binder proxy object is created by the server in response to the second Binder proxy object sent by the client. The third Binder proxy object is associated with the second Binder proxy object, and both are used to realize cross-end collaborative work between the client and the server. The release of the third Binder proxy object means the end of the cross-end collaborative work. Therefore, the second Binder management unit can send a Binder release instruction to the first Binder management unit, instructing the release of the second Binder proxy object corresponding to the carried Binder identifier.
[0156] S612: The first Binder management unit releases the Binder proxy object indicated by the Binder identifier in response to the Binder release instruction.
[0157] An embodiment of the present application provides a Binder management system, the system includes a client and a server, the client runs a first application and a first service collaboration module, the server runs a second application and a second service collaboration module, the client and the server can work together through the first service collaboration module and the second service collaboration module, in the process of collaborative work, the first application and the second service collaboration module in the client, the second application and the second service collaboration module in the server all have corresponding Binder proxy objects, and each Binder proxy object is used together to complete the collaborative work process. Therefore, after the fourth Binder proxy object corresponding to the second application is released, the collaborative work stops, and the Binder proxy object corresponding to the above-mentioned service collaboration module is no longer needed. Therefore, the second Binder management unit can first release the third Binder proxy object that is in the server with the second application, and send a Binder release instruction to the first Binder management unit to instruct the first Binder management unit to release the second Binder proxy object whose Binder identifier is associated with the third Binder proxy object. From the above, it can be seen that after the fourth Binder proxy object of the second application in the server side is released in the solution provided by the embodiment of the present application, the second Binder management unit can not only release the third Binder proxy object in the server side, but also release another electronic device across the end, that is, the second Binder proxy object in the client, thereby realizing the release of the Binder of the service collaboration module.
[0158] It should be noted that the embodiment of the present application does not limit the release method of the first Binder proxy object of the first application. The first Binder proxy object can be released by using the Binder proxy object release method provided by the operating system configured by the client in the related technology, or the first Binder proxy object can be released after the second Binder proxy object is released.
[0159] In addition, the second Binder proxy object and the third Binder proxy object in the related technology cannot be released, which will further cause the Binder reference object, Binder entity object, and Binder local object referenced by the second Binder proxy object to be unable to be released, and the Binder reference object, Binder entity object, and Binder local object referenced by the third Binder proxy object cannot be released. However, the solution provided in the embodiment of the present application can release the second Binder proxy object and the third Binder proxy object, so each Binder object referenced by the second Binder proxy object and the third Binder proxy object can also be released. Specifically, the way the client releases the Binder object referenced by the second Binder proxy object and the way the server releases the Binder object referenced by the third Binder proxy object can be referred to the related technology, and this embodiment does not limit this.
[0160] See also Figure 7 , which is a schematic diagram of the second Binder management process provided in the embodiment of the present application, and is similar to the aforementioned Figure 6 Compared with the embodiment shown, the method further includes the following step S613.
[0161] S613: After sending the third Binder proxy object to a second application each time, the second Binder management unit adds 1 to the count value currently corresponding to the third Binder proxy object.
[0162] Specifically, the above-mentioned server may include multiple second applications that all participate in cross-end interaction work. In this case, the second Binder management unit needs to send a third Binder proxy object to each of the multiple second applications. After receiving the third Binder proxy object, each second application obtains its corresponding fourth Binder proxy object.
[0163] In addition, the second Binder management unit creates a counter for the third Binder proxy object, which is used to record the number of third Binder proxy objects sent by the second Binder management unit to the second application. Each time the third Binder proxy object is sent, a second application obtains a fourth Binder proxy object associated with the third Binder proxy object. That is, the count value can identify the number of fourth Binder proxy objects currently associated with the third Binder proxy object.
[0164] In addition, the above step S609 can be implemented by the following steps S609A-S609B.
[0165] S609A: After the second Binder management unit determines that a fourth Binder proxy object of the second application is released, it subtracts 1 from the count value currently corresponding to the third Binder proxy object.
[0166] From the previous description, it can be seen that the count value corresponding to the third Binder proxy object can identify the number of fourth Binder proxy objects associated with the third Binder proxy object. Therefore, each time it is determined that the fourth Binder proxy object of a second application is released, the count value currently corresponding to the third Binder proxy object needs to change accordingly, that is, subtract 1 from the current corresponding count value.
[0167] S609B: After determining that the count value corresponding to the third Binder proxy object drops to 0, the second Binder management unit releases the third Binder proxy object.
[0168] Specifically, the count value dropping to 0 indicates that all fourth Binder proxy objects originally associated with the third Binder proxy object are released. In this case, the third Binder proxy object can be released.
[0169] From the above, it can be seen that the solution provided in the embodiment of the present application uses a count value to count the number of fourth Binder proxy objects associated with the third Binder proxy object. The third Binder proxy object will be released only after the count value corresponding to the third Binder proxy object drops to 0, that is, all fourth Binder proxy objects related to the third Binder proxy object are released. This can prevent the third Binder proxy object from being released prematurely and affecting the normal execution of cross-end interaction work.
[0170] In order to show the difference between the solution provided by the embodiment of the present application and the related art, see Figure 8 , which is a schematic diagram of an application scenario in the related technology.
[0171] This application scenario does not involve cross-end interaction. Application 1, Application 2, and Binder driver in the figure are located in the same electronic device. Application 1 transmits proxy1 to Application 2, Application 2 obtains proxy1', proxy1 references binder_ref1, proxy1' references binder_ref1', binder_ref1 and binder_ref1' reference binder_node1. The operating system configured in the electronic device can release proxy1 of Application 1 and proxy2 of Application 2 by itself.
[0172] Since the relevant technology itself does not involve cross-end interaction, there is no service collaboration module, and there is no Binder proxy object of the service collaboration module, and the operating system configured in the electronic device cannot release the Binder proxy object of the service collaboration module. However, the embodiment of the present application is suitable for the application scenario of cross-end interaction and can release the Binder proxy object of the service collaboration module.
[0173] Corresponding to the aforementioned Binder management system, the embodiment of the present application also provides a Binder management method applied to a client.
[0174] See also Fig. 9 , which is a flow chart of a Binder management method applied to a client provided in an embodiment of the present application, wherein a first application and a first service collaboration module are run in the client, wherein the first service collaboration module includes a first Binder management unit, and the method includes the following steps S901-S905.
[0175] S901: The first application sends a first Binder proxy object of the first application to the first Binder management unit.
[0176] S902: The first Binder management unit obtains a second Binder proxy object that references the same Binder entity object as the first Binder proxy object, and allocates a Binder identifier to the second Binder proxy object.
[0177] S903: The first Binder management unit sends the Binder identifier to the second Binder management unit on the server side, so that the second Binder management unit creates a third Binder proxy object, records the association relationship between the third Binder proxy object and the Binder identifier, and sends the third Binder proxy object to the second application, so that the second application obtains a fourth Binder proxy object that references the same Binder entity object as the third Binder proxy object.
[0178] The second application and the second service collaboration module are run in the server, the second Binder management unit is included in the second service collaboration module, and the client and the server collaborate with each other through the first service collaboration module and the second service collaboration module.
[0179] S904: receiving a Binder release instruction sent by the second Binder management unit, where the Binder release instruction is sent by the second Binder management unit after determining that the fourth Binder proxy object is released and releasing the third Binder proxy object.
[0180] The Binder release instruction carries the Binder identifier corresponding to the third Binder proxy object.
[0181] S905: The first Binder management unit releases the Binder proxy object indicated by the Binder identifier in response to the Binder release instruction.
[0182] An embodiment of the present application provides a Binder management system, the system includes a client and a server, the client runs a first application and a first service collaboration module, the server runs a second application and a second service collaboration module, the client and the server can work together through the first service collaboration module and the second service collaboration module, in the process of collaborative work, the first application and the second service collaboration module in the client, the second application and the second service collaboration module in the server all have corresponding Binder proxy objects, and each Binder proxy object is used together to complete the collaborative work process. Therefore, after the fourth Binder proxy object corresponding to the second application is released, the collaborative work stops, and the Binder proxy object corresponding to the above-mentioned service collaboration module is no longer needed. Therefore, the second Binder management unit can first release the third Binder proxy object that is in the server with the second application, and send a Binder release instruction to the first Binder management unit to instruct the first Binder management unit to release the second Binder proxy object whose Binder identifier is associated with the third Binder proxy object. From the above, it can be seen that after the fourth Binder proxy object of the second application in the server side is released in the solution provided by the embodiment of the present application, the second Binder management unit can not only release the third Binder proxy object in the server side, but also release another electronic device across the end, that is, the second Binder proxy object in the client, thereby realizing the release of the Binder of the service collaboration module.
[0183] In one embodiment of the present application, the Binder release instruction is sent by the second Binder management unit after releasing the third Binder proxy object when the count value corresponding to the third Binder proxy object drops to 0;
[0184] The count value corresponding to the third Binder proxy object is updated by the second Binder management unit in the following manner: after the second Binder management unit sends the third Binder proxy object to a second application, the count value currently corresponding to the third Binder proxy object is added by 1; after the second Binder management unit determines that the fourth Binder proxy object of a second application is released, the count value currently corresponding to the third Binder proxy object is subtracted by 1.
[0185] From the above, it can be seen that the solution provided in the embodiment of the present application uses a count value to count the number of fourth Binder proxy objects associated with the third Binder proxy object. Only when the count value corresponding to the third Binder proxy object drops to 0, that is, all fourth Binder proxy objects related to the third Binder proxy object are released, will the third Binder proxy object be released and a Binder release instruction be sent to the first Binder management unit. This can prevent the second Binder proxy object and the third Binder proxy object from being released in advance and affecting the normal execution of cross-end interaction work.
[0186] Corresponding to the aforementioned Binder management system, the embodiment of the present application also provides a Binder management method applied to the server.
[0187] See also Fig.10 , which is a flow chart of a Binder management method applied to a server provided in an embodiment of the present application, wherein a second application and a second service collaboration module are run in the server, wherein the second service collaboration module includes a second Binder management unit, and the method includes the following steps S1001-S1005.
[0188] S1001: The second Binder management unit receives a Binder identifier sent by the first Binder management unit in the client.
[0189] Among them, the first application is run in the above-mentioned client to the above-mentioned first service collaboration module, the above-mentioned first service collaboration module includes the above-mentioned first Binder management unit, the above-mentioned Binder identifier is allocated by the above-mentioned first Binder management unit to the second Binder proxy object, the above-mentioned second Binder proxy object is obtained by the above-mentioned first Binder management unit after receiving the first Binder proxy object sent by the above-mentioned first application, and references the same Binder entity object as the above-mentioned first Binder proxy object.
[0190] S1002: After receiving the Binder identifier, the second Binder management unit creates a third Binder proxy object and records the association relationship between the third Binder proxy object and the Binder identifier.
[0191] S1003: The second Binder management unit sends the third Binder proxy object to the second application.
[0192] S1004: The second application obtains a fourth Binder proxy object that references the same Binder entity object as the third Binder proxy object.
[0193] S1005: After the second Binder management unit determines that the fourth Binder proxy object is released, it releases the third Binder proxy object, determines the Binder identifier corresponding to the third Binder proxy object according to the recorded association relationship, and sends a Binder release instruction carrying the Binder identifier to the first Binder management unit, so that the first Binder management unit releases the Binder proxy object indicated by the Binder identifier in response to the Binder release instruction.
[0194] An embodiment of the present application provides a Binder management system, the system includes a client and a server, the client runs a first application and a first service collaboration module, the server runs a second application and a second service collaboration module, the client and the server can work together through the first service collaboration module and the second service collaboration module, in the process of collaborative work, the first application and the second service collaboration module in the client, the second application and the second service collaboration module in the server all have corresponding Binder proxy objects, and each Binder proxy object is used together to complete the collaborative work process. Therefore, after the fourth Binder proxy object corresponding to the second application is released, the collaborative work stops, and the Binder proxy object corresponding to the above-mentioned service collaboration module is no longer needed. Therefore, the second Binder management unit can first release the third Binder proxy object that is in the server with the second application, and send a Binder release instruction to the first Binder management unit to instruct the first Binder management unit to release the second Binder proxy object whose Binder identifier is associated with the third Binder proxy object. From the above, it can be seen that after the fourth Binder proxy object of the second application in the server side is released in the solution provided by the embodiment of the present application, the second Binder management unit can not only release the third Binder proxy object in the server side, but also release another electronic device across the end, that is, the second Binder proxy object in the client, thereby realizing the release of the Binder of the service collaboration module.
[0195] In one embodiment of the present application, the above method further includes:
[0196] Step A: After the second Binder management unit sends the third Binder proxy object to a second application, it adds 1 to the count value currently corresponding to the third Binder proxy object.
[0197] Furthermore, after the second Binder management unit determines that the fourth Binder proxy object is released through the following steps B-C, it releases the third Binder proxy object.
[0198] Step B: After the second Binder management unit determines that a fourth Binder proxy object of the second application is released, it subtracts 1 from the count value currently corresponding to the third Binder proxy object.
[0199] Step C: After determining that the count value corresponding to the third Binder proxy object drops to 0, the second Binder management unit releases the third Binder proxy object.
[0200] From the above, it can be seen that the solution provided in the embodiment of the present application uses a count value to count the number of fourth Binder proxy objects associated with the third Binder proxy object. The third Binder proxy object will be released only after the count value corresponding to the third Binder proxy object drops to 0, that is, all fourth Binder proxy objects related to the third Binder proxy object are released. This can prevent the third Binder proxy object from being released prematurely and affecting the normal execution of cross-end interaction work.
[0201] In a specific implementation, the present application also provides a computer storage medium, wherein the computer storage medium may store a program, wherein when the program is executed, the device where the computer readable storage medium is located is controlled to perform some or all of the steps in the above embodiment. The above storage medium may be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0202] In a specific implementation, an embodiment of the present application further provides a computer program product, which includes executable instructions. When the executable instructions are executed on a computer, the computer executes some or all of the steps in the above method embodiment.
[0203] The various embodiments of the mechanism disclosed in the present application can be implemented in hardware, software, firmware or a combination of these implementation methods. The embodiments of the present application can be implemented as a computer program or program code executed on a programmable system, which includes at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device and at least one output device.
[0204] Program code can be applied to input instructions to perform the functions described in this application and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.
[0205] Program code can be implemented with high-level programming language or object-oriented programming language to communicate with the processing system. When necessary, program code can also be implemented with assembly language or machine language. In fact, the mechanism described in this application is not limited to the scope of any specific programming language. In either case, the language can be a compiled language or an interpreted language.
[0206] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, instructions may be distributed over a network or by other computer-readable media. Therefore, machine-readable media may include any mechanism for storing or transmitting information in a machine (e.g., computer) readable form, including, but not limited to, floppy disks, optical disks, optical disks, compact disc read-only memories (Compact Disc Read Only Memory, CD-ROMs), magneto-optical disks, read-only memories (Read Only Memory, ROM), random access memories (RAM), erasable programmable read-only memories (Erasable Programmable Read Only Memory, EPROM), electrically erasable programmable read-only memories (Electrically Erasable Programmable Read Only Memory, EEPROM), magnetic cards or optical cards, flash memory, or a tangible machine-readable memory for transmitting information (e.g., carrier waves, infrared signal digital signals, etc.) using the Internet in electrical, optical, acoustic, or other forms of propagation signals. Accordingly, machine-readable media include any type of machine-readable media suitable for storing or transmitting electronic instructions or information in a form readable by a machine (eg, a computer).
[0207] In the accompanying drawings, some structural or method features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be required. Instead, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the accompanying drawings of the specification. In addition, the inclusion of structural or method features in a particular figure does not mean that such features are required in all embodiments, and in some embodiments, these features may not be included or may be combined with other features.
[0208] It should be noted that the units / modules mentioned in the various device embodiments of the present application are all logical units / modules. Physically, a logical unit / module can be a physical unit / module, or a part of a physical unit / module, or can be implemented as a combination of multiple physical units / modules. The physical implementation method of these logical units / modules themselves is not the most important. The combination of functions implemented by these logical units / modules is the key to solving the technical problems proposed by the present application. In addition, in order to highlight the innovative part of the present application, the above-mentioned device embodiments of the present application do not introduce units / modules that are not closely related to solving the technical problems proposed by the present application, which does not mean that there are no other units / modules in the above-mentioned device embodiments.
[0209] It should be noted that in the examples and description of this patent, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one" do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0210] Although the present application has been illustrated and described with reference to certain preferred embodiments thereof, it will be apparent to those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the present application.
Claims
1. A Binder management system, characterized in that: The system includes a client and a server, wherein a first application and a first service collaboration module are run in the client, and a second application and a second service collaboration module are run in the server, wherein the client and the server collaborate through the first service collaboration module and the second service collaboration module, wherein the first service collaboration module includes a first Binder management unit, and the second service collaboration module includes a second Binder management unit; The first application sends a first Binder proxy object of the first application to the first Binder management unit; The first Binder management unit obtains a second Binder proxy object that references the same Binder entity object as the first Binder proxy object, and allocates a Binder identifier to the second Binder proxy object; The first Binder management unit sends the Binder identifier to the second Binder management unit; The second Binder management unit creates a third Binder proxy object after receiving the Binder identifier, and records the association relationship between the third Binder proxy object and the Binder identifier; The second Binder management unit sends the third Binder proxy object to the second application; The second application obtains a fourth Binder proxy object that references the same Binder entity object as the third Binder proxy object; After the second Binder management unit determines that the fourth Binder proxy object is released, it releases the third Binder proxy object, determines the Binder identifier corresponding to the third Binder proxy object according to the recorded association relationship, and sends a Binder release instruction carrying the Binder identifier to the first Binder management unit; The first Binder management unit releases the Binder proxy object indicated by the Binder identifier in response to the Binder release instruction.
2. The system according to claim 1, characterized in that The second Binder management unit is further used for: After each sending of the third Binder proxy object to a second application, adding 1 to the count value currently corresponding to the third Binder proxy object; After the second Binder management unit determines that the fourth Binder proxy object is released, releasing the third Binder proxy object includes: After the second Binder management unit determines that a fourth Binder proxy object of a second application is released, it subtracts 1 from the count value currently corresponding to the third Binder proxy object; after determining that the count value corresponding to the third Binder proxy object drops to 0, the third Binder proxy object is released.
3. A Binder management method, characterized in that: Applied to a client, the client runs a first application and a first service collaboration module, the first service collaboration module includes a first Binder management unit, and the method includes: The first application sends a first Binder proxy object of the first application to the first Binder management unit; The first Binder management unit obtains a second Binder proxy object that references the same Binder entity object as the first Binder proxy object, and allocates a Binder identifier to the second Binder proxy object; The first Binder management unit sends the Binder identifier to the second Binder management unit of the server, so that the second Binder management unit creates a third Binder proxy object, records the association relationship between the third Binder proxy object and the Binder identifier, and sends the third Binder proxy object to the second application, so that the second application obtains a fourth Binder proxy object that references the same Binder entity object as the third Binder proxy object. The second application and the second service collaboration module are run in the server, the second Binder management unit is included in the second service collaboration module, and the client and the server work in collaboration with the second service collaboration module through the first service collaboration module; Receive a Binder release instruction sent by the second Binder management unit, where the Binder release instruction is sent after the second Binder management unit determines that the fourth Binder proxy object is released and releases the third Binder proxy object, and the Binder release instruction carries a Binder identifier corresponding to the third Binder proxy object; The first Binder management unit releases the Binder proxy object indicated by the Binder identifier in response to the Binder release instruction.
4. The method according to claim 3, characterized in that The Binder release instruction is sent by the second Binder management unit after releasing the third Binder proxy object when the count value corresponding to the third Binder proxy object drops to 0; The count value corresponding to the third Binder proxy object is updated by the second Binder management unit in the following manner: after the second Binder management unit sends the third Binder proxy object to a second application, the count value currently corresponding to the third Binder proxy object is added by 1; after the second Binder management unit determines that the fourth Binder proxy object of a second application is released, the count value currently corresponding to the third Binder proxy object is subtracted by 1.
5. A Binder management method, characterized in that: Applied to a server, the server runs a second application and a second service collaboration module, the second service collaboration module includes a second Binder management unit, and the method includes: The second Binder management unit receives a Binder identifier sent by a first Binder management unit in a client, wherein a first application is run in the client to the first service collaboration module, the first service collaboration module includes the first Binder management unit, the Binder identifier is allocated by the first Binder management unit to the second Binder proxy object, the second Binder proxy object is obtained by the first Binder management unit after receiving the first Binder proxy object sent by the first application, and references the same Binder entity object as the first Binder proxy object; The second Binder management unit creates a third Binder proxy object after receiving the Binder identifier, and records the association relationship between the third Binder proxy object and the Binder identifier; The second Binder management unit sends the third Binder proxy object to the second application; The second application obtains a fourth Binder proxy object that references the same Binder entity object as the third Binder proxy object; After the second Binder management unit determines that the fourth Binder proxy object is released, it releases the third Binder proxy object, determines the Binder identifier corresponding to the third Binder proxy object according to the recorded association relationship, and sends a Binder release instruction carrying the Binder identifier to the first Binder management unit, so that the first Binder management unit releases the Binder proxy object indicated by the Binder identifier in response to the Binder release instruction.
6. The method according to claim 5, characterized in that The method further comprises: After the second Binder management unit sends the third Binder proxy object to a second application, the count value currently corresponding to the third Binder proxy object is increased by 1; After the second Binder management unit determines that the fourth Binder proxy object is released, releasing the third Binder proxy object includes: After the second Binder management unit determines that a fourth Binder proxy object of a second application is released, it subtracts 1 from the count value currently corresponding to the third Binder proxy object; after determining that the count value corresponding to the third Binder proxy object drops to 0, the third Binder proxy object is released.
7. A client, characterized in that: The device comprises a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute the method according to any one of claims 3 to 4.
8. A server, characterized in that: The device comprises a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute the method according to any one of claims 5 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 3 to 4.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 5 to 6.
Citation Information
Patent Citations
Terminal equipment and cross-process communication method thereof
CN111443961A
Binder drive memory management method and device, equipment and storage medium
CN115718663A
Accessing service application components across multiple devices
CN115803718A
Client system, multi-client system and server client system
WO2016170659A1
Accessing service application components across multiple devices
WO2022005522A1