CN111984712B - Information processing method, device and storage medium - Google Patents

Information processing method, device and storage medium Download PDF

Info

Publication number
CN111984712B
CN111984712B CN201910441648.5A CN201910441648A CN111984712B CN 111984712 B CN111984712 B CN 111984712B CN 201910441648 A CN201910441648 A CN 201910441648A CN 111984712 B CN111984712 B CN 111984712B
Authority
CN
China
Prior art keywords
terminal
information
identifier
database
user
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
CN201910441648.5A
Other languages
Chinese (zh)
Other versions
CN111984712A (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.)
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software 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 China Mobile Communications Group Co Ltd, China Mobile Suzhou Software Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201910441648.5A priority Critical patent/CN111984712B/en
Publication of CN111984712A publication Critical patent/CN111984712A/en
Application granted granted Critical
Publication of CN111984712B publication Critical patent/CN111984712B/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/25Integrating or interfacing systems involving database management systems
    • 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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides an information processing method and device, wherein the method is applied to a server side and comprises the following steps: receiving request information sent by at least one terminal; acquiring a first identifier corresponding to each terminal in the at least one terminal based on the received request information; determining a user type corresponding to each terminal in the at least one terminal based on the first identifier; based on the user type corresponding to each terminal, routing the request information of each terminal to a corresponding database; wherein different user types in the at least one terminal correspond to different databases. The method of the invention can be conveniently adapted to different service systems, and meets the storage requirements of different services.

Description

Information processing method, device and storage medium
Technical Field
The present invention relates to the field of service support, and in particular, to an information processing method, an information processing apparatus, and a storage medium.
Background
With the development of internet services, the number of users gradually increases, the amount of data accumulated in the system database sharply increases, and the storage requirement of data becomes higher while the amount of data increases.
The multi-tenant software architecture serving as a new software architecture changes the mode of system delivery and user use, is more flexible and extensible, and is easy to customize and integrate quickly so as to adapt to the change of user requirements. In addition, the multi-tenant technology can enable a plurality of tenants to share one application program or computing environment, so that the development cost is reduced, and meanwhile, the isolation of data among users can be ensured.
However, different business systems have different requirements, different data storage modes and different isolation degrees required by data; if the independent database is separately allocated to the user, a large pressure is brought to the cost of the system; if all users share one database, the cost is low, but the isolation degree is low, and the safety is poor. If a plurality of users share one database and use program isolation, data sharing is difficult to realize.
Disclosure of Invention
In view of the above, the present invention is directed to an information processing method, an information processing apparatus, and a storage medium, which are capable of flexibly providing multi-tenant functions for different service systems.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
the embodiment of the invention provides an information processing method, which is applied to a server side and comprises the following steps:
receiving request information sent by at least one terminal;
acquiring a first identifier corresponding to each terminal in the at least one terminal based on the received request information;
determining a user type corresponding to each terminal in the at least one terminal based on the first identifier;
based on the user type corresponding to each terminal, routing the request information of each terminal to a corresponding database; wherein different user types in the at least one terminal correspond to different databases.
In the foregoing solution, the routing the request information of each terminal to a corresponding database based on the user type corresponding to each terminal includes:
determining a mapping relation between the user type and a database;
and routing the request information to a corresponding database based on the mapping relation.
In the above scheme, the determining the mapping relationship between the user type and the database includes:
determining the mapping relation between the user type and a database based on the configuration information of the routing middleware;
the configuration information at least comprises a user type corresponding to each terminal, data fragment information and basic information of a database server.
In the above scheme, before receiving the request information sent by at least one terminal, the method further includes:
receiving registration information sent by at least one terminal, wherein the registration information at least comprises a first identifier and a second identifier, and the second identifier is used for representing a user name corresponding to the terminal.
In the foregoing solution, after the routing the request information of each terminal to the corresponding database based on the user type corresponding to each terminal, the method further includes:
sending data information to a terminal corresponding to the second identifier based on the second identifier;
the data information comprises private information and shared information, the private information is identified through a first field in a database table, and the shared information is identified through a second field in the database table; the first field and the second field are different fields.
An embodiment of the present invention further provides an information processing apparatus, where the apparatus includes: a communication interface, and a processor, wherein,
the communication interface is used for receiving request information sent by at least one terminal;
the processor is configured to obtain, based on the received request information, a first identifier corresponding to each terminal in the at least one terminal; determining a user type corresponding to each terminal in the at least one terminal based on the first identifier; based on the user type corresponding to each terminal, routing the request information of each terminal to a corresponding database; wherein different user types in the at least one terminal correspond to different databases.
In the above apparatus, the processor is configured to determine a mapping relationship between the first identifier and a database; and routing the request information to a corresponding database based on the mapping relation.
In the above apparatus, the processor is configured to determine a mapping relationship between the user type and a database based on configuration information of routing middleware;
the configuration information at least comprises a user type corresponding to each terminal, data fragment information and basic information of a database server.
In the above apparatus, the communication interface is further configured to receive registration information sent by at least one terminal, where the registration information at least includes a first identifier and a second identifier, and the second identifier is used to characterize a user name corresponding to the terminal.
In the above apparatus, the communication interface is further configured to send data information to a terminal corresponding to the second identifier based on the second identifier; the data information comprises private information and shared information, the private information is identified through a first field in a database table, and the shared information is identified through a second field in the database table; the first field and the second field are different fields.
The invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, performs any of the steps of the method described above.
According to the information processing method and device provided by the embodiment of the invention, the first identifier is obtained based on the received request information, and then the user type corresponding to the current terminal is determined based on the first identifier, so that different types of user information can be stored in different databases, and users of the same type are stored in the same database; the design can meet the requirements of high isolation and low isolation of storage at the same time, realize the adaptation to different service systems and meet different storage requirements.
Drawings
FIG. 1 is a flow chart of an information processing method according to an embodiment of the present invention;
FIG. 2 is a functional relationship diagram of database middleware;
FIG. 3 is a detailed view of an embodiment of the invention;
fig. 4 is a schematic structural diagram of an information processing apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the following describes specific technical solutions of the present invention in further detail with reference to the accompanying drawings in the embodiments of the present invention. The following examples are intended to illustrate the invention, but not to limit the scope of the invention.
Based on this, an embodiment of the present invention provides an information processing method, which is applied to a server side, and as shown in fig. 1, the method includes:
s101, receiving request information sent by at least one terminal;
s102, acquiring a first identifier corresponding to each terminal in the at least one terminal based on the received request information;
s103, determining a user type corresponding to each terminal in the at least one terminal based on the first identifier;
s104, routing the request information of each terminal to a corresponding database based on the user type corresponding to each terminal; wherein different user types in the at least one terminal correspond to different databases.
It should be noted that, for the same application system, due to different business requirements, there is a difference in data storage, and it has become a trend to store different data tables through different databases. When data of one table in one database is originally separated into different databases or different tables, in order to realize transparency to upper-layer application and not to influence the application, a middle layer is required to logically operate and process the data of the upper-layer application, and then the data are issued to a target database data table; and after data is collected and processed, the data is returned to the upper application. Here, the database middleware is set as a middle layer to complete the processing and routing of data.
The database middleware includes MyCat middleware, DBProxy, oneproxy, etc., and may be other database middleware, and for the present invention, the middleware is not listed here as long as it can realize the sub-library and sub-table routing.
The database middleware is installed on the server side, and the connection with different databases can be realized by configuring in the configuration file. The database middleware can provide services to one or more applications in a multi-tenant manner, and each application can access an independent or shared physical database.
In order to describe the technical solution of the present invention more specifically, in the embodiment of the present invention, a MyCat middleware is used as an intermediate layer to perform routing processing on data.
Fig. 2 is a functional relationship diagram of the database middleware, and as shown in fig. 2, the database middleware is mainly configured to intercept an SQL statement sent by a user, and perform some specific analyses on the SQL statement: such as fragment analysis, route analysis, read-write separation analysis, cache analysis and the like, searching a related table, analyzing the definition of the table, acquiring the value of a fragment field in SQL if a fragment rule exists, matching a fragment function to obtain a fragment list corresponding to the SQL, sending the SQL statement to a corresponding database for execution, finally collecting and processing result data returned by all fragments, properly processing the returned result, finally outputting the result to a client and returning the result to a user.
Here, the terminal may include a mobile terminal such as a mobile phone, a smart phone, a notebook computer, a PAD (tablet computer), etc., and may also be a fixed terminal such as a desktop computer, etc.
The request information is an SQL statement generated by all operations performed on the webpage by the user; because the same service system has the condition that a plurality of users operate simultaneously at the same time, the MyCat middleware can simultaneously receive a plurality of operation requests from different clients. It should be noted that, the operation of the user on the terminal is generally in the form of SQL statements sent to the background server.
Here, the present embodiment is described by taking a user logging in a web page as an example, and those skilled in the art can understand that the request information here may also be a query operation request, a browsing operation request, and the like performed by the user on the web page.
The request information at least carries a first identifier, the MyCat middleware analyzes the request information to obtain the first identifier of the terminal after receiving the request information, and can determine the user type corresponding to the terminal based on the first identifier, that is, after analyzing and obtaining the first identifier, the MyCat middleware can determine the user type operating on the terminal according to the first identifier.
The user types are used for representing databases corresponding to users, and different user types correspond to different databases; after the user type is obtained, the MyCat middleware may route the operation of the user to a corresponding database. For example, assuming that the user type is a and the corresponding database is dbA, when it is determined that the user type is a, the user is routed to the dbA database.
Wherein the routing the request information of each terminal to a corresponding database based on the user type corresponding to each terminal includes:
determining the mapping relation between the user type and a database; and routing the request information to a corresponding database based on the mapping relation.
Here, after receiving the request information, the request is routed to the corresponding database according to the first identifier obtained through parsing, and thus before routing, it is necessary to know a corresponding relationship between the user type and the database, that is, a mapping relationship between the first identifier and the database.
Further, the determining the mapping relationship between the user type and the database includes:
determining the mapping relation between the user type and a database based on the configuration information of the routing middleware;
the configuration information at least comprises a user type corresponding to each terminal, data fragment information and basic information of a database server.
Here, the configuration information of the routing middleware is information in a configuration file; taking MyCat middleware as an example, after MyCat software is installed, a conf file is found and used for storing a configuration file. In the conf file, a server.xml file is a configuration file for MyCat server parameter adjustment and user authorization, and is used for setting an account number, parameters and the like; xml file is a configuration file of logic library definition, database table and fragment definition; xml file is the configuration file of the fragmentation rule.
And after designing a corresponding database and table dividing strategy according to business needs, configuring parameters under a conf file of MyCat middleware based on the designed database and table dividing strategy. Based on the configuration, after the user type is obtained, the request information of the user is routed to the corresponding database and the database table.
In the configuration file, the parameters of the server.xml file include user, name, password, schema, privilees, and the like, and the user parameter is a user configuration node; the name parameter is a login user name, namely the user name connected with Mycat; the password parameter is a login password, namely a password for connecting Mycat; the schema parameter is a database name; the schema parameters are associated with configurations in a schema. For example, if the user needs to manage two databases db1, db2, then db1, db2 are configured; the privileges parameter is the permission of configuring the user for adding, deleting, modifying and checking the table.
It should be noted that, in general, the configuration in the server.
For the embodiment of the present invention, in order to match different service systems, a schema. Xml file corresponds to information of each type of user, i.e. user type.
Parameters of the schema, xml file comprise schema, dataNode, dataHost and the like; the schema parameter is set for a logic database, a name node exists in the schema parameter, the name is a name of the logic database and corresponds to the schema parameter in server. Xml, the configuration of schema parameters in the schema is as follows:
<schema name="A"checkSQLschema="false"dataNode="dn1">
</schema>
<schema name="B"checkSQLschema="false"dataNode="dn2">
</schema>
<schema name="C"checkSQLschema="false"dataNode="dn3">
</schema>
here, in the schema tag, the name attribute is a first identifier representing a user type, and after the MyCat middleware acquires the first identifier based on request information, the database name corresponding to the user type may be obtained based on the first identifier, so that the request information may be routed to a corresponding database.
For the data parameter, the dataNode parameter is fragmentation information, that is, sub-library related configuration. For example:
<dataNode name="dn1"dataHost="host1"database="dbA"/>
<dataNode name="dn2"dataHost="host2"database="dbB"/>
<dataNode name="dn3"dataHost="host3"database="dbC"/>
here, in the databonde tag, the database attribute represents the database name corresponding to different user types, for example, the database corresponding to the first identifier a is dbA.
For the dataHost parameter, the dataHost parameter is configuration information of a physical database; since the configuration information of each dataHost is basically the same, only one configuration method is given here, for example:
<dataHost name="host1"maxCon="1000"minConNode="10"balance="0"writeType="0"dbType="mysql"dbDriver="jdbc">
<heartbeat>select user()</heartbeat>
<writeHost host="host1"url="databasehost"user="root"password="123"/>
</dataHost>
here, in the dataHost tag, the user attribute is a user configuration node; the name parameter is a login user name; the password parameter is a login password, and the user name and the password are used for connecting the Mycat middleware.
After the above configuration, the data requests of users having different first identifiers can be corresponding to the corresponding database of the dataHost configuration.
Here, before the receiving the request information sent by the at least one terminal, the method further includes:
receiving registration information sent by at least one terminal, wherein the registration information at least comprises a first identifier and a second identifier, and the second identifier is used for representing a user name corresponding to the terminal.
After the user operates on the terminal, the background server side receives the corresponding SQL statements and can operate the corresponding database after analyzing the SQL statements. However, the background server will receive the registration information before receiving the request information.
The registration information is account registration information corresponding to the terminal user, and after the user registers the account information, subsequent login operation or query operation can be performed based on the registered account information. The registration information at least comprises a first identifier and a second identifier, namely a user type and a user name.
It should be noted that, in the actual registration process, there is also password information; based on the registered first identification, the second identification and the password information, the user can log in the account.
After routing the request information of each terminal to the corresponding database based on the user type corresponding to each terminal, the method further includes:
sending data information to a terminal corresponding to the second identifier based on the second identifier;
the data information comprises private information and shared information, the private information is identified through a first field in a database table, and the shared information is identified through a second field in the database table; the first field and the second field are different fields.
Here, after the account of the terminal logs in, the server side receives the request information, and after analyzing the request information, the server side can acquire the user type and the user name, and further acquire the corresponding database information. And the server sends the information corresponding to the user name to the terminal after the user logs in because the second identifier is used for representing the user name corresponding to the terminal. For example, if the user type of the admin of the user is a, after the admin of the user logs in, because the user type obtained after the admin user is analyzed is a, the operation information of the admin user is routed to a dbA, and the related content of the admin user in the dbA is sent to the terminal of the admin user, so that the admin user can see the data information corresponding to the account number of the admin user after logging in.
The data information consists of 2 parts of private information and shared information, namely information corresponding to the accounts and public information which can be viewed by all the accounts.
Here, the information corresponding to the account is information that only the account can be seen after the user logs in; for example, after the admin user logs in, task information, logs and the like corresponding to the admin user can be displayed, and the part of information is private information which can be seen only by the admin user.
The public information which can be checked by all accounts is information except the account private information after a user logs in; for example, after an admin user logs in, the page may display some public information, such as a query box, an icon, and other content that all users have after logging in, and all users may access this part of data.
In order to distinguish private information and shared information, different fields can be set in a database to distinguish the private information and the shared information, wherein the private information is identified by a first field in the database table, and the shared information is identified by a second field in the database table; for example, a first field may be set to a username and a second field may be set to default. And the value of the user name field corresponds to the user name distributed by the system, and the field is carried every time the user requests data information. The value of the default field ensures that this portion of data is public information.
In order to distinguish private information from shared information, a TenantId field can be added to fields needing isolation or sharing in the database, and the TenantId field is set to be a corresponding user name or 'default' according to which user can read the data or can be accessed by all users, so that the data corresponding to the user name and the 'default' data can be returned to the user when the user accesses the data in the database table.
In order to express the content of the present embodiment more clearly, the description is given with reference to specific application cases, taking the following service requirements as an example:
fig. 3 is a specific scenario diagram of an embodiment of the present invention, as shown in fig. 3, when users in a business system need a separate database to store data information, or a designer of the business system needs to allocate user data in the system to different databases for storage in terms of performance, security, and the like, first unique first identifiers need to be allocated to the users, and the first identifiers are designed by a specific business system as long as the first identifiers are guaranteed to be meaningful and unique.
Specifically, user type information is configured for user types which need to be stored in a separate database in an application system, that is, different first identifiers are allocated for different user types, for example, the user type 1 is allocated, and the user type 2 is allocated with schema id1 and schema id2 respectively; after the allocation is designed, setting a configuration file of the Mycat data routing middleware, and allocating requests of different user types to corresponding databases, for example, allocating a request of schema id1 to the database 1, and allocating a request of schema id2 to the database 2. The database 1 is used for storing data of the user type 1, the database 2 is used for storing data of the user type 2, and the physical isolation mode can meet the high isolation requirement of the data.
Allocating different second identifications Tenant Ids in the system for users with low isolation requests and small data storage quantity, for example, allocating second identifications Tenant1 and Tenant2 for a user 1 and a user 2 respectively, isolating data in the Tenant1 and the Tenant2 through the system, and allocating a Default identification for public information to enable the information to be public information in a database; here, the user 1 and the user 2 are of the same user type, that is, both user types 3, and thus, the databases corresponding to the data of the user 1 and the user 2 are both databases 3; in a database table of the database 3, a TennantId field and a default field are set for distinguishing the types of information, so that the information processing mode can be determined based on different fields, the logical isolation of data in the same database is realized, and the use space of the database is effectively reduced.
According to the information processing method provided by the embodiment of the invention, by setting the first identifier and the second identifier, different types of user data can be supported to be stored in different databases, and physical isolation of data is realized; for the users of the same type, the logical isolation between the users can be realized by setting the fields of the database table, thereby effectively reducing the use space of the database. The information processing method of the invention provides a mixed storage scheme, so that the processing requirements on different required services can be met on the basis of realizing the sub-database storage of the users with high isolation and the logic isolation of the users with low isolation.
Based on the same technical concept as the foregoing embodiment, an embodiment of the present invention further provides an information processing apparatus, as shown in fig. 4, where the information processing apparatus 200 includes: a communication interface 201, a processor 202, wherein,
the communication interface 201 is configured to receive request information sent by at least one terminal;
the processor 202 is configured to obtain, based on the received request information, a first identifier corresponding to each terminal in the at least one terminal; determining a user type corresponding to each terminal in the at least one terminal based on the first identifier; based on the user type corresponding to each terminal, routing the request information of each terminal to a corresponding database;
wherein different user types in the at least one terminal correspond to different databases.
Here, the terminal may include a mobile terminal such as a mobile phone, a smart phone, a notebook computer, a PAD (tablet computer), etc., and may also be a fixed personal terminal such as a desktop computer, etc.
The request information is all operations performed by the user on the webpage; because the same service system has the condition that a plurality of users operate simultaneously at the same time, the MyCat middleware can receive a plurality of operation requests from different clients at the same time, and it needs to be noted that the operation of the users on the terminal is generally sent to the background server in the form of SQL statements.
Here, the request information at least carries a first identifier, the MyCat middleware analyzes the request information after receiving the request information to obtain the first identifier of the terminal, and based on the first identifier, may determine a user type corresponding to the terminal, that is, after analyzing and obtaining the first identifier, the MyCat middleware may determine, according to the first identifier, a type of a user operating on the terminal.
Further, the processor 202 is configured to determine a mapping relationship between the user type and a database;
and routing the request information to a corresponding database based on the mapping relation.
Here, after receiving the request information, the request is routed to the corresponding database according to the first identifier obtained through parsing, and thus before routing, it is necessary to know a corresponding relationship between the user type and the database, that is, a mapping relationship between the first identifier and the database.
The processor 202 is specifically configured to determine a mapping relationship between the user type and a database based on configuration information of the routing middleware; the configuration information at least comprises a user type corresponding to each terminal, data fragment information and basic information of a database server.
Here, the configuration information of the routing middleware is information in a configuration file; taking the MyCat middleware as an example, after the MyCat software is installed, a conf file is found, and the conf file is used for storing the configuration file. In the conf file, a server.xml file is a configuration file for parameter adjustment of the MyCat server and authorization of a user, and is used for setting an account number, parameters and the like, a schema.xml file is a configuration file for logic library definition, a database table and fragment definition, and a rule.xml file is a configuration file for fragment rules.
And after designing a corresponding database and table dividing strategy according to business needs, configuring parameters under a conf file of MyCat middleware based on the designed database and table dividing strategy. Based on the configuration, after the user type is obtained, the request information of the user is routed to the corresponding database and the database table.
Further, the communication interface 201 is further configured to receive registration information sent by at least one terminal, where the registration information at least includes a first identifier and a second identifier, and the second identifier is used to characterize a user name corresponding to the terminal.
After the user operates on the terminal, the background server side receives the corresponding SQL statement, and after the SQL statement is analyzed, the corresponding database can be operated. However, the background server receives the registration information before receiving the request information.
The registration information is account registration information corresponding to the terminal user, and after the user registers the account information, subsequent login operation or query operation can be performed based on the registered account information. The registration information at least comprises a first identifier and a second identifier, namely a user type and a user name.
It should be noted that, in the actual registration process, there is also password information; based on the registered first identification, the registered second identification and the password information, the user can log in the account.
Besides, the communication interface 201 is further configured to send data information to a terminal corresponding to the second identifier based on the second identifier;
the data information comprises private information and shared information, the private information is identified through a first field in a database table, and the shared information is identified through a second field in the database table; the first field and the second field are different fields.
The data information consists of 2 parts of private information and shared information, namely information corresponding to the accounts and public information which can be viewed by all the accounts. Here, the information corresponding to the account is information that only the account can be seen corresponding to the account after the user logs in, for example, after the admin user logs in, task information, logs and the like corresponding to the admin user are displayed, and this part of information is private information that only the admin user can see. The public information that can be viewed by all accounts is information except the account private information after the user logs in, for example, after the admin user logs in, a page displays some public information, such as a query box, an icon and other contents that all users have after logging in, and all users can access the data.
To distinguish private information, identified by a first field in the database table, from shared information, identified by a second field in the database table, e.g., the first field may be set to a user name and the second field may be set to default, different fields may be set in the database. And the value of the user name field corresponds to the user name distributed by the system, and the field is carried every time the user requests data information. The value of the default field ensures that this portion of data is public information.
In order to distinguish private information from shared information, a TenantId field can be added to fields needing isolation or sharing in the database, and the TenantId field is set to be a corresponding user name or 'default' according to which user can read the data or can be accessed by all users, so that the data corresponding to the user name and the 'default' data can be returned to the user when the user accesses the data in the database table.
It should be noted that, because the principle of the information processing apparatus 200 for solving the problem is similar to the aforementioned information processing method, the specific implementation process and implementation principle of the information processing apparatus 200 can be referred to the aforementioned method and implementation process, and the description of the implementation principle, and repeated parts are not repeated.
The information processing device provided by the embodiment of the invention can support different types of user data to be stored in different databases by setting the first identifier and the second identifier, thereby realizing data isolation; for the users of the same type, the logical isolation between the users can be realized by setting the fields of the database table, thereby effectively reducing the use space of the database. The information processing device can be used for providing a mixed storage scheme, so that the processing requirements on different required services can be met on the basis of realizing sub-database storage on users with high isolation and logic isolation on users with low isolation.
Embodiments of the present invention further provide a computer storage medium having a computer program stored thereon, where the computer program is executed by a processor to implement the steps of one of the embodiments of the method. And when being executed by a processor, the computer program implements the steps of the method provided in the first embodiment, which are not described herein again.
The device according to the embodiment of the present invention may also be stored in a computer-readable storage medium if it is implemented in the form of a software functional module and sold or used as an independent product. Based on such understanding, the technical solutions of the embodiments of the present invention may be essentially implemented or a part contributing to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present invention.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments. And the aforementioned storage medium includes: a mobile storage device, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and various media capable of storing program codes.
The method disclosed by the embodiment of the invention can be applied to a processor or realized by the processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or by instructions in the form of software. The Processor may be a general purpose Processor, a Digital Signal Processor (DSP), a discrete hardware component, or the like. The processor may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present invention. The steps of the method disclosed by the embodiment of the invention can be directly implemented by a hardware decoding processor, or can be implemented by combining hardware and software modules in the decoding processor. The software modules may be located in a storage medium that is located in a memory and that is read by a processor to perform the steps of the method described above in connection with its hardware.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (8)

1. An information processing method applied to a server side is characterized by comprising the following steps:
receiving registration information sent by at least one terminal, wherein the registration information at least comprises a first identifier and a second identifier, and the second identifier is used for representing a user name corresponding to the terminal;
receiving request information sent by at least one terminal;
acquiring a first identifier corresponding to each terminal in the at least one terminal based on the received request information;
determining a user type corresponding to each terminal in the at least one terminal based on the first identifier;
based on the user type corresponding to each terminal, routing the request information of each terminal to a corresponding database; wherein different user types in the at least one terminal correspond to different databases;
sending data information to a terminal corresponding to the second identifier based on the second identifier;
the data information comprises private information and shared information, the private information is identified through a first field in a database table, and the shared information is identified through a second field in the database table; the first field identification and the second field identification are different field identifications.
2. The method of claim 1, wherein the routing the request information of each terminal to a corresponding database based on the user type corresponding to each terminal comprises:
determining a mapping relation between the user type and a database;
and routing the request information to a corresponding database based on the mapping relation.
3. The method of claim 2, wherein determining the mapping relationship between the user type and the database comprises:
determining the mapping relation between the user type and a database based on the configuration information of the routing middleware;
the configuration information at least comprises a user type corresponding to each terminal, data fragment information and basic information of a database server.
4. An information processing apparatus, characterized in that the apparatus comprises: a communication interface, and a processor, wherein,
the communication interface is configured to receive registration information sent by at least one terminal, where the registration information at least includes a first identifier and a second identifier, and the second identifier is used to represent a user name corresponding to the terminal; receiving request information sent by at least one terminal;
the processor is configured to obtain, based on the received request information, a first identifier corresponding to each terminal in the at least one terminal; determining a user type corresponding to each terminal in the at least one terminal based on the first identifier; based on the user type corresponding to each terminal, routing the request information of each terminal to a corresponding database; wherein different user types in the at least one terminal correspond to different databases; sending data information to a terminal corresponding to the second identifier based on the second identifier; the data information comprises private information and shared information, the private information is identified through a first field in a database table, and the shared information is identified through a second field in the database table; the first field identification and the second field identification are different field identifications.
5. The apparatus of claim 4,
the processor is used for determining the mapping relation between the user type and a database; and routing the request information to a corresponding database based on the mapping relation.
6. The apparatus of claim 4,
the communication interface is further configured to receive registration information sent by at least one terminal, where the registration information at least includes a first identifier and a second identifier, and the second identifier is used to represent a user name corresponding to the terminal.
7. The apparatus of claim 6,
the communication interface is further configured to send data information to a terminal corresponding to the second identifier based on the second identifier;
the data information comprises private information and shared information, the private information is identified through a first field in a database table, and the shared information is identified through a second field in the database table; the first field and the second field are different fields.
8. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 3.
CN201910441648.5A 2019-05-24 2019-05-24 Information processing method, device and storage medium Active CN111984712B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910441648.5A CN111984712B (en) 2019-05-24 2019-05-24 Information processing method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910441648.5A CN111984712B (en) 2019-05-24 2019-05-24 Information processing method, device and storage medium

Publications (2)

Publication Number Publication Date
CN111984712A CN111984712A (en) 2020-11-24
CN111984712B true CN111984712B (en) 2022-12-13

Family

ID=73437077

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910441648.5A Active CN111984712B (en) 2019-05-24 2019-05-24 Information processing method, device and storage medium

Country Status (1)

Country Link
CN (1) CN111984712B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113190627A (en) * 2021-06-02 2021-07-30 南京恩瑞特实业有限公司 Nginx and Mycat based information system architecture and configuration method thereof
CN113377784B (en) * 2021-08-13 2021-12-03 成都市维思凡科技有限公司 Data processing method, system and storage medium based on middleware
CN113645304B (en) * 2021-08-13 2023-06-16 恒生电子股份有限公司 Data service processing method and related equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106686031A (en) * 2015-11-09 2017-05-17 广东华邦云计算股份有限公司 Method and device for updating application to be in SaaS mode
CN109388631A (en) * 2018-10-11 2019-02-26 山东浪潮通软信息科技有限公司 A kind of database of multi-tenant divides library implementation method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106686031A (en) * 2015-11-09 2017-05-17 广东华邦云计算股份有限公司 Method and device for updating application to be in SaaS mode
CN109388631A (en) * 2018-10-11 2019-02-26 山东浪潮通软信息科技有限公司 A kind of database of multi-tenant divides library implementation method

Also Published As

Publication number Publication date
CN111984712A (en) 2020-11-24

Similar Documents

Publication Publication Date Title
US20170364697A1 (en) Data interworking method and data interworking device
CN111984712B (en) Information processing method, device and storage medium
US9515948B2 (en) Techniques for generically accessing data
CN110019080B (en) Data access method and device
US11966384B2 (en) Generating external identifiers for data entities using a data catalog system
CN103620601A (en) Joining tables in a mapreduce procedure
CN107103011B (en) Method and device for realizing terminal data search
US8856158B2 (en) Secured searching
CN114064690A (en) Data processing method and device
CN112307052A (en) Data management method, service system, terminal and storage medium
US20180081920A1 (en) Generating and accessing a data table
US9679014B2 (en) Generating and accessing a data table
US9037609B1 (en) Method for determining access of queries
US20230055129A1 (en) Techniques for utilizing patterns and logical entities
KR20180007792A (en) Apparatus and method for providing data based on cloud service
US20200110898A1 (en) Systems and methods for obtaining anonymized information derived from data obtained from external data providers
US20240232175A1 (en) Generating external identifiers for data entities using a data catalog system
US20230195755A1 (en) Identification and classification of sensitive information in data catalog objects
JP2015108934A (en) Advertisement distribution system and advertisement distribution method
US11899680B2 (en) Techniques for metadata value-based mapping during data load in data integration job
US11949761B2 (en) Techniques for distributed interface component generation
US20230033059A1 (en) System and methods for dynamic log indexing and processing
US9262450B1 (en) Using distinguished names and relative distinguished names for merging data in an XML schema
US20230066530A1 (en) Optimizing the response time of data profiling in interactive sessions
US20230259406A1 (en) Workflow Data Redistribution in Hybrid Public/Private Computing Environments

Legal Events

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