CN115878202A - Attribute value loading method and device, electronic equipment and storage medium - Google Patents

Attribute value loading method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115878202A
CN115878202A CN202211651326.1A CN202211651326A CN115878202A CN 115878202 A CN115878202 A CN 115878202A CN 202211651326 A CN202211651326 A CN 202211651326A CN 115878202 A CN115878202 A CN 115878202A
Authority
CN
China
Prior art keywords
target
attribute value
attribute
target attribute
value corresponding
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211651326.1A
Other languages
Chinese (zh)
Inventor
程鑫茹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wingtech Communication Co Ltd
Original Assignee
Wingtech Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wingtech Communication Co Ltd filed Critical Wingtech Communication Co Ltd
Priority to CN202211651326.1A priority Critical patent/CN115878202A/en
Publication of CN115878202A publication Critical patent/CN115878202A/en
Pending legal-status Critical Current

Links

Images

Abstract

The embodiment of the application relates to the technical field of data processing, and discloses a method and a device for loading attribute values, electronic equipment and a storage medium, wherein the method comprises the following steps: recording a real-time attribute value corresponding to a target attribute as a target attribute value corresponding to the target attribute into a target set in real time, wherein the target attribute value is always consistent with the real-time attribute value, and the target attribute is any one of a plurality of attributes included by an operating system; and under the condition that the attribute value of the target attribute is determined to be missing, acquiring a target attribute value corresponding to the target attribute from the target set, and taking the target attribute value as a real-time attribute value corresponding to the target attribute at the current moment. By implementing the embodiment of the application, the corresponding attribute value of the target attribute with the missing attribute value in the operating system can be automatically reloaded, so that the normal operation of the operating system is ensured.

Description

