CN110278331B - System attribute feedback method, device, terminal and storage medium - Google Patents

System attribute feedback method, device, terminal and storage medium Download PDF

Info

Publication number
CN110278331B
CN110278331B CN201910561080.0A CN201910561080A CN110278331B CN 110278331 B CN110278331 B CN 110278331B CN 201910561080 A CN201910561080 A CN 201910561080A CN 110278331 B CN110278331 B CN 110278331B
Authority
CN
China
Prior art keywords
attribute
application program
attribute value
terminal
preset
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.)
Active
Application number
CN201910561080.0A
Other languages
Chinese (zh)
Other versions
CN110278331A (en
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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201910561080.0A priority Critical patent/CN110278331B/en
Publication of CN110278331A publication Critical patent/CN110278331A/en
Application granted granted Critical
Publication of CN110278331B publication Critical patent/CN110278331B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/72406User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by software upgrading or downloading

Landscapes

  • Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Stored Programmes (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the application discloses a method, a device, a terminal and a storage medium for feeding back system attributes. The method comprises the following steps: receiving an attribute acquisition request of an application program, wherein the attribute acquisition request is sent when the application program calls a system interface and is used for requesting to acquire an attribute value of a target system attribute; if the application program does not belong to the preset application program, feeding back a first attribute value of the target system attribute to the application program; and if the application program belongs to the preset application program, feeding back a second attribute value of the target system attribute to the application program. By adopting the method provided by the embodiment of the application, different attribute values can be fed back for different application programs, for example, the first attribute value which is the same as that of the common terminal is set for the customized terminal, and the specific second attribute value is set for the customized terminal, so that the specific application program can distinguish the common terminal from the customized terminal according to the obtained second attribute value, and the identification degree between the terminals is favorably improved.

Description

System attribute feedback method, device, terminal and storage medium
Technical Field
The embodiment of the application relates to the technical field of terminals, in particular to a method and a device for feeding back system attributes, a terminal and a storage medium.
Background
When a user uses an application to distribute content on various platforms, the content finally displayed is usually accompanied by a terminal model. For example, when a message is posted using a social application, the message displayed on the social platform is accompanied by information such as "mobile phone from XX (terminal model)".
In order to realize the function of displaying the terminal model, the application program needs to acquire model information from the system, so that the issued content and the model information are sent to the server together, and the server determines the terminal model according to the model information.
Disclosure of Invention
The embodiment of the application provides a method, a device, a terminal and a storage medium for feeding back system attributes. The technical scheme is as follows:
in one aspect, an embodiment of the present application provides a method for feeding back system attributes, where the method includes:
receiving an attribute acquisition request of an application program, wherein the attribute acquisition request is sent when the application program calls a system interface and is used for requesting to acquire an attribute value of a target system attribute;
if the application program does not belong to a preset application program, feeding back a first attribute value of the target system attribute to the application program;
and if the application program belongs to the preset application program, feeding back a second attribute value of the target system attribute to the application program, wherein the first attribute value is different from the second attribute value.
In another aspect, an embodiment of the present application provides a system attribute feedback apparatus, where the apparatus includes:
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving an attribute acquisition request of an application program, the attribute acquisition request is sent when the application program calls a system interface, and the attribute acquisition request is used for requesting to acquire an attribute value of a target system attribute;
the first feedback module is used for feeding back a first attribute value of the target system attribute to the application program when the application program does not belong to a preset application program;
and the second feedback module is used for feeding back a second attribute value of the target system attribute to the application program when the application program belongs to the preset application program, wherein the first attribute value is different from the second attribute value.
In another aspect, an embodiment of the present application provides a terminal, where the terminal includes a processor and a memory; the memory stores at least one instruction for execution by the processor to implement a method of feedback of system attributes as described in the above aspect
In another aspect, the present application provides a computer-readable storage medium, which stores at least one instruction for execution by a processor to implement the system attribute feedback method according to the above aspect.
In another aspect, the present application provides a computer program product, where at least one instruction is stored, and the at least one instruction is loaded and executed by a processor to implement the system attribute feedback method according to the above aspect.
In the embodiment of the application, after an attribute acquisition request of an application program is received, whether the application program belongs to a preset application program is determined, if not, a first attribute value of a target system attribute is fed back to the application program, and if not, a second attribute value different from the first attribute value is fed back to the application program; compared with the prior art that only a uniform attribute value can be fed back, the method provided by the embodiment of the application can feed back different attribute values for different application programs, for example, the specific application program can distinguish the common terminal from the customized terminal according to the obtained second attribute value by setting the first attribute value which is the same as that of the common terminal for the customized terminal and setting the specific second attribute value for the customized terminal, which is beneficial to improving the identification degree between the terminals.
Drawings
Fig. 1 and 2 are block diagrams illustrating a structure of a terminal according to an exemplary embodiment of the present application;
FIG. 3 illustrates a flow chart of a method for feedback of system attributes, shown in an exemplary embodiment of the present application;
FIG. 4 is a schematic diagram of an implementation of a feedback method for attributes of the system shown in FIG. 3;
FIG. 5 illustrates a flow chart of a method of feedback of system attributes, shown in another exemplary embodiment of the present application;
FIG. 6 is a flow chart of a method for feedback of system attributes when applied to an android operating system;
fig. 7 is a block diagram illustrating a structure of a feedback apparatus for system attributes according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Reference herein to "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
Referring to fig. 1 and 2, a block diagram of a terminal 100 according to an exemplary embodiment of the present application is shown. The terminal 100 may be a mobile phone, a tablet computer, a notebook computer, an e-book, etc. The terminal 100 in the present application may include one or more of the following components: a central processor 110, a memory 120, and a display 130.
Processor 110 may include one or more processing cores. The processor 110 connects various parts within the overall terminal 100 using various interfaces and lines, and performs various functions of the terminal 100 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 120 and calling data stored in the memory 120. Alternatively, the processor 110 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable gate Array (FPGA), and Programmable Logic Array (PLA). The processor 110 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a Neural-Network Processing Unit (NPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing the content to be displayed by the touch display screen 130; the NPU is used for realizing an Artificial Intelligence (AI) function; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 110, but may be implemented by a single chip.
The Memory 120 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). Optionally, the memory 120 includes a non-transitory computer-readable medium. The memory 120 may be used to store instructions, programs, code sets, or instruction sets. The memory 120 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like; the storage data area may store data (such as audio data, a phonebook) created according to the use of the terminal 100, and the like.
Taking an operating system as an Android (Android) system as an example, programs and data stored in the memory 120 are shown in fig. 1, and a Linux kernel layer 220, a system runtime layer 240, an application framework layer 260, and an application layer 280 are stored in the memory 120. The Linux kernel layer 220 provides underlying drivers for various hardware of the terminal 100, such as a display driver, an audio driver, a camera driver, a bluetooth driver, a Wi-Fi driver, power management, and the like. The system runtime library layer 240 provides the main feature support for the Android system through some C/C + + libraries. For example, the SQLite library provides support for a database, the OpenGL/ES library provides support for 3D drawing, the Webkit library provides support for a browser kernel, and the like. Also provided in the system Runtime layer 240 is an Android Runtime library 242(Android Runtime), which mainly provides some core libraries and can allow developers to write Android applications using the Java language. The application framework layer 260 provides various APIs that may be used in building applications, and developers may build their own applications by using these APIs, such as activity management, window management, view management, notification management, content provider, package management, session management, resource management, and location management. At least one application program runs in the application layer 280, and the application programs may be a contact program, a short message program, a clock program, a camera application, etc. of the operating system; or an application program developed by a third-party developer, such as an instant messaging program, a photo beautification program, and the like.
Taking an operating system as an IOS system as an example, programs and data stored in the memory 120 are shown in fig. 2, and the IOS system includes: a Core operating system Layer 320(Core OS Layer), a Core services Layer 340(Core services Layer), a Media Layer 360(Media Layer), and a touchable Layer 380(Cocoa Touch Layer). The kernel operating system layer 320 includes an operating system kernel, drivers, and underlying program frameworks that provide functionality closer to hardware for use by program frameworks located in the kernel services layer 340. The core services layer 340 provides system services and/or program frameworks, such as a Foundation framework, an account framework, an advertisement framework, a data storage framework, a network connection framework, a geographic location framework, a motion framework, and so forth, that are needed by the application. The media layer 360 provides audiovisual interfaces for applications, such as graphics-related interfaces, audio-related interfaces, video-related interfaces, and audio/video transmission technology wireless broadcast (AirPlay) interfaces. The touchable layer 380 provides various common interface-related frameworks for application development, and the touchable layer 380 is responsible for user touch interaction operations on the terminal 100. Such as a local notification service, a remote push service, an advertising framework, a game tool framework, a messaging User Interface (UI) framework, a User Interface UIKit framework, a map framework, and so forth.
In the framework shown in FIG. 2, the framework associated with most applications includes, but is not limited to: a base framework in the core services layer 340 and a UIKit framework in the touchable layer 380. The base framework provides many basic object classes and data types, provides the most basic system services for all applications, and is UI independent. While the class provided by the UIKit framework is a basic library of UI classes for creating touch-based user interfaces, iOS applications can provide UIs based on the UIKit framework, so it provides an infrastructure for applications for building user interfaces, drawing, processing and user interaction events, responding to gestures, and the like.
The display screen 130 is used to display the display components of the user interface. Optionally, the display screen 130 further has a touch function for receiving a touch operation of a user on or near the display screen by using any suitable object such as a finger, a touch pen, and the like. The display 130 is generally disposed on a front panel of the terminal 130. The display screen 130 may be designed as a full-face screen, a curved screen, a contoured screen, a double-face screen, or a folding screen. The display 130 may also be designed as a combination of a full-screen and a curved-screen, and a combination of a non-flat screen and a curved-screen, which is not limited in this embodiment.
In addition, those skilled in the art will appreciate that the configuration of terminal 100 as illustrated in the above-described figures is not intended to be limiting of terminal 100, and that terminals may include more or less components than those illustrated, or some components may be combined, or a different arrangement of components. For example, the terminal 100 further includes a radio frequency circuit, an input unit, a sensor, an audio circuit, a Wireless Fidelity (WiFi) module, a power supply, a bluetooth module, and other components, which are not described herein again.
In the related art, a terminal manufacturer customizes a terminal to obtain a customized terminal, and in order to avoid performing a repeated authentication test on an un-customized terminal and a customized terminal with the same hardware configuration, the customized terminal and the un-customized terminal generally have the same system attribute, such as the same terminal model.
However, the same system attributes are used for the customized terminal and the non-customized terminal, which affects the recognition between the terminals. For example, for a customized terminal and an un-customized terminal installed with a social application, when a message is published by using the social application, the message published by using the customized terminal and the un-customized terminal will be displayed from the same terminal because the system attributes obtained by the social application are consistent.
In order to improve the recognition between the customized terminal and the non-customized terminal, the terminal manufacturer needs to set different system attributes, such as different terminal models, for the non-customized terminal and the customized terminal, but this will cause repeated authentication tests and increase the workload of the authentication tests.
In the method for feeding back system attributes provided in the embodiment of the present application, after receiving an attribute acquisition request of an application program, a terminal determines whether the application program belongs to a preset application program, if not, a first attribute value of a target system attribute is fed back to the application program, and if not, a second attribute value different from the first attribute value is fed back to the application program, so that the application program can distinguish the terminal according to the different attribute values.
By adopting the method, a terminal manufacturer can set the same first attribute value for the customized terminal and the non-customized terminal in advance and set a specific second attribute value for the customized terminal. For a customized terminal and an un-customized terminal of the same application program (belonging to a preset application program), the application program obtains a first attribute value from the un-customized terminal, and obtains a second attribute value different from the first attribute value from the customized terminal, so that the un-customized terminal or the customized terminal is distinguished based on the obtained different attribute values, and the identification degree between the terminals is improved.
The feedback method of the system attribute provided by the embodiment of the application can be applied to the following application scenes:
firstly, the model of the terminal is displayed when the application program is used for releasing the content.
When the application program is used for releasing the content, the application program needs to acquire the model information of the current terminal, so that the model information and the content to be released are sent to a background server of the application program together. And after receiving the model information and the content to be issued, the background server determines the model of the terminal according to the model information, so that the content to be issued and the model of the terminal are issued to the content sharing platform together. When the feedback method of the system attribute provided by the embodiment of the application is applied to the application scenario, a terminal manufacturer sets a uniform first terminal model for a non-customized terminal and a customized terminal in advance, and sets a specific second terminal model for the customized terminal (the terminal model does not need to be subjected to authentication test, and is only agreed in advance for the terminal manufacturer and an application program developer). For a non-customized terminal provided with an application program, when the content is released through the application program, the content to be released and the first model information are sent to a background server, the background server determines the model of the first terminal according to the first model information, and a content sharing platform finally displays that the content to be released is released by the terminal with the first terminal model; and for the customized terminal provided with the application program, when the content is published through the application program, the content to be published and the second type number information are sent to the background server, the background server determines the type of the second terminal according to the second type number information, and the content sharing platform finally displays the terminal publication of the content to be published with the second terminal type.
And secondly, keeping the version secret in the terminal testing process.
When the terminal runs by using the test software, the test software reports the obtained terminal model and the obtained running data to the server, and the server updates the terminal performance list according to the reported data. In a testing stage before the terminal is released, in order to avoid the leakage of the terminal version information, the feedback method of the system attribute provided by the embodiment of the application can be applied. In one possible embodiment, a first terminal model and a second terminal model are set for the test terminal set by the terminal manufacturer, and the test software is set as the preset application program, wherein the second terminal model may be the terminal model of the published terminal. When the test terminal is tested by using the test software, the test terminal feeds back the second type number information to the test software, and the second type number information and the running part are uploaded to the server by the test terminal. The server determines that the terminal is the published terminal according to the second type number information, so that the terminal version information can be effectively prevented from being leaked.
Of course, the feedback method of the system attribute provided in the embodiment of the present application may also be used in other scenarios where the system attribute needs to be obtained, and the above application scenarios are only used for illustrative explanation and are not limited thereto.
Referring to fig. 3, a flow chart of a feedback method of system attributes is shown in an exemplary embodiment of the present application. The present embodiment is illustrated by applying the method to the terminal 100 shown in fig. 1 or 2. The method comprises the following steps:
step 301, receiving an attribute obtaining request of an application program, where the attribute obtaining request is sent when the application program calls a system interface, and the attribute obtaining request is used to request to obtain an attribute value of a target system attribute.
The system interface provides the operating system to the application program, the application program obtains the interface of the system attribute through the interface calling mode, and different system attributes correspond to different system interfaces. In one possible embodiment, the target system attributes include, but are not limited to, at least one of: terminal model, terminal manufacturer, terminal brand.
Optionally, in different application scenarios, the time for triggering the attribute acquisition request is different. In the first application scenario, when the attribute acquisition request is issued by an application program, the application program is triggered when calling a system interface; in the second application scenario, the attribute obtaining request is triggered when the application program calls the system interface during the terminal testing process by the application program.
In an illustrative example, as shown in fig. 4, in the process of issuing a message using an application program "XX microblog" in a terminal 41, when a click signal to an issue button is received, the terminal 41 receives a model acquisition request of the "XX microblog"; in the process of issuing a message using the application program "XX chat" in the terminal 41, when a click signal to the issue button is received, the terminal 41 receives a model acquisition request for the "XX chat".
In a possible implementation manner, after receiving the attribute obtaining request, the terminal obtains an application identifier of the application program, and determines whether the application program belongs to a preset application program according to the application identifier, if so, the following step 303 is executed, and if not, the following step 302 is executed, where the preset application program is preset by a terminal manufacturer.
Step 302, if the application program does not belong to the preset application program, feeding back a first attribute value of the target system attribute to the application program.
In one possible embodiment, the first attribute value is a default attribute value of the target system attribute, and the first attribute value is subjected to a certification test. In an illustrative example, for the customized terminal, the first attribute value of the customized terminal is the attribute value of the non-customized terminal.
Optionally, the application program sends the acquired first attribute value to a background server of the application program, and the background server displays corresponding attribute information according to the first attribute value.
Illustratively, as shown in fig. 4, since the application "XX chat" does not belong to the preset application, the "XX chat" acquires the first model "mobile 1244" fed back by the terminal 41, and sends the first model "mobile 1244" and the message to be issued "renew phone la" to the first server 42 (the background server of the "XX chat"). The first server 42 determines that the terminal model is "XX handset" according to the first model "mobile 1244", thereby displaying a field "from XX handset" after the issued message.
Step 303, if the application program belongs to the preset application program, feeding back a second attribute value of the target system attribute to the application program, where the first attribute value is different from the second attribute value.
Optionally, the second attribute value is an attribute value preset in a terminal development process, and the second attribute value has not been subjected to a certification test. In order to enable the backend server of the preset application program to identify the model of the terminal according to the second attribute value, in a possible implementation manner, the backend server of the preset application program stores a corresponding relationship between the second attribute value and the attribute information in advance, and the corresponding relationship is provided by a terminal manufacturer.
Schematically, as shown in fig. 4, since the application "XX microblog" belongs to a preset application, the "XX microblog" acquires the second type number "mobile 1245" fed back by the terminal 41, and sends the second type number "mobile 1245" and the message to be issued "renew cellphone la" to the second server 43 (the background server of the "XX microblog"). The second server 43 determines that the terminal model is "XX mobile phone customized plate" according to the first model "mobile 1245", and thus displays a field "from XX mobile phone customized plate" after the issued message.
To sum up, in the embodiment of the present application, after receiving an attribute acquisition request of an application program, determining whether the application program belongs to a preset application program, if not, feeding back a first attribute value of a target system attribute to the application program, and if not, feeding back a second attribute value different from the first attribute value to the application program; compared with the prior art that only a uniform attribute value can be fed back, the method provided by the embodiment of the application can feed back different attribute values for different application programs, for example, the specific application program can distinguish the common terminal from the customized terminal according to the obtained second attribute value by setting the first attribute value which is the same as that of the common terminal for the customized terminal and setting the specific second attribute value for the customized terminal, which is beneficial to improving the identification degree between the terminals.
In a possible implementation manner, when the application program does not belong to the preset application program, the terminal (system) feeds back the first attribute value to the application program in a conventional manner; when the application belongs to the preset application, the terminal (system) modifies the first attribute value into the second attribute value through the reflection mechanism, so as to feed the second attribute value back to the application.
Referring to fig. 5, a flow chart of a feedback method of system attributes is shown in accordance with another exemplary embodiment of the present application. The present embodiment is illustrated by applying the method to the terminal 100 shown in fig. 1 or 2. The method comprises the following steps:
step 501, an attribute obtaining request of an application program is received, where the attribute obtaining request is sent when the application program calls a system interface, and the attribute obtaining request is used to request to obtain an attribute value of a target system attribute.
The step 301 may be referred to in the implementation manner of this step, and this embodiment is not described herein again.
Step 502, obtain a system configuration file.
The system configuration file comprises attribute values corresponding to various system attributes.
For example, for a customized terminal, the target system attribute contains both the first attribute value and the second attribute value, while for an un-customized terminal, the target system attribute contains only one attribute value (i.e., the first attribute value). Therefore, in a possible implementation manner, after receiving the attribute obtaining request, the terminal first obtains the system configuration file, and detects whether the system configuration file includes the second attribute field (corresponding to the second attribute value). If the system configuration file includes the second attribute field, it indicates that the terminal is configured with two attribute values (the system configuration file of each terminal includes the first attribute field), and execute step 504; if the system configuration file does not contain the second attribute field, it indicates that the terminal is configured with only one attribute value, and step 503 is executed.
Step 503, if the system configuration file does not include the second attribute field, feeding back the first attribute value of the target system attribute to the application program.
When the second attribute field is not included in the system configuration file, the terminal feeds back the attribute value (i.e., the first attribute value) to the application program because the target system attribute is configured with only one attribute value.
Step 504, if the system configuration file includes the second attribute field, determining whether the application program belongs to a preset application program.
When the system configuration file includes the second attribute field, in order to determine what attribute value is fed back to the application program, optionally, the terminal further obtains an application identifier of the application program, and determines whether the application program belongs to a preset application program according to the application identifier. If not, go to step 505; if so, go to step 506.
In a possible implementation mode, the terminal downloads an application program list from a server (a server corresponding to the terminal), wherein the application program list comprises an application identification of a preset application program. When the system configuration file comprises the second attribute field, the terminal detects whether the application identifier of the application program belongs to the application program list. If the application program is the preset application program, determining that the application program is the preset application program, otherwise, determining that the application program is not the preset application program.
Optionally, the application list is maintained by the server, and accordingly, the terminal downloads the application list from the server according to a predetermined update policy (for example, at predetermined time intervals, or each time a new application is installed). When the background server corresponding to the target application program stores the corresponding relationship between the second attribute value and the attribute information (that is, the background server can obtain the corresponding attribute information according to the second attribute value sent by the target application program), the server updates the application identifier of the target application program to the application program list.
And 505, if the application program does not belong to the preset application program, feeding back a first attribute value of the target system attribute to the application program.
The step 302 may be referred to in the implementation manner of this step, and this embodiment is not described herein again.
Step 506, if the application program belongs to the preset application program, obtaining the public field to which the target system attribute belongs through a reflection method to obtain a target attribute array, wherein the target attribute array comprises the target system attribute.
When the application program belongs to the preset application program, the terminal needs to modify the attribute value of the target system attribute through a reflection mechanism. In a possible implementation manner, when the terminal obtains the attribute value of the target system attribute, the attribute field corresponding to the target system attribute is determined first, and then the corresponding attribute value is obtained according to the attribute field. Therefore, in this embodiment of the present application, before modifying the attribute value of the target system attribute, the terminal first obtains, by using a reflection method, a target attribute array including the target system attribute, where the target attribute array includes all accessible public (public) fields of a Class or an interface represented by a Class object to which the target system attribute belongs.
In one possible implementation, the target attribute array includes an attribute field corresponding to each system attribute, and the attribute field points to an attribute value. For example, the target attribute array includes an attribute field corresponding to a terminal model, an attribute field corresponding to a terminal brand, and an attribute field corresponding to a terminal manufacturer, where the terminal model is a target system attribute.
Step 507, the attribute field of the target system attribute in the target attribute array is modified into a second attribute field by the reflection of the first attribute field, wherein the first attribute field corresponds to the first attribute value, and the second attribute field corresponds to the second attribute value.
In a possible implementation manner, the attribute field of the target system attribute in the target attribute array defaults to be the first attribute field, and since the first attribute field (point) corresponds to the first attribute value, the terminal acquires the first attribute value of the target system attribute by default, whereas in this embodiment, in order to enable the terminal to finally feed back the second attribute value of the target system attribute, the terminal modifies the attribute field of the target system attribute from the reflection of the first attribute field to the reflection of the second attribute field.
In an illustrative example, the terminal modifies the first attribute field MODEL xx of the terminal MODEL001 in the target attribute array to the second attribute field MODEL xx.
And step 508, acquiring a second attribute value according to the second attribute field, and feeding back the second attribute value to the application program.
In a possible implementation manner, the terminal obtains a second attribute value corresponding to a second attribute field from the system configuration file according to the second attribute field corresponding to the target system attribute after reflection modification, so as to feed back the second attribute value to the application program.
In an illustrative example, the system configuration file includes a first attribute value mobile1244 corresponding to the first attribute field xx.xx.model001 and a first attribute value mobile1245 corresponding to the first attribute field xx.xx.model002, the attribute value fed back to the application before reflection modification is mobile144, and the attribute value fed back to the application after reflection modification is mobile 145.
In this embodiment, when a predetermined application requests to acquire an attribute value of an attribute of a target system, a terminal dynamically modifies an attribute field of the attribute of the target system through a reflection mechanism, so as to acquire a specific attribute value different from a default attribute value according to the modified attribute field, and feeds back the specific attribute value to the predetermined application, thereby achieving an effect of feeding back the specific attribute value for the specific application.
In a possible implementation manner, after receiving an attribute acquisition request of an application program, a terminal detects whether a target system attribute corresponding to the attribute acquisition request belongs to a preset system attribute, and if so, further determines whether the application program belongs to the preset application program; and if not, feeding back the first attribute value of the target system attribute to the application program. The preset system attribute is a system attribute with at least two attribute values.
In addition, in order to enable more applications to display corresponding attribute information according to the second attribute value, in a possible implementation manner, when the applications do not belong to the preset applications, after the terminal feeds back the first attribute value of the target system attribute to the applications, an application adding request is sent to the server, the application adding request includes an application identifier of the applications, and the server is used for updating the application list according to the application identifier of the applications.
Optionally, the application addition request is triggered manually by a user, or automatically by a terminal; and after receiving the application addition request, the server interacts with the background server of the application program according to the application identifier in the application addition request, and after storing the corresponding relationship between the second attribute value and the attribute information in the background server (that is, the background server can identify the second attribute value and determine the corresponding attribute information), updates the application identifier of the application program to the application program list.
Optionally, reflection mechanisms used under different operating systems are different, and a terminal operating system is taken as an android operating system, a target system attribute is a terminal MODEL (one attribute in a build class), and a first attribute field is ro.product.model, and a second attribute field is ro.product. Referring to fig. 6, a flow chart of a feedback method of system attributes is shown in accordance with another exemplary embodiment of the present application.
Step 601, receiving an attribute obtaining request of the application program, where the attribute obtaining request is sent when an Android Package (APK) of the application program calls a system interface, and the attribute obtaining request is used for requesting to obtain an attribute value of a terminal model.
When the attribute value of the target system attribute needs to be acquired, the APK of the application program calls a corresponding system interface. For example, when the terminal model needs to be obtained, the APK calls a system interface for obtaining the terminal model.
And step 602, acquiring a build.
In a possible implementation manner, after the operating system acquires the built.prop file, it is detected whether the built.prop file includes a ro.product _ model, if so, step 604 is executed, and if not, step 603 is executed.
Step 603, if the built.prop file does not include the ro.product. times _ model, feeding back the first attribute value of the terminal model to the application program.
In one possible implementation, the operating system obtains the corresponding first attribute value from the built.
Step 604, if the build.prop file includes a ro.product.
In a possible embodiment, when the build.prop file includes a ro.product _ model, an Activity Management Service (AMS) in the operating system acquires an APK package name, detects whether the APK package name belongs to a predetermined APK package name, determines that the application program belongs to a preset application program if the APK package name belongs to the predetermined APK package name, and performs step 606, and performs step 605 if the APK package name does not belong to the predetermined APK package name.
Step 605, if the application program does not belong to the preset application program, feeding back the first attribute value of the terminal model to the application program.
Similar to the step 603, the operating system obtains the corresponding first attribute value from the built.
Step 606, if the application program belongs to the preset application program, obtaining the public field to which the terminal model belongs by the getFields method to obtain a target attribute array, wherein the target attribute array comprises the terminal model.
In one possible implementation, the AMS obtains the public Field to which the MODEL belongs through the getFields to obtain a target attribute array Field [ ] corresponding to a plurality of fields, where the target attribute array includes a first attribute Field MODEL ═ ro.
Step 607, the attribute field of the target system attribute in the target attribute array is modified from the ro.product.model reflection to the ro.product.model corresponding to the first attribute value, and the ro.product.model corresponding to the second attribute value.
Further, the AMS modifies a first attribute field MODEL ═ ro.product.model reflection corresponding to the target system attribute to a second attribute field MODEL ═ ro.product.
Step 608, obtaining a second attribute value corresponding to the ro.product. model from the build.prop, and feeding back the second attribute value to the application program.
After the reflection modification is completed, the AMS may obtain a second attribute value from the build.prop file according to the ro.product.
Referring to fig. 7, a block diagram of a feedback apparatus for system attributes according to an embodiment of the present application is shown. The apparatus may be implemented as all or a portion of the terminal in software, hardware, or a combination of both. The device includes:
a receiving module 701, configured to receive an attribute obtaining request of an application, where the attribute obtaining request is sent when the application calls a system interface, and the attribute obtaining request is used to request to obtain an attribute value of a target system attribute;
a first feedback module 702, configured to feed back a first attribute value of the target system attribute to the application program when the application program does not belong to a preset application program;
a second feedback module 703, configured to feed back, to the application program, a second attribute value of the target system attribute when the application program belongs to the preset application program, where the first attribute value is different from the second attribute value.
Optionally, the second feedback module 703 includes:
the acquisition unit is used for acquiring a common field to which the target system attribute belongs through a reflection method to obtain a target attribute array if the application program belongs to the preset application program, wherein the target attribute array comprises the target system attribute;
a modification unit, configured to modify an attribute field of the target system attribute in the target attribute array from a first attribute field reflection to a second attribute field, where the first attribute field corresponds to the first attribute value, and the second attribute field corresponds to the second attribute value;
and the feedback unit is used for acquiring the second attribute value according to the second attribute field and feeding back the second attribute value to the application program.
Optionally, the feedback unit is configured to:
and acquiring the second attribute value corresponding to the second attribute field from a system configuration file, wherein the system configuration file comprises the attribute values corresponding to various system attributes.
Optionally, the apparatus further comprises:
the acquisition module is used for acquiring the system configuration file;
a first determining module, configured to determine whether the application program belongs to the preset application program if the system configuration file includes the second attribute field;
a third feedback module, configured to feed back the first attribute value of the target system attribute to the application program if the system configuration file does not include the second attribute field.
Optionally, the attribute obtaining request is sent when the system interface is called by the android installation package APK of the application program;
the reflection method is the getFields method;
the system configuration file is a build.
Optionally, the apparatus further comprises:
the second determining module is used for determining whether the application program belongs to a preset application program or not if the target system attribute belongs to a preset system attribute;
and the fourth feedback module is used for feeding back the first attribute value of the target system attribute to the application program if the target system attribute does not belong to the preset system attribute.
Optionally, the apparatus further comprises:
the downloading module is used for downloading an application program list from a server, the application program list comprises the application identification of the preset application program, and the application program list is used for determining whether the application program belongs to the preset application program.
Optionally, the apparatus further comprises:
and the sending module is used for sending an application adding request to the server, wherein the application adding request comprises the application identifier of the application program, and the server is used for updating the application program list according to the application identifier of the application program.
To sum up, in the embodiment of the present application, after receiving an attribute acquisition request of an application program, determining whether the application program belongs to a preset application program, if not, feeding back a first attribute value of a target system attribute to the application program, and if not, feeding back a second attribute value different from the first attribute value to the application program; compared with the prior art that only a uniform attribute value can be fed back, the method provided by the embodiment of the application can feed back different attribute values for different application programs, for example, the specific application program can distinguish the common terminal from the customized terminal according to the obtained second attribute value by setting the first attribute value which is the same as that of the common terminal for the customized terminal and setting the specific second attribute value for the customized terminal, which is beneficial to improving the identification degree between the terminals.
The embodiment of the present application further provides a computer-readable medium, where at least one instruction is stored, and the at least one instruction is loaded and executed by the processor to implement the method for feeding back the system attribute according to the above embodiments.
The embodiment of the present application further provides a computer program product, where at least one instruction is stored, and the at least one instruction is loaded and executed by a processor to implement the method for feeding back the system attribute according to the above embodiments.
Those skilled in the art will recognize that, in one or more of the examples described above, the functions described in the embodiments of the present application may be implemented in hardware, software, firmware, or any combination thereof. When implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (11)

1. A method for feedback of system attributes, the method comprising:
receiving an attribute acquisition request of an application program, wherein the attribute acquisition request is sent when the application program calls a system interface, and the attribute acquisition request is used for requesting to acquire an attribute value of a target system attribute, wherein the application program is used for displaying attribute information corresponding to the acquired attribute value, and different attribute values correspond to different attribute information;
if the application program does not belong to a preset application program, feeding back a first attribute value of the target system attribute to the application program;
and if the application program belongs to the preset application program, feeding back a second attribute value of the target system attribute to the application program, wherein the first attribute value is different from the second attribute value.
2. The method according to claim 1, wherein if the application program belongs to the preset application program, feeding back a second attribute value of the target system attribute to the application program comprises:
if the application program belongs to the preset application program, acquiring a public field to which the target system attribute belongs through a reflection method to obtain a target attribute array, wherein the target attribute array comprises the target system attribute;
reflecting and modifying an attribute field of the target system attribute in the target attribute array from a first attribute field to a second attribute field, wherein the first attribute field corresponds to the first attribute value, and the second attribute field corresponds to the second attribute value;
and acquiring the second attribute value according to the second attribute field, and feeding back the second attribute value to the application program.
3. The method of claim 2, wherein obtaining the second attribute value according to the second attribute field comprises:
and acquiring the second attribute value corresponding to the second attribute field from a system configuration file, wherein the system configuration file comprises the attribute values corresponding to various system attributes.
4. The method of claim 3, wherein after receiving the request for obtaining the property of the application program, the method further comprises:
acquiring the system configuration file;
if the system configuration file comprises the second attribute field, determining whether the application program belongs to the preset application program;
and if the second attribute field is not included in the system configuration file, feeding back the first attribute value of the target system attribute to the application program.
5. The method according to claim 3 or 4, wherein the attribute obtaining request is sent when the android installation package (APK) of the application program calls the system interface;
the reflection method is the getFields method;
the system configuration file is a build.
6. The method according to any one of claims 1 to 4, wherein after receiving the attribute acquisition request of the application program, the method further comprises:
if the target system attribute belongs to a preset system attribute, determining whether the application program belongs to the preset application program;
and if the target system attribute does not belong to the preset system attribute, feeding back the first attribute value of the target system attribute to the application program.
7. The method according to any one of claims 1 to 4, wherein before receiving the attribute acquisition request of the application program, the method further comprises:
downloading an application program list from a server, wherein the application program list comprises an application identifier of the preset application program, and the application program list is used for determining whether the application program belongs to the preset application program.
8. The method according to claim 7, wherein after feeding back the first attribute value of the target system attribute to the application program if the application program does not belong to a preset application program, the method further comprises:
and sending an application adding request to the server, wherein the application adding request comprises the application identifier of the application program, and the server is used for updating the application program list according to the application identifier of the application program.
9. An apparatus for feedback of system attributes, the apparatus comprising:
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving an attribute acquisition request of an application program, the attribute acquisition request is sent when the application program calls a system interface, the attribute acquisition request is used for requesting to acquire an attribute value of a target system attribute, the application program is used for displaying attribute information corresponding to the acquired attribute value, and different attribute values correspond to different attribute information;
the first feedback module is used for feeding back a first attribute value of the target system attribute to the application program when the application program does not belong to a preset application program;
and the second feedback module is used for feeding back a second attribute value of the target system attribute to the application program when the application program belongs to the preset application program, wherein the first attribute value is different from the second attribute value.
10. A terminal, characterized in that the terminal comprises a processor and a memory; the memory stores at least one instruction for execution by the processor to implement a method of feedback of system attributes as claimed in any one of claims 1 to 8.
11. A computer-readable storage medium having stored thereon at least one instruction for execution by a processor to implement a method of feedback of system attributes as claimed in any one of claims 1 to 8.
CN201910561080.0A 2019-06-26 2019-06-26 System attribute feedback method, device, terminal and storage medium Active CN110278331B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910561080.0A CN110278331B (en) 2019-06-26 2019-06-26 System attribute feedback method, device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910561080.0A CN110278331B (en) 2019-06-26 2019-06-26 System attribute feedback method, device, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN110278331A CN110278331A (en) 2019-09-24
CN110278331B true CN110278331B (en) 2021-08-20

Family

ID=67963405

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910561080.0A Active CN110278331B (en) 2019-06-26 2019-06-26 System attribute feedback method, device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN110278331B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104166717A (en) * 2014-08-18 2014-11-26 腾讯科技(深圳)有限公司 Unread message displaying method and device based on terminal operation system
CN105893416A (en) * 2015-12-01 2016-08-24 乐视网信息技术(北京)股份有限公司 Data service system
CN109032793A (en) * 2018-07-11 2018-12-18 Oppo广东移动通信有限公司 Method, apparatus, terminal and the storage medium of resource distribution

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4201284B1 (en) * 2007-12-28 2008-12-24 株式会社メキキ Attribute information authentication apparatus, attribute information authentication method, and computer program
CN104516783B (en) * 2013-09-27 2019-04-23 华为终端(东莞)有限公司 Authority control method and device
US20170105041A1 (en) * 2015-10-13 2017-04-13 Le Holdings (Beijing) Co., Ltd. Method and device of interactive function card of smart television
CN106909561A (en) * 2015-12-23 2017-06-30 北京奇虎科技有限公司 A kind of page push method and device
CN107846511A (en) * 2017-10-30 2018-03-27 深圳市金立通信设备有限公司 A kind of method, terminal and computer-readable recording medium for accessing moving advertising
CN109408569A (en) * 2018-09-28 2019-03-01 平安科技(深圳)有限公司 JSON data transfer device, device, computer equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104166717A (en) * 2014-08-18 2014-11-26 腾讯科技(深圳)有限公司 Unread message displaying method and device based on terminal operation system
CN105893416A (en) * 2015-12-01 2016-08-24 乐视网信息技术(北京)股份有限公司 Data service system
CN109032793A (en) * 2018-07-11 2018-12-18 Oppo广东移动通信有限公司 Method, apparatus, terminal and the storage medium of resource distribution

Also Published As

Publication number Publication date
CN110278331A (en) 2019-09-24

Similar Documents

Publication Publication Date Title
CN108762937B (en) Configuration information sending method, configuration information obtaining method, configuration information sending device, configuration information obtaining device and terminal
CN110209501B (en) Frequency adjusting method and device of graphic processor, terminal and storage medium
US20220156133A1 (en) Cross-Process Communication Method, Apparatus, and Device
CN109542614B (en) Resource allocation method, device, terminal and storage medium
CN109408136B (en) Information processing method, information processing apparatus, storage medium, and electronic device
CN110955499B (en) Processor core configuration method, device, terminal and storage medium
US11782756B2 (en) Method and apparatus for scheduling processor core, and storage medium
CN111433743A (en) APP remote control method and related equipment
US9875109B2 (en) Method and apparatus for generating user adaptive application in mobile terminal
CN110990105A (en) Interface display method and device, electronic equipment and storage medium
CN112653670A (en) Service logic vulnerability detection method, device, storage medium and terminal
CN113268212A (en) Screen projection method and device, storage medium and electronic equipment
CN109522131A (en) Resource allocation method, device and equipment
CN114222003A (en) Service calling method, system, device, equipment and storage medium
CN110572815A (en) Network access method, device, storage medium and terminal
CN117555459A (en) Application group processing method and device, storage medium and electronic equipment
CN109933960B (en) Service calling control method, service calling method, device and terminal
CN110278331B (en) System attribute feedback method, device, terminal and storage medium
CN113286349B (en) Personal hot spot connection method, device, terminal and storage medium
CN113950043B (en) Communication method, device, storage medium and terminal
CN109669715A (en) application program dynamic updating method, device and storage medium
CN113419650A (en) Data moving method and device, storage medium and electronic equipment
CN113315687B (en) Proxy network management method, device, storage medium and terminal
CN110913384A (en) Dial card switching method and device, storage medium and terminal
CN112612487B (en) Application installation method, device, storage medium and terminal

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
GR01 Patent grant
GR01 Patent grant