Android-based user information determination method, device, equipment and storage medium
By designing a method in the Android system to use the target user identification to query the user's basic information and operational attribute information, the problem of low efficiency in obtaining user permission information in network behavior scenarios is solved, and fast and efficient information acquisition is achieved.
Patent Information
- Application Number
- CN202010454322.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-05-26
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2040-05-26
AI Technical Summary
In network behavior scenarios, obtaining the user's operation permission information is inefficient and requires multiple iterations to query the user's basic information and operation attribute information.
By designing a method in the Android system, the target user ID is used to call the information query function to generate the target information package object, which contains the user's basic information and operational attribute information, and the preset user table, attribute table and association table structures are used for query. Achieve one-time acquisition of user-related information.
It improves the speed and efficiency of obtaining user-related information, simplifies the information query process, and reduces the number of queries.
Smart Images

Figure CN113722574B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to Internet technologies, and in particular to an Android-based user information determination method, apparatus, device, and storage medium. Background Art
[0002] In scenarios involving network behavior, a user may have different operation attributes. For example, in the website access scenario of Internet search, the user's operation attributes can be divided into ordinary users, ordinary members, senior members, etc.; in the online game scenario, the user's operation attributes can be divided into different game roles; in real-time interactive scenarios such as online meetings and live webcasts, the user's operation attributes can be divided into interactive roles such as hosts and participants. In different operation attributes, users have different operation permissions for different modules.
[0003] If you need to know a user's operating permissions for a module on a website, you need to first obtain the user's basic information, then obtain the user's operating attribute information for the website based on the user basic information, and then obtain the user's operating permission information for the module on the website based on the operating attribute information.
[0004] The above method of obtaining permission information requires multiple iterative queries, which will result in very low efficiency in obtaining user-related information. Summary of the invention
[0005] Embodiments of the present invention provide an Android-based user information determination method, apparatus, device, and storage medium to achieve more efficient and rapid acquisition of user-related information.
[0006] In a first aspect, an embodiment of the present invention provides a method for determining user information based on Android, comprising:
[0007] Obtain the target user ID of the user information to be determined;
[0008] Taking the target user identifier as an input parameter, calling an information query function to generate a target information package object, wherein the target information package object includes target user basic information corresponding to the target user identifier and at least one target operation attribute information;
[0009] The information query function generates the target information package object in the following way:
[0010] According to the target user identifier, query the information corresponding to the target user identifier from the user information table, the attribute information table and the association information table between users and attributes in the database to determine the target user basic information and each target operation attribute information, wherein the user information table, the attribute information table and the association information table are stored according to a preset user table structure, a preset attribute table structure and a preset association table structure respectively;
[0011] By mapping table fields with container object fields, the target user basic information and each target operation attribute information are stored in an initial information package object, and a target information package object corresponding to the target user identifier is generated, wherein the initial information package object includes a container object.
[0012] In a second aspect, an embodiment of the present invention further provides an Android-based user information determination device, the device comprising:
[0013] A target user identification determination module is used to obtain a target user identification of the user information to be determined;
[0014] A target information package object generation module, used to call an information query function with the target user identifier as an input parameter to generate a target information package object, wherein the target information package object includes target user basic information corresponding to the target user identifier and at least one target operation attribute information;
[0015] The target information package object generation module includes a function execution submodule, which is used to realize the function of generating the target information package object in the following manner:
[0016] According to the target user identifier, query the information corresponding to the target user identifier from the user information table, the attribute information table and the association information table between users and attributes in the database to determine the target user basic information and each target operation attribute information, wherein the user information table, the attribute information table and the association information table are stored according to a preset user table structure, a preset attribute table structure and a preset association table structure respectively;
[0017] By mapping table fields with container object fields, the target user basic information and each target operation attribute information are stored in an initial information package object, and a target information package object corresponding to the target user identifier is generated, wherein the initial information package object includes a container object.
[0018] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0019] one or more processors;
[0020] a storage device for storing one or more programs,
[0021] When the one or more programs are executed by the one or more processors, the one or more processors implement the Android-based user information determination method provided by any embodiment of the present invention.
[0022] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the Android-based user information determination method provided by any embodiment of the present invention.
[0023] The embodiment of the present invention obtains the target user identifier of the user information to be determined; takes the target user identifier as an input parameter, calls an information query function, and generates a target information package object, wherein the target information package object contains the target user basic information and at least one target operation attribute information corresponding to the target user identifier; wherein the information query function realizes the function of generating the target information package object in the following manner: according to the target user identifier, querying the information corresponding to the target user identifier from the user information table, the attribute information table, and the association information table between the user and the attribute in the database, and determining the target user basic information and each target operation attribute information, wherein the user information table, the attribute information table, and the association information table are stored according to a preset user table structure, a preset attribute table structure, and a preset association table structure, respectively; through the mapping between the table field and the container object field, the target user basic information and each target operation attribute information are stored in the initial information package object, and the target information package object corresponding to the target user identifier is generated, wherein the initial information package object contains the container object. It realizes the storage of each user's basic information and each operation attribute information according to the corresponding predefined table structure, and establishes the association relationship between the user information table and the attribute information table through the association information table. In this way, the user information table, the attribute information table and the association information table can be queried using the target user identifier through the information query function, and the user basic information and all the target operation attribute information corresponding to the target user identifier can be obtained at one time, thereby improving the speed and efficiency of obtaining user-related information. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 is a flow chart of a method for determining user information based on Android in Embodiment 1 of the present invention;
[0025] Figure 2 This is a functional implementation flow chart of an information query function in an Android-based user information determination method in Embodiment 1 of the present invention;
[0026] Figure 3 It is a flowchart of the functional implementation of the information query function in the method for determining user information based on Android in the second embodiment of the present invention;
[0027] Figure 4 This is a schematic diagram of the structure of an Android-based user information determination device in Embodiment 3 of the present invention;
[0028] Figure 5 It is a structural schematic diagram of an electronic device in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0029] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0030] Embodiment 1
[0031] The Android-based user information determination method provided in this embodiment can be applied to obtain user-related information in scenarios involving network behavior, such as obtaining user basic information, operation attribute categories, and operation permissions in real-time interactive scenarios such as Internet search website access scenarios, online game scenarios, online meetings, and online live broadcasts. The method can be executed by an Android-based user information determination device, which can be implemented in software and / or hardware, and can be integrated in an electronic device equipped with an Android system, such as a mobile phone, a tablet computer, or a smart TV. See Figure 1 , the method of this embodiment specifically includes:
[0032] S110: Obtain a target user identifier for the user information to be determined.
[0033] Specifically, in order to simplify the user information acquisition process, the embodiment of the present invention directly uses the user identification as the input information for user information acquisition, rather than other more complex information of the user. The target user identification can be set during code design, or can be input through the human-computer interaction interface during the execution of the user information query process.
[0034] S120: Taking the target user identifier as an input parameter, calling the information query function, generating a target information package object, wherein the target information package object includes the target user basic information corresponding to the target user identifier and at least one target operation attribute information.
[0035] Among them, the information query function is a predefined function used to query all information of a user based on the user identifier. For example, the information query function selectUserWithRoleListById is defined as funselectUserWithRoleListById(id:Int):UserInfoWrapper, the input parameter of the function is the user identifier id, and the return value is the result set data (i.e., the target information wrapping object) of a predefined wrapper type (i.e., information wrapping class) UserInfoWrapper. For the description of the information wrapping class, see the description of the subsequent embodiments. User basic information refers to the user's own information such as the user's name and gender. Operation attribute information refers to information related to the user's operation attributes, for example, the operation attribute information includes the operation attribute category and the permission information corresponding to the operation attribute. The operation attribute category varies according to the application scenario. For example, in the website access scenario of Internet search, the operation attribute category is ordinary users, ordinary members, senior members, etc.; in the online game scenario, the operation attribute category is game characters; in real-time interactive scenarios such as online meetings and live webcasts, the operation attribute category is interactive roles such as hosts and participants.
[0036] Specifically, in an embodiment of the present invention, the user information query process is encapsulated into an information query function, and the target user identification ID is used as the function input parameter. By calling the information query function, a target information package object is returned, and the target information package object contains all relevant information of the target user to be queried, that is, the target user basic information and all target operation attribute information.
[0037] See also Figure 2 The information query function generates the target information package object in the following way:
[0038] S210: According to the target user identifier, query the information corresponding to the target user identifier from the user information table, the attribute information table and the association information table between users and attributes in the database to determine the target user basic information and each target operation attribute information.
[0039] Among them, the user information table, the attribute information table and the association information table are stored according to the preset user table structure, the preset attribute table structure and the preset association table structure, respectively. Exemplarily, the preset user table structure contains a user status field, and the value of the user status field is used to characterize the user's current status as enabled or disabled. The advantage of this setting is that it can ensure that the user can be blocked and unblocked when the data is not deleted. Exemplarily, the preset association table structure contains a user identifier and at least one attribute identifier associated with the user identifier. The attribute identifier refers to globally unique information used to distinguish different operation attribute categories. The advantage of this setting is that it can simplify the amount of data in the association table and further improve the efficiency of information query.
[0040] Specifically, the concepts in authority are divided into three points: user, operation attribute category, and authority. One user can have multiple operation attribute categories, and one operation attribute category can also have multiple users, so it is a many-to-many relationship. One operation attribute category can have multiple permissions, and one permission can also correspond to multiple operation attribute categories, so the operation attribute category and authority are also a many-to-many relationship. That is, users and operation attribute categories are many-to-many, and operation attribute categories and permissions are many-to-many. Based on this, in order to improve data query efficiency, the preset user table structure, preset attribute table structure, and preset association table structure are pre-designed in this embodiment to organize user-related information in the database. In this way, the user basic information, operation attribute information, and the association relationship between the two in the database can be stored according to the table structure requirements, and the user information table, attribute information table, and the association information table between users and attributes can be obtained. When it is necessary to obtain user information, it can be queried from the user information table, attribute information table, and association information table according to the target user identifier to obtain the target user basic information and each target operation attribute information.
[0041] The designs of the above preset user table structure, preset attribute table structure and preset association table structure can be exemplified as follows:
[0042] Default user table structure:
[0043]
[0044]
[0045] Default attribute table structure:
[0046]
[0047] Preset association table structure:
[0048]
[0049] S220. By mapping table fields with container object fields, the target user basic information and each target operation attribute information are stored in the initial information package object, and a target information package object corresponding to the target user identifier is generated.
[0050] Among them, the container object refers to an object generated based on a predefined container class, which is used to store a certain type of user-related information queried from the database, such as a basic information container class that stores user basic information, an attribute information container class that stores operation attribute information, etc. The initial information package object is an initialized object generated based on a predefined package class, which is used to store all user-related information. The initial information package object contains a container object. The target information package object is a package class object that stores user-related information. The description of the container class and the package class can be found in the subsequent embodiments.
[0051] Specifically, the user-related information obtained from the database query is relatively large and scattered. In order to ensure data integrity, the present embodiment pre-designs a container class for storing information and a package class for integrating various container classes. In addition, the mapping between the table and the container is pre-designed so that the queried data can be mapped and stored in the container object. In specific implementation, through the mapping between the pre-established table fields and the container object fields, the target user basic information and each target operation attribute information obtained from the database query can be stored in the initial information package object, and the target information package object can be obtained as the return value of the information query function.
[0052] The query implementation logic code of the information query function selectUserWithRoleListById of S210 to S220 can be exemplified as follows:
[0053]
[0054]
[0055] Among them <select>The tag indicates querying the data. id="selectUserWithRoleListById" indicates that the query logic is mapped one-to-one with the function name of the information query function. resultMap="userInfoRoleListResult" is the result set obtained by mapping between table fields and container object fields. parameterType="integer" indicates that the input parameter is an integer, that is, the target user ID.
[0056] The technical solution of this embodiment is to obtain the target user identifier of the user information to be determined; use the target user identifier as an input parameter, call the information query function, and generate a target information package object, wherein the target information package object contains the target user basic information and at least one target operation attribute information corresponding to the target user identifier; wherein the information query function realizes the function of generating the target information package object in the following manner: according to the target user identifier, query the information corresponding to the target user identifier from the user information table, the attribute information table, and the association information table between the user and the attribute in the database to determine the target user basic information and each target operation attribute information, wherein the user information table, the attribute information table, and the association information table are stored according to a preset user table structure, a preset attribute table structure, and a preset association table structure, respectively; through the mapping between the table field and the container object field, the target user basic information and each target operation attribute information are stored in the initial information package object, and the target information package object corresponding to the target user identifier is generated, wherein the initial information package object contains the container object. The basic information of each user and each operation attribute information are stored according to the corresponding predefined table structure, and the association relationship between the user information table and the attribute information table is established through the association information table. In this way, the user information table, the attribute information table and the association information table can be queried by the information query function using the target user identifier, and the basic user information and all the target operation attribute information corresponding to the target user identifier are obtained at one time, thereby improving the acquisition speed and efficiency of user-related information.
[0057] Embodiment 2
[0058] Based on the above embodiment 1, this embodiment further optimizes "according to the target user identifier, from the user information table, the attribute information table and the association information table between the user and the attribute in the database, to determine the basic information of the target user and the attribute information of each target operation". On this basis, the generation process of the "initial information package object" can be further added. Among them, the explanation of the terms that are the same or corresponding to the above embodiments will not be repeated here.
[0059] Referring to Figure 3, the function implementation method of the information query function in the user information determination method based on Android provided in this embodiment includes:
[0060] S310, based on the predefined basic information container class, construct an initial package class.
[0061] Among them, the basic information container class is a predefined container class, which is used to store user basic information.The initial wrapper class refers to a predefined and initialized wrapper class, which is used to store all user-related information through a combination of container classes.
[0062] Specifically, in order to effectively carry the queried user data, a result information wrapper class UserInfoWrapper is pre-designed in this embodiment. The wrapper class UserInfoWrapper inherits from the basic information container class Userinfo, so that UserInfoWrapper has all the attribute information of the Userinfo class. The specific wrapper class design code example is: class UserInfoWrapper:Userinfo(){}.
[0063] The design code example of the above basic information container class is as follows:
[0064]
[0065]
[0066] Among them, @TableId(value="id",type=IdType.AUTO) is used to describe that the field is the primary key id information. If it is not described, it may cause errors in the subsequent primary key self-increment method, thereby causing abnormal result information in the program. In addition, all fields are initialized to null or 0, so that the security of the data can be effectively guaranteed. In addition, the rule of naming the fields in the container is to remove the underscores of the corresponding fields in the database, and then change the first lowercase letter after the underscore to an uppercase letter. The purpose of this design is to facilitate the subsequent processing of data mapping and do the preliminary preparation work, and improve the efficiency of subsequent container mapping.
[0067] Exemplarily, the basic information container class contains a constructor without parameters and a constructor with all parameters. In the basic information container class, a constructor without parameters and a constructor with all parameters are designed through the constructor keyword. In this way, the constructor without parameters is convenient for subsequent ORM framework reflection to call, avoid abnormalities in the ORM framework, and improve the compatibility of the container class. The constructor with all parameters is to facilitate the subsequent filling of the container to fill all the data at one time, improve the filling efficiency of the query data, and further improve the efficiency of user information query.
[0068] Exemplarily, the system string conversion function is overwritten in the basic information container class. In order to facilitate the subsequent display operation of the data, the system string conversion function toString is overwritten in the definition of the basic information container class. When the container object needs to be printed later, the toString method can be automatically called to print out the specific information of the container object, which can display the data information in the container object more friendly and improve the efficiency of code debugging and development.
[0069] S320. In the initial package class, based on the predefined attribute information container class, a variable list type attribute information container set is constructed, and the attribute information container set is initialized to an empty set to generate an information package class.
[0070] The attribute information container class is a predefined container class used to store operation attribute information.
[0071] Specifically, the initial wrapper class already contains all the attribute information of the Userinfo class. In order to enable it to store the operation attribute information, an attribute information container set roleList whose list element type is the mutable list type MutableList of the attribute information container class is added inside the initial wrapper class to carry all the operation attribute information in the future. In addition, the attribute information container set is initialized to an empty collection object such as mutableListOf(), and the information wrapper class can be generated.
[0072] Exemplarily, the system string conversion function is overridden in both the attribute information container class and the information wrapper class. Similarly, in order to observe the data in the information wrapper class UserInfoWrapper in the future, the class also overrides the toString method. In the implementation of the overriding method, the toString method first calls the toString method of the parent class (i.e., the Userinfo class) by calling the function ${super.toString()}, and then adds the relevant information of UserInfoWrapper (roleList=$roleList), so that the toString method in UserInfoWrapper can display all the information, further improving the efficiency of development and debugging.
[0073] Based on the above description, the code design example of the information package class is as follows:
[0074]
[0075] Among them, the design code example of the attribute information container class is as follows:
[0076]
[0077]
[0078] S330, generate an initial information package object based on the information package class.
[0079] Specifically, use the constructor of the information package class to instantiate a package class object as the initial information package object, and the values of each field in the initial information package object are all initialized values.
[0080] S340, determine whether the target user identifier is queried from the user information table.
[0081] Specifically, the implementation of the query process can be to select whether the user information table contains the target user identifier. If not, it means that there is no user information corresponding to the target user identifier, and the query process ends. If it is included, execute S350.
[0082] S350, determine the target user basic information from the user information table, and determine whether the target user identifier is queried from the associated information table.
[0083] Specifically, read the target user basic information from the user information table. Further determine whether the target user identifier exists in the associated information table. If not, it means that the target user has no associated operation attribute type, and execute S370 to return the user basic information. If it exists, execute S360.
[0084] S360, according to the target user identifier, determine at least one target attribute identifier from the associated information table, and according to each target attribute identifier, determine each target operation attribute information corresponding to the target user identifier from the attribute information table.
[0085] Specifically, all target attribute identifiers associated with the target user identifier are read from the association information table. Then, according to the target attribute identifier, all target operation attribute information is queried and read from the attribute information table.
[0086] S370, through the mapping between the table field and the container object field, the target user basic information and each target operation attribute information are stored in the initial information package object, and the target information package object corresponding to the target user identifier is generated.
[0087] Specifically, in order to store the user information read from the database into the initial information package object, the mapping between the table field in each table and the container object field in the corresponding container object is designed in this embodiment. Then, according to the mapping regulations, the target user basic information and all target operation attribute information are mapped and stored in the initial information package object, and the target information package object is obtained.
[0088] The mapping design agent between table fields and container object fields can be exemplified as follows:
[0089] The mapping between the user information table and the mapping result set object resultMap is:
[0090]
[0091]
[0092] Where id represents the unique identifier of the result set, and the type of the result set is com.micro.user.entity.Userinfo. Each result tag in the result set contains two sub-tags property and column. Property is the corresponding field information in the basic information container class Userinfo, and column is the corresponding field information of the user information table in the database. In this way, a one-to-one mapping relationship between the basic information container class and the user information table is established through each result tag.
[0093] The mapping between the information wrapper class UserInfoWrapper and the mapping result set object resultMap is:
[0094]
[0095] Where the unique identifier id tag of the result set is defined as userInfoRoleListResult, the type is com.micro.user.domain.UserInfoWrapper, and the result set of baseUserInfo is inherited through the extends keyword. Then, by<collection property="roleList"ofType="com.micro.user.entity.Role"> Tag to indicate the mapping of data in the attribute information container collection. Among them, property = "roleList" indicates the field information in UserInfoWrapper, and ofType = "com.micro.user.entity.Role" indicates the type information of each element in the attribute information container collection. After that, the mapping relationship between the attribute information table and the attribute information container class Role is described in the sub-collection.Among them<id property="id"column="r_id" / > It represents the mapping of the primary key ID, property="id" represents the field information in the attribute information container class Role, and column="r_id" represents the corresponding field information in the attribute information table in the database. The mapping in all attribute information container objects Role is implemented in a similar way, and the mapping logic of the entire UserInfoWrapper is completed.
[0096] It should be noted that, taking the id field as an example, the fields of various tables in the database are designed as id, and it is designed as "r_id" here. This is because UserInfoWrapper inherits baseUserInfo, but there is already an id description information in baseUserInfo. At this time, if "r_id" is written as id, it will conflict with the id existing in baseUserInfo, which will cause the failure of the mapping relationship, and thus the correct mapping of the data cannot be achieved. Here, the id is forced to be modified to the mapping of column="r_id". Later, it is necessary to associate column="r_id" with id in a specific way. The specific association method can be found in the code implementation of the information query function in Example 1.
[0097] S380, call the system string conversion function in the target information package object to display the target user basic information and each target operation attribute information.
[0098] Specifically, by calling the system string conversion function toString in the target information package object, all user information corresponding to the target user identifier, that is, the target user basic information and each target operation attribute information, can be output and displayed.
[0099] It should be noted that S310 and S320 can only be executed when the information query function is run for the first time. The execution order of S340~S360 and S370 is not limited. S380 can be executed every time or only in the debugging stage.
[0100] The technical solution of this embodiment, through the design of the basic information container class, the attribute information container class and the information package class, and the mapping design between the table field and the container object field, can realize the data integration and storage of user-related information queried from different tables in the database into the target information package object, while ensuring data integrity, improving data flow efficiency, and further improving user information query efficiency.
[0101] Embodiment 3
[0102] This embodiment provides a user information determination device based on Android, see FIG4 , the device specifically comprises:
[0103] a target user identification determination module 410, used to obtain the target user identification of the user information to be determined;
[0104] a target information package object generation module 420, used to call the information query function with the target user identification as an input parameter to generate a target information package object, wherein the target information package object contains the target user basic information corresponding to the target user identification and at least one target operation attribute information;
[0105] wherein the target information package object generation module 420 comprises a function execution submodule, used to realize the generation of the target information package object in the following manner: Functions of the target information package object:
[0106] Based on the target user identifier, query the information corresponding to the target user identifier from the user information table, attribute information table and the association information table between users and attributes in the database to determine the target user basic information and each target operation attribute information, wherein the user information table, attribute information table and association information table are stored according to the preset user table structure, the preset attribute table structure and the preset association table structure respectively;
[0107] Through the mapping between the table fields and the container object fields, store the target user basic information and each target operation attribute information into the initial information package object, and generate a target information package object corresponding to the target user identifier, wherein the initial information package object contains the container object.
[0108] Optionally, the function execution submodule is further used to:
[0109] construct an initial package class based on a predefined basic information container class before storing the target user basic information and each target operation attribute information into the initial information package object;
[0110] construct an attribute information container set of a variable list type based on a predefined attribute information container class within the initial package class, and initialize the attribute information container set to an empty set to generate an information package class;
[0111] generate an initial information package object based on the information package class.
[0112] The basic information container class includes a constructor without parameters and a constructor with all parameters.
[0113] Wherein, the system string conversion function is copied in the basic information container class, the attribute information container class and the information package class;
[0114] Accordingly, the function execution submodule is also used to:
[0115] After storing the target user basic information and each target operation attribute information into the initial information package object through the mapping between the table field and the container object field, and generating the target information package object corresponding to the target user identifier, call the system string conversion function in the target information package object to display the target user basic information and each target operation attribute information.
[0116] Optionally, the preset association table structure includes a user identifier and at least one attribute identifier associated with the user identifier.
[0117] Optionally, the function execution submodule is specifically used to:
[0118] determine whether the target user identifier is queried from the user information table;
[0119] if so, determine the target user basic information from the user information table, and determine whether the target user identifier is queried from the associated information table;
[0120] if so, determine at least one target attribute identifier from the associated information table based on the target user identifier, and determine each target operation attribute information corresponding to the target user identifier from the attribute information table based on each target attribute identifier.
[0121] Optionally, the preset user table structure includes a user status field, and the value of the user status field is used to indicate whether the current status of the user is enabled or disabled.
[0122] Through the Android-based user information determination device of the third embodiment of the present invention, it is realized that each user's basic information and each operation attribute information are stored according to the corresponding predefined table structure, and the association relationship between the user information table and the attribute information table is established through the association information table, so that the user information table, the attribute information table and the association information table can be queried by using the target user identifier through the information query function, and the user basic information and all the target operation attribute information corresponding to the target user identifier are obtained at one time, thereby improving the acquisition speed and efficiency of user-related information.
[0123] The Android-based user information determination device provided by the embodiment of the present invention can execute the Android-based user information determination method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0124] It is worth noting that in the above-mentioned embodiment of the Android-based user information determination device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of mutual distinction, and are not used to limit the protection scope of the present invention.
[0125] Embodiment 4
[0126] Referring to FIG. 5 , this embodiment provides an electronic device 500, which includes: one or more processors 520; a storage device 510, which is used to store one or more programs. When the one or more programs are executed by the one or more processors 520, the one or more processors 520 implement the Android-based user information determination method provided by the embodiment of the present invention, including:
[0127] obtaining the target user identifier of the user information to be determined;
[0128] using the target user identifier as an input parameter, calling an information query function, and generating a target information package object, wherein the target information package object includes target user basic information corresponding to the target user identifier and at least one target operation attribute information;
[0129] wherein the information The information query function realizes the function of generating the target information package object in the following manner:
[0130] According to the target user identifier, the information corresponding to the target user identifier is queried from the user information table, the attribute information table and the association information table between the user and the attribute in the database to determine the target user basic information and each target operation attribute information, wherein the user information table, the attribute information table and the association information table are stored according to the preset user table structure, the preset attribute table structure and the preset association table structure respectively;
[0131] Through the mapping between the table field and the container object field, the target user basic information and each target operation attribute information are stored in the initial information package object, and the target information package object corresponding to the target user identifier is generated, wherein the initial information package object contains the container object.
[0132] Of course, those skilled in the art can understand that the processor 520 can also implement the technical solution of the user information determination method based on Android provided by any embodiment of the present invention.
[0133] The electronic device 500 shown in FIG5 is only an example and should not bring any limitation to the function and scope of use of the embodiment of the present invention.
[0134] As shown in FIG5, the electronic device 500 is presented in the form of a general computing device. The components of the electronic device 500 may include, but are not limited to, one or more processors 520, a storage device 510, and a bus 550 that connects different system components (including the storage device 510 and the processor 520).
[0135] The bus 550 represents one or more of several types of bus structures, including a memory bus or a memory controller, a peripheral bus, a graphics acceleration port, a processor or a local bus using any of a variety of bus structures. For example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0136] The electronic device 500 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 500, including volatile and non-volatile media, removable and non-removable media.
[0137] Storage device 510 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 511 and / or cache memory 512. Electronic device 500 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 513 may be used to read and write non-removable, non-volatile magnetic media (not shown in FIG. 5 , commonly referred to as “hard drive”). Although not shown in FIG. 5 , a disk drive for reading and writing a removable non-volatile disk (such as a “floppy disk”) and an optical disk drive for reading and writing a removable non-volatile optical disk (such as a CD-ROM, DVD-ROM or other optical media) may be provided. In these cases, each drive may be connected to bus 550 via one or more data medium interfaces. Storage device 510 may include at least one program product having a set (such as at least one) of program modules, which are configured to perform the functions of various embodiments of the present invention.
[0138] A program / utility 514 having a set (at least one) of program modules 515 may be stored in, for example, a storage device 510, such program modules 515 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination thereof may include the implementation of a network environment. The program module 515 generally performs the functions and / or methods of any embodiment described in the present invention.
[0139] The electronic device 500 may also communicate with one or more external devices 560 (e.g., a keyboard, a pointing device, a display 570, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 500, and / or may communicate with any device that enables the electronic device 500 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed through an input / output interface (I / O interface) 530. Furthermore, the electronic device 500 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 540. As shown in FIG5 , the network adapter 540 communicates with other modules of the electronic device 500 via the bus 550. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 500, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0140] The processor 520 executes various functional applications and data processing by running programs stored in the storage device 510, such as implementing the Android-based user information determination method provided in an embodiment of the present invention.
[0141] Embodiment 5
[0142] This embodiment provides a storage medium containing computer executable instructions, which are used to execute a user information determination method based on Android when executed by a computer processor, the method comprising:
[0143] obtaining a target user identifier of the user information to be determined;
[0144] using the target user identifier as an input parameter, calling an information query function, and generating a target information package object, wherein the target information package object contains target user basic information corresponding to the target user identifier and at least one target operation attribute information;
[0145] wherein the information query function realizes the function of generating the target information package object in the following manner:
[0146] According to the target user identifier, the information corresponding to the target user identifier is queried from the user information table, the attribute information table and the association information table between the user and the attribute in the database to determine the target user basic information and each target operation attribute information, wherein the user information table, the attribute information table and the association information table are stored according to the preset user table structure, the preset attribute table structure and the preset association table structure respectively;
[0147] Through the mapping between the table field and the container object field, the target user basic information and each target operation attribute information are stored in the initial information package object, and the target information package object corresponding to the target user identifier is generated, wherein the initial information package object contains the container object.
[0148] Of course, the storage medium containing computer executable instructions provided in the embodiment of the present invention is not limited to the above method operation, and the computer executable instructions can also execute the relevant operations in the user information determination method based on Android provided in any embodiment of the present invention.
[0149] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. Computer readable storage media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or components, or any combination of the above. More specific examples of computer readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or device.
[0150] A computer readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, in which a computer readable program code is carried. This propagated data signal can take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above.The computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device.
[0151] The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wire, optical cable, RF, etc., or any suitable combination of the foregoing.
[0152] The computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider). Note that the above are only preferred embodiments of the present invention and the applied technical principles. It will be appreciated by those skilled in the art that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made to those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail by the above embodiments, the present invention is not limited only to the above embodiments, and without departing from the concept of the present invention, more other equivalent embodiments may also be included, and the scope of the present invention is determined by the appended claims.< / select>
Claims
1. A method for determining user information based on Android, characterized in that: include: Obtain the target user ID of the user information to be determined; Taking the target user identifier as an input parameter, calling an information query function to generate a target information package object, wherein the target information package object includes target user basic information corresponding to the target user identifier and at least one target operation attribute information; The information query function generates the target information package object in the following way: According to the target user identifier, query the information corresponding to the target user identifier from the user information table, the attribute information table and the association information table between users and attributes in the database to determine the target user basic information and each target operation attribute information, wherein the user information table, the attribute information table and the association information table are stored according to a preset user table structure, a preset attribute table structure and a preset association table structure respectively; By mapping table fields with container object fields, the target user basic information and each target operation attribute information are stored in an initial information package object, and a target information package object corresponding to the target user identifier is generated, wherein the initial information package object includes a container object; The preset association table structure includes a user identifier and at least one attribute identifier associated with the user identifier; According to the target user identifier, querying the information corresponding to the target user identifier from the user information table, the attribute information table, and the association information table between users and attributes in the database to determine the target user basic information and each target operation attribute information includes: Determine whether the target user identifier is found in the user information table; If not, it means that there is no user information corresponding to the target user identifier, and the query process ends; If yes, determining the target user basic information from the user information table, and determining whether the target user identifier is found from the association information table; If so, at least one target attribute identifier is determined from the association information table according to the target user identifier, and each target operation attribute information corresponding to the target user identifier is determined from the attribute information table according to each target attribute identifier.
2. The method according to claim 1, characterized in that Before storing the target user basic information and each target operation attribute information into the initial information package object, it also includes: Construct the initial package class based on the predefined basic information container class; In the initial package class, based on the predefined attribute information container class, a variable list type attribute information container set is constructed, and the attribute information container set is initialized to an empty set to generate an information package class; The initial information package object is generated based on the information package class.
3. The method according to claim 2, characterized in that The basic information container class includes a constructor without parameters and a constructor with all parameters.
4. The method according to claim 2, characterized in that: The system string conversion function is copied in the basic information container class, the attribute information container class and the information package class; Accordingly, after storing the target user basic information and each target operation attribute information into the initial information package object through mapping between the table field and the container object field, and generating the target information package object corresponding to the target user identifier, it also includes: The system string conversion function in the target information package object is called to display the target user basic information and each target operation attribute information.
5. The method according to claim 1, characterized in that The preset user table structure includes a user status field, and the value of the user status field is used to indicate whether the current status of the user is an enabled state or a disabled state.
6. A user information determination device based on Android, characterized in that: include: A target user identification determination module is used to obtain a target user identification of the user information to be determined; A target information package object generation module, used to call an information query function with the target user identifier as an input parameter to generate a target information package object, wherein the target information package object includes target user basic information corresponding to the target user identifier and at least one target operation attribute information; The target information package object generation module includes a function execution submodule, which is used to realize the function of generating the target information package object in the following manner: According to the target user identifier, query the information corresponding to the target user identifier from the user information table, the attribute information table and the association information table between users and attributes in the database to determine the target user basic information and each target operation attribute information, wherein the user information table, the attribute information table and the association information table are stored according to a preset user table structure, a preset attribute table structure and a preset association table structure respectively; By mapping table fields with container object fields, the target user basic information and each target operation attribute information are stored in an initial information package object, and a target information package object corresponding to the target user identifier is generated, wherein the initial information package object includes a container object; The preset association table structure includes a user identifier and at least one attribute identifier associated with the user identifier; The function execution submodule is specifically used for: Determine whether the target user ID is found in the user information table; If not, it means that there is no user information corresponding to the target user identifier, and the query process ends; If yes, determine the target user basic information from the user information table, and determine whether the target user identifier is found from the associated information table; If so, at least one target attribute identifier is determined from the association information table according to the target user identifier, and each target operation attribute information corresponding to the target user identifier is determined from the attribute information table according to each target attribute identifier.
7. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the Android-based user information determination method as described in any one of claims 1-5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the Android-based user information determination method as described in any one of claims 1 to 5 is implemented.