Attribute value loading method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a method and an apparatus for loading an attribute value, an electronic device, and a storage medium.
Background
In an operating system (for example, an android system), an attribute system is designed for uniformly managing attributes of the system, wherein each attribute in the attribute system corresponds to an attribute name and an attribute value and is used for recording system setting information in the operating system or interaction information between system processes.
In practice, it is found that attribute values corresponding to the attributes may be flushed away in the running process of the operating system, so that the attribute values of some attributes are missing, and the normal running of the operating system may be affected.
Disclosure of Invention
The embodiment of the application discloses a method and a device for loading attribute values, electronic equipment and a storage medium, which can automatically reload corresponding attribute values of target attributes with missing attribute values in an operating system so as to ensure the normal operation of the operating system.
A first aspect of the embodiments of the present application discloses a method for loading attribute values, where an operating system includes multiple attributes, each attribute corresponds to an attribute value, and the attribute is used to describe system setting information of the operating system or interaction information between system processes, and the method includes:
recording a real-time attribute value corresponding to a target attribute as a target attribute value corresponding to the target attribute into a target set in real time, wherein the target attribute value is always consistent with the real-time attribute value, and the target attribute is any one of a plurality of attributes included in the operating system;
and under the condition that the attribute value of the target attribute is determined to be missing, acquiring a target attribute value corresponding to the target attribute from the target set, and taking the target attribute value as a real-time attribute value corresponding to the target attribute at the current moment.
As an optional implementation manner, in the first aspect of this embodiment of the present application, the target attribute is used to record information in a target partition included in the operating system, where the target partition is any one of multiple partitions included in the operating system; and after real-time attribute values corresponding to the target attributes are recorded into a target set in real time as target attribute values corresponding to the target attributes, the method comprises the following steps:
and generating a target file according to the target set, wherein each target attribute value in the target file corresponds to one piece of identification information, and the identification information is used for representing a target partition and a target attribute to which the target attribute value belongs.
As an optional implementation manner, in the first aspect of the embodiment of the present application, acquiring a target attribute value corresponding to the target attribute from the target set, and taking the target attribute value as a real-time attribute value corresponding to the target attribute at the current time includes:
acquiring a target set according to the target file, and acquiring a target attribute value corresponding to the target attribute from the target set;
and determining a target partition and a target attribute value corresponding to the target attribute value according to the identification information corresponding to the target attribute value, and taking the target attribute value as a real-time attribute value corresponding to the target attribute in the target partition at the current moment.
As an optional implementation manner, in the first aspect of the embodiment of the present application, after obtaining the target attribute value corresponding to the target attribute from the target set, the method further includes:
judging whether the target attribute value is compatible with other first attribute values included by the operating system;
and if the second attribute value included in the first attribute value is not compatible with the target attribute value, deleting the second attribute value.
As an optional implementation manner, in the first aspect of this embodiment of the present application, after the determining that the attribute value of the target attribute is missing, the method further includes:
if the target attribute value corresponding to the target attribute is not obtained in the target set, generating an environment variable through a preset script program, and taking the environment variable as a real-time attribute value corresponding to the target attribute at the current moment.
As an optional implementation manner, in the first aspect of the embodiment of the present application, acquiring a target attribute value corresponding to the target attribute from the target set includes:
and acquiring a target attribute value corresponding to the target attribute from a target set through a target function, wherein the target function comprises an import function.
As an optional implementation manner, in the first aspect of this embodiment of the present application, before the determining that the attribute value of the target attribute is missing, the method further includes:
if the operating system is detected to be executing the operation of loading the mirror image of the system directory, determining that the attribute value of the target attribute is missing under the condition that the operation of loading the mirror image of the system directory is completed.
A second aspect of the embodiments of the present application discloses an attribute value loading apparatus, where an operating system includes multiple attributes, each attribute corresponds to an attribute value, and the attribute is used to describe system setting information of the operating system or interaction information between system processes, the apparatus includes:
a recording unit, configured to record a real-time attribute value corresponding to a target attribute as a target attribute value corresponding to the target attribute into a target set in real time, where the target attribute value is always consistent with the real-time attribute value, and the target attribute is any one of multiple attributes included in the operating system;
and the loading unit is used for acquiring a target attribute value corresponding to the target attribute from the target set under the condition that the attribute value of the target attribute is determined to be missing, and taking the target attribute value as a real-time attribute value corresponding to the target attribute at the current moment.
A third aspect of an embodiment of the present application discloses an electronic device, including:
a memory storing executable program code;
a processor coupled with the memory;
the processor calls the executable program code stored in the memory to execute the method for loading the attribute value disclosed in the first aspect of the embodiment of the present application.
A fourth aspect of embodiments of the present application discloses a computer-readable storage medium storing a computer program, where the computer program causes a computer to execute a method for loading an attribute value disclosed in the first aspect of embodiments of the present application.
A fifth aspect of embodiments of the present application discloses a computer program product, which, when run on a computer, causes the computer to perform part or all of the steps of any one of the methods of the first aspect of embodiments of the present application.
A sixth aspect of the present embodiment discloses an application publishing platform, where the application publishing platform is configured to publish a computer program product, where the computer program product, when running on a computer, causes the computer to perform part or all of the steps of any one of the methods in the first aspect of the present embodiment.
Compared with the related art, the embodiment of the application has the following beneficial effects:
in the embodiment of the application, a real-time attribute value corresponding to any one target attribute included in an operating system can be recorded into a target set in real time as a target attribute value corresponding to the target attribute, wherein the target attribute value in the target set is always consistent with the real-time attribute value of the target attribute; and then under the condition that the attribute value of the target attribute is determined to be missing, the target attribute value corresponding to the target attribute can be automatically acquired from the target set, and the acquired target attribute value is used as the real-time attribute value corresponding to the target attribute at the current moment, so that the condition that the normal operation of the operating system is influenced due to the missing of the attribute value of the target attribute is avoided.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic flowchart of a method for loading attribute values disclosed in an embodiment of the present application;
FIG. 2 is a flowchart illustrating another method for loading attribute values according to an embodiment of the present disclosure;
FIG. 3 is a flowchart illustrating a method for loading attribute values according to another embodiment of the present disclosure;
FIG. 4 is a schematic structural diagram illustrating loading of attribute values according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an electronic device disclosed in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first", "second", "third" and "fourth", etc. in the description and claims of the present application are used for distinguishing different objects, and are not used for describing a specific order. The terms "comprises," "comprising," and "having," and any variations thereof, in the embodiments of the present application, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements explicitly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The embodiment of the application discloses an attribute value loading method and device, electronic equipment and a storage medium, which can automatically reload corresponding attribute values of target attributes with missing attribute values in an operating system so as to ensure the normal operation of the operating system.
The technical solution of the present application will be described in detail with reference to specific examples.
To more clearly describe the method and apparatus for loading attribute values, the electronic device, and the storage medium disclosed in the embodiments of the present application, first, attributes and attribute values in an operating system are described.
In an operating system (for example, an android system), an attribute system is designed for uniformly managing attributes of the system, and an attribute name and an attribute value are correspondingly set for each attribute in the attribute system and are used for recording system setting information in the operating system or interaction information between system processes. For example: a read-only attribute whose attribute name starts with "ro.", an attribute "ctrl. Start" for starting a service, and an attribute "ctrl. Stop" for stopping a service, and the like, are not limited herein.
However, in practice, it is found that attribute values corresponding to various attributes may be flushed away during the operation of the operating system for various reasons, for example: due to the reasons that the operating system runs wrongly, the attribute system runs wrongly when recording the attribute values, and the like, the attribute values of the corresponding attributes are lost, and the normal running of the operating system is possibly influenced. In the related art, developers are usually required to manually search for missing attribute values, and then the missing attribute values are restored to corresponding attribute positions by means of compiling and the like, so that the operation is complicated and the maintenance is inconvenient.
The embodiment of the application provides a method for loading attribute values, which can record real-time attribute values corresponding to any target attribute included in an operating system as target attribute values corresponding to the target attribute in a target set in real time, wherein the target attribute values in the target set are always consistent with the real-time attribute values of the target attribute; and further, under the condition that the attribute value of the target attribute is determined to be missing, the target attribute value corresponding to the target attribute can be automatically loaded in the target set, and the loaded target attribute value is used as the real-time attribute value corresponding to the target attribute at the current moment, so that the condition that the normal operation of an operating system is influenced due to the missing of the attribute value of the target attribute is avoided. In addition, the attribute values can be automatically recorded and restored, and developers do not need to manually search and compile, so that the maintenance difficulty is reduced.
Based on this, the method for loading attribute values disclosed in the embodiments of the present application is described below.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a method for loading attribute values according to an embodiment of the present disclosure. Optionally, the method may be applied to various electronic devices or other execution bodies installed with an operating system, and is not limited herein; the electronic device may include, but is not limited to, a mobile phone, a tablet computer, a smart watch, or the like. Optionally, the method may comprise the steps of:
102. and recording the real-time attribute value corresponding to the target attribute as a target attribute value corresponding to the target attribute into a target set in real time, wherein the target attribute value is always consistent with the real-time attribute value, and the target attribute is any one of a plurality of attributes included by the operating system.
In the embodiment of the present application, the Operating System may include, but is not limited to, an android System, a Linux Operating System, or a Real Time Operating System (RTOS), and is not limited herein. The operating system may include a plurality of attributes for describing system setting information of the operating system or interaction information between system processes.
Optionally, each attribute may correspond to an attribute value, and the attribute value may be input by a developer or a user, or generated by an electronic device, which is not limited herein. Optionally, the electronic device may record, in real time, a real-time attribute value corresponding to a target attribute included in the operating system as a target attribute value corresponding to the target attribute in the target set.
Optionally, the target set may be a set generated by the electronic device and used for storing the target attribute values, so that the electronic device is convenient to record and load the target attribute values corresponding to the target attributes, that is, the electronic device is convenient to manage the target attribute values.
Alternatively, the target attribute may be any of a plurality of attributes included by the operating system. Alternatively, the target attribute may be an attribute whose attribute value does not change. In another embodiment, the target attribute may be an attribute whose attribute value may change, such as: root. Alternatively, the target attribute value recorded in the target set may change with a change in the real-time attribute value of the target attribute, so that the target attribute value in the target set and the real-time attribute value of the target attribute are always consistent.
104. And under the condition that the attribute value of the target attribute is determined to be missing, loading the target attribute value corresponding to the target attribute in the target set, and taking the target attribute value as a real-time attribute value corresponding to the target attribute at the current moment.
In the process of operating the operating system, due to reasons such as an operating system running error or an attribute system error in recording the attribute value, the attribute value of the target attribute may be missing. Further, the electronic device may load a target attribute value corresponding to the target attribute in the target set when determining that the attribute value of the target attribute is missing, that is, the electronic device may obtain the target attribute value corresponding to the target attribute from the target set; furthermore, the electronic device can use the target attribute value as a real-time attribute value corresponding to the target attribute at the current moment, so that the situation that the normal operation of the operating system is influenced due to the missing of the attribute value of the target attribute can be avoided.
By implementing the method disclosed in each embodiment, the real-time attribute value corresponding to any target attribute included in the operating system can be recorded in the target set in real time as the target attribute value corresponding to the target attribute, wherein the target attribute value in the target set and the real-time attribute value of the target attribute are always kept consistent; and further, under the condition that the attribute value of the target attribute is determined to be missing, the target attribute value corresponding to the target attribute can be automatically loaded in the target set, and the loaded target attribute value is used as the real-time attribute value corresponding to the target attribute at the current moment, so that the condition that the normal operation of the operating system is influenced due to the missing of the attribute value of the target attribute is avoided.
Referring to fig. 2, fig. 2 is a schematic flowchart illustrating another attribute value loading method according to an embodiment of the present application. Alternatively, the method may be applied to various electronic devices or other execution subjects installed with an operating system, and is not limited herein; the electronic device may include, but is not limited to, a mobile phone, a tablet computer, a smart watch, or the like. Optionally, the method may comprise the steps of:
202. and recording the real-time attribute value corresponding to the target attribute as a target attribute value corresponding to the target attribute into the target set in real time, wherein the target attribute value is always consistent with the real-time attribute value, and the target attribute is any one of a plurality of attributes included in the operating system.
As an alternative implementation manner, the electronic device may determine a first target attribute in the target set; if the first target attribute is multiple, determining a first target attribute with the same target attribute value from the multiple first target attributes, and merging the target attribute values of the first target attributes with the same target attribute value, wherein the first target attribute is an attribute with an attribute value which cannot be changed.
For example, assuming that the target attribute values corresponding to the first target attribute a and the second target attribute b are both "X", the attribute values of the first target attribute a and the second target attribute b may be merged, so that the target attribute value "X" is recorded only once in the target set, thereby reducing the amount of data stored in the target set, and further saving the storage space of the electronic device. In addition, the attribute value of the first target attribute does not change, so that the situation that the electronic equipment needs to split the first target attribute values with different attribute values subsequently due to the change of the attribute value is avoided, and the calculation amount of the electronic equipment can be reduced.
204. And generating a target file according to the target set, wherein each target attribute value in the target file corresponds to one piece of identification information, and the identification information is used for indicating a target partition and a target attribute to which the target attribute value belongs.
In an embodiment of the present application, the operating system may include a plurality of partitions (partitions). Alternatively, the target attribute may be an attribute for recording information in a target partition included in the operating system, the target partition being any one of a plurality of partitions included in the operating system. Further, the electronic device may record real-time attribute values of the target attributes corresponding to the target partition to the target set. For example: the partition a includes an attribute a1, an attribute a2, and an attribute a3, and then real-time attribute values corresponding to the attribute a1, the attribute a2, and the attribute a3 may all be recorded in a target set corresponding to the partition a.
Optionally, the real-time attribute values corresponding to other attributes of other partitions may be recorded in other sets corresponding to other partitions. Therefore, the subsequent electronic equipment can conveniently index the attribute value corresponding to the target attribute included in each partition according to the target set corresponding to each partition.
In an alternative embodiment, the electronic device may generate the target file from the target collection. Optionally, the types of the target file may include, but are not limited to: prop, not limited herein.
Optionally, each target attribute value included in the target file may correspond to one piece of identification information, where the identification information is used to indicate a target partition and a target attribute to which the target attribute value belongs. For example: partition A, attribute a; or partition B, attribute B.
It can be understood that the whole operating system includes a large number of attributes, and for this reason, if the real-time attribute values corresponding to all the attributes in the operating system are recorded in the same target set, the efficiency of the electronic device in searching the attribute values in the target set will be reduced, and it is inconvenient for the electronic device to manage the attribute value pieces. By implementing the method, the electronic device can respectively generate the corresponding target sets for each partition included in the operating system, further record the real-time attribute value corresponding to the attribute included in each partition into the corresponding target set, and mark the partition and the attribute corresponding to each target attribute value, so that subsequent query and loading are facilitated, and the efficiency of searching the attribute values in the target sets by the electronic device is improved.
As an optional implementation manner, when determining that the attribute value of the target attribute is missing, the electronic device may determine a corresponding target file according to the target partition to which the target attribute belongs, and further analyze the target file to obtain a target set corresponding to the target partition. Further, the electronic device may load a target attribute value corresponding to the target attribute in the target set; and determining a target partition and a target attribute value corresponding to the target attribute value according to the identification information corresponding to the target attribute value, and taking the target attribute value as a real-time attribute value corresponding to the target attribute in the target partition at the current moment.
For example, when the electronic device determines that the identification information of the target attribute value is "partition a, attribute a", the target attribute value may be used as a real-time attribute value corresponding to the attribute a located in the partition a at the current time.
By implementing the method, the electronic equipment can determine the target attribute corresponding to the loaded target attribute value through the identification information corresponding to the target attribute value, thereby ensuring that the target attribute value can be added into the correct target attribute subsequently.
206. And under the condition that the attribute value of the target attribute is determined to be missing, loading the target attribute value corresponding to the target attribute in the target set, and taking the target attribute value as a real-time attribute value corresponding to the target attribute at the current moment.
As an optional implementation manner, in a case that it is determined that the attribute value of the target attribute is missing, the electronic device may load the target attribute value corresponding to the target attribute in the target set through the target function. Optionally, the objective function may include, but is not limited to, an import function.
By implementing the method, the electronic equipment can load the target attribute value in the target set through the target functions such as the import function and the like, and the loading mode is simple and convenient, so that the implementation difficulty of the method is reduced.
As an optional implementation manner, in the case that it is determined that the attribute value of the target attribute is missing, the electronic device may determine whether the missing attribute value of the target attribute affects normal operation of the operating system; if it is determined that the missing attribute values of the target attributes will affect the normal operation of the operating system, the target attribute values corresponding to the target attributes may be loaded in the target set, and the target attribute values are used as the real-time attribute values corresponding to the target attributes at the current time.
If it is determined that the missing of the attribute value of the target attribute does not affect the normal operation of the operating system, the attribute value of the target attribute may not be loaded and supplemented.
By implementing the method, the attribute value of the target attribute can be loaded and supplemented under the condition that the normal operation of the operating system is influenced by the missing attribute value of the target attribute; therefore, the electronic equipment is prevented from loading and supplementing all the attributes with missing attribute values, and the calculation amount and the power consumption of the electronic equipment can be reduced.
Optionally, the electronic device may further determine whether the electronic device performs a restart operation within a first time period in the future when it is determined that the absence of the attribute value of the target attribute will affect normal operation of the operating system; if the electronic device does not execute the restart operation within the first future duration, the target attribute value corresponding to the target attribute may be loaded in the target set, and the target attribute value may be used as a real-time attribute value corresponding to the target attribute at the current time.
If the electronic device is to perform the restart operation within a first time period in the future, the attribute value of the target attribute may not be loaded and supplemented, where the first time period may be set by a developer according to a great deal of development experience, and typical values include 10 seconds, 20 seconds, and the like, which is not limited herein.
It should be noted that, in the process of executing the restart operation, the electronic device reloads the attribute value in the operating system, so that the target attribute value missing from the attribute value is also loaded and supplemented, and if it is determined that the electronic device is to execute the restart operation, the supplementation operation of the missing attribute value may not be performed any more, so that the calculation amount and the power consumption of the electronic device may be reduced.
By implementing the method disclosed in each embodiment, the real-time attribute value corresponding to any target attribute included in the operating system can be recorded in the target set in real time as the target attribute value corresponding to the target attribute, wherein the target attribute value in the target set and the real-time attribute value of the target attribute are always kept consistent; further, under the condition that the attribute value of the target attribute is determined to be missing, the target attribute value corresponding to the target attribute can be automatically loaded in the target set, and the loaded target attribute value is used as the real-time attribute value corresponding to the target attribute at the current moment, so that the condition that the normal operation of an operating system is influenced due to the missing of the attribute value of the target attribute is avoided; the real-time attribute values corresponding to the attributes included in each partition are recorded into the corresponding target set, and the partitions and the attributes corresponding to the target attribute values are marked, so that subsequent query and loading are facilitated, and the efficiency of searching the attribute values in the target set by the electronic equipment is improved; the target attribute corresponding to the loaded target attribute value can be determined through the identification information corresponding to the target attribute value, and then the target attribute value can be added into the correct target attribute in the follow-up process; and the target attribute value can be loaded in the target set through target functions such as an import function and the like, and the loading mode is simple and convenient, so that the implementation difficulty of the method is reduced.
Referring to fig. 3, fig. 3 is a flowchart illustrating a method for loading an attribute value according to another embodiment of the present application. Optionally, the method may be applied to various electronic devices or other execution bodies installed with an operating system, and is not limited herein; the electronic device may include, but is not limited to, a mobile phone, a tablet computer, a smart watch, or the like. Optionally, the method may comprise the steps of:
302. and recording the real-time attribute value corresponding to the target attribute as a target attribute value corresponding to the target attribute into a target set in real time, wherein the target attribute value is always consistent with the real-time attribute value, and the target attribute is any one of a plurality of attributes included by the operating system.
304. And if the operation that the operating system is executing the mirror image of the loading system directory is detected, determining that the attribute value of the target attribute is missing under the condition that the operation that the mirror image of the loading system directory is executed is finished.
It should be noted that, when the operating system flushes the mirror image of the system directory, the attribute value corresponding to the attribute in the operating system is easily flushed, and thus the attribute value of the attribute is lost. Wherein, the mirror image (system. Img: system. Img) of the system directory includes the main directory and file of the operating system.
Alternatively, when the electronic device detects that the operating system is executing the operation of loading the image of the system target, if it is further determined that the operation of loading the image of the system directory is completed, it may be determined that the attribute value of the target attribute is missing due to flushing of the image of the flushed system directory.
In an alternative embodiment, the electronic device may detect whether the operating system is performing an operation of loading the image of the system directory, in case it is determined that the electronic device is performing the compatibility test; and if the operation that the operating system is executing the mirror image of the loading system directory is detected, determining that the attribute value of the target attribute is missing under the condition that the operation that the mirror image of the loading system directory is executed is finished.
Optionally, the compatibility Test may include a VTS (Vendor Test Suite) Test, which is a Test performed on a Vendor Interface to ensure forward compatibility of hardware such as HALs.
It should be noted that the electronic device usually needs to be flushed into the mirror image of the system directory when performing the VTS test. By implementing the method, the electronic device can detect whether the operating system is executing the operation of loading the mirror image of the system directory only when the electronic device is determined to be executing the VTS test, so that the electronic device is prevented from always executing the operation of detecting whether the operating system is executing the operation of loading the mirror image of the system directory, and the calculation amount and the power consumption of the electronic device can be reduced.
306. And under the condition that the attribute value of the target attribute is determined to be missing, loading the target attribute value corresponding to the target attribute in the target set, and taking the target attribute value as a real-time attribute value corresponding to the target attribute at the current moment.
In the embodiment of the application, the electronic device may optimize the step of loading the target attribute value corresponding to the target attribute from the target set by using a preset script program. And (4) optional. The preset script program may include, but is not limited to: makefile script program.
Optionally, the electronic device may call the target attribute value to the corresponding target attribute by calling a script program. Invoking the script program may include, but is not limited to: sh script program.
In an optional embodiment, after the electronic device loads the target attribute value corresponding to the target attribute from the target set, it may determine whether the target attribute value is compatible with other first attribute values already existing in the operating system; further, if a second attribute value that is incompatible with the target attribute value exists in the first attribute values, the electronic device may delete the second attribute value.
By implementing the method, the electronic device can delete the second attribute value under the condition that the newly loaded target attribute value is determined to be incompatible with the originally existing second attribute value in the operating system, so that the condition that the target attribute is still in the attribute value missing state due to incompatibility of the newly loaded target attribute value and the normal operation of the operating system is influenced is avoided.
As another optional implementation, in the case that it is determined that the attribute value of the target attribute is missing, the electronic device may load a target attribute value corresponding to the target attribute in the target set; and if the electronic equipment does not load the target attribute value corresponding to the target attribute in the target set, the electronic equipment can generate an environment variable through a preset script program, and the generated environment variable is used as a real-time attribute value corresponding to the target attribute at the current moment. Optionally, the preset script program may include but is not limited to: makefile script program.
By implementing the method, the electronic equipment can take the environmental variable generated by the preset script program as the real-time attribute value corresponding to the target attribute at the current moment under the condition that the target attribute value corresponding to the target attribute cannot be loaded from the target set, so that the condition that the normal operation of the operating system is influenced due to the missing of the attribute value of the target attribute can be avoided.
By implementing the method disclosed in each embodiment, the real-time attribute value corresponding to any target attribute included in the operating system can be recorded in the target set in real time as the target attribute value corresponding to the target attribute, wherein the target attribute value in the target set is always consistent with the real-time attribute value of the target attribute; further, under the condition that the attribute value of the target attribute is determined to be missing, the target attribute value corresponding to the target attribute can be automatically loaded in the target set, and the loaded target attribute value is used as the real-time attribute value corresponding to the target attribute at the current moment, so that the condition that the normal operation of an operating system is influenced due to the missing of the attribute value of the target attribute is avoided; and detecting whether the operating system is executing the operation of loading the mirror image of the system directory only when the electronic device is determined to be executing the VTS test, so that the electronic device is prevented from always executing the operation of detecting whether the operating system is executing the operation of loading the mirror image of the system directory, and the calculation amount and the power consumption of the electronic device can be reduced; the second attribute value can be deleted under the condition that the newly loaded target attribute value is determined to be incompatible with the originally existing second attribute value in the operating system, so that the condition that the normal operation of the operating system is influenced because the target attribute is still in the attribute value missing state due to the incompatibility of the newly loaded target attribute value is avoided; and the environment variable generated by the preset script program is used as the real-time attribute value corresponding to the target attribute at the current moment, so that the condition that the normal operation of the operating system is influenced due to the loss of the attribute value of the target attribute can be avoided.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an attribute value loading apparatus according to an embodiment of the present application. Alternatively, the apparatus may be applied to various electronic devices or other execution bodies installed with an operating system, and is not limited herein; the electronic device may include, but is not limited to, a mobile phone, a tablet computer, a smart watch, or the like. The operating system may include a plurality of attributes, each attribute corresponding to an attribute value, the attributes being used to describe system setting information of the operating system or interaction information between system processes. Optionally, the apparatus may include a recording unit 402 and a loading unit 404, wherein:
a recording unit 402, configured to record a real-time attribute value corresponding to a target attribute as a target attribute value corresponding to the target attribute into a target set in real time, where the target attribute value and the real-time attribute value are always consistent, and the target attribute is any one of multiple attributes included in an operating system;
a loading unit 404, configured to load, in the target set, the target attribute value corresponding to the target attribute when it is determined that the attribute value of the target attribute is missing, and use the target attribute value as a real-time attribute value corresponding to the target attribute at the current time.
By implementing the device, the real-time attribute value corresponding to any target attribute included in the operating system can be recorded into the target set in real time as the target attribute value corresponding to the target attribute, wherein the target attribute value in the target set is always consistent with the real-time attribute value of the target attribute; and further, under the condition that the attribute value of the target attribute is determined to be missing, the target attribute value corresponding to the target attribute can be automatically loaded in the target set, and the loaded target attribute value is used as the real-time attribute value corresponding to the target attribute at the current moment, so that the condition that the normal operation of an operating system is influenced due to the missing of the attribute value of the target attribute is avoided.
As an optional implementation manner, the target attribute is used to record information in a target partition included in the operating system, where the target partition is any one of multiple partitions included in the operating system; and, the apparatus shown in fig. 4 may further include a first generating unit, not shown, in which:
the first generating unit is used for generating a target file according to the target set after real-time attribute values corresponding to the target attributes are recorded into the target set in real time as target attribute values corresponding to the target attributes, wherein each target attribute value included in the target file corresponds to one piece of identification information, and the identification information is used for representing a target partition and the target attributes to which the target attribute values belong.
By implementing the device, the corresponding target set can be respectively generated for each partition included in the operating system, and then the real-time attribute value corresponding to the attribute included in each partition is recorded in the corresponding target set, and the partition and the attribute corresponding to each target attribute value are marked, so that subsequent query and loading are facilitated, and the efficiency of searching the attribute values in the target set by the electronic equipment is improved.
As an optional implementation manner, the loading unit 404 is further configured to obtain a target set according to the target file, and load a target attribute value corresponding to the target attribute in the target set; and determining a target partition and a target attribute value corresponding to the target attribute value according to the identification information corresponding to the target attribute value, and taking the target attribute value as a real-time attribute value corresponding to the target attribute in the target partition at the current moment.
By implementing the device, the target attribute corresponding to the loaded target attribute value can be determined through the identification information corresponding to the target attribute value, and the target attribute value can be added into the correct target attribute subsequently.
As an alternative embodiment, the apparatus shown in fig. 4 may further include a deletion unit, not shown in the drawings, where:
the deleting unit is used for judging whether the target attribute value is compatible with other first attribute values included by the operating system after the target attribute value corresponding to the target attribute is loaded in the target set; and deleting the second attribute value if the second attribute value included in the first attribute value is incompatible with the target attribute value.
By implementing the device, the second attribute value can be deleted under the condition that the newly loaded target attribute value is determined to be incompatible with the originally existing second attribute value in the operating system, so that the condition that the target attribute is still in the attribute value missing state due to incompatibility of the newly loaded target attribute value and the normal operation of the operating system is influenced is avoided.
As an alternative implementation, the apparatus shown in fig. 4 may further include a second generating unit, not shown, where:
and the second generating unit is used for generating an environment variable through a preset script program and taking the environment variable as a real-time attribute value corresponding to the target attribute at the current moment if the target attribute value corresponding to the target attribute is not loaded in the target set after the attribute value of the target attribute is determined to be missing.
By implementing the device, the environment variable generated by the preset script program can be used as the real-time attribute value corresponding to the target attribute at the current moment, so that the condition that the normal operation of the operating system is influenced due to the loss of the attribute value of the target attribute can be avoided.
As an optional implementation manner, the loading unit 404 is further configured to load a target attribute value corresponding to the target attribute in the target set through an object function, where the object function includes an import function.
By implementing the device, the target attribute value can be loaded in the target set through the target functions such as the import function and the like, and the loading mode is simple and convenient, so that the implementation difficulty of the method is reduced.
As an alternative implementation, the apparatus shown in fig. 4 may further include a determination unit, not shown, where:
and the determining unit is used for determining that the attribute value of the target attribute is missing under the condition that the operation of loading the mirror image of the system directory is finished if the operation that the operating system is executing the mirror image of the system directory is detected before the attribute value of the target attribute is missing.
By implementing the device, whether the operation of loading the mirror image of the system directory is executed by the operating system can be detected only when the electronic equipment is determined to execute the VTS test, the electronic equipment is prevented from always executing the operation of detecting whether the operating system is executing the mirror image of the system directory, and therefore the calculation amount and the power consumption of the electronic equipment can be reduced.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
As shown in fig. 5, the electronic device may include:
a memory 501 in which executable program code is stored;
a processor 502 coupled to a memory 501;
the processor 502 calls the executable program code stored in the memory 501 to execute the method for loading attribute values disclosed in the foregoing embodiments.
The embodiment of the application discloses a computer-readable storage medium, which stores a computer program, wherein the computer program enables a computer to execute the loading method of the attribute value disclosed in each embodiment.
The embodiment of the present application also discloses an application publishing platform, wherein the application publishing platform is used for publishing a computer program product, and when the computer program product runs on a computer, the computer is caused to execute part or all of the steps of the method in the above method embodiments.
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. Those skilled in the art should also appreciate that the embodiments described in this specification are exemplary embodiments in nature, and that acts and modules are not necessarily required to practice the invention.
In various embodiments of the present application, it should be understood that the size of the serial number of each process described above does not mean that the execution sequence is necessarily sequential, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated units, if implemented as software functional units and sold or used as separate products, may be stored in a computer accessible memory. Based on such understanding, the technical solution of the present application, which is a part of or contributes to the prior art in essence, or all or part of the technical solution, may be embodied in the form of a software product, stored in a memory, including several requests for causing a computer device (which may be a personal computer, a server, a network device, or the like, and may specifically be a processor in the computer device) to execute part or all of the steps of the above-described method of the embodiments of the present application.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be implemented by program instructions associated with hardware, and the program may be stored in a computer-readable storage medium, which includes Read-Only Memory (ROM), random Access Memory (RAM), programmable Read-Only Memory (PROM), erasable Programmable Read-Only Memory (EPROM), one-time Programmable Read-Only Memory (OTPROM), electrically Erasable Programmable Read-Only Memory (EEPROM), an optical Disc-Read-Only Memory (CD-ROM) or other storage medium, a magnetic tape, or any other medium capable of storing data for a computer or other computer.
The method and apparatus for loading an attribute value, the electronic device, and the storage medium disclosed in the embodiments of the present application are described in detail above, and a specific example is applied in the present application to explain the principle and the implementation of the present application, and the description of the above embodiments is only used to help understand the method and the core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A method for loading attribute values is characterized in that an operating system comprises a plurality of attributes, each attribute corresponds to an attribute value, and the attributes are used for describing system setting information of the operating system or interaction information among system processes, and the method comprises the following steps:
recording a real-time attribute value corresponding to a target attribute as a target attribute value corresponding to the target attribute into a target set in real time, wherein the target attribute value is always consistent with the real-time attribute value, and the target attribute is any one of a plurality of attributes included in the operating system;
and under the condition that the attribute value of the target attribute is determined to be missing, acquiring a target attribute value corresponding to the target attribute from the target set, and taking the target attribute value as a real-time attribute value corresponding to the target attribute at the current moment.
2. The method of claim 1, wherein the target attribute is used to record information in a target partition included in the operating system, the target partition being any one of a plurality of partitions included in the operating system; and after recording the real-time attribute value corresponding to the target attribute as the target attribute value corresponding to the target attribute into the target set in real time, the method comprises the following steps:
and generating a target file according to the target set, wherein each target attribute value in the target file corresponds to one piece of identification information, and the identification information is used for representing a target partition and a target attribute to which the target attribute value belongs.
3. The method according to claim 2, wherein the obtaining a target attribute value corresponding to the target attribute from the target set and using the target attribute value as a real-time attribute value corresponding to the target attribute at the current time includes:
acquiring a target set according to the target file, and acquiring a target attribute value corresponding to the target attribute from the target set;
and determining a target partition and a target attribute value corresponding to the target attribute value according to the identification information corresponding to the target attribute value, and taking the target attribute value as a real-time attribute value corresponding to the target attribute in the target partition at the current moment.
4. The method of claim 1, wherein after obtaining the target attribute value corresponding to the target attribute from the target set, the method further comprises:
judging whether the target attribute value is compatible with other first attribute values included by the operating system or not;
and if the second attribute value included in the first attribute value is not compatible with the target attribute value, deleting the second attribute value.
5. The method of claim 1, wherein after said determining that the attribute value of the target attribute is missing, the method further comprises:
and if the target attribute value corresponding to the target attribute is not acquired in the target set, generating an environment variable through a preset script program, and taking the environment variable as a real-time attribute value corresponding to the target attribute at the current moment.
6. The method of claim 1, wherein obtaining the target attribute value corresponding to the target attribute from the target set comprises:
and acquiring a target attribute value corresponding to the target attribute from a target set through a target function, wherein the target function comprises an import function.
7. The method of any of claims 1-6, wherein prior to said determining that an attribute value of said target attribute is missing, said method further comprises:
if the operating system is detected to be executing the operation of loading the mirror image of the system directory, determining that the attribute value of the target attribute is missing under the condition that the operation of loading the mirror image of the system directory is completed.
8. An attribute value loading device, wherein an operating system includes a plurality of attributes, each attribute corresponds to an attribute value, and the attributes are used to describe system setting information of the operating system or interaction information between system processes, the device comprising:
a recording unit, configured to record a real-time attribute value corresponding to a target attribute as a target attribute value corresponding to the target attribute into a target set in real time, where the target attribute value is always consistent with the real-time attribute value, and the target attribute is any one of multiple attributes included in the operating system;
and the loading unit is used for acquiring a target attribute value corresponding to the target attribute from the target set under the condition that the attribute value of the target attribute is determined to be missing, and taking the target attribute value as a real-time attribute value corresponding to the target attribute at the current moment.
9. An electronic device comprising a memory storing executable program code, and a processor coupled to the memory; wherein the processor invokes the executable program code stored in the memory to perform the method of any of claims 1-7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 7.
CN202211651326.1A 2022-12-21 2022-12-21 Attribute value loading method and device, electronic equipment and storage medium Pending CN115878202A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211651326.1A CN115878202A (en) 2022-12-21 2022-12-21 Attribute value loading method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211651326.1A CN115878202A (en) 2022-12-21 2022-12-21 Attribute value loading method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115878202A true CN115878202A (en) 2023-03-31

