Data transmission method, system and device, electronic equipment and readable storage medium
Actively sending matching information in electronic devices through the information distribution interface, solving the problem of low data reading efficiency caused by polling operations and achieving more efficient data transmission.
Patent Information
- Application Number
- CN202510411889.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-02
- Publication Date
- 2025-07-08
AI Technical Summary
In the prior art, electronic devices need to frequently perform polling operations when reading data, resulting in inefficient data reading.
Through the information distribution interface, electronic devices actively send information matching their information type to the application, avoiding the application's polling operation on the system database.
Improves the efficiency of data reading in electronic devices and reduces resource occupancy and power consumption.
Smart Images

Figure CN120276884A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of electronic technology, and particularly relates to a data transmission method, system, device, electronic device, and readable storage medium. Background Art
[0002] With the development of electronic device technology, electronic devices have been integrated into users' lives. When users use an application (APP), the APP often needs to obtain required information. For example, the "map" application needs to obtain location information.
[0003] In the related art, when an application in an electronic device reads data in the electronic device, it needs to perform a polling operation on the database to read data from the database. Since the polling operation needs to repeatedly execute data reading multiple times, the efficiency of reading data in the electronic device is relatively low. Summary of the Invention
[0004] The purpose of the embodiments of this application is to provide a data transmission method, system, device, electronic device, and readable storage medium, which can improve the efficiency of data reading in an electronic device.
[0005] In a first aspect, the embodiments of this application provide a data transmission method, which includes: an electronic device obtains a first information type corresponding to a first application, where the first information type is the information type of the information required by the first application; the electronic device transmits first information to the first application through an information distribution interface according to the first information type; where the first information is the information stored in the information storage area of the electronic device that matches the first information type.
[0006] In a second aspect, the embodiments of this application provide a data transmission device, which includes: an acquisition module and a processing module; the acquisition module is used to obtain a first information type corresponding to a first application, where the first information type is the information type of the information required by the first application; the processing module is used to transmit first information to the first application through an information distribution interface according to the first information type obtained by the acquisition module; where the first information is the information stored in the information storage area of the electronic device that matches the first information type.
[0007] In a third aspect, the embodiments of this application provide an electronic device, which includes a processor and a memory. The memory stores a program or instruction that can run on the processor, and when the program or instruction is executed by the processor, the steps of the method described in the first aspect are implemented.
[0008] Fourthly, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0009] Fifthly, an embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor, and the processor is configured to run a program or instruction to implement the method described in the first aspect.
[0010] Sixthly, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.
[0011] In an embodiment of the present application, an electronic device obtains a first information type corresponding to a first application program, where the first information type is the information type required by the first application program; the electronic device transmits first information to the first application program through an information distribution interface according to the first information type; where the first information is the information stored in the information storage area of the electronic device that matches the first information type. Through this method, the electronic device can actively send the first information that matches the first information type in the information storage area to the first application program through the information distribution interface, without the application program performing a polling operation on the system database, thereby improving the data reading efficiency in the electronic device. Description of the Drawings
[0012] Figure 1 It is a schematic diagram of the architecture of a possible operating system provided by an embodiment of the present application;
[0013] Figure 2 It is a schematic flowchart of a data transmission method provided by an embodiment of the present application;
[0014] Figure 3 It is a schematic flowchart of a data transmission method provided by some embodiments of the present application;
[0015] Figure 4 It is a schematic flowchart of a data transmission method provided by some embodiments of the present application;
[0016] Figure 5 It is a schematic flowchart of a data transmission method provided by some embodiments of the present application;
[0017] Figure 6 It is a schematic structural diagram of a data transmission device provided by some embodiments of the present application;
[0018] Figure 7 It is a schematic structural diagram of an electronic device provided by some embodiments of the present application;
[0019] Figure 8 Schematic diagram of the hardware structure of an electronic device provided for some embodiments of the present application. Detailed implementation manners
[0020] The technical solutions in the embodiments of the present application will be clearly described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application belong to the scope of protection of the present application.
[0021] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such terms can be interchanged under appropriate circumstances so that the embodiments of the present application can be implemented in an order different from those illustrated or described herein, and the objects distinguished by "first", "second", etc. generally belong to the same category, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / " generally means an "or" relationship between the associated objects before and after.
[0022] The terms "at least one (item)", "at least one of", etc. in the specification and claims of the present application refer to any one, any two or more combinations of the included objects. For example, at least one (item) of a, b, and c can represent: "a", "b", "c", "a and b", "a and c", "b and c", and "a, b, and c", where a, b, and c can be single or multiple. Similarly, "at least two (items)" means two or more, and its meaning is similar to that of "at least one (item)".
[0023] The data transmission methods, devices, electronic devices, and readable storage media provided in the embodiments of the present application will be described in detail below with reference to the accompanying drawings, through specific embodiments and their application scenarios.
[0024] In a specific application scenario, the data transmission method provided in the embodiments of the present application can be applied to the scenario where a "map" application program obtains location information.
[0025] Exemplarily, when the "Map" application in an electronic device wants to obtain location information, it needs to perform a polling operation on the system database to obtain the location information. At this time, the "Map" application needs to continuously and regularly query the database to check whether location information that meets its requirements has been generated or updated. In this way, the repeated read operations not only consume computing resources but also increase the access pressure on the database, thereby reducing the efficiency of reading data in the electronic device.
[0026] In some other cases, if the "Map" application needs to obtain location information from another application (such as a location service application), it needs to be implemented through the Binder mechanism for inter-process communication. Occupying Binder resources for inter-process data transmission itself consumes a large amount of power. In addition, if the location information is not yet ready in the location service application, the thread used for reading data in the "Map" application needs to be suspended and wait, further increasing resource occupancy and power consumption waste, resulting in low efficiency of data reading in the electronic device.
[0027] In the data transmission method, device, electronic device, and readable storage medium provided in the embodiments of the present application, the "Map" application can declare that it needs to obtain location information through the registration interface of the Information Dispatch Service (IDS), that is, register its corresponding first information type as "location information". Then, the electronic device obtains the information type of the "Map" application (i.e., the first application) as "location information" (i.e., the first information type). After that, according to the information type "location information", the electronic device sends the location information, such as the longitude and latitude information of the current electronic device (i.e., the first information), to the "Map" application through the information distribution interface of the IDS. This longitude and latitude information is the information found by the electronic device from the information cache pool maintained by the IDS or the system database table that matches the information type "location information". In this way, the electronic device can actively send the first information that matches the first information type in the information storage area to the first application through the information distribution interface, without the application performing a polling operation on the system database, thereby improving the efficiency of reading data in the electronic device.
[0028] Next, taking the operating system as an example, an exemplary description is given of the software environment to which the data transmission method provided in the embodiments of the present application is applied.
[0029] As Figure 1 shown, Figure 1 is a schematic diagram of the architecture of a possible operating system provided in the embodiments of the present application. As Figure 1 shown, the architecture of this operating system includes at least four layers, namely: the application layer, the framework layer, the kernel layer, and the hardware layer.
[0030] Among them, the application layer includes various applications in the operating system. For example, Figure 1 APP1 - APP3 in
[0031] The functions of components and processes in each layer are described below.
[0032] Hardware layer: It contains physical hardware devices such as CPU, memory, display screen, touch screen, etc., providing computing, storage, and input / output capabilities, which is the basis for the operation of the entire system.
[0033] Kernel layer: The operating system kernel is responsible for the management and allocation of hardware resources, including process scheduling, memory management, file system, etc.
[0034] Framework layer: It contains system core services and management components, responsible for overall coordination and management of the operation of the application layer and data transmission, etc. Specifically, it includes the following key components:
[0035] Information Registration and Distribution Service (IDS): It provides standard information registration interfaces and information distribution interfaces, allowing applications in the application layer to register and obtain information. The information registration interface enables applications to submit information data generated by themselves, which does not involve user privacy and is not sensitive, to the IDS service so that other applications can use this information, improving the overall consistency and experience of the system. The information distribution interface allows applications to obtain the information types and contents they need from the IDS service.
[0036] It should be noted that the IDS service is an asynchronous service that can distribute information one - to - many. When an application requests to obtain information, if there is no appropriate information type and content in the IDS service, the application can first register to obtain an information listening. When appropriate information becomes available, the IDS service will actively callback or distribute it to the corresponding application process, thus improving the efficiency of information distribution, reducing the number of inter - process communications between applications, and the resource overhead of applications starting threads to query.
[0037] Other framework services: Such as the window management service, which is responsible for managing operations such as the creation, destruction, display, and hiding of application windows, coordinating the switching and layout between application windows; the activity management service, which is used to manage the activity life cycle of applications, ensuring that applications obtain sufficient system resources when running in the foreground, and reasonably recycling resources occupied by background activities; the notification management service, which processes notification messages sent by applications, controlling the display method of notifications and user interaction logic.
[0038] ART Virtual Machine: Provides the runtime environment for the Android operating system and is responsible for executing the bytecode files of applications. When an application is installed, the ART Virtual Machine compiles the bytecode into native machine code, thereby improving the running efficiency and performance of the application. It also provides functions such as memory management, garbage collection, and security detection to ensure that applications run in a stable and secure environment.
[0039] Application layer: Contains various applications that directly interact with users, such as weather applications, map applications, etc.
[0040] Through the above architecture, the operating system can manage and control data transmission in the electronic device.
[0041] The execution subject of the data transmission method provided in the embodiments of the present application can be a data transmission device, and this data transmission device can be an electronic device, or a functional module or functional entity in the electronic device. Hereinafter, taking the electronic device executing the data transmission method as an example, the technical solution provided in the embodiments of the present application will be described.
[0042] Figure 2 For the flowchart of the data transmission method provided in the embodiments of the present application, as Figure 2 shown, the data transmission method provided in the embodiments of the present application may include the following steps 201 to step 202:
[0043] Step 201: The electronic device obtains the first information type corresponding to the first application program.
[0044] Wherein, the above first information type is the information type of the information required by the above first application program
[0045] In some embodiments of the present application, the above first application program may include applications in the system that need to perform data interaction and information acquisition. The first application program may involve multiple aspects such as system services, user interaction, and background data processing, covering various application programs running on the electronic device, such as social applications, map applications, weather applications, etc.
[0046] Exemplarily, the above first application program may be a weather application.
[0047] In some embodiments of the present application, the above first information type may include any one of the following: social type, location type, weather type, system type.
[0048] It should be noted that the above information types may be the data categories required by various applications in the electronic device during operation. These data categories include system status information, user input information, sensor data, network data, etc., covering all information types that the electronic device needs to process and interact with in various application scenarios, such as weather type, network data type, etc.
[0049] Exemplarily, the above first information type may be location information.
[0050] It should be noted that location information is key data required by many applications in specific scenarios. For example, map applications need location information to implement navigation and positioning functions, social applications need location information to implement functions such as location-based check-in, and sports and health applications need location information to record the user's movement trajectory and distance, etc.
[0051] It can be understood that the first information type corresponding to the above first application program may include specific types of data required by the first application program during its operation. The data belonging to the first information type is closely related to the function implementation and business logic of the first application program. The normal operation of the first application program and the provision of services to users require the support of such data.
[0052] For example, the information type obtained by the electronic device for the weather application (i.e., the first application program) is the temperature type (i.e., the first information type). The information type obtained by the electronic device for the map application is the location type. The information type obtained by the electronic device for the social application is the conversation type.
[0053] In some embodiments of the present application, the above electronic device obtaining the first information type corresponding to the first application program may occur when the first application program requests data.
[0054] Exemplarily, when the battery management application needs to update the current real-time remaining battery power of the electronic device, it needs to obtain the remaining battery power information of the electronic device. The electronic device can obtain the information type required by the battery management application as the battery power information type.
[0055] Step 202: The electronic device transmits the first information to the first application program through the information distribution interface according to the first information type.
[0056] Wherein, the above first information is the information in the information storage area of the above electronic device that matches the above first information type; the above information storage area is an information cache pool, or the above information storage area includes a database table.
[0057] In some embodiments of the present application, the above information distribution interface may be a standardized interface provided by IDS, allowing applications to obtain the required data by specifying the information type.
[0058] In some embodiments of the present application, the information distribution interface is designed as an asynchronous service, capable of distributing information one-to-many. When an application requests to obtain information, if the information is temporarily unavailable, the application can register for listening, and the electronic device will actively distribute the information after it becomes available, thereby improving the efficiency and real-time performance of information acquisition.
[0059] Exemplarily, the above first information may be specific longitude and latitude coordinates, such as "116.404013, 39.904211". After the electronic device obtains the type of location information requested by the map application, it will search in the information storage area through the information distribution interface for longitude and latitude information that matches this type. If found, the longitude and latitude coordinate information will be sent to the map application for operations such as map display and navigation.
[0060] Exemplarily again, the above first information may be specific temperature information, such as "26°C".
[0061] Exemplarily again, the above first information may be the remaining battery power information of the electronic device, such as "85%".
[0062] In some embodiments of the present application, the above information cache pool may be an area opened by the system in the memory for temporarily storing information data.
[0063] In some embodiments of the present application, the above database table may be a structured table used by the system for long-term storage of information data. The database table organizes data according to certain rules and relationships, making the storage of data more orderly and facilitating complex data query and management operations.
[0064] It can be understood that when the data in the information cache pool reaches a certain amount or meets specific conditions (such as the information being marked as long-term storage information), the electronic device will synchronize this data from the cache pool to the database table to ensure the persistence and integrity of the data.
[0065] Exemplarily, the electronic device obtains that the information type corresponding to the screen management application program (i.e., the first application program) is the screen brightness type (i.e., the first information type). Then, the electronic device finds the information that matches the screen brightness type, such as "85 nit" (i.e., the first information), from the information storage area according to the screen brightness type. Then, the electronic device actively sends the screen brightness information "85 nit" to the screen management application program through the information distribution interface.
[0066] In this way, the electronic device can actively send the first information that matches the first information type in the information storage area to the first application program through the information distribution interface, without the application program performing a polling operation on the system database, thereby improving the efficiency of reading data in the electronic device.
[0067] In some embodiments of the present application, the information cache pool includes at least one of the following pieces of information:
[0068] Information obtained by the system-level services of the above-mentioned electronic device;
[0069] Information obtained by at least one application in the above-mentioned electronic device.
[0070] In some embodiments of the present application, the information obtained by the above-mentioned system-level services may include information obtained by the electronic device itself, such as sensor data of the device, network status information, battery status information, etc.
[0071] Exemplarily, the information obtained by the above-mentioned system-level services may be the current remaining battery percentage obtained by the battery management module of the device, such as 63%.
[0072] In some embodiments of the present application, the information of the above-mentioned at least one application may include information such as data generated inside the application, data input by the user, and data processed by the application.
[0073] Exemplarily, the information of the above-mentioned at least one application may be new picture data generated after user editing in a picture editing application, or new note content created by the user in a note application.
[0074] In some embodiments of the present application, after the electronic device obtains the first information type corresponding to the first application, it may search for information matching the first information type in the information storage area to obtain the first information that meets the conditions.
[0075] In this way, the electronic device can actively send, through the information distribution interface, the information obtained by the system-level services or the information of the application that matches the first information type in the information storage area to the first application, without the application performing a polling operation on the system database when it needs to obtain system information, or occupying Binder resources to perform inter-process communication with other applications when it needs to obtain the information of other applications, thereby improving the efficiency of reading data in the electronic device.
[0076] In some embodiments of the present application, the above step 202 may include the following steps 202a and 202b:
[0077] Step 202a: The electronic device searches for the first information matching the first information type in the information storage area according to the first information type.
[0078] Step 202b: The electronic device transmits the first information to the first application through the information distribution interface.
[0079] Exemplarily, based on the location information (i.e., the first information type), the electronic device searches in the information storage area (information cache pool or database table) for the first information that matches it. For example, the electronic device finds the latitude and longitude coordinates "116.404013, 39.904211" in the information cache pool. After that, the electronic device sends the found latitude and longitude coordinates "116.404013, 39.904211" to the map application (i.e., the first application) through the information distribution interface, so that it can update the map display or perform navigation calculations.
[0080] In this way, the electronic device can actively send, through the information distribution interface, the information obtained by the system-level service or the information of the application program in the information storage area that matches the first information type to the first application program, without the application program actively searching for the information that matches the information type of the information it needs, thereby improving the efficiency of reading data in the electronic device.
[0081] In some embodiments of the present application, before the above step 201, the data transmission method provided by the embodiments of the present application may further include the following step 203:
[0082] Step 203: The electronic device receives registration information from at least one application program through the information registration interface, and the at least one application program includes the first application program.
[0083] Wherein, one piece of registration information includes at least one of the following:
[0084] The information type requested by an application program to be read;
[0085] The information type that the above application program allows other applications to read;
[0086] The information that the above application program allows other applications to read;
[0087] The application type of other applications that the above application program allows to read information.
[0088] In some embodiments of the present application, the above information registration interface may be a standardized interface provided by IDS, allowing application programs to register information. This interface is designed as an asynchronous service and can receive the information types and contents registered by application programs, so that other applications can obtain this information subsequently.
[0089] In some embodiments of the present application, the information type requested by the above application program to be read may be the information type of the information required by the application program to be obtained.
[0090] Exemplarily, the map application may request to read the location information type in order to obtain the user's current location data during operation.
[0091] In some embodiments of the present application, the type of information that the above application allows other applications to read may be the type of information that the application can provide to other applications to meet the information requirements of other applications.
[0092] Exemplarily, a weather application can provide weather information types for other applications (such as a calendar application, a sports application, etc.) to read weather data, so that other applications can provide richer functions for users in specific scenarios.
[0093] In some embodiments of the present application, the information that the above application allows other applications to read may be the specific information that the application itself can provide to other applications.
[0094] Exemplarily, a battery monitoring application can provide other applications with the battery temperature information of the current electronic device, such as 42°C.
[0095] In some embodiments of the present application, the application type that the above application allows other applications to read information may be the application type of the application that is the specified information reader of the application, that is, the information provided by the application can be read by applications of which application types.
[0096] Exemplarily, for example, the GPS positioning service application of an electronic device can specify that an application of the "map" application type can obtain the location information it provides, that is, the application type allowed to read information is the "map" application type.
[0097] The following combines Figure 3 to exemplarily illustrate the data transmission method provided by the embodiments of the present application.
[0098] As Figure 3 shown, Figure 3 the architecture of the operating system in Figure 3 includes 4 layers, namely: an application layer, a framework layer, a kernel layer, and a hardware layer. Among them, the application layer includes each application in the operating system. For example,
[0099] It should be noted that Figure 3 the arrows marked with numerical labels in
[0100] are used to indicate the steps and order of the data transmission method provided by the embodiments of the present application.
[0101] Exemplarily, step 302: After the information registration and distribution service receives the registration information of APP1, it stores the weather data information in the information cache pool or the system database for matching retrieval and distribution in subsequent processes.
[0102] Exemplarily, step 303: APP2 (such as a calendar application) calls the information distribution interface to request the weather information type data from the information registration and distribution service, aiming to provide the display of the current day's weather on the interface of the calendar application for the user.
[0103] Exemplarily, step 304: After the information registration and distribution service receives the request from APP2, it checks the information cache pool to see if there is information that matches the "weather type". If information that meets the conditions is found, the next step is executed; if not, APP2 is allowed to perform asynchronous registration to implement information listening, and the information will be distributed when it becomes available.
[0104] Exemplarily, step 305: After the information registration and distribution service finds the weather data information registered by APP1 in the information storage area, it sends the information to APP2 through the information distribution interface. After APP2 receives the weather data, it displays it on the interface of the calendar application to provide the current day's weather information for the user.
[0105] In this way, the electronic device receives the registration information from at least one application program through the registration interface in the information registration and distribution service, so that the electronic device can receive the information and information types that the application programs can provide, as well as the information types of the information required by the application programs, so that the electronic device can subsequently actively distribute information to each application program through the information distribution interface, without the application programs actively searching for information that matches the information types they need, thereby improving the efficiency of reading data in the electronic device.
[0106] In some embodiments of the present application, after the above step 203, the data transmission method provided by the embodiments of the present application may further include the following step 204:
[0107] Step 204: The electronic device stores the information in at least one queue in the information cache pool according to the information types that one application program allows other applications to read information.
[0108] Wherein, one queue corresponds to one information type.
[0109] In some embodiments of the present application, the above queue may be a data structure for storing and managing data in a specific order. The queue follows the First In First Out (FIFO) principle, that is, the data that enters the queue earliest will be processed first.
[0110] It can be understood that in the data transmission method provided in the embodiments of the present application, queues are used to classify and store different types of information in the information cache pool, and each queue corresponds to a specific information type, thereby improving the retrieval and distribution efficiency of information.
[0111] Exemplarily, when a weather application registers specific weather-type information (such as "sunny, 25°C, humidity 45%") with the system through an information registration interface, the electronic device stores the specific weather information in the "weather type" queue in the information cache pool according to the information type (weather type). In this way, when other applications (such as a calendar application, a sports application, etc.) request to obtain weather-type data, the system can match the information type required by other applications as the weather type, search for and provide the corresponding information from the "weather type" queue, thereby improving the efficiency and real-time performance of data acquisition.
[0112] Another example is Figure 4 shown, Figure 4 which includes a queue for information type 1, a queue for information type 2, and a queue for information type 3, and the information types of each queue are different. Figure 4 The ellipsis in it indicates that the information cache pool contains not only the three queues shown in the figure, but also other queues not shown. Figure 4 The arrow in it is used to indicate that the electronic device stores the corresponding data in the queue for information type 2. The electronic device can store the information data with the information type of "information type 2" registered by the application program in the queue for information type 2, so that when the information type required by other application programs is "information type 2", the electronic device can search for the information data in this queue and send the information to other application programs through the information distribution interface.
[0113] In this way, the electronic device can store the registration information of the application program in the form of queues in the information cache pool, so that the electronic device can subsequently actively distribute information to each application program through the information distribution interface, without the application program actively searching for information that matches the information type it needs, thereby improving the efficiency of reading data in the electronic device.
[0114] In some embodiments of the present application, after the above step 204, the data transmission method provided in the embodiments of the present application may further include the following step 205:
[0115] Step 205: The electronic device stores at least part of the information stored in at least one queue in a database table.
[0116] In some embodiments of the present application, the above database table may include a structured table for long-term storage of information, which contains multiple fields to record different types of data attributes. For example, for the data in the location information queue, the database table may include fields such as location ID, longitude, latitude, timestamp, etc.; for the data in the weather information queue, it may include fields such as weather ID, location, date, temperature, humidity, wind speed, etc.
[0117] Exemplarily, taking location information as an example, when multiple location data points are accumulated in the location information queue in the information cache pool, or some location information is marked as needing long-term storage, the electronic device will store this location information in the database table. Specifically, information such as the longitude and latitude coordinates and acquisition time of each location data point will be inserted into the location record of the database table one by one.
[0118] Another example is Figure 5 shown Figure 5 including Information Type 1 Queue - Information Type 3 Queue and the database table, where the ellipsis indicates that the information cache pool contains not only the three queues shown in the figure, but also other queues not shown, and the arrow indicates storing the information in the Information Type 2 Queue into the database table. For example, the electronic device can store the information in the Information Type 2 Queue into the database table.
[0119] In this way, the electronic device can store the registration information of the application in the database table for a long time to manage the storage space of the information cache pool or store important information for a long time, so that the storage space of the information cache pool is sufficient and important information is not easily lost, thereby improving the efficiency of reading data in the electronic device.
[0120] Each of the above method embodiments, or various possible implementation manners in each method embodiment, can be executed alone, or, on the premise of no contradiction, can also be executed in combination with each other, which can be specifically determined according to actual usage requirements, and the embodiments of the present application do not limit this.
[0121] The execution subject of the data transmission method provided by the embodiments of the present application can be a data transmission device, and this data transmission device can be an electronic device, or a functional module or functional entity in the electronic device. The following takes the data transmission device executing the data transmission method as an example to illustrate the technical solution provided by the embodiments of the present application.
[0122] For the data transmission method provided by the embodiments of the present application, the execution subject can be a data transmission device. In the embodiments of the present application, taking the data transmission device executing the data transmission method as an example, the data transmission device provided by the embodiments of the present application is described.
[0123] Figure 6 is the structural schematic diagram of the data transmission device provided by the embodiments of the present application, asFigure 6 As shown in Figure 6 , the data transmission device 600 may include an acquisition module 601 and a processing module 602, where: the acquisition module is configured to acquire a first information type corresponding to a first application, and the first information type is an information type required by the first application; the processing module is configured to transmit first information to the first application through an information distribution interface according to the first information type acquired by the acquisition module; where the first information is information in the information storage area of the electronic device that matches the first information type; the information storage area is an information cache pool, or the information storage area includes a database table.
[0124] In some embodiments of the present application, the information cache pool includes at least one of the following pieces of information: information acquired by the system-level service of the electronic device; information acquired by at least one application in the electronic device.
[0125] In some embodiments of the present application, the processing module is further configured to search for the first information that matches the first information type in the information storage area according to the first information type acquired by the acquisition module; the processing module is further configured to send the first information to the first application through the information distribution interface.
[0126] In some embodiments of the present application, the device further includes: a receiving module; the receiving module is configured to receive registration information from at least one application through an information registration interface before the electronic device acquires the first information type corresponding to the first application, and the at least one application includes the first application; where one piece of registration information includes at least one of the following: the information type requested by an application to read; the information type that an application allows other applications to read; the information that an application allows other applications to read; the application type of other applications that an application allows to read information.
[0127] In some embodiments of the present application, the processing module is further configured to, after the electronic device receives the registration information from at least one application through the information registration interface, store the information in at least one queue in the information cache pool according to the information type of the information that an application allows other applications to read, and one queue corresponds to one information type.
[0128] In some embodiments of the present application, the processing module is further configured to, after storing the information in at least one queue in the information cache pool, store at least part of the information stored in the at least one queue in a database table.
[0129] The data transmission device provided in the embodiment of the present application obtains the first information type corresponding to the first application program, where the first information type is the information type required by the first application program; the electronic device transmits the first information to the first application program through the information distribution interface according to the first information type; wherein, the first information is the information stored in the information storage area of the electronic device that matches the first information type; the information storage area is an information cache pool, or the information storage area includes a database table. Through this method, the electronic device can actively send the first information that matches the first information type in the information storage area to the first application program through the information distribution interface, without the application program performing a polling operation on the system database, thereby improving the data reading efficiency in the electronic device.
[0130] The data transmission device in the embodiment of the present application can be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a handheld computer, an in-vehicle electronic device, a Mobile Internet Device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc., and can also be a server, a Network Attached Storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc. The embodiment of the present application does not make specific limitations.
[0131] The data transmission device in the embodiment of the present application can be a device with an operating system. The operating system can be an Android operating system, an iOS operating system, or other possible operating systems. The embodiment of the present application does not make specific limitations.
[0132] The data transmission device provided in the embodiment of the present application can implement each process implemented by the above data transmission method embodiment. To avoid repetition, it will not be elaborated here.
[0133] Optionally, as Figure 7As shown in the figure, an embodiment of the present application further provides an electronic device 700, including a processor 701 and a memory 702. A program or instruction that can run on the processor 701 is stored on the memory 702. When the program or instruction is executed by the processor 701, each step of the above data transmission method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be elaborated here.
[0134] It should be noted that the electronic device in the embodiment of the present application includes the above-mentioned mobile electronic device and non-mobile electronic device.
[0135] Figure 8 It is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application.
[0136] The electronic device 100 includes but is not limited to: a radio frequency unit 101, a network module 102, an audio output unit 103, an input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, and a processor 110 and other components.
[0137] Those skilled in the art can understand that the electronic device 100 may further include a power supply (such as a battery) for supplying power to each component. The power supply can be logically connected to the processor 110 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system. Figure 8 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0138] Among them, the above-mentioned processor 110 is used to obtain a first information type corresponding to a first application program; the above-mentioned processor 110 is used to transmit first information to the above-mentioned first application program through an information distribution interface according to the above-mentioned first information type obtained by the above-mentioned processor 110, and the above-mentioned first information type is an information type required by the above-mentioned first application program; among them, the above-mentioned first information is information in the information storage area of the electronic device that matches the above-mentioned first information type; the above-mentioned information storage area is an information cache pool, or the above-mentioned information storage area includes a database table.
[0139] In some embodiments of the present application, the above-mentioned information cache pool includes at least one of the following information: information obtained by the system-level service of the electronic device; information obtained by at least one application program in the electronic device.
[0140] In some embodiments of the present application, the above-mentioned processor 110 is further configured to, according to the above-mentioned first information type obtained by the above-mentioned processor 110, search for the above-mentioned first information that matches the above-mentioned first information type in the above-mentioned information storage area; the above-mentioned processor 110 is further configured to send the above-mentioned first information to the above-mentioned first application program through an information distribution interface.
[0141] In some embodiments of the present application, the above-mentioned device further includes: a radio frequency unit 101; the above-mentioned radio frequency unit 101 is configured to, before the above-mentioned electronic device obtains the first information type corresponding to the first application program, receive registration information from at least one application program through an information registration interface, and the above-mentioned at least one application program includes the above-mentioned first application program; wherein, the information type requested by an application program to read; the information type that an application program allows other application programs to read; the information that an application program allows other application programs to read; the application type of other application programs that an application program allows to read information.
[0142] In some embodiments of the present application, the above-mentioned processor 110 is further configured to, after the above-mentioned electronic device receives registration information from at least one application program through an information registration interface, according to the information type of the information that an application program allows other application programs to read, store the above-mentioned information into at least one queue in the above-mentioned information cache pool, and one queue corresponds to one information type.
[0143] In some embodiments of the present application, the above-mentioned processor 110 is further configured to, after storing the above-mentioned information into at least one queue in the above-mentioned information cache pool, store at least part of the information stored in the above-mentioned at least one queue into a database table.
[0144] The electronic device provided by the embodiments of the present application, the electronic device obtains the first information type corresponding to the first application program, and the above-mentioned first information type is the information type of the information required by the above-mentioned first application program; the above-mentioned electronic device transmits the first information to the above-mentioned first application program through an information distribution interface according to the above-mentioned first information type; wherein, the above-mentioned first information is the information in the information storage area of the above-mentioned electronic device that matches the above-mentioned first information type; the above-mentioned information storage area is an information cache pool, or the above-mentioned information storage area includes a database table. Through this method, the electronic device can actively send the first information that matches the first information type in the information storage area to the first application program through the information distribution interface, without the application program performing a polling operation on the system database, thereby improving the data reading efficiency in the electronic device.
[0145] It should be understood that in the embodiments of the present application, the input unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042. The GPU 1041 processes the image data of static pictures or videos obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit 107 includes at least one of a touch panel 1071 and other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include two parts: a touch detection device and a touch controller. The other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be elaborated here.
[0146] The memory 109 can be used to store software programs and various data. The memory 109 mainly includes a first storage area for storing programs or instructions and a second storage area for storing data. Among them, the first storage area can store an operating system, applications or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 109 may include a volatile memory or a non-volatile memory, or the memory 109 may include both a volatile memory and a non-volatile memory. Among them, the non-volatile memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically EPROM (EEPROM), or a flash memory. The volatile memory may be a Random Access Memory (RAM), a Static RAM (SRAM), a Dynamic RAM (DRAM), a Synchronous DRAM (SDRAM), a Double Data Rate SDRAM (DDR SDRAM), an Enhanced SDRAM (ESDRAM), a Synch link DRAM (SLDRAM), and a Direct Rambus RAM (DRRAM). The memory 109 in the embodiments of the present application includes, but is not limited to, these and any other suitable types of memories.
[0147] The processor 110 may include one or more processing units; optionally, the processor 110 integrates an application processor and a modem processor. Among them, the application processor mainly processes operations related to the operating system, user interface, application programs, etc., and the modem processor mainly processes wireless communication signals, such as a baseband processor. It can be understood that the above-mentioned modem processor may not be integrated into the processor 110 either.
[0148] The embodiments of the present application further provide a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, it realizes each process of the above-mentioned data transmission method embodiment and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0149] Among them, the processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes computer-readable storage media, such as computer read-only memory ROM, random access memory RAM, magnetic disks or optical discs, etc.
[0150] The embodiments of the present application further provide a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run a program or instruction to realize each process of the above-mentioned data transmission method embodiment and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0151] It should be understood that the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, system chip, chip system, or system-on-chip, etc.
[0152] The embodiments of the present application provide a computer program product, which is stored in a storage medium and is executed by at least one processor to realize each process of the above-mentioned data transmission method embodiment and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0153] It should be noted that in this text, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising one..." does not exclude the existence of additional identical elements in the process, method, article or device comprising such element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, but may also include performing functions in a substantially simultaneous manner or in a reverse order according to the functions involved. For example, the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, the features described with reference to certain examples may be combined in other examples.
[0154] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-described example methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present application.
[0155] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Those of ordinary skill in the art, under the inspiration of the present application and without departing from the spirit and scope protected by the claims of the present application, can also make many forms, all of which fall within the protection scope of the present application.
Claims
1. A data transmission method, characterized in that, The method includes: The electronic device obtains a first information type corresponding to a first application, where the first information type is the information type required by the first application; The electronic device transmits first information to the first application through an information distribution interface according to the first information type; Wherein, the first information is the information stored in the information storage area of the electronic device that matches the first information type.
2. The method according to claim 1, wherein The information storage area is an information cache pool, or the information storage area includes a database table.
3. The method according to claim 1, wherein The information cache pool includes at least one of the following information: The information obtained by the electronic device through a system-level service; The information obtained from at least one application in the electronic device.
4. The method according to claim 1 or 3, characterized in that, The electronic device transmits first information to the first application through an information distribution interface according to the first information type, including: The electronic device searches for the first information that matches the first information type in the information storage area according to the first information type; The electronic device sends the first information to the first application through an information distribution interface.
5. The method according to claim 1, wherein Before the electronic device obtains the first information type corresponding to the first application, the method further includes: The electronic device receives registration information from at least one application through an information registration interface; Wherein, one piece of registration information includes at least one of the following: The information type requested by an application to read; The information type that the application allows other applications to read; The information that the application allows other applications to read; The application type of other applications that the application allows to read information.
6. The method according to claim 5, wherein After receiving registration information from at least one application at the information registration interface of the electronic device, the method further includes: According to the information type of the information that the application allows other applications to read, store the information in at least one queue in the information cache pool; Wherein, one queue corresponds to one information type.
7. The method according to claim 6, characterized in that, After storing the information in at least one queue in the information cache pool, the method further includes: Store at least part of the information stored in the at least one queue in a database table.
8. A data transmission system, the system comprising: The application layer and the framework layer, the framework layer includes an information registration and distribution service, and the information registration and distribution service includes an information distribution interface; The information registration and distribution service is used to obtain a first information type corresponding to the first application, where the first information type is the information type required by the first application; The information registration and distribution service is further used to transmit first information to the first application in the application layer through an information distribution interface according to the first information type; Wherein, the first information is the information stored in the information storage area of the electronic device that matches the first information type.
9. The system according to claim 8, wherein The information registration and distribution service is specifically used to search for the first information that matches the first information type in the information storage area according to the first information type; The information registration and distribution service is specifically used to transmit the first information to the first application through the information distribution interface.
10. The system according to claim 8, wherein The information registration and distribution service further includes an information registration interface; The information registration interface is used to receive registration information from at least one application; Wherein, one piece of registration information includes at least one of the following: The type of information requested by an application to read; The type of information that the application allows other applications to read; The information that the application allows other applications to read; The application type of other applications that the application allows to read information.
11. The system according to claim 8, characterized in that, The information registration and distribution service is also used to store the information into at least one queue in the information cache pool according to the type of information that the application allows other applications to read, and one queue corresponds to one type of information.
12. A data transmission device, characterized in that, The device includes: an acquisition module and a processing module; The acquisition module is used to acquire the first information type corresponding to the first application, and the first information type is the type of information required by the first application; The processing module is used to transmit the first information to the first application through the information distribution interface according to the first information type acquired by the acquisition module; Wherein, the first information is the information in the information storage area of the electronic device that matches the first information type.
13. The data transmission device according to claim 12, wherein The device further includes: a receiving module; The receiving module is used to receive registration information from at least one application through the information registration interface before the electronic device acquires the first information type corresponding to the first application; Wherein, one piece of registration information includes at least one of the following: The type of information requested by an application to read; The type of information that the application allows other applications to read; The information that the application allows other applications to read; The application type of other applications that the application allows to read information.
14. An electronic device, characterized in that, It includes a processor and a memory. The memory stores a program or instruction that can run on the processor. When the program or instruction is executed by the processor, the steps of the data transmission method described in any one of claims 1-7 are implemented.
15. A readable storage medium, characterized in that, The program or instruction is stored on the readable storage medium. When the program or instruction is executed by the processor, the steps of the data transmission method described in any one of claims 1-7 are implemented.