A method, device and storage medium for reading node information

By searching and associating sub-nodes with the same information in the DRM framework, the problem of writing a large amount of information when adding new screen nodes is solved, making the system easier to maintain and saving memory.

CN117707453BActive Publication Date: 2024-09-20HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311030781.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-15
Publication Date
2024-09-20
Estimated Expiration
2043-08-15

AI Technical Summary

Technical Problem

In the Direct Rendering Manager (DRM) framework, a large amount of information needs to be written when adding screen nodes, resulting in increased system maintenance difficulty and excessive memory usage.

Method used

By searching for associated information when the electronic device is started, child nodes with the same information are associated. When adding a new screen node, you only need to write different child node information, and read the stored information through the associated information, reducing repeated storage.

Benefits of technology

It reduces the difficulty of system maintenance, reduces memory usage, and improves the ease of maintenance and efficiency of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117707453B
    Figure CN117707453B
Patent Text Reader

Abstract

The present application provides a method, device and storage medium for reading node information. The present application searches for a first sub-node under a first screen node corresponding to a first display screen of the electronic device when the electronic device is started, and when the first sub-node is not found, searches for associated information step by step under an upper-level node corresponding to the first sub-node, and when the associated information is found, reads the second information in the second sub-node. Since the present application sets associated information for associating sub-nodes corresponding to the same information, when a new screen node is added, it is not necessary to write all the information corresponding to the screen node. For the same information, the sub-node under the newly added screen node can be associated with the sub-node storing the information by setting associated information, so that when reading the information corresponding to the newly added screen node, the information can be read from the sub-node storing the information through the associated information, thereby making the system easy to maintain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electronic technology, and in particular to a method, device and storage medium for reading node information. Background Art

[0002] Direct Rendering Manager (DRM) is a graphics rendering architecture that manages display output and buffer allocation. DRM supports multiple programs to use the system's video hardware resources at the same time and manages resource requests and access from multiple programs.

[0003] At present, each display screen in the DRM framework corresponds to a separate screen node, and each screen node stores relevant information of the corresponding display screen. When starting an electronic device, it is necessary to read the information stored in the screen node corresponding to the display screen of the electronic device to control the display screen to display images.

[0004] However, since the DRM framework of the electronic device includes multiple screen nodes, and each screen node usually stores a large amount of information, when a new screen node needs to be added to the DRM framework, all the corresponding information under the screen node usually needs to be written, which increases the difficulty of system maintenance. Summary of the invention

[0005] The present application provides a method, device and storage medium for reading node information, aiming to solve the problem of difficult system maintenance.

[0006] In order to achieve the above objectives, this application adopts the following technical solutions:

[0007] First aspect: The present application provides a method for reading node information, including: when an electronic device is started, under a first screen node corresponding to a first display screen of the electronic device, searching for a first sub-node, the first sub-node being used to store first information of the first display screen; when the first sub-node is not found, under an upper-level node corresponding to the first sub-node, searching for associated information step by step, the associated information being used to associate the first sub-node with a second sub-node under a second screen node, the second screen node corresponding to a second display screen, the second sub-node being used to store second information of the second display screen, the second information being the same as the first information; when the associated information is found, reading the second information in the second sub-node.

[0008] Since the present application sets association information for associating subnodes corresponding to the same information, when adding a new screen node, it is not necessary to write all the information corresponding to the screen node. For the same information, the subnode under the newly added screen node can be associated with the subnode storing the information by setting association information, so that when reading the information corresponding to the subnode under the newly added screen node, the information can be read from the subnode storing the information through the association information, thereby making the system easy to maintain. At the same time, since there is no need to store a large amount of repeated information, the memory usage is effectively reduced.

[0009] In one possible implementation, when the first child node is not found, the associated information is searched for level by level under the upper node corresponding to the first child node, including: when the first child node is not found, searching for the associated information under the parent node of the first child node; when the associated information is not found under the parent node of the first child node, searching for the associated information under the parent node of the parent node of the first child node.

[0010] In one possible implementation, when the first child node is not found, the associated information is searched under the parent node of the first child node, including: when the first child node is not found, determining whether the parent node of the first child node is a root node; when it is determined that the parent node of the first child node is not a root node, searching for the associated information under the parent node of the first child node.

[0011] In a possible implementation, when the first child node is not found, after determining whether the parent node of the first child node is a root node, the method further includes: when it is determined that the parent node of the first child node is a root node, reading information in the parent node of the first child node.

[0012] In a possible implementation, when the electronic device is started, the first child node is searched under the first screen node corresponding to the first display screen of the electronic device, including: when the electronic device is started, calling the reconstructed get attribute value function, sending a read instruction, the reconstructed get attribute value function is obtained by rewriting the native get attribute value function in the direct rendering manager DRM; in response to the read instruction, searching for the first child node under the first screen node corresponding to the first display screen of the electronic device. Based on the reconstructed get attribute value function in the present application, screen nodes can be added without changing the DRM framework, which makes it easier to read node information and reduces the difficulty of system maintenance.

[0013] In a possible implementation, when the electronic device is started, the first sub-node is searched under the first screen node corresponding to the first display screen of the electronic device, including: when the electronic device is started, the electronic device is parsed to obtain a parsing result; when the parsing result is that the electronic device supports calling the reconstructed attribute value acquisition function, the first sub-node is searched under the first screen node corresponding to the first display screen of the electronic device. Since not all electronic devices support calling the reconstructed attribute value acquisition function, before reading the node information, the electronic device is parsed to determine the corresponding method of reading the node information.

[0014] In one possible implementation, in response to a read instruction, searching for a first child node under a first screen node corresponding to a first display screen of an electronic device includes: in response to the read instruction, calling a native get attribute value function in a direct rendering manager DRM, searching for a first child node under a first screen node corresponding to the first display screen of an electronic device.

[0015] In a possible implementation, when the electronic device is started, after searching for the first sub-node under the first screen node corresponding to the first display screen of the electronic device, the method further includes: when the first sub-node is found, reading the first information in the first sub-node.

[0016] Second aspect: The present application provides an electronic device, which includes a processor and a memory: the memory is used to store program code and transmit the program code to the processor; the processor is used to execute the steps of a node information reading method as described above according to the instructions in the program code.

[0017] A third aspect: The present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of a method for reading node information as described above are implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 A schematic diagram of an existing device tree provided for an embodiment of the present application;

[0019] Figure 2 A schematic diagram of a device tree after adding a screen node in an existing embodiment of the present application;

[0020] Figure 3 A schematic diagram of a device tree including associated information provided in an embodiment of the present application;

[0021] Figure 4 A schematic diagram of searching a subnode 2.1 provided in an embodiment of the present application;

[0022] Figure 5A schematic diagram of searching for a sub-node 2.2.2 provided in an embodiment of the present application;

[0023] Figure 6 A flowchart of a method for reading node information provided by an embodiment of the present application;

[0024] Figure 7 A flow chart of an analysis method provided in an embodiment of the present application;

[0025] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0026] Fig. 9 This is a software structure block diagram of the electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0027] The terms "first", "second", and "third" in the specification, claims, and drawings of this application are used to distinguish different objects rather than to limit a specific order. In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way.

[0028] In order to make the description of the following embodiments clear and concise, a brief introduction to the related technology is first given:

[0029] The device tree (DTS) consists of a series of named nodes and properties. It stores the device information in the system and can be updated when adding or deleting devices. Nodes are used to classify and describe hardware information or software information. One or more properties are described in a node. A node can include a root node, a parent node, and a child node. Properties are names and values ​​that appear in pairs and can be expressed in the form of key-value pairs to describe specific hardware information or software information. The information in each node in the device tree constitutes a property list. When the driver uses the information in this node, it can obtain the corresponding information in this property list.

[0030] For example, in the device tree, the information that can be described may include the number and type of processors (CPUs), memory base addresses and sizes, interrupt controllers and interrupt usage, etc. By using the device tree, the docking and interaction between the operating system kernel and the hardware devices can be achieved.

[0031] Specifically, the nodes in the device tree of the present application may include a root node, a screen node, and corresponding child nodes under each screen node. One screen node corresponds to a display screen, and the relevant information of the display screen corresponding to the screen node is the attribute corresponding to the screen node. When starting an electronic device, it is necessary to read the corresponding information under the screen node corresponding to the display screen of the electronic device, that is, it is necessary to read the attribute value under the screen node corresponding to the display screen to control the display screen to display images.

[0032] Device Tree Source Include (DTSI), also known as the device tree source include file, is the device tree header file. The DTSI file is part of the device tree and is used to describe a part of the device tree, such as the configuration information of peripheral devices, drivers, etc. The DTSI file will be compiled into a compiled binary file, i.e. a binary file in dtb format, by the Device Tree Compiler (DTC). The dtb file will finally be put into the system and parsed by the kernel.

[0033] At present, each display screen in the DRM framework corresponds to a separate screen node. When starting the electronic device, it is necessary to read the information in the screen node corresponding to the display screen to realize image display on the display screen. However, since each screen node usually stores a large amount of information, when a new screen node needs to be added, it is usually necessary to write all the information corresponding to the screen node, which increases the difficulty of system maintenance.

[0034] like Figure 1 As shown, the figure is a schematic diagram of an existing device tree provided by an embodiment of the present application. In the figure, two screen nodes corresponding to each display screen are stored under the root node. Specifically, the first display screen corresponds to the first screen node (screen node 1), and the second display screen corresponds to the second screen node (screen node 2). For the first screen node, two child nodes are associated therewith, namely the first and second-level child nodes (child node 1.1) and the second and second-level child nodes (child node 1.2), wherein the second and second-level child nodes are associated with two child nodes, namely the first and third-level child nodes (child node 1.2.1) and the second and third-level child nodes (child node 1.2.2); for the second screen node, two child nodes are also associated with the second screen node, namely the third and second-level child nodes (child node 2.1) and the fourth and second-level child nodes (child node 2.2), wherein the fourth and second-level child nodes are the parent nodes of the third and third-level child nodes (child node 2.2.1) and the fourth and third-level child nodes (child node 2.2.2).

[0035] When starting an electronic device, it is necessary to read the information under the screen node corresponding to the display screen of the electronic device to realize image display on the display screen. Specifically, before reading the information under the screen node, it is necessary to search for each corresponding sub-node under the screen node.

[0036] Exemplarily, the display screen of the electronic device corresponds to the second screen node. When reading the information in the fourth third-level child node, that is, when reading the information in child node 2.2.2, search for screen node 2 from the root node, and search for child node 2.2 in screen node 2. After finding child node 2.2, you can search for child node 2.2.2 in the parent node of child node 2.2.2, that is, child node 2.2, and read the information in child node 2.2.2.

[0037] On the one hand, if in screen node 2, only the information in subnode 2.2.1 is different from the information in screen node 1, that is, the information in subnode 2.1 is the same as the information in subnode 1.1, the information in subnode 2.2.2 is the same as the information in subnode 1.2.2, and the information in subnode 2.2.1 is different from the information in subnode 1.2.1. In this case, it is necessary to store two copies of the same information, which is equivalent to storing two copies of the information in subnodes 1.1 and 1.2.1. Furthermore, when there are a large number of display screens and there is a large amount of duplicate information between screen nodes corresponding to different display screens, there is a problem of a large amount of redundant data occupying memory.

[0038] Based on this, in the embodiment of the present application, the sub-nodes storing the same information are linked by establishing association information. When the corresponding first sub-node is not found under the first screen node, the information is read from the second sub-node associated with the first sub-node through the association information. The second sub-node associated with the first sub-node through the association information actually stores the corresponding information, and the information in the second sub-node is the same as the corresponding information in the first sub-node. Therefore, for the sub-nodes that originally store the same information, it is only necessary to select one of them as the sub-node that actually stores the information, and establish association information in other sub-nodes. When it is necessary to read the information, the information can be read from the sub-node that actually stores the information through the association information, without the need to repeatedly store the same information, which can effectively save memory.

[0039] Secondly, for the device tree currently used to read node information, when a screen node corresponding to a display screen needs to be added, all the corresponding information under the screen node needs to be written. Exemplarily, the newly added screen node is the third screen node, and the third screen node belongs to the same level of nodes as the first screen node and the second screen node.

[0040] like Figure 2As shown, the figure is a schematic diagram of a device tree after adding a new screen node according to an embodiment of the present application. For the third screen node (screen node 3), two child nodes are associated with the third screen node, namely the fifth second-level child node (child node 3.1) and the sixth second-level child node (child node 3.2), wherein the sixth second-level child node is the parent node of the fifth third-level child node (child node 3.2.1) and the sixth third-level child node (child node 3.2.2).

[0041] It can be seen that for the current device tree, since each display screen corresponds to a separate screen node, that is, each screen node is independent of each other, when a new screen node needs to be added, all the information corresponding to the screen node needs to be written, and the amount of data under the screen node is usually large, which increases the difficulty of system maintenance.

[0042] Based on this, in this application, the sub-nodes corresponding to the same information are linked by establishing associated information. When a new screen node is added, it is only necessary to write the sub-node with information different from that stored in the already written sub-node. For the sub-node with the same information as that stored in the written sub-node, it is only necessary to establish associated information to associate the sub-node under the newly added screen node with the sub-node under the corresponding screen node. There is no need to write all the corresponding information under the newly added screen node, making the system easy to maintain.

[0043] It should be noted that, generally, there are a large number of screen nodes under the DRM framework, and currently each screen node stores a large amount of information, for example, each screen node stores thousands of rows of data information. The number of screen nodes existing under the DRM framework is not specifically limited in this application. For the sake of ease of introduction, the embodiment of this application is described by taking 2 to 3 screen nodes under a DRM framework as an example.

[0044] Combine the following Figure 3-Figure 5 , the application scenarios provided by the embodiments of the present application are introduced.

[0045] When the user starts the electronic device, the electronic device will read the information in the screen node corresponding to the display screen of the electronic device to realize image display on the display screen. Specifically, before reading the information in the screen node, it is necessary to find the corresponding subnode under the screen node.

[0046] like Figure 3 As shown in FIG. 1 , this figure is a schematic diagram of a device tree including associated information provided by an embodiment of the present application. Figure 1The same as in the example, there are two screen nodes under the root node, namely the first screen node and the second screen node. Specifically, the first display screen corresponds to the first screen node (screen node 1), and the second display screen corresponds to the second screen node (screen node 2). For the first screen node, two child nodes are associated with it, namely the first and second-level child nodes (child node 1.1) and the second and second-level child nodes (child node 1.2), wherein the second and second-level screen nodes are associated with two child nodes, namely the first and third-level child nodes (child node 1.2.1) and the second and third-level child nodes (child node 1.2.2); for the second screen node, the second screen node is also associated with two child nodes, namely the third and second-level child nodes (child node 2.1) and the fourth and second-level child nodes (child node 2.2), wherein only the information in the third and third-level child nodes (child node 2.2.1) is different from the information in the first screen node. That is, among them, only child node 2.2.1 is different from child node 1.2.1.

[0047] Exemplarily, the root node may be an MDSs node, and the MDSs node may be used to store source data of the file system.

[0048] Since only the information in subnode 2.2.1 in the second screen node is different from the information in the first screen node, association information is established under the second screen node in the present application. Exemplarily, the association information can be in the form of a string, which is used to link subnode 1.2.2 under the first screen node when searching for subnode 2.2.2 to read the information in subnode 1.2.2. At the same time, the part that is different from that in the first screen node is retained under subnode 2.2, that is, the information in subnode 2.2.1 is still saved under subnode 2.2. In the present application, by establishing association information, while providing convenience for system maintenance, it avoids repeated storage of the same data and effectively reduces memory usage.

[0049] like Figure 4As shown, the figure is a schematic diagram of a search for a subnode 2.1 provided by an embodiment of the present application. In the case where the display screen of the electronic device corresponds to the second screen node, it is necessary to read the information corresponding to each subnode under the second screen node. Taking the reading of the information corresponding to the subnode 2.1 as an example, first find the second screen node corresponding to the display screen of the electronic device from the root node, that is, find the second screen node, and then find the subnode 2.1 under the second screen node. If the subnode 2.1 is not found, find whether there is associated information under the second screen node. When it is found that there is associated information under the second screen node, and the associated information is found to link the first screen node, it means that the subnode 2.1 under the second screen node is associated with the subnode 1.1 under the first screen node through the associated information, that is, the information in the subnode 2.1 is the same as the information in the subnode 1.1, and then the subnode 1.1 can be found in the first screen node. After finding the subnode 1.1, the information in the subnode 1.1 is returned, and the information in the subnode 1.1 is the information that should be stored in the subnode 2.1.

[0050] like Figure 5 As shown, this figure is a schematic diagram of searching for a sub-node 2.2.2 provided by an embodiment of the present application. In the case that the sub-node 2.2.2 is not found in the second screen node, it is searched whether there is associated information under the parent node of the sub-node 2.2.2, that is, it is searched whether there is associated information under the sub-node 2.2. In the case that there is no associated information in the sub-node 2.2, it is searched whether there is associated information under the parent node of the sub-node 2.2, that is, it is searched whether there is associated information under the second screen node. Figure 5 As shown, the associated information can be found in the second screen node, and the associated information is equal to the first screen node. In this case, the subnode 1.2 can be found in the first screen node. Since the subnode 2.2.2 is not found under the second screen node, but the associated information is found to be equal to the first screen node, it means that the information in the subnode 1.2.2 is the same as the information that should be stored in the subnode 2.2.2. Then, after finding the subnode 1.2, the subnode 1.2.2 is searched in the subnode 1.2, and the information found in the subnode 1.2.2 is returned as the result.

[0051] In the embodiment of the present application, when the electronic device is started, under the first screen node corresponding to the first display screen of the electronic device, the first sub-node is searched to read the first information corresponding to the first sub-node. If the first sub-node is not found, the associated information can be searched step by step under the upper node corresponding to the first sub-node. When the associated information associates the first sub-node with the second sub-node under the second screen node, the second information in the second sub-node can be read when the associated information is found. Since the associated information for linking sub-nodes corresponding to the same information is provided in the present application, when a new screen node is added, it is not necessary to write all the information corresponding to the screen node. When reading the information corresponding to the display screen, the associated information can be used to read the relevant information from the sub-node that actually stores the information, thereby making the system easy to maintain. The following combines the above scenarios and Figure 4-Figure 6 , a method for reading node information provided in an embodiment of the present application is introduced, Figure 6 A flowchart of a method for reading node information provided in an embodiment of the present application.

[0052] S101. Call the reconstructed attribute value acquisition function and send a read instruction.

[0053] Specifically, in the case of a first screen node corresponding to a first display screen of an electronic device, when the electronic device is started, it is necessary to read the information corresponding to each sub-node under the first screen node to realize the image display of the first display screen. The read instruction is used to instruct to read the information corresponding to each sub-node under the first screen node. Exemplarily, the following is introduced by taking the reading of the first sub-node under the first screen node as an example, and the first sub-node is used to store the first information of the first display screen.

[0054] In the DRM native framework, a native function for obtaining property values ​​is used to obtain property values. Exemplarily, the native function for obtaining property values ​​used in the DRM native framework is the of_get_property function, which is used to return the property value under each node, that is, to return the information stored in each node.

[0055] In order to facilitate system maintenance, save memory, and avoid repeated storage of the same data, the application rewrites and reconstructs the get property value function in the DRM native framework, and obtains the reconstructed get property value function, so as to call the reconstructed get property value function, send a read instruction, and read the information corresponding to each sub-node under the first screen node. Exemplarily, in this application, the of_get_property function can be rewritten as the lcdkit_get_property function, and the lcdkit_get_property function can be called to execute the node information reading method provided in the embodiment of this application.

[0056] S102. In response to the read instruction, search for the first child node under the first screen node.

[0057] Specifically, since there are a large number of identical parts in the information corresponding to each screen node, the present application associates the sub-nodes storing the same information in different screen nodes by establishing associated information, and uses at least one of the sub-nodes as the sub-node that actually stores the information. Information is not stored in the remaining sub-nodes, but associated information is established to associate them with the sub-nodes that actually store the information.

[0058] Exemplarily, the association information can be used to associate the first subnode with the second subnode under the second screen node. The second screen node corresponds to the second display screen, and the second subnode is used to store the second information of the second display screen, and the second information is the same as the first information. For example, Figure 4 , the information in subnode 1.1 under screen node 1 is the same as the corresponding information in subnode 2.1, and subnode 1.1 actually stores information, while subnode 2.1 does not actually store information. Instead, there is associated information under screen node 2, and the associated information is equal to screen node 1, indicating that the information that should be stored in subnode 2.1 can be read from subnode 1.1.

[0059] Since the first child node may not be a child node that actually stores information, but needs to be linked to a child node that stores corresponding information through associated information. Therefore, in response to the read instruction, it is necessary to first find out whether the first child node exists in the first screen node. Exemplarily, the native property value acquisition function of_get_property function in the DRM framework can be called to try to obtain whether the first information exists in the first screen node. If the first child node does not exist under the first screen node, the first information cannot be obtained.

[0060] If there is a first child node under the first screen node, it means that the first child node is a child node that stores information. The first information in the first child node can be directly read, that is, the attribute value corresponding to the first child node can be directly returned to realize the image display of the display screen corresponding to the first screen node.

[0061] If the first child node does not exist in the first screen node, it means that the first child node is not a child node for storing information, and S103 is executed.

[0062] S103: Determine whether the current node is a root node.

[0063] Specifically, in the present application, when the first child node is not found, the associated information is searched for level by level in the parent node of the first child node. In the process of searching for the associated information, it is necessary to determine whether the node currently being searched is a root node.

[0064] Exemplarily, when searching for associated information under the parent node of the first child node, it is determined whether the parent node of the first child node is a root node. If the parent node of the first child node is a root node, it indicates that the search for the current first screen node has been completed. If the parent node of the first child node is a root node, it indicates that the first information cannot be read in the first screen node, and S104 is executed to return to the current node. That is, in this case, the current node is the parent node of the first child node. If the parent node of the first child node is not a root node, S105 is executed.

[0065] Exemplarily, the root nodes in the embodiments of the present application may include qcom, mdss_mdp nodes and soc nodes, etc.

[0066] S105: Determine whether association information is set under the current node.

[0067] Specifically, when the current node is the parent node of the first child node, determine whether the association information is set under the parent node of the first child node. When the parent node of the first child node is not the root node, you can continue to search whether there is association information under the parent node of the first child node. The association information is used to associate child nodes corresponding to the same information in different screen nodes, wherein at least one child node actually stores information, while the remaining child nodes do not store information, but establish association information to associate with the child nodes that actually store information.

[0068] Exemplarily, in the case where the association information links two child nodes corresponding to the same information, and the first information corresponding to the first child node is the same as the second information corresponding to the second child node, then the first information can be stored only in the first child node, and the association information can be set in the second child node. When the second information corresponding to the second child node needs to be read, since the second child node is associated with the first child node through the association information, the first information in the first child node can be read through the association information, and the first information in the first child node is used as the second information corresponding to the second child node, and returned as the result. Similarly, the second information can be stored only in the second child node, and the association information can be set in the first child node. When the first information corresponding to the first child node needs to be read, the second information in the second child node can be read through the association information, and the second information is used as the first information corresponding to the first child node, and returned as the result.

[0069] In the case where the association information links three child nodes corresponding to the same information, the information corresponding to the first child node, the second child node, and the third child node is the same. Similarly, the first information can be stored only in the first child node, and the association information can be set in the second child node and the third child node respectively. When it is necessary to read the information corresponding to the second child node or the third child node, the association information can be used to link to the first child node, read the information in the first child node, use the information in the first child node as the information corresponding to the second child node or the third child node, and return it as the result.

[0070] It should be noted that in the present application, the first sub-node can be used as a sub-node for storing information, and related information can be set in the second screen node, or the second sub-node can be used as a sub-node for storing information, and related information can be set in the first sub-node. The above is only an example and is not specifically limited in the present application.

[0071] If no association information is set under the parent node of the first child node, S106 is executed to search for association information in the parent node of the current node.

[0072] Exemplarily, when the previous node is the parent node of the first child node, the associated information is searched in the parent node of the parent node of the first child node. Specifically, in the embodiment of the present application, when the first child node is not found, the associated information can be searched level by level under the upper-level node corresponding to the first child node until the associated information is found. Among them, the upper-level node corresponding to the first child node may include the parent node of the first child node, the parent node of the parent node of the first child node, and so on.

[0073] For example, Figure 5 As shown, in the process of reading the child node 2.2.2, the associated information is first searched under the parent node of the child node 2.2.2, that is, the associated information is searched under the child node 2.2. Since the associated information is not set in the child node 2.2, the associated information is continued to be searched under the parent node of the parent node of the child node 2.2.2, that is, the parent node of the screen node 2.2, the second screen node (screen node 2), until the associated information is found under the second screen node. After the associated information is found, S108 is executed.

[0074] If association information is set in the parent node of the first child node, it means that the first child node is associated with a child node of storage information through the association information, and the first information corresponding to the first child node is the same as the information corresponding to the child node of the storage information, which is equivalent to the first information being stored in the child node of the storage information associated with the first child node through the association information. In this case, execute S107.

[0075] S107. Return to the second child node.

[0076] Among them, the first subnode is associated with the second subnode under the second screen node through the association information, the second screen node corresponds to the second display screen, the second subnode is used to store the second information of the second display screen, and the second information is the same as the first information. The screen node storing the information is the screen node that actually stores the information. In the case where the first information is not actually stored in the first subnode, but the association information is set in the parent node of the first subnode, and the first subnode is associated with the second subnode storing the information through the association information, it means that the first information corresponding to the first subnode is the same as the second information in the second subnode storing the information, which is equivalent to storing the first information in the second subnode. Furthermore, after finding the association information, the second subnode storing the information associated with the first subnode through the association information can be returned.

[0077] S108. Read information.

[0078] Specifically, after returning the second child node of the storage information associated with the first child node through the association information, the second information is read from the second child node, and the second information is used as the first information corresponding to the first child node and returned as a result.

[0079] In a possible implementation, in the process of searching for associated information in the parent nodes of the first child node step by step, if a parent node of the first child node is found to be a root node, after executing S104 and returning to the current node, S108 may be executed to read the information in the current node.

[0080] In the embodiment of the present application, the reconstructed attribute value acquisition function is called to execute the reading of the first information. However, since there are electronic devices that do not support the calling of the reconstructed attribute value acquisition function, in a possible implementation, before sending the read instruction based on the reconstructed attribute value acquisition function, that is, when the electronic device is started, the electronic device is parsed to obtain the parsing result. When the parsing result is that the electronic device supports the calling of the reconstructed attribute value acquisition function, the first child node is searched under the first screen node.

[0081] Specifically, Figure 7 As shown, this figure is a flow chart of an analysis method provided in an embodiment of the present application, which includes S201 to S203.

[0082] S201, calling a parsing function to determine whether the electronic device supports calling the reconstructed attribute value acquisition function. The parsing function is used to determine whether the electronic device supports calling the reconstructed attribute value acquisition function. Exemplarily, a flag bit can be set in a node, the parsing function is called, the flag bit is read, and whether the electronic device supports calling the reconstructed attribute value acquisition function is determined according to the flag bit.

[0083] If the electronic device does not support calling the reconstructed attribute value acquisition function, execute S202; if the electronic device supports calling the reconstructed attribute value acquisition function, execute S203.

[0084] S202, execute the default reading method. That is, if the electronic device does not support calling the reconstructed get attribute value function, the default node information reading method is still used, that is, only calling the get attribute value function in the original DRM architecture, based on the original device tree (such as Figure 1 As shown), to obtain the first information corresponding to the first child node.

[0085] S203, calling the reconstructed attribute value acquisition function to read the node information. That is, if the electronic device supports calling the reconstructed attribute value acquisition function, it means that the node information reading method provided by the embodiment of the present application can be executed, and a read instruction can be sent based on the reconstructed attribute value acquisition function.

[0086] In summary, in the present application, when the electronic device is started, the first sub-node is searched under the first screen node corresponding to the first display screen of the electronic device. When the first sub-node is not found, the associated information is searched step by step under the upper-level node corresponding to the first sub-node. When the associated information is found, the second information in the second sub-node is read. Since the associated information for associating sub-nodes corresponding to the same information is set in the present application, when a new screen node is added, it is not necessary to write all the information corresponding to the screen node. For the same information, the sub-node under the newly added screen node can be associated with the sub-node storing the information by setting the associated information, so that when reading the information corresponding to the sub-node under the newly added screen node, the information can be read from the sub-node storing the information through the associated information, thereby making the system easy to maintain. At the same time, since there is no need to store a large amount of repeated information, the memory usage is effectively reduced.

[0087] In some embodiments, the electronic device may be a mobile phone, a tablet computer, a desktop, a laptop, a notebook computer, an ultra-mobile personal computer (UMPC), a handheld computer, a netbook, a personal digital assistant (PDA), a wearable electronic device, a smart watch, etc. The present application does not impose any special restrictions on the specific form of the above electronic devices. In this embodiment, the structure of the electronic device may be as follows: Figure 8 As shown, Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0088] like Figure 8As shown, the electronic device may include a processor 110, an external memory interface 120, an internal memory 121, an antenna 1, an antenna 2, a mobile communication module 130, a wireless communication module 140, a sensor module 150, a motor 160, a camera 161, and a display screen 162, etc. The sensor module 150 may include a pressure sensor 150A, a proximity light sensor 150B, a touch sensor 150C, an ambient light sensor 150D, etc.

[0089] It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than shown in the figure, or combine some components, or split some 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 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and / or a neural network processor (neural-network processing unit, NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors. For example, in the present application, the processor 110 can search for a first sub-node under a first screen node corresponding to a first display screen of the electronic device when the electronic device is started, and the first sub-node is used to store the first information of the first display screen; when the first sub-node is not found, the associated information is searched level by level under the upper node corresponding to the first sub-node, and the associated information is used to associate the first sub-node with the second sub-node under the second screen node, the second screen node corresponds to the second display screen, and the second sub-node is used to store the second information of the second display screen, and the second information is the same as the first information; when the associated information is found, the second information in the second sub-node is read.

[0091] The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.

[0092] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 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 110, and thus improves the efficiency of the system.

[0093] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuits 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, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[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 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 150C, the charger, the flash, the camera 161, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 150C through the I2C interface, so that the processor 110 communicates with the touch sensor 150C through the I2C bus interface to realize the touch function of the electronic device.

[0095] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 140 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.

[0096] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 140 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 140 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0097] 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 110 and the wireless communication module 140. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 140 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 140 through the UART interface to implement the function of playing music through a Bluetooth headset.

[0098] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 162 and the camera 161. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 161 communicate via the CSI interface to realize the shooting function of the electronic device. The processor 110 and the display screen 162 communicate via the DSI interface to realize the display function of the electronic device.

[0099] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 161, the display 162, the wireless communication module 140, the audio module 170, the sensor module 150, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0100] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, mobile communication module 130, wireless communication module 140, modem processor and baseband processor.

[0101] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 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.

[0102] The mobile communication module 130 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to electronic devices. The mobile communication module 130 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 130 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 130 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 130 may be arranged in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 130 may be arranged in the same device as at least some of the modules of the processor 110.

[0103] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 162. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 130 or other functional modules.

[0104] The wireless communication module 140 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to electronic devices. The wireless communication module 140 can be one or more devices integrating at least one communication processing module. The wireless communication module 140 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signal and filters it, and sends the processed signal to the processor 110. The wireless communication module 140 can also receive the signal to be sent from the processor 110, modulate the frequency, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0105] In some embodiments, the antenna 1 of the electronic device is coupled to the mobile communication module 130, and the antenna 2 is coupled to the wireless communication module 140, so that the electronic device can communicate with the network and other devices through wireless communication technology. The 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 code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite-based augmentation system (SBAS).

[0106] The electronic device implements the display function through a GPU, a display screen 162, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 162 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0107] The display screen 162 is used to display images, videos, etc. The display screen 162 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, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device may include 1 or N display screens 162, where N is a positive integer greater than 1.

[0108] A series of graphical user interfaces (GUIs) can be displayed on the display screen 162 of the electronic device, and these GUIs are the main screens of the electronic device. Generally speaking, the size of the display screen 162 of the electronic device is fixed, and only limited controls can be displayed on the display screen 162 of the electronic device. A control is a GUI element, which is a software component included in an application program, and controls all data processed by the application program and interactive operations on these data. Users can interact with the control through direct manipulation to read or edit relevant information of the application program. Generally speaking, a control can include visual interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets.

[0109] The electronic device can realize the shooting function through ISP, camera 161, video codec, GPU, display screen 162 and application processor.

[0110] The external memory interface 120 can be used to connect an external memory card, such as a MicroSD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos can be stored in the external memory card.

[0111] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 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 storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory 121, and / or the instructions stored in the memory provided in the processor.

[0112] The pressure sensor 150A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 150A can be set on the display screen 162. There are many types of pressure sensors 150A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 150A, the capacitance between the electrodes changes. The electronic device determines the intensity of the pressure based on the change in capacitance. When a touch operation acts on the display screen 162, the electronic device detects the touch operation intensity according to the pressure sensor 150A. The electronic device can also calculate the touch position according to the detection signal of the pressure sensor 150A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.

[0113] The ambient light sensor 150D is used to sense the brightness of the ambient light. The electronic device can adaptively adjust the brightness of the display screen 162 according to the perceived ambient light brightness. The ambient light sensor 150D can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 150D can also cooperate with the proximity light sensor 150B to detect whether the electronic device is in a pocket to prevent accidental touch.

[0114] The touch sensor 150C is also called a "touch control device". The touch sensor 150C can be set on the display screen 162, and the touch sensor 150C and the display screen 162 form a touch screen, also called a "touch control screen". The touch sensor 150C is used to detect touch operations acting on or near it. The touch sensor 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 162. In other embodiments, the touch sensor 150C can also be set on the surface of the electronic device, which is different from the position of the display screen 162.

[0115] Motor 160 can generate vibration prompts. Motor 160 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 162, motor 160 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.

[0116] In addition, an operating system is running on the above components, such as the iOS operating system developed by Apple, the Android open source operating system developed by Google, and the Windows operating system developed by Microsoft. Application programs can be installed and run on the operating system.

[0117] The operating system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device.

[0118] Fig. 9 It is a software structure block diagram of the electronic device according to an embodiment of the present application.

[0119] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system may include an application framework layer, an Android runtime (Android runtime) and a system library, and a kernel layer.

[0120] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions. For example, the predefined functions in this application may include a reconstructed attribute value acquisition function, a native attribute value acquisition function, etc. Fig. 9 As shown, the application framework layer may include a view system, a resource manager, and the like.

[0121] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0122] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0123] AndroidRuntime includes core libraries and virtual machines. AndroidRuntime is responsible for scheduling and management of the Android system.

[0124] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0125] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0126] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0127] A 2D graphics engine is a drawing engine for 2D drawings.

[0128] The kernel layer is the layer between hardware and software. The kernel layer contains at least the DRM framework, display driver, sensor driver, and camera driver.

[0129] It should be noted that although the embodiments of the present application are described using the Android system as an example, its basic principles are also applicable to electronic devices based on operating systems such as iOS and Windows.

[0130] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for reading node information, characterized in that: include: When the electronic device is started, the reconstructed attribute value acquisition function is called and a read instruction is sent, wherein the reconstructed attribute value acquisition function is obtained by rewriting the native attribute value acquisition function in the direct rendering manager DRM; In response to the read instruction, searching for a first sub-node under a first screen node corresponding to a first display screen of the electronic device, wherein the first sub-node is used to store first information of the first display screen; When the first sub-node is not found, under the upper-level node corresponding to the first sub-node, association information is searched level by level, the association information is used to associate the first sub-node with a second sub-node under a second screen node, the second screen node corresponds to a second display screen, the second sub-node is used to store second information of the second display screen, and the second information is the same as the first information; When the associated information is found, the second information in the second sub-node is read.

2. The method according to claim 1, characterized in that When the first child node is not found, searching for associated information level by level under the upper-level node corresponding to the first child node includes: When the first child node is not found, searching for the association information under the parent node of the first child node; When the association information is not found under the parent node of the first child node, the association information is searched under the parent node of the parent node of the first child node.

3. The method according to claim 2, characterized in that When the first child node is not found, searching for the association information under the parent node of the first child node includes: When the first child node is not found, determining whether the parent node of the first child node is a root node; When it is determined that the parent node of the first child node is not a root node, the association information is searched under the parent node of the first child node.

4. The method according to claim 3, characterized in that After determining whether the parent node of the first child node is a root node when the first child node is not found, the method further includes: When it is determined that the parent node of the first child node is the root node, information in the parent node of the first child node is read.

5. The method according to claim 1, characterized in that When the electronic device is started, the reconstructed attribute value acquisition function is called and a read instruction is sent, including: When the electronic device is started, the electronic device is analyzed to obtain an analysis result; When the analysis result indicates that the electronic device supports calling the reconstructed attribute value acquisition function, the reconstructed attribute value acquisition function is called and a read instruction is sent.

6. The method according to claim 1, characterized in that In response to the read instruction, searching for a first subnode under a first screen node corresponding to a first display screen of the electronic device includes: In response to the read instruction, a native attribute value acquisition function in the direct rendering manager DRM is called to search for a first child node under a first screen node corresponding to a first display screen of the electronic device.

7. The method according to any one of claims 1 to 6, characterized in that: When the electronic device is started, after searching for the first sub-node under the first screen node corresponding to the first display screen of the electronic device, the method further includes: When the first sub-node is found, the first information in the first sub-node is read.

8. An electronic device, characterized in that: The electronic device comprises a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the steps of a method for reading node information as described in any one of claims 1 to 7 according to the instructions in the program code.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of a method for reading node information according to any one of claims 1 to 7 are implemented.