CN107122381B - File generation method and device and data analysis method and device - Google Patents

File generation method and device and data analysis method and device Download PDF

Info

Publication number
CN107122381B
CN107122381B CN201710081979.3A CN201710081979A CN107122381B CN 107122381 B CN107122381 B CN 107122381B CN 201710081979 A CN201710081979 A CN 201710081979A CN 107122381 B CN107122381 B CN 107122381B
Authority
CN
China
Prior art keywords
user
authority
data analysis
schema file
template
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
CN201710081979.3A
Other languages
Chinese (zh)
Other versions
CN107122381A (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.)
Beijing Xingxuan Technology Co Ltd
Original Assignee
Beijing Xingxuan Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xingxuan Technology Co Ltd filed Critical Beijing Xingxuan Technology Co Ltd
Priority to CN201710081979.3A priority Critical patent/CN107122381B/en
Publication of CN107122381A publication Critical patent/CN107122381A/en
Application granted granted Critical
Publication of CN107122381B publication Critical patent/CN107122381B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2465Query processing support for facilitating data mining operations in structured databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2425Iterative querying; Query formulation based on the results of a preceding query
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Mathematical Physics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Fuzzy Systems (AREA)
  • Probability & Statistics with Applications (AREA)
  • Storage Device Security (AREA)

Abstract

The embodiment of the invention provides a file generation method and device, a data analysis method and device and a mobile terminal, and relates to the technical field of computer application. The file generation method comprises the following steps: acquiring a file template; determining user rights based on the user identifier; and generating a file according to the file template and the user authority. The technical scheme provided by the embodiment of the invention determines the user authority in the file through the user identifier, so that the customized file can be directionally generated to realize personalized authority constraint, thereby improving the user experience.

Description

File generation method and device and data analysis method and device
Technical Field
The present invention relates to the field of computer application technologies, and in particular, to a file generation method and apparatus, a data analysis method and apparatus, and a mobile terminal.
Background
Online Analytical Processing (OLAP) is a major application of data warehouse systems, supports complex Analytical operations, emphasizes decision support, and provides intuitive and understandable query results. In the context of big data analysis, OLAP is one of the important approaches to data analysis.
In the use scene of the OLAP, the permission limitation of resources is supported to ensure the safety of information. However, at present, a schema file for obtaining user rights in the OLAP is a static file (the same for all users), so that the rights constraint provided to the user is relatively static, and the rights constraint cannot be customized for different users, thereby reducing user experience.
Disclosure of Invention
The embodiment of the invention provides a file generation method and device, a data analysis method and device and a mobile terminal, which are used for solving the problem that the user experience is reduced because the permission constraint of customization cannot be carried out on different users in the prior art.
In a first aspect, an embodiment of the present invention provides a file generation method.
Specifically, the method comprises the following steps:
acquiring a file template;
determining user rights based on the user identifier;
and generating a file according to the file template and the user authority.
In the invention, the user authority in the file is determined by the user identifier, so that the customized file can be generated in a directional manner to realize personalized authority constraint, thereby improving the user experience.
With reference to the first aspect, in some implementations of the invention, the determining the user right based on the user identifier includes:
acquiring a permission model according to the user identifier;
and determining the user authority according to the authority model.
With reference to the first aspect, in some implementations of the present invention, the generating a file according to the file template and the user right includes:
identifying a label template matched with the authority name of the user authority from the file template;
judging whether the number of the label templates is equal to the number of elements of the authority value set in the user authority;
and if the number of the label templates is equal to the number of the elements, carrying out placeholder replacement processing on the different label templates in the file template by using different elements in the permission value set respectively.
With reference to the first aspect, in some implementations of the present invention, the generating a file according to the file template and the user right further includes:
if the number of the label templates is not equal to the number of the elements, respectively generating different replacement labels through the label templates and different elements in the permission value set;
deleting the tag template and inserting the replacement tag in the file template.
In a second aspect, embodiments of the present invention provide a data analysis method.
Specifically, the method comprises the following steps:
loading a file generated according to any one of the file generation methods based on the data analysis request;
acquiring user permission from the file;
and performing data analysis processing according to the data analysis request and the user authority.
With reference to the second aspect, in some implementations of the invention, the performing data analysis processing according to the data analysis request and the user authority includes:
generating a database query request according to the data analysis request;
filtering the database query request by using the user authority;
reading data from the database based on the filtered database query request;
and performing analysis processing on the data.
Since the data filtering process is performed before querying the database in the present invention, the pressure on the database can be reduced and the coverage of the authority control can also be improved.
In a third aspect, an embodiment of the present invention provides a file generation apparatus.
Specifically, the apparatus comprises:
the acquisition module is used for acquiring a file template;
a determination module to determine a user privilege based on the user identifier;
and the generating module is used for generating a file according to the file template and the user authority.
In the invention, the user authority in the file is determined by the user identifier, so that the customized file can be generated in a directional manner to realize personalized authority constraint, thereby improving the user experience.
With reference to the third aspect, in some implementations of the invention, the determining module includes:
the acquisition unit is used for acquiring a permission model according to the user identifier;
and the determining unit is used for determining the user authority according to the authority model.
With reference to the third aspect, in some implementations of the invention, the generating module includes:
the identification unit is used for identifying a label template matched with the authority name of the user authority from the file template;
the judging unit is used for judging whether the number of the label templates is equal to the number of elements of the authority value set in the user authority;
and the replacing unit is used for respectively carrying out placeholder replacement processing on different label templates in the file template by using different elements in the permission value set under the condition that the number of the label templates is equal to the number of the elements.
With reference to the third aspect, in some implementations of the invention, the generating module further includes:
a generating unit, configured to generate different replacement labels through the label template and different elements in the permission value set, respectively, when the number of the label templates is not equal to the number of the elements;
and the deleting and inserting unit is used for deleting the label template and inserting the replacing label in the file template.
In a fourth aspect, embodiments of the present invention provide a data analysis apparatus.
Specifically, the apparatus comprises:
the loading module is used for loading the file generated according to any file generation method based on the data analysis request;
the acquisition module is used for acquiring the user permission from the file;
and the processing module is used for performing data analysis processing according to the data analysis request and the user permission.
With reference to the fourth aspect, in some implementations of the invention, the processing module includes:
the generating unit is used for generating a database query request according to the data analysis request;
the filtering unit is used for filtering the database query request by utilizing the user authority;
a reading unit, configured to read data from a database based on the filtered database query request;
and the processing unit is used for executing analysis processing on the data.
Since the data filtering process is performed before querying the database in the present invention, the pressure on the database can be reduced and the coverage of the authority control can also be improved.
In a fifth aspect, embodiments of the present invention provide a mobile terminal, including a memory and a processor; wherein,
the memory is to store one or more computer instructions, wherein the one or more computer instructions are for the processor to invoke for execution;
the processor is configured to perform the operations of any one of the above file generation methods or any one of the above data analysis methods.
These and other aspects of the invention will be more readily apparent from the following description of the embodiments.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on the drawings without creative efforts.
Fig. 1 is a flowchart of a file generation method according to embodiment 1 of the method of the present invention;
FIG. 2 illustrates one embodiment of the process S12 shown in FIG. 1;
FIG. 3 shows an architecture diagram of a RBAC (Role-Based Access Control) model;
FIG. 4 illustrates one embodiment of the process S13 shown in FIG. 1;
FIG. 5 is a flow chart of a method of data analysis according to method embodiment 4 of the present invention;
FIG. 6 illustrates one embodiment of the process S21 illustrated in FIG. 5;
FIG. 7 illustrates one embodiment of the process S23 illustrated in FIG. 5;
FIG. 8 is a schematic configuration diagram of a file creation apparatus according to embodiment 1 of the present invention;
FIG. 9 illustrates one embodiment of the determination module 12 shown in FIG. 8;
FIG. 10 illustrates one embodiment of the generation module 13 shown in FIG. 8;
FIG. 11 is a schematic configuration diagram of a data analysis apparatus according to embodiment 4 of the present invention;
FIG. 12 illustrates one embodiment of the load module 21 shown in FIG. 11;
FIG. 13 illustrates one embodiment of the processing module 23 shown in FIG. 11.
Detailed Description
Various aspects of the invention are described in detail below with reference to the figures and the detailed description. Well-known processes, modules, units and their interconnections, links, communications or operations with each other are not shown or described in detail herein in various embodiments of the invention.
Also, the described features, architectures, or functions may be combined in any manner in one or more embodiments.
Furthermore, it should be understood by those skilled in the art that the following embodiments are illustrative only and are not intended to limit the scope of the present invention. Those of skill in the art will also readily appreciate that the modules or elements or steps of the various embodiments described herein and illustrated in the figures may be combined and arranged in a wide variety of different configurations.
Technical terms not specifically described in the present specification should be construed in the broadest sense in the art unless otherwise specifically indicated.
In some of the flows described in the present specification and claims and in the above figures, a number of operations are included that occur in a particular order, but it should be clearly understood that these operations may be performed out of order or in parallel as they occur herein, with the order of the operations being indicated as 101, 102, etc. merely to distinguish between the various operations, and the order of the operations by themselves does not represent any order of performance. Additionally, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel. It should be noted that, the descriptions of "first", "second", etc. in this document are used for distinguishing different messages, devices, modules, etc., and do not represent a sequential order, nor limit the types of "first" and "second" to be different.
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without inventive effort based on the embodiments of the present invention, are within the scope of the present invention.
[ METHOD EMBODIMENT 1 ]
Fig. 1 is a flowchart of a file generation method according to embodiment 1 of the method of the present invention. Referring to fig. 1, in the present embodiment, the method includes:
s11: and acquiring a file template.
S12: user rights are determined based on the user identifier.
S13: and generating a file according to the file template and the user authority.
In the present invention, the user identifier includes, for example, but is not limited to: user number, user mailbox and other identification information. The user rights include, for example but not limited to: a name of the right, and a set of rights values. The authority name is used to indicate what resource the user performs access control on, and the authority value set is used to indicate the specific resource the user has the ability to access, for example, the authority name is: CITY, the set of authority values is: { Shanghai, Beijing, Shenyang }.
In the invention, the user authority in the file is determined by the user identifier, so that the customized file can be generated in a directional manner to realize personalized authority constraint, thereby improving the user experience.
[ METHOD EMBODIMENT 2 ]
The method provided by this embodiment includes all the contents of method embodiment 1, and is not described herein again. As shown in fig. 2, in the present embodiment, the process S12 is implemented as follows:
s121: and acquiring a permission model according to the user identifier.
S122: and determining the user authority according to the authority model.
In the present invention, the rights model includes, for example, but not limited to: a "user-permission" model, and a "user-role-permission" model.
Wherein, the 'user-authority' model is a model directly associating users and authorities; the "user-role-authority" model is a model that associates users and authorities through roles, and is also called a RBAC model.
Fig. 3 shows an architecture diagram of the RBAC model. Note that, 1 …? And 1 … denotes the mapping number relationship between the arrow head and the arrow tail. Among them, 1 …? At least 1 arrow head part and at least 1 arrow tail part are shown; 1 … indicates at least 0 heads of arrows and at least 1 tail of arrows. For example, between a user and a character, the user has at least 1 character.
[ METHOD EMBODIMENT 3 ]
The method provided by this embodiment includes all the contents of method embodiment 1 or method embodiment 2, and is not described herein again. As shown in fig. 4, in the present embodiment, the process S13 is implemented as follows:
s131: and identifying a label template matched with the authority name of the user authority from the file template.
S132: and judging whether the number of the label templates is equal to the number of elements of the authority value set in the user authority. If so, S133 is executed, and if not, S134 is executed.
S133: in the file template, different elements in the permission value set are utilized to respectively carry out placeholder replacement processing on different label templates.
S134: and respectively generating different replacement labels through different elements in the label template and the permission value set.
S135: deleting the tag template and inserting the replacement tag in the file template.
In the present invention, the placeholder replacement processing refers to replacing a placeholder (a character string starting with @ and ending with @) with specified content.
[ METHOD EMBODIMENT 4 ]
Fig. 5 is a flow chart of a data analysis method according to method embodiment 4 of the present invention. Referring to fig. 5, in the present embodiment, the method includes:
s21: loading the file based on the data analysis request.
Wherein the file is generated according to the method provided in any one of method embodiments 1 to 3.
S22: and acquiring the user right from the file.
S23: and performing data analysis processing according to the data analysis request and the user authority.
[ METHOD EMBODIMENT 5 ]
The method provided by this embodiment includes all the contents of method embodiment 4, and is not described herein again. As shown in fig. 6, in the present embodiment, the process S21 is implemented as follows:
s211: and analyzing the user identifier from the data analysis request.
S212: and loading the file according to the user identifier.
[ METHOD EMBODIMENT 6 ]
The method provided by this embodiment includes all the contents of method embodiment 4 or method embodiment 5, and is not described herein again. As shown in fig. 7, in the present embodiment, the process S23 is implemented as follows:
s231: and generating a database query request according to the data analysis request.
S232: and filtering the database query request by using the user authority.
S233: reading data from the database based on the filtered database query request.
S234: and performing analysis processing on the data.
Since the data filtering process is performed before querying the database in the present invention, the pressure on the database can be reduced and the coverage of the authority control can also be improved.
[ METHOD EMBODIMENT 7 ]
The file generation method provided by the present embodiment is described below by taking an OLAP scenario as an example. The method comprises the following steps:
treatment 1: the OLAP service passes the user identifier to a dynamic processing service (hereinafter referred to as service S).
And (3) treatment 2: the service S sends the user identifier to the user resource list service to request the user right and reads the corresponding schema file template.
And (3) treatment: the user resource list service acquires the user right based on the RBAC right model after obtaining the user identifier, and returns the user right in a MAP (K, V) (name value pair) mode.
Wherein, K is the authority name, and V is the authority value set.
And (4) treatment: and the service S generates a schema file according to the schema file template and the user authority.
The specific implementation of the process 4 is explained in detail below with reference to the drawings.
And respectively executing the following processing aiming at each acquired user authority:
A. and identifying a label template matched with the authority name of the user authority from the schema file template.
B. And judging whether the number of the label templates is equal to the number of elements of the authority value set in the user authority. If yes, executing C, and if not, executing D.
C. In the file template, different elements in the permission value set are utilized to respectively carry out placeholder replacement processing on different label templates.
D. And respectively generating different replacement labels through different elements in the label template and the permission value set, and deleting the label template and inserting the replacement labels in the file template.
A partial example of a schema file template is given below:
Figure GDA0001276488690000081
Figure GDA0001276488690000091
take the user authority with K as DYNAMIC _ CITY as an example. In the schema file template, the label template matched with the authority name of the user authority is:
<MemberGrant member=”[City Role.Default].[City].[@
DYNAMIC_CITY@]”access=”all”></MemberGrant>
the number of the label templates is 1. If V of the user right is { Beijing } and the number of elements is also 1, directly replacing a placeholder "@ DYNAMIC _ CITY @" in the label template by 'Beijing'.
If V of the user right is { shanghai, beijing, shengyang } and the number of elements is 3, different replacement labels are generated by using the label template and different elements in V, for example, the generated replacement label is:
1. < membergram member ═ City role. default ] - [ City ] - [ shanghai ] "access ═ all >
2. < MemberGrant member ═ City role. default ] - [ City ] - [ beijing ] - "access ═ all >
3. < MemberGrant member ═ City role. default ] - [ City ] - [ sheng yang ] "access ═ all >
And inserting the generated replacement label into the position of the label template in the schema file template, and deleting the label template. Therefore, the content in the original schema file template is:
<HierarchyGrant hierarchy=”[City Role.Default]”rollupPolicy=”partial” access=”custom”>
<MemberGrant member=”[City Role.Default].[City].[@ DYNAMIC_CITY@]”access=”all”>
</MemberGrant>
</HierarchyGrant>
the method comprises the following steps:
<HierarchyGrant hierarchy=”[City Role.Default]”rollupPolicy=”partial” access=”custom”>
< MemberGrant member ═ City role. default ] - [ City ] - [ shanghai ] "access ═ all >
</MemberGrant>
< MemberGrant member ═ City role. default ] - [ City ] - [ beijing ] "access ═ all >
</MemberGrant>
< MemberGrant member ═ City role. default ] - [ City ] - [ sheng yang ] "access ═ all >
</MemberGrant>
</HierarchyGrant>
[ METHOD EMBODIMENT 8 ]
The data analysis method provided in the present embodiment is described below by taking an OLAP scenario as an example. The method comprises the following steps:
treatment 1: the client sends a data analysis request to the OLAP service.
And (3) treatment 2: the OLAP service parses the user identifier from the received data analysis request.
And (3) treatment: and the OLAP service loads the schema file according to the analyzed user identifier.
The schema file is a customized file generated according to the user identifier (for a specific generation manner, refer to the aforementioned file generation method, which is not described herein again). In addition, if the schema file is generated, the schema file is not generated again, but when the user authority is changed, the original schema file needs to be cleaned, and a new schema file needs to be generated according to the changed user authority.
And (4) treatment: and the OLAP service acquires the user authority from the loaded schema file.
And (4) treatment 5: the OLAP service generates a database query request according to the received data analysis request.
And (6) treatment: and the OLAP service filters the generated database query request by using the acquired user permission.
And (7) treatment: and the OLAP service sends the filtered database query request to a data warehouse.
And (4) treatment 8: and the data warehouse executes query processing after receiving the database query request and feeds back the queried data to the OLAP service.
And (4) treatment: the OLAP service executes analysis processing on the data fed back by the data warehouse according to the received data analysis request, and feeds back a processing result to the client.
Wherein the analytical processes include, for example, but are not limited to: drilling, slicing, and dicing.
Since the data filtering process is performed before querying the database in the present invention, the pressure on the database can be reduced and the coverage of the authority control can also be improved.
[ DEVICE EMBODIMENT 1 ]
Fig. 8 is a schematic configuration diagram of a file creation apparatus according to embodiment 1 of the apparatus of the present invention. Referring to fig. 8, the file generating apparatus 1 includes: the obtaining module 11, the determining module 12, and the generating module 13 specifically:
the obtaining module 11 is used for obtaining a file template.
The determination module 12 is configured to determine the user right based on the user identifier.
The generating module 13 is configured to generate a file according to the file template acquired by the acquiring module 11 and the user right determined by the determining module 12.
In the present invention, the user identifier includes, for example, but is not limited to: user number, user mailbox and other identification information. The user rights include, for example but not limited to: a name of the right, and a set of rights values. The authority name is used to indicate what resource the user performs access control on, and the authority value set is used to indicate the specific resource the user has the ability to access, for example, the authority name is: CITY, the set of authority values is: { Shanghai, Beijing, Shenyang }.
In the invention, the user authority in the file is determined by the user identifier, so that the customized file can be generated in a directional manner to realize personalized authority constraint, thereby improving the user experience.
[ DEVICE EMBODIMENT 2 ]
The apparatus provided in this embodiment includes all the contents of apparatus embodiment 1, and is not described herein again. As shown in fig. 9, in the present embodiment, the determining module 12 includes: the acquisition unit 121, and the determination unit 122, specifically:
the obtaining unit 121 is configured to obtain a rights model according to the user identifier.
The determining unit 122 is configured to determine the user right according to the right model acquired by the acquiring unit 121.
In the present invention, the rights model includes, for example, but not limited to: a "user-permission" model, and a "user-role-permission" model.
Wherein, the 'user-authority' model is a model directly associating users and authorities; the "user-role-authority" model is a model that associates users and authorities through roles, and is also called a RBAC model.
[ DEVICE EMBODIMENT 3 ]
The apparatus provided in this embodiment includes all of the contents of apparatus embodiment 1 or apparatus embodiment 2, and will not be described again here. As shown in fig. 10, in the present embodiment, the generation module 13 includes: the identifying unit 131, the judging unit 132, the replacing unit 133, the generating unit 134, and the deleting and inserting unit 135, specifically:
the identifying unit 131 is configured to identify a tag template matching the authority name of the user authority from the file template.
The judging unit 132 is configured to judge whether the number of the tag templates identified by the identifying unit 131 is equal to the number of elements of the permission value set in the user right.
The replacing unit 133 is configured to, in the file template, perform placeholder replacement processing on different tag templates respectively by using different elements in the permission value set when the determining unit 132 determines that the number of tag templates is equal to the number of elements.
The generating unit 134 is configured to generate different replacement labels through the label template and different elements in the permission value set, respectively, in a case that the determining unit 132 determines that the number of the label templates is not equal to the number of the elements.
The deletion and insertion unit 135 is used in the file template, deletes the tag template, and inserts the replacement tag generated by the generation unit 134.
In the present invention, the placeholder replacement processing refers to replacing a placeholder (a character string starting with @ and ending with @) with specified content.
[ DEVICE EMBODIMENT 4 ]
Fig. 11 is a schematic configuration diagram of a data analysis device according to embodiment 4 of the present invention. Referring to fig. 11, the data analysis device 2 includes: the loading module 21, the obtaining module 22, and the processing module 23 specifically:
the loading module 21 is configured to load a file based on the data analysis request.
Wherein the file is generated according to the method of any one of method embodiments 1 to 3.
The obtaining module 22 is configured to obtain the user right from the file loaded by the loading module 21.
The processing module 23 is configured to perform data analysis processing according to the data analysis request and the user right acquired by the acquisition module 22.
[ DEVICE EMBODIMENT 5 ]
The apparatus provided in this embodiment includes all the contents of apparatus embodiment 4, and is not described herein again. As shown in fig. 12, in this embodiment, the loading module 21 includes: the parsing unit 211 and the loading unit 212 specifically:
the parsing unit 211 is configured to parse the user identifier from the data analysis request.
The loading unit 212 is configured to load the file according to the user identifier parsed by the parsing unit 211.
[ DEVICE EMBODIMENT 6 ]
The apparatus provided in this embodiment includes all of apparatus embodiment 4 or apparatus embodiment 5, and is not described herein again. As shown in fig. 13, in the present embodiment, the processing module 23 includes: the generating unit 231, the filtering unit 232, the reading unit 233, and the processing unit 234, specifically:
the generating unit 231 is configured to generate a database query request according to the data analysis request.
The filtering unit 232 is configured to filter the database query request generated by the generating unit 231 by using the user right.
The reading unit 233 is configured to read data from the database based on the database query request filtered by the filtering unit 232.
The processing unit 234 is configured to perform analysis processing on the data read out by the reading unit 233.
Since the data filtering process is performed before querying the database in the present invention, the pressure on the database can be reduced and the coverage of the authority control can also be improved.
The embodiment of the invention also provides a mobile terminal, which comprises a memory and a processor; wherein,
the memory is to store one or more computer instructions, wherein the one or more computer instructions are for the processor to invoke for execution;
the processor is configured to perform the operations of any one of method embodiment 1 to method embodiment 8.
Furthermore, embodiments of the present invention also provide a computer storage medium storing one or more computer instructions that, when executed by one or more devices, cause the devices to perform the operations of any one of method embodiments 1 to 8.
Those skilled in the art will clearly understand that the present invention may be implemented entirely in software, or by a combination of software and a hardware platform. Based on such understanding, all or part of the technical solutions of the present invention contributing to the background may be embodied in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, a smart phone, a network device, etc.) to execute the method according to each embodiment or some parts of the embodiments of the present invention.
As used herein, the term "software" or the like refers to any type of computer code or set of computer-executable instructions in a general sense that is executed to program a computer or other processor to perform various aspects of the present inventive concepts as discussed above. Furthermore, it should be noted that according to one aspect of the embodiment, one or more computer programs implementing the method of the present invention when executed do not need to be on one computer or processor, but may be distributed in modules in multiple computers or processors to execute various aspects of the present invention.
Computer-executable instructions may take many forms, such as program modules, executed by one or more computers or other devices. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. In particular, the functionality of the program modules may be combined or split between various embodiments as desired.
Also, technical solutions of the present invention may be embodied as a method, and at least one example of the method has been provided. The actions may be performed in any suitable order and may be presented as part of the method. Thus, embodiments may be configured such that acts may be performed in an order different than illustrated, which may include performing some acts simultaneously (although in the illustrated embodiments, the acts are sequential).
The definitions given and used herein should be understood with reference to dictionaries, definitions in documents incorporated by reference, and/or their ordinary meanings.
In the claims, as well as in the specification above, all transitional phrases such as "comprising," "having," "containing," "carrying," "having," "involving," "consisting essentially of …," and the like are to be understood to be open-ended, i.e., to include but not limited to. Only "consisting of … …" should be an overphrase of being closed or semi-closed.
The terms and expressions used in the specification of the present invention have been set forth for illustrative purposes only and are not meant to be limiting. It will be appreciated by those skilled in the art that changes could be made to the details of the above-described embodiments without departing from the underlying principles thereof. The scope of the invention is, therefore, indicated by the appended claims, in which all terms are intended to be interpreted in their broadest reasonable sense unless otherwise indicated.
The invention discloses a1 and a file generation method, which comprises the following steps:
acquiring a file template;
determining user rights based on the user identifier;
and generating a file according to the file template and the user authority.
A2, the method of A1, wherein the determining user rights based on user identifiers comprises:
acquiring a permission model according to the user identifier;
and determining the user authority according to the authority model.
A3, the method as in A1 or A2, wherein the generating a file according to the file template and the user right includes:
identifying a label template matched with the authority name of the user authority from the file template;
judging whether the number of the label templates is equal to the number of elements of the authority value set in the user authority;
and if the number of the label templates is equal to the number of the elements, carrying out placeholder replacement processing on the different label templates in the file template by using different elements in the permission value set respectively.
A4, the method of A3, wherein the generating files according to the file templates and the user rights further comprises:
if the number of the label templates is not equal to the number of the elements, respectively generating different replacement labels through the label templates and different elements in the permission value set;
deleting the tag template and inserting the replacement tag in the file template.
The invention also discloses A5 and a data analysis method, which comprises the following steps:
loading a file generated according to the method of any one of A1-A4 based on a data analysis request;
acquiring user permission from the file;
and performing data analysis processing according to the data analysis request and the user authority.
A6, the method as in A5, wherein the performing data analysis processing according to the data analysis request and the user right comprises:
generating a database query request according to the data analysis request;
filtering the database query request by using the user authority;
reading data from the database based on the filtered database query request;
and performing analysis processing on the data.
The invention also discloses B7, a file generating device, comprising:
the acquisition module is used for acquiring a file template;
a determination module to determine a user privilege based on the user identifier;
and the generating module is used for generating a file according to the file template and the user authority.
B8, the apparatus of B7, wherein the determining module comprises:
the acquisition unit is used for acquiring a permission model according to the user identifier;
and the determining unit is used for determining the user authority according to the authority model.
B9, the apparatus of B7 or B8, the generating module comprising:
the identification unit is used for identifying a label template matched with the authority name of the user authority from the file template;
the judging unit is used for judging whether the number of the label templates is equal to the number of elements of the authority value set in the user authority;
and the replacing unit is used for respectively carrying out placeholder replacement processing on different label templates in the file template by using different elements in the permission value set under the condition that the number of the label templates is equal to the number of the elements.
B10, the apparatus as described in B9, the generating module further comprising:
a generating unit, configured to generate different replacement labels through the label template and different elements in the permission value set, respectively, when the number of the label templates is not equal to the number of the elements;
and the deleting and inserting unit is used for deleting the label template and inserting the replacing label in the file template.
The invention discloses B11, a data analysis device, comprising:
a loading module for loading a file generated according to the method of any one of A1-A4 based on a data analysis request;
the acquisition module is used for acquiring the user permission from the file;
and the processing module is used for performing data analysis processing according to the data analysis request and the user permission.
B12, the apparatus as described in B11, the processing module comprising:
the generating unit is used for generating a database query request according to the data analysis request;
the filtering unit is used for filtering the database query request by utilizing the user authority;
a reading unit, configured to read data from a database based on the filtered database query request;
and the processing unit is used for executing analysis processing on the data.
The invention also discloses C13, a mobile terminal, comprising a memory and a processor; wherein,
the memory is to store one or more computer instructions, wherein the one or more computer instructions are for the processor to invoke for execution;
the processor is configured to perform the operations of any one of A1-A6.

Claims (11)

1. A file generation method, applied to an online analytical processing (OLAP) service in a data warehouse system, comprises the following steps:
acquiring a schema file template;
analyzing a user identifier of a user from a data analysis request of a client, and determining user authority based on the user identifier;
generating a schema file according to the schema file template and the user authority, wherein the schema file is used for filtering a database query request generated based on the data analysis request according to the user authority in the schema file when the OLAP service responds to the data analysis request of the user;
wherein the generating the schema file according to the schema file template and the user authority includes:
identifying a label template matched with the authority name of the user authority from the schema file template;
judging whether the number of the label templates is equal to the number of elements of the authority value set in the user authority;
and if the number of the label templates is equal to the number of the elements, carrying out placeholder replacement processing on the different label templates in the schema file template by using different elements in the permission value set respectively.
2. The method of claim 1, wherein the determining user rights based on a user identifier comprises:
acquiring a permission model according to the user identifier;
and determining the user authority according to the authority model.
3. The method of claim 1, wherein generating a schema file based on the schema file template and the user permissions further comprises:
if the number of the label templates is not equal to the number of the elements, respectively generating different replacement labels through the label templates and different elements in the permission value set;
deleting the tag template and inserting the replacement tag in the schema file template.
4. A method of data analysis, the method comprising:
loading a schema file generated according to the method of any one of claims 1 to 3 based on a data analysis request;
acquiring user authority from the schema file;
and performing data analysis processing according to the data analysis request and the user authority.
5. The method of claim 4, wherein the performing data analysis processing based on the data analysis request and the user authority comprises:
generating a database query request according to the data analysis request;
filtering the database query request by using the user authority;
reading data from the database based on the filtered database query request;
and performing analysis processing on the data.
6. An apparatus for generating a file, the apparatus being applied to an online analytical processing (OLAP) service in a data warehouse system, the apparatus comprising:
the acquisition module is used for acquiring the schema file template;
the determining module is used for analyzing the user identifier of the user from the data analysis request of the client and determining the user authority based on the user identifier;
a generating module, configured to generate a schema file according to the schema file template and the user permission, where the schema file is used for filtering, by the OLAP service, a database query request generated based on the data analysis request according to the user permission in the schema file when responding to the data analysis request of the user;
wherein the generating module comprises:
the identification unit is used for identifying a label template matched with the authority name of the user authority from the schema file template;
the judging unit is used for judging whether the number of the label templates is equal to the number of elements of the authority value set in the user authority;
and the replacing unit is used for respectively carrying out placeholder replacement processing on different label templates in the schema file template by utilizing different elements in the permission value set under the condition that the number of the label templates is equal to the number of the elements.
7. The apparatus of claim 6, wherein the determining module comprises:
the acquisition unit is used for acquiring a permission model according to the user identifier;
and the determining unit is used for determining the user authority according to the authority model.
8. The apparatus of claim 6, wherein the generating module further comprises:
a generating unit, configured to generate different replacement labels through the label template and different elements in the permission value set, respectively, when the number of the label templates is not equal to the number of the elements;
and the deleting and inserting unit is used for deleting the label template and inserting the replacing label in the schema file template.
9. A data analysis apparatus, characterized in that the apparatus comprises:
a loading module, configured to load the schema file generated according to the method of any one of claims 1 to 3 based on a data analysis request;
the acquisition module is used for acquiring the user authority from the schema file;
and the processing module is used for performing data analysis processing according to the data analysis request and the user permission.
10. The apparatus of claim 9, wherein the processing module comprises:
the generating unit is used for generating a database query request according to the data analysis request;
the filtering unit is used for filtering the database query request by utilizing the user authority;
a reading unit, configured to read data from a database based on the filtered database query request;
and the processing unit is used for executing analysis processing on the data.
11. A mobile terminal, characterized in that the mobile terminal comprises a memory and a processor; wherein,
the memory is to store one or more computer instructions, wherein the one or more computer instructions are for the processor to invoke for execution;
the processor is configured to perform the method of any one of claims 1 to 5.
CN201710081979.3A 2017-02-15 2017-02-15 File generation method and device and data analysis method and device Active CN107122381B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710081979.3A CN107122381B (en) 2017-02-15 2017-02-15 File generation method and device and data analysis method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710081979.3A CN107122381B (en) 2017-02-15 2017-02-15 File generation method and device and data analysis method and device

Publications (2)

Publication Number Publication Date
CN107122381A CN107122381A (en) 2017-09-01
CN107122381B true CN107122381B (en) 2020-11-20

Family

ID=59718213

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710081979.3A Active CN107122381B (en) 2017-02-15 2017-02-15 File generation method and device and data analysis method and device

Country Status (1)

Country Link
CN (1) CN107122381B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108897877A (en) * 2018-07-03 2018-11-27 浙江赛佳控股有限公司 Big data analysis tool and method based on EXCEL
CN109657215A (en) * 2018-09-27 2019-04-19 深圳壹账通智能科技有限公司 Document structure tree method, equipment, storage medium and device based on template
CN113177696A (en) * 2021-04-09 2021-07-27 上海辛格迪健康科技有限公司 Method and system for generating controlled file template of medicine quality system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102081710A (en) * 2010-12-14 2011-06-01 中国石油集团川庆钻探工程有限公司 Authority setting method and authority control method
CN102508669A (en) * 2011-11-14 2012-06-20 浙江鸿程计算机系统有限公司 Automatic program code generating method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060212472A1 (en) * 2004-11-30 2006-09-21 Wavenetworx Inc. Method and system for creating a rich media content portal using third-party commercial portal application software

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102081710A (en) * 2010-12-14 2011-06-01 中国石油集团川庆钻探工程有限公司 Authority setting method and authority control method
CN102508669A (en) * 2011-11-14 2012-06-20 浙江鸿程计算机系统有限公司 Automatic program code generating method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于XML 的可灵活配置树形导航菜单的设计实现;李朔;《百度文库》;20110915;第1-7页 *
如何在应用系统中实现数据权限的控制功能;伍华聪;《博客园https://www.cnblogs.com/wuhuacong/p/3664204.html》;20140414;第1-4页 *

Also Published As

Publication number Publication date
CN107122381A (en) 2017-09-01

Similar Documents

Publication Publication Date Title
CN110447035B (en) User content obfuscation in structured user data files
CN110506271B (en) Configurable annotations for privacy-sensitive user content
US9460117B2 (en) Image searching
US10453165B1 (en) Computer vision machine learning model execution service
EP3029581B1 (en) Processing program, processing system, and processing method
US9116879B2 (en) Dynamic rule reordering for message classification
US8650250B2 (en) Identifying compatible web service policies
CN107122381B (en) File generation method and device and data analysis method and device
US20110264628A1 (en) Data collector
JP5347965B2 (en) XML data processing system, data processing method used in the system, and XML data processing control program
US10956659B1 (en) System for generating templates from webpages
CN112115105A (en) Service processing method, device and equipment
US20130151519A1 (en) Ranking Programs in a Marketplace System
US20170359445A1 (en) Dynamic discovery and management of page fragments
CN110069455B (en) File merging method and device
CN107633080B (en) User task processing method and device
CN110505289B (en) File downloading method and device, computer readable medium and wireless communication equipment
CN106503198A (en) A kind of cold data recognition methodss and system based on hadoop metadata
US9542457B1 (en) Methods for displaying object history information
CN117520112A (en) Method, device, equipment and storage medium for efficiency analysis processing of computing task
US20150347402A1 (en) System and method for enabling a client system to generate file system operations on a file system data set using a virtual namespace
US20140207729A1 (en) Rapid Provisioning of Information for Business Analytics
CN109408577A (en) ORACLE database JSON analytic method, system, device and can storage medium
CN115455006A (en) Data processing method, data processing device, electronic device, and storage medium
CN113742529A (en) Multi-table front-end processing method and device

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
CB02 Change of applicant information

Address after: Building N3, building 12, No. 27, Jiancai Chengzhong Road, Haidian District, Beijing 100096

Applicant after: Beijing Xingxuan Technology Co.,Ltd.

Address before: 100085 Beijing, Haidian District on the road to the information on the ground floor of the 1 to the 3 floor of the 2 floor, room 11, 202

Applicant before: Beijing Xiaodu Information Technology Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant