CN-116881302-B - Product information configuration method and related device
Abstract
The embodiment of the application discloses a product information configuration method and a related device, wherein the method comprises the steps of determining an identifier corresponding to electronic equipment and an identifier hierarchical mapping file, adjusting a first data structure according to the identifier hierarchical mapping file to obtain a target data structure, wherein the first data structure is established when the electronic equipment is started, searching structural data in the target data structure to obtain a target list, wherein the target list comprises target resource data matched with the identifier and target priority corresponding to the target resource data, and configuring the target resource data according to the target priority corresponding to the target resource data to obtain product information corresponding to the electronic equipment. The embodiment of the application is beneficial to reducing the redundancy of product information.
Inventors
- YUAN HUAN
Assignees
- OPPO广东移动通信有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20230720
Claims (10)
- 1. A product information configuration method applied to an electronic device, comprising: Determining an identifier and an identifier hierarchical mapping file corresponding to the electronic equipment, wherein the identifier hierarchical mapping file is adapted to the electronic equipment; adjusting a first data structure according to the identifier hierarchical mapping file to obtain a target data structure, wherein the first data structure is established when the electronic equipment is started, and the first data structure is established according to a default initial identifier hierarchical mapping file; Searching structural data in the target data structure to obtain a target list, wherein the target list comprises target resource data matched with the identifier and target priority corresponding to the target resource data; and configuring the target resource data according to the target priority corresponding to the target resource data to obtain the product information corresponding to the electronic equipment.
- 2. The method of claim 1, wherein prior to determining the identifier-hierarchical mapping file to which the identifier corresponds, the method further comprises: determining the identifier in response to a start-up instruction, and storing the identifier; Reading the initial identifier hierarchical mapping file; and establishing the first data structure according to the initial identifier hierarchical mapping file.
- 3. The method of claim 2, wherein the first data structure comprises a plurality of first hierarchies, each first hierarchy corresponding to a first identifier packet, each first identifier packet associated with first resource data, the first resource data comprising at least one first subset of product information, data isolation between the first subsets of product information, each first identifier packet and/or associated first resource data corresponding to a first priority.
- 4. A method according to claim 3, wherein said adjusting the first data structure according to the identifier hierarchy map file to obtain the target data structure comprises: Determining resource data associated with the identifier group indicated by the identifier hierarchical mapping file, and a hierarchy; Comparing the hierarchy with the plurality of first hierarchies to determine whether a hierarchy needs to be newly added in the first data structure; If a hierarchy needs to be newly added in the first data structure, merging the hierarchy into the first hierarchies of the first data structure, and merging the resource data into the corresponding hierarchies to obtain a second data structure, wherein the second data structure comprises a plurality of second hierarchies, each second hierarchy corresponds to a second identifier group, each second identifier group is associated with second resource data, and each second identifier group and/or the associated second resource data corresponds to one first priority; Respectively comparing the priority corresponding to the resource data associated with the identifier packet with a plurality of first priorities corresponding to a plurality of first resource data, and determining whether the first priority corresponding to any one of the first resource data in the second data structure needs to be adjusted; And if the first priority corresponding to any one of the first resource data in the second data structure needs to be adjusted, merging the priorities corresponding to the resource data associated with the identifier packets into the plurality of first priorities to obtain a plurality of second priorities, and obtaining the target data structure, wherein each second resource data corresponds to the second priority, the target data structure comprises a plurality of second levels, each second level corresponds to one second identifier packet, and each second identifier packet is associated with the second resource data.
- 5. The method according to claim 1 or 4, wherein the configuring the target resource data according to the target priority corresponding to the target resource data to obtain the product information corresponding to the electronic device includes: Sorting the target resource data according to the target priority corresponding to the target resource data; and in the sorting process, replacing the target resource data with higher target priority with the target resource data with lower target priority to obtain the product information.
- 6. The method of claim 4, wherein the structured data comprises a plurality of second hierarchies having structured mappings and the second identifier groupings corresponding to each of the second hierarchies, and wherein the searching the structured data in the destination data structure for a destination list comprises: Searching a plurality of second identifier groups corresponding to the plurality of second levels in the target data structure to obtain target identifier groups matched with the identifiers; Determining target resource data corresponding to the target identifier packet; and generating the target list according to the target identifier group and the corresponding target resource data.
- 7. The method of claim 5, wherein the product information is stored in an attribute service that is used to provide a product information query service to a system service or an application.
- 8. A product information configuration device is characterized in that the device is applied to an electronic device and comprises a determination unit, an adjustment unit, a search unit and a configuration unit, wherein, The determining unit is used for determining an identifier and an identifier hierarchical mapping file corresponding to the electronic equipment, wherein the identifier hierarchical mapping file is adapted to the electronic equipment; The adjusting unit is used for adjusting a first data structure according to the identifier hierarchical mapping file to obtain a target data structure, wherein the first data structure is established when the electronic equipment is started, and the first data structure is established according to a default initial identifier hierarchical mapping file; the searching unit is used for searching structural data in the target data structure to obtain a target list, wherein the target list comprises target resource data matched with the identifier and target priority corresponding to the target resource data; The configuration unit is configured to configure the target resource data according to the target priority corresponding to the target resource data, so as to obtain product information corresponding to the electronic equipment.
- 9. An electronic device comprising a processor, a memory, a communication interface, and one or more programs stored in the memory and configured to be executed by the processor, the programs comprising instructions for performing the steps in the method of any of claims 1-7.
- 10. A computer-readable storage medium, characterized in that a computer program for electronic data exchange is stored, wherein the computer program causes a computer to perform the method according to any one of claims 1-7.
Description
Product information configuration method and related device Technical Field The application relates to the technical field of electronic equipment, in particular to a product information configuration method and a related device. Background When an Over-the-Air Technology (OTA) is upgraded, the electronic device may typically compile different product information for each region and/or operator on the market through a brushkit, or load the region and/or operator product information from the partition according to an identifier written when the electronic device is produced. However, in general, the version storage of the package consumes a lot of storage resources, and when product information of an area and/or an operator is loaded from a partition according to identifiers, there is a lot of redundant information when there is the same complete subset of product information for a plurality of identifiers, and a lot of traffic resources are consumed by a user when the OTA is upgraded. Disclosure of Invention The embodiment of the application provides a product information configuration method and a related device, which simplify the customization work of product information of multiple areas/operators of electronic equipment while removing redundant product information. In a first aspect, an embodiment of the present application provides a method for configuring product information, which is applied to an electronic device, and the method includes: Determining an identifier and an identifier hierarchical mapping file corresponding to the electronic equipment, wherein the identifier hierarchical mapping file is adapted to the electronic equipment; According to the identifier hierarchical mapping file, a first data structure is adjusted to obtain a target data structure, wherein the first data structure is established when the electronic equipment is started; Searching structural data in the target data structure to obtain a target list, wherein the target list comprises target resource data matched with the identifier and target priority corresponding to the target resource data; and configuring the target resource data according to the target priority corresponding to the target resource data to obtain the product information corresponding to the electronic equipment. In a second aspect, an embodiment of the present application provides a product information configuration apparatus, which is applied to an electronic device, and includes a determining unit, an adjusting unit, a searching unit, and a configuration unit, wherein, The determining unit is used for determining an identifier and an identifier hierarchical mapping file corresponding to the electronic equipment, wherein the identifier hierarchical mapping file is adapted to the electronic equipment; The adjusting unit is used for adjusting a first data structure according to the identifier hierarchical mapping file to obtain a target data structure, wherein the first data structure is established when the electronic equipment is started; the searching unit is used for searching structural data in the target data structure to obtain a target list, wherein the target list comprises target resource data matched with the identifier and target priority corresponding to the target resource data; The configuration unit is configured to configure the target resource data according to the target priority corresponding to the target resource data, so as to obtain product information corresponding to the electronic equipment. In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a memory, a communication interface, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the processor, the programs including instructions for performing steps in any of the methods of the first aspect of the embodiments of the present application. In a fourth aspect, embodiments of the present application provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program causes a computer to perform part or all of the steps as described in any of the methods of the first aspect of the embodiments of the present application. In a fifth aspect, embodiments of the present application provide a computer program product, wherein the computer program product comprises a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps described in any of the methods of the first aspect of the embodiments of the present application. The computer program product may be a software installation package. It can be seen that in the embodiment of the application, an identifier and an identifier hierarchical mapping file corresponding to the electronic device can be determined, wherein the identifie