Family

ID=85754231

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211651326.1A Pending CN115878202A (en) 2022-12-21 2022-12-21 Attribute value loading method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115878202A (en)

Similar Documents

Publication Publication Date Title
CN112732587B (en) Automatic test log acquisition method and device, electronic equipment and storage medium
CN113590327A (en) Project resource detection method and device, electronic equipment and storage medium
CN112905441A (en) Test case generation method, test method, device and equipment
CN110990001A (en) IVR (Interactive Voice response) process execution method and device
CN114780019A (en) Electronic device management method and device, electronic device and storage medium
CN110244951B (en) Application publishing method and device
CN115878202A (en) Attribute value loading method and device, electronic equipment and storage medium
CN115617668A (en) Compatibility testing method, device and equipment
CN116069366A (en) Client application program updating method and device, storage medium and electronic equipment
CN114610516A (en) Application program repairing method and device, computer equipment and storage medium
CN114691496A (en) Unit testing method, unit testing device, computing equipment and medium
CN113760631A (en) Page loading duration determination method, device, equipment and storage medium
CN113986385A (en) Item font library loading method and device, electronic equipment and storage medium
CN113590179A (en) Plug-in detection method and device, electronic equipment and storage medium
CN112988277A (en) Rule file loading method, device, server and medium
CN110362320B (en) Command implementation method and device of application development platform
CN112579156A (en) Processing system, processing method, processing device and processing equipment of business event
CN113590225B (en) Mapping detection method and device, electronic equipment and storage medium
CN112558975B (en) Method and device for switching codes of components, electronic equipment and readable storage medium
CN112604296B (en) Game updating method, electronic equipment and related system
CN117632620B (en) Management method and device for software radio equipment test
CN116627439A (en) System upgrading method, device, equipment and storage medium
CN117008837A (en) Partition mounting method, device and equipment of magnetic disk and storage medium
CN117950682A (en) UI resource management method, device, equipment and storage medium
CN115964232A (en) User interface testing method, device, storage medium and computer program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination