WO2023236756A1 - Multi-tenant data database allocation method, and program product and electronic device - Google Patents

Multi-tenant data database allocation method, and program product and electronic device Download PDF

Info

Publication number
WO2023236756A1
WO2023236756A1 PCT/CN2023/095171 CN2023095171W WO2023236756A1 WO 2023236756 A1 WO2023236756 A1 WO 2023236756A1 CN 2023095171 W CN2023095171 W CN 2023095171W WO 2023236756 A1 WO2023236756 A1 WO 2023236756A1
Authority
WO
WIPO (PCT)
Prior art keywords
product
data
tenant
database
information
Prior art date
Application number
PCT/CN2023/095171
Other languages
French (fr)
Chinese (zh)
Inventor
段凯歌
魏玉婷
莫元武
Original Assignee
易保网络技术(上海)有限公司
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 易保网络技术(上海)有限公司 filed Critical 易保网络技术(上海)有限公司
Publication of WO2023236756A1 publication Critical patent/WO2023236756A1/en

Links

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/21Design, administration or maintenance of databases
    • G06F16/211Schema design and management
    • 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/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • 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
    • G06F16/278Data partitioning, e.g. horizontal or vertical partitioning
    • 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

Definitions

  • the present application relates to the field of computer technology, and in particular to a multi-tenant data sharding method, program products and electronic equipment.
  • SaaS service means that the SaaS provider builds all the network infrastructure, software, and hardware operation platforms required for the company's informatization, and is responsible for a series of services such as all early implementation and later maintenance.
  • the company does not need to purchase software and hardware, build a computer room, Recruiting IT personnel allows you to use information systems through the Internet.
  • multiple tenant projects are deployed on the SaaS service provider's server, and each tenant project has a corresponding database. For example, the urban medical insurance tenant has a corresponding urban medical insurance tenant database, accident insurance Tenants have corresponding accident insurance tenant databases, etc.
  • connection resources of the database in the server are relatively precious.
  • the existing tenant sharding method cannot change with changes in the business. Users of the same tenant in different regions operate the same tenant database. The data in the database can easily cause performance problems such as increased database load and insufficient number of connections. Simply accessing the corresponding tenant database based on tenant information cannot efficiently handle insurance business. For example, for the urban medical insurance project, if only based on the original tenant sharding method, a large number of users from different regions simultaneously request the server to obtain data in the same tenant database, which will easily cause the database load corresponding to the urban medical insurance to increase and the number of connections to be increased. Insufficient and other performance issues prevent the insurance business from being processed efficiently.
  • this application relates to a multi-tenant data sharding method, program product, and electronic device.
  • embodiments of the present application provide a multi-tenant data sharding method for a system including a server and a storage device serving as a database, wherein the server is configured with an interception matching module, and the interception matching module includes a data interception module.
  • the above methods include:
  • the data interception module obtains the request to execute the insurance business
  • the regional rule matching module Based on the product information and geographical area information in the request passed by the data interception module, the regional rule matching module matches the request with the regional database information of the product management database in the database, where the product corresponds to multiple products in the database.
  • Product area database which includes product configuration rules corresponding to insurance business implementers;
  • the regional rule matching module obtains the product configuration rules in the product regional library, and obtains the data required to execute the insurance business according to the product configuration rules;
  • the organizational structure interception module obtains the tenant information in the request; and the tenant rule matching module obtains the tenant information required to execute the insurance business from the tenant library in the database based on the tenant information passed by the organizational structure interception module.
  • the data is not matched.
  • the embodiment of the present application provides a multi-tenant data sharding method for a system including a server and a storage device as a database.
  • the data interception module obtains a request to execute insurance business; the regional rule matching module is based on the request passed by the data interception module.
  • the product information and geographical area information in the database are matched with the regional library information of the product management library in the database; in the case of matching the regional library information, the regional rule matching module obtains product configuration rules from the product regional library in the database.
  • Tenant information obtains the data required to perform insurance business from the tenant library in the database.
  • This method combines geographical area information with the sub-database method. According to the characteristics that the same insurance product can correspond to different regional databases, different regions corresponding to the same product are divided into different databases.
  • the product can access different product regional libraries, which improves the single database sub-rule based on tenant information, which can effectively avoid the problem of insurance business processing failure caused by accessing the same database only based on a single tenant sub-database rule, thereby improving the efficiency of the insurance business. processing efficiency.
  • the product management library in the database may be a lightweight directory access protocol, where the lightweight directory access protocol includes product information and geographical area information corresponding to the product area library in the database. And the name, code name or path address of each product regional library.
  • the lightweight directory access protocol can be used as a special database that organizes information according to a tree structure and is specially optimized for browsing and searching directories and reading content.
  • the product management library adopts a lightweight directory access protocol.
  • the regional rule matching module can more quickly match the request with the regional library information of the product management library in the database based on the product information and geographical area information in the request passed by the data interception module. match.
  • matching the request with the regional library information of the product management library in the database includes,
  • the regional rule matching module obtains product configuration rules from the product regional library in the database, and obtains data required to execute the insurance business according to the product configuration rules, including,
  • the regional rule matching module obtains product configuration rules from the specific regional database corresponding to the product regional database in the database through the regional database connection string, and obtains the data required to execute the insurance business based on the product configuration rules.
  • the regional rule matching module can quickly and efficiently obtain product configuration rules from the product regional library in the database through the regional library connection string, and obtain the data required to execute the insurance business based on the product configuration rules.
  • the product area library includes product configuration rules corresponding to the insurance business implementer as,
  • the product area library includes product configuration rules specified by one insurance business implementer or multiple product configuration rules specified by multiple insurance business implementers.
  • the product area library includes product configuration rules specified by one insurance business implementer or multiple product configuration rules specified by multiple insurance business implementers. Multiple configuration rules are provided for the same insurance product in the same area, so that Regional sub-library rules are more reasonable.
  • the product information includes a product name or product code.
  • the product name or product code is a direct and effective element for expressing the product.
  • the product information includes the product name or product code, which helps to match the regional database information in the product management database according to the product information and regional information.
  • the geographical area information includes the administrative area to which the product is divided or the custom area to which the product is divided based on customization.
  • the geographical area information includes the administrative area to which the product is divided or the custom area to which the product is divided according to customization, which is conducive to obtaining the product area database in combination with product information, and efficiently accessing it according to the area information in the product management database Corresponding specific regional database.
  • the regional library information includes product regional library name, code number or path address.
  • the regional library information including the specific product regional library name, code or path address, provides multiple representation methods for obtaining the product regional library in the product management library.
  • the data required to perform insurance business includes,
  • the data required for executing the insurance business includes at least one of the basic element content data on the policy, executing the policy generation, executing the query of the insurance business status, or executing the logical data for reviewing the insurance document. After obtaining the aforementioned data Finally, insurance business can be effectively processed based on the obtained data.
  • the database includes,
  • Product management library product area library and tenant library.
  • the database includes a product management library, a product area library and a tenant library, which provide conditions for implementing regional sub-database rules and tenant sub-database rules.
  • embodiments of the present application provide a multi-tenant data sharding device, including:
  • Data receiving module used to receive data
  • Data forwarding module used to forward data
  • the interception matching module is used to intercept data and match the intercepted data with regional sharding rules or tenant sharding rules;
  • Execution business logic module used to execute business logic
  • the interception matching module includes,
  • a data interception module used to obtain the first data, where the first data includes product information and geographical area information;
  • the regional rule matching module is used to match regional sub-library rules based on product information and geographical area information;
  • the organizational structure interception module is used to obtain the second data, where the second data includes tenant information;
  • the tenant rule matching module is used to match tenant sharding rules based on tenant information.
  • the above-mentioned first data is the request data transmitted by the data forwarding module; the above-mentioned second data is the request data transmitted by the regional rule matching module.
  • the multi-tenant data sharding device includes a data receiving module, a data forwarding module, an interception matching module, and an execution business logic module.
  • the insurance business can be processed through the aforementioned modules, wherein,
  • the regional rule matching module includes multiple sub-modules that implement dynamic sharding rules based on the geographical area information in the request. Each sub-module can effectively implement a multi-tenant data sharding method.
  • embodiments of the present application provide a computer-readable storage medium. Instructions are stored on the computer-readable storage medium. When the instructions are executed on an electronic device, the electronic device causes the electronic device to execute the above first aspect and the first aspect. Any multi-tenant data sharding method among various possible implementations.
  • inventions of the present application provide a chip device.
  • the chip device includes:
  • a processor configured to execute a computer executable program, so that the electronic device installed with the chip device executes any one of the multi-tenant data sharding methods of the above-mentioned first aspect and various possible implementations of the first aspect.
  • embodiments of the present application provide a computer program product, which is characterized in that the computer program product includes instructions, and when the instructions are executed, the above-mentioned first aspect and various possible implementations of the first aspect are implemented. Any multi-tenant data sharding method.
  • embodiments of the present application provide an electronic device, which is characterized by including:
  • memory for storing instructions for execution by one or more processors of the electronic device
  • a processor when the instructions are executed by one or more processors of the electronic device, the processor is configured to execute the instructions stored in the memory to implement the above first aspect and various possibilities of the first aspect. Implement any multi-tenant data sharding method.
  • the embodiment of the present application provides a multi-tenant data sharding method for a system including a server and a storage device as a database.
  • the data interception module obtains a request to execute insurance business; the regional rule matching module is based on the request passed by the data interception module.
  • the product information and geographical area information in the database are matched with the regional library information of the product management library in the database; in the case of matching the regional library information, the regional rule matching module obtains product configuration rules from the product regional library in the database.
  • Tenant information obtains the data required to perform insurance business from the tenant library in the database.
  • This method combines geographical area information with the sub-database method. According to the characteristics that the same insurance product can correspond to different regional databases, different regions corresponding to the same product are divided into different databases.
  • a multi-tenant data sub-database device has a data receiving module, a data forwarding module, an interception matching module, and an execution business logic module, which can effectively complete the process of processing insurance business.
  • the regional rule matching module includes a data interception module, a regional rule matching module, an organizational structure interception module, and a tenant rule matching module. Multiple sub-modules implement dynamic sub-database rules based on the product information, geographical area information, or tenant information in the request.
  • Figure 1A shows a schematic diagram of an insurance business scenario according to some embodiments of the present application
  • Figure 1B shows an unfinished policy interface schematic diagram according to some embodiments of the present application
  • Figure 1C shows a schematic diagram of a completed policy interface according to some embodiments of the present application.
  • FIG. 2A shows a schematic structural diagram of a server 200b according to some embodiments of the present application
  • Figure 2B shows a schematic structural diagram of an interception matching module 203 according to some embodiments of the present application
  • Figure 2C shows a schematic structural diagram of a database 300 according to some embodiments of the present application.
  • Figure 3 shows a schematic diagram of the interaction process between the interception matching module 203 and each sub-database in the database 300 according to some embodiments of the present application;
  • Figure 4 shows a flow chart of a multi-tenant data sharding method according to some embodiments of the present application
  • Figure 5 shows a schematic diagram of the hardware structure of a server 200b according to some embodiments of the present application.
  • Illustrative embodiments of the present application include, but are not limited to, a multi-tenant data sharding method, program products, and electronic devices.
  • Figure 1A shows an insurance business scenario to which the technical solution of the present application is applicable, according to some embodiments of the present application.
  • it includes the policy holder, the user terminal 100 used by the policy holder, the server 200a corresponding to the insurance company, the server 200b corresponding to the SaaS service, and the database 300 deployed on the server 200b.
  • the insurance company purchase services from SaaS providers. Therefore, the insurance company only needs to deploy the facilities required for processing insurance business on the server, and then it can process the insurance business by accessing the server 200b.
  • the user terminal 100 can be connected to the server 200a through the network, and the server 200a can be connected to the server 200b through the network to handle insurance services.
  • the user terminal 100 can communicate with the server 200a through a wireless fidelity (Wireless-Fidelity, Wi-Fi) network, Bluetooth, and other wireless networks
  • the server 200a can communicate through a wireless fidelity (Wireless-Fidelity, Wi-Fi) network, Bluetooth, and other wireless networks. Wait for the wireless network to communicate with the server 200b.
  • the user terminal 100 can be installed with the insurance company's client software, such as an insurance application (Application, APP).
  • the policyholder can access the server 200a through the insurance APP installed on the user terminal 100 to purchase the insurance products he or she needs, such as purchasing Urban medical insurance, pension insurance, vehicle insurance, accident insurance, etc.; policyholders can also use the instant messaging APP in the user terminal 100 to scan the QR code corresponding to each insurance to purchase insurance. Handle insurance business.
  • the server 200a encrypts the data according to the request data sent by the user terminal 100, and then sends the encrypted request data to the server 200b.
  • the server 200b After receiving the insurance service request, the server 200b identifies the insurance product based on the insurance product tenant information in the request.
  • the specific tenant to which it belongs obtains the stored data in the database 300 corresponding to the tenant in the server 200b according to the tenant sub-database rules, executes the insurance business content, and sends the processed insurance business results to the server 200a, and the server 200a then sends the processed insurance business results to the server 200a.
  • the insurance business result data is decrypted and the final result is sent to the user terminal 100, thereby completing the insurance business processing process.
  • the server 200b is deployed with data according to the insurance company's own business needs.
  • the insurance company places the insurance business that needs to be processed using software services on the server 200b for processing according to the business, which reduces the maintenance cost and improves the availability of resources.
  • FIG. 1B shows the page 101 of the user terminal 100 when the user applies for insurance.
  • a policy needs to be generated.
  • the user terminal 100 sends a request to generate a city medical insurance policy to the server 200a; after receiving the request sent by the policy holder through the user terminal 100, the server 200a encrypts the request data, and then sends the encrypted request data to the server 200b; the server 200b After receiving the encrypted request to generate a city medical insurance policy, 200b identifies the tenant to which the city medical insurance product belongs (hereinafter referred to as the "medical insurance tenant").
  • the medical insurance tenant can be an insurance company.
  • the server 200a decrypts the processed insurance business result data according to the corresponding decryption method, and sends the final result to the user terminal 100.
  • the business request for generating a city medical insurance policy is only one of the insurance services set by the insurance company in the server 200b to be processed by the server 200b, and the above is only an example.
  • the insurance business processed by the server 200b can also generate blank policy business according to the insurance request, query the status of the insurance business, review insurance documents, and so on.
  • the server 200a needs to divide the insurance according to the multi-tenant classification. Database rules accessing the same database can easily cause performance problems such as increased database load and insufficient number of connections. This can easily cause policyholders to fail to apply for insurance, which not only wastes connection resources but also affects the processing of insurance business.
  • the user terminal 100 sends a request to generate a city medical insurance policy to the server 200a. After receiving the request sent by the user terminal 100, the server 200a encrypts data related to privacy security and sends the encrypted request data to the server 200b.
  • the server 200b 200b based on the obtained data request and the tenant sub-database rules, determined that the city's medical insurance belongs to the medical insurance tenant. Due to the large number of connections to the medical insurance tenant database, the connection to the medical insurance tenant database failed, and insurance documents could not be generated, which wasted connection resources. , affecting the process of handling urban medical insurance business.
  • the corresponding policy data content will be different due to the different geographical areas where the policy holder wants to insure.
  • the urban medical reimbursement scope and reimbursement ratio, deductible setting, insurance requirements, geographical use requirements and other protection contents are different.
  • the insurance content of urban medical insurance in city A is different from that of urban medical insurance in city B.
  • the coverage content of medical insurance is different. Therefore, insured products and geographical areas can be associated, and the database can be divided according to the correlation between insured products and geographical areas.
  • this application proposes a multi-tenant data sharding method.
  • the server 200b matches the insurance product information and geographical area information in the request with the regional sharding rules. If the match is successful, the server 200b obtains the data based on the regional sharding rules.
  • the product configuration rules corresponding to the insurance company and the relevant data required to execute the insurance business corresponding to the product configuration rules execute the insurance business logic; if the match with the regional sub-database rules fails, the tenant information in the request is matched with the tenant sub-database rules. , after the matching is successful, the insurance business logic is executed based on the relevant data for executing the insurance business obtained by the tenant sub-database rules.
  • insurance products correspond to multiple product regional libraries
  • the product regional libraries include product configuration rules corresponding to insurance business implementers.
  • geographical areas can be understood as different administrative areas, such as areas divided by provinces, cities, districts, and counties, or they can also be customized geographical areas based on the level of economic development and the number of permanent residents.
  • the user fills out the policy interface shown in Figure 1B.
  • the server 200b receives the request to generate urban medical insurance policy data, it obtains the product name and insurable data in the request. city, and match the product name "xx city medical insurance” and the insurable city “Anyang" with the regional sub-database rules. If the match is successful, the urban medical insurance product configuration rules corresponding to the insurance company are obtained in the corresponding regional database in Anyang (hereinafter referred to as the "Anyang database”), as well as the relevant information required to execute the insurance business corresponding to the urban medical insurance product configuration rules.
  • Anyang database anyang
  • the server 200b executes the business logic of generating medical insurance, it sends the data to the server 200a.
  • the server 200a decrypts the data and then sends it to the user terminal 100.
  • the user terminal 100 displays the insurance document interface 102 as shown in Figure 1C. At this time The insurance document interface cannot be modified.
  • the server 200b receives the information of multiple user terminals 100 in Anyang, Yulin and other places obtained by the server 200a, In the insurance request, the server 200b can obtain the urban medical insurance product configuration rules corresponding to the insurance company in the Anyang database according to the regional sub-database rules, and the relevant data required to execute the insurance business corresponding to the urban medical insurance product configuration rules.
  • the data is executed to generate the urban medical insurance policy business logic; then the urban medical insurance product configuration rules corresponding to the insurance company in the regional database corresponding to Yulin (hereinafter referred to as the "Yulin database") are obtained according to the regional sub-database rules, as well as the urban medical insurance product configuration rules corresponding to the urban medical insurance
  • the product configuration rules correspond to the relevant data required to execute the insurance business, and a city medical insurance policy is generated based on the obtained data.
  • the user terminal 100 in the application scenario shown in FIG. 1A can be any electronic device that can install an insurance company's application program and has a display screen.
  • Server 200a and server 200b may be separate
  • a server can also be a server cluster composed of multiple servers.
  • the device structure corresponding to the server 200b is first introduced.
  • the server 200b includes a data receiving module 201, a data forwarding module 202, an interception matching module 203, and an execution business logic module 204.
  • the data receiving module 201 may be used to receive request data.
  • the data receiving module 201 can receive the request data related to the insurance business sent by the server 200a, and send the request data to the data forwarding module 202.
  • the data receiving module 201 receives a message sent by the server 200a.
  • the message includes at least one field of product information related to the insurance business, regional information, or tenant information to which the insurance product belongs.
  • the data forwarding module 202 may be used to forward request data.
  • the data forwarding module 202 can obtain the request data related to the insurance business sent by the data receiving module 201, filter out the irrelevant data in the request data, and send the filtered request data to the interception matching module. 203.
  • the interception matching module 203 can be used to intercept data, and match the intercepted data with regional sharding rules or tenant sharding rules.
  • the interception matching module 203 can receive the data sent by the data forwarding module 202, and perform regional sub-library rule matching based on the product information and geographical area information in the request data. If the matching is successful, the obtained data will be matched. The result data is sent to the execution business logic module 204; if the matching fails, the tenant information in the request is obtained, the tenant sharding rules are matched according to the tenant information, and the result data obtained by matching is sent to the execution business logic module 204.
  • the corresponding sharding strategy is matched based on the geographical area information or tenant information in the obtained request, which improves the original single tenant sharding method, so that under high concurrency conditions, for the same insurance product, due to Adopt a regional sub-database strategy to access different sub-databases to avoid the problem of failure to obtain data when accessing the same policy database, thereby improving the efficiency of processing insurance business.
  • the interception matching module 203 may be a chained multi-interceptor.
  • the business logic execution module 204 is used to execute business logic.
  • the business execution logic module 204 can receive the insurance business data successfully matched by the interception matching module 203 and execute the insurance business. For example, execute the business of generating insurance documents, reviewing insurance documents, querying the status of insurance business, etc.
  • the specific functional modules that the interception matching module 203 may include and each sub-database included in the database 300 in some embodiments of the present application will be introduced first.
  • the interception matching module 203 may include a data interception module 203a, a regional rule matching module 203b, an organizational structure interception module 203c, and a tenant rule matching module 203d.
  • the data interception module 203a obtains the request data forwarded by the data forwarding module 202, and sends the request data to the regional rule matching module 203b. It can be understood that in some implementations, the data interception module 203a may be a data interceptor.
  • the regional rule matching module 203b can receive the request data sent by the data interception module 203a, and first searches the product management library in the database 300 according to the product information and regional information in the request data. If the product corresponding to the product is found in the product management library, For specific regional library information, search the product regional library in the database 300 based on the regional library information to obtain the product configuration rules corresponding to the product regional library and the insurance business implementer and the data corresponding to the product configuration rules. If the match is successful, If the specific area corresponding to the product is not found in the product management library, then the match fail.
  • the organizational structure interception module 203c obtains the request data sent by the area rule matching module 203b, obtains the tenant information according to the request data, and sends the tenant information to the tenant rule matching module 203d.
  • the tenant information may be information about insurance products or insurance companies corresponding to the insurance products. It can be understood that in some implementations, the organizational structure interception module 203c can be an organizational structure interceptor.
  • the tenant rule matching module 203d receives the data sent by the organizational structure interception module 203c, matches the tenant information in the acquired data in the tenant library in the database 300, and obtains the execution business logic data or policy data of the insurance business corresponding to the tenant. , sending the searched data to the execution business logic module 204.
  • the database 300 includes a product management database 301 , a product area database 302 and a tenant database 303 .
  • each sub-database in the database 300 can be a relational database or a lightweight directory access protocol (Lightweight Directory Access Protocol, LDAP).
  • LDAP Lightweight Directory Access Protocol
  • LDAP can be used as a special database that organizes information according to a tree structure. It is specially optimized for browsing and searching directories and reading content. It is a hierarchical database with very good data reading capabilities. Reading data from a relational database is an order of magnitude faster.
  • the LDAP directory stores record items in the form of a series of "attribute pairs". Each record item includes an attribute type and an attribute value.
  • the product management database 301 may be an LDAP database
  • the regional database information stored in the product management database 301 may be insurance product information, regional information, and the name, code, or path address of the product regional database corresponding to the product regional database 302.
  • the attributes of the record items in the product management library 301 can be customized with product name attributes, region attributes, specific product regional library names, codes, or path address attributes corresponding to specific regional libraries, and corresponding attribute values are obtained according to the attributes.
  • the product management database 301 includes information about each product and multiple regional libraries corresponding to each product, such as product regional library names, codes, or path addresses.
  • product regional libraries corresponding to each product
  • the product is K insurance product
  • the product is sold in cities A, B, and C.
  • the B city library name corresponding to the K insurance product
  • Code name or regional library path address, C city library name, code name or product regional library path address corresponding to the K insurance product, etc.
  • Each of the multiple products will have multiple corresponding regional libraries.
  • the product matching database 301 may include the database names, codes or path addresses corresponding to the urban medical insurance products in Yulin, Anyang and other places.
  • the product area database 302 includes multiple area databases corresponding to products, and each sub-database in the product area database corresponds to the name or path address of the product area database obtained from the product management database.
  • each sub-database includes the A city library corresponding to K insurance product or the path address corresponding to A city library, the B city library corresponding to K insurance product or the path address corresponding to B city library, the K insurance product corresponding C city library or the path address corresponding to the C city library, etc.
  • there are multiple corresponding product regional libraries including Weihai library, Yulin library, Anyang library and other regional libraries.
  • Each product area library includes product configuration rules corresponding to insurance business implementers.
  • One product area library may include product configuration rules corresponding to multiple different insurance companies. Specifically, multiple product configuration rules specified by an insurance company or A product configuration rule stipulated by one insurance company or a product configuration rule stipulated by multiple insurance companies, etc. There are no restrictions on specific circumstances.
  • the Yulin library includes urban medical insurance product configuration rules set by multiple insurance companies.
  • the tenant library 303 includes multiple tenant libraries, such as A tenant library, B tenant library, C tenant library, etc. Each tenant library can store the data required for the same product of the same insurance company, or can store multiple products of the same insurance company. data required for the product.
  • tenant database 303 may include a city health insurance tenant database.
  • the structural diagram shown in the above server 200b is only a schematic.
  • corresponding modules can be added or deleted on this basis, and the specific structure is not required here.
  • it may also include a user management module, a user configuration module, a policy management module, etc.
  • Each sub-database of the database included in the above-mentioned database 300 is only an example. In other embodiments, corresponding sub-databases can also be added or reduced on this basis, and the specific structure is not required here.
  • the data interception module 203a intercepts the request to generate a policy.
  • the requests to generate insurance policies intercepted by the data interception module 203a include information that can characterize insurance products, policyholders' information, insurable geographical area information, product sales channels, etc., which will not be described in detail here.
  • product information can include product code or name
  • geographical area information that can be insured can be different administrative regions, such as areas divided by provinces, cities, districts, and counties, or it can also be based on economic development level, resident status, etc. Geographic areas divided into customizable populations. Among them, product information and insurable cities can be identified by numbers, letters, etc. after being encrypted by the server 200a. The specific identification method is not specified.
  • the data interception module 203a intercepts a request to generate a city medical insurance policy.
  • the request includes information that can characterize the city's medical insurance product, policyholder information, and insurable city information.
  • the data interception module 203a sends a policy generation request to the regional rule matching module 203b.
  • the data interception module 203a sends a request to generate a city medical insurance policy to the regional rule matching module 203b.
  • the regional rule matching module 203b obtains product information and geographical area information according to the request data.
  • the regional rule matching module 203b obtains the code of the city medical insurance product as 01 and the identifier of the insurable city Anyang as AY based on the obtained request to generate a city medical insurance policy.
  • the regional rule matching module 203b sends a request to obtain the specific regional database information corresponding to the product to the product management database 301.
  • the regional rule matching module 203b may be configured to match regional rules through a specific domain language, that is, a consensus language.
  • rule ⁇ rule name 'regional sub-library rule'
  • the regional rule matching module 203b sends a request to obtain the specific regional database information corresponding to the product to the product management database 301 based on the obtained product information and geographical area information.
  • the request may include obtaining the name, code or path of the product regional database corresponding to the insurance product. Address and other information.
  • the regional rule matching module 203b sends the city medical insurance product code 01 to the product management library 301, the insurable city Anyang is identified as AY, and the product area corresponding to the product in the product management library 301 Library name, code or path address.
  • the product management database 301 searches in the database based on the product information and geographical area information obtained in the request, and checks whether there is regional database information corresponding to the product and geographical area information in the database. If yes, proceed to step 314 to obtain the specific regional database information corresponding to the product; if not, proceed to step 306 to return a regional branch database rule matching failure message.
  • the product management database 301 checks whether there is a regional database corresponding to the insurance product code 01 and the insurable city Anyang AY in the database based on the city medical insurance product code 01 and the insurable city Anyang AY obtained in the request. If yes, proceed to step 314 to obtain the specific regional library name, code or path address corresponding to the product; if not, proceed to step 306 to return a regional sub-library matching failure message.
  • S306 The product management library 301 sends a message that there is no matching regional library information to the regional rule matching module 203b.
  • a message that there is no matching regional library information is sent to the regional rule matching module 203b.
  • the product management database 301 does not match the regional database name, code or path address corresponding to the product code 01 and the insurable city Anyang City AY in the database, and sends a message that there is no matching regional database information to the regional rule matching module 203b. .
  • the regional rule matching module 203b sends a request to generate a policy to the organizational structure interception module 203c.
  • the regional rule matching module 203b receives the message sent by the product management library 301 that there is no matching regional library information, determines that the matching of regional sub-library rules fails, and then sends a request to generate a policy to the organizational structure interception module 203c.
  • the regional rule matching module 203b receives the message sent by the product management library 301 that there is no matching regional library information, determines that the matching of regional sub-database rules fails, and sends a request to generate a city medical insurance policy to the organizational structure interception module 203c.
  • the organizational structure interception module 203c sends a request to generate a policy to the tenant rule matching module 203d, where the request includes tenant information.
  • the organizational structure interception module 203c obtains the request to generate a policy sent by the regional rule matching module 203b, it obtains the tenant information in the request data and sends the tenant information to the tenant rule matching module 203d.
  • the tenant information can include the tenant name or code, etc.
  • the representation method can be numbers, letters, or other characters, etc., and there is no specific limit here.
  • the tenant's name and code may be the name or code of the insurance company corresponding to the insurance product, etc.
  • the organizational structure interception module 203c obtains the request to generate a city medical insurance policy sent by the regional rule matching module 203b, it obtains the city's medical insurance tenant information based on the request data, and sends the medical insurance tenant information to the tenant rule matching module 203d.
  • the tenant name corresponding to the urban medical insurance product tenant database can be HMB tenant.
  • the tenant rule matching module 203d obtains a request to generate a policy.
  • tenant rule matching module 203d obtains the request to generate a policy sent by the organizational structure interception module 203c.
  • the tenant rule matching module 203d obtains the generated city medical insurance sent by the organizational structure interception module 203c. Policy Request.
  • the tenant rule matching module 203d sends a request to the tenant library 303 to obtain the data required to generate the policy in the corresponding tenant library.
  • the tenant rule matching module 203d may specify matching with tenant sub-library rules through a specific domain language, that is, a consensus language.
  • rule ⁇ rule name 'tenant sub-database rule'
  • the tenant rule matching module 203d sends a request to the tenant library 303 to obtain the data required to generate the policy in the corresponding tenant library according to the tenant information in the request.
  • the tenant rule matching module 203d sends a request to the tenant library 303 to obtain the data required to generate a city medical insurance policy in the HMB tenant library according to the city medical insurance tenant information in the request.
  • S311 The tenant database 303 obtains the data required to generate the policy.
  • the tenant database 303 searches the corresponding tenant database for data required to generate a policy based on the acquired tenant information. It can be understood that the data required to generate the policy may include the basic elements of the policy and the logical data to generate the policy.
  • the tenant database 303 searches the HMB tenant database for data required to generate a city medical insurance policy based on the tenant information.
  • the tenant database 303 sends the data required to generate a policy to the tenant rule matching module 203d.
  • the tenant library 303 after the tenant library 303 searches the corresponding tenant library for the data required to generate the policy, it sends the obtained data to the tenant rule matching module 203d.
  • the tenant database 303 searches the HMB tenant database for data required to generate a city medical insurance policy, it sends the acquired data to the tenant rule matching module 203d.
  • the tenant rule matching module 203d determines that the tenant sub-database rule is successfully matched.
  • the tenant rule matching module 203d determines that the tenant sub-database rule is successfully matched.
  • the product management database 301 obtains specific regional database information corresponding to the product.
  • the product management library 301 searches the database for corresponding regional library information based on product information and geographical area information.
  • the corresponding regional library information may include the name, code or path address of the product regional library corresponding to the insurance product and geographical area information.
  • the specific representation method may be numbers, letters, etc., which are not specifically limited here.
  • the product management database 301 searches for the city medical product code 01 in the database, the insurable city Anyang city identifier is AY, and the corresponding product area database name in the product management database 301 is Anyang database.
  • the product management library 301 sends the specific regional library information corresponding to the product to the regional rule matching module 203b.
  • the product management database 301 sends the urban medical insurance product corresponding to the regional database where policy data can be obtained and generated to the regional rule matching module 203b.
  • the regional database is the Anyang database.
  • the regional rule matching module 203b sends a request to the product regional database 302 to obtain the product configuration rules in the corresponding product regional database, and obtain the data required to generate the policy according to the product configuration rules.
  • the regional rule matching module 203b sends it to the product regional library 302 to obtain the product configuration rules in the corresponding product regional library, and obtains the requirements for executing the policy generation according to the product configuration rules.
  • one product area library may include product configuration rules corresponding to multiple different insurance companies; specifically, multiple product configuration rules stipulated by one insurance company or one product configuration rule stipulated by one insurance company or multiple product configuration rules stipulated by multiple insurance companies.
  • the regional rule matching module 203b obtains the product regional library corresponding to the urban medical insurance product as the Anyang library, it sends it to the product regional library 302 through the regional library connection string.
  • the urban medical insurance product configuration rules are obtained and based on The product configuration rule obtains a request to perform the data required to generate a city health insurance policy.
  • the product area database 302 obtains product configuration rules, and obtains data required to generate a policy according to the product configuration rules.
  • the product area library 302 searches in the corresponding area library according to the request, obtains product configuration rules, and obtains data required to generate a policy according to the product configuration rules.
  • the product area database 302 searches the Anyang database according to the area database connection string in the request, obtains the urban medical insurance product configuration rules, and obtains the data required to generate the urban medical insurance policy according to the product configuration rules.
  • the product area database 302 sends the obtained product configuration rules to the area rule matching module 203b, as well as the data corresponding to the product configuration rules required to execute the policy generation.
  • the product regional database 302 after acquiring the product configuration rules and generating the data required for the insurance policy according to the execution corresponding to the product configuration rules, the product regional database 302 sends the acquired product configuration rules and the corresponding product configuration rules to the regional rule matching module 203b. The corresponding execution generates the data required for the policy.
  • the product regional database 302 sends the acquired urban medical insurance product configuration rules to the regional rule matching module 203b, and Data required to generate urban medical insurance policies corresponding to product configuration rules.
  • the regional rule matching module 203b determines that the regional sub-library rules are successfully matched.
  • the regional rule matching module 203b determines that the regional sub-database rules are successfully matched.
  • the regional rule matching module 203b determines that the regional sub-database rules are successfully matched.
  • Figure 4 shows a flow chart of using the server 200b as the execution subject to execute the multi-tenant data sharding method in the embodiment of the present application.
  • the specific process includes the following steps:
  • the user terminal 100 sends a request to perform relevant insurance services to the server 200a; after receiving the request sent by the user terminal 100, the server 200a encrypts the request data and converts the encrypted request Sent to the server 200b; the server 200b obtains the request to execute the relevant insurance business.
  • executing relevant insurance business may include generating insurance policies, calculating premiums, querying the current insurance business status, reviewing insurance documents, surrendering insurance, and online claims settlement, etc.
  • the user terminal 100 sends a request to generate a city medical insurance policy to the server 200a; after receiving the request sent by the user through the user terminal 100, the server 200a encrypts the request data and sends the encrypted request to the server 200b; the server 200b Gets a request to execute a city health insurance policy.
  • the data receiving module 201 obtains a request for executing relevant insurance services sent by the server 200a.
  • the data forwarding module 202 filters the data in the request.
  • step S402 Based on the product information and geographical area information in the request data, determine whether it successfully matches the regional sub-library rules. If the judgment result is yes, go to step S404; if the judgment result is no, go to step S403.
  • the server 200b obtains the request to execute the relevant insurance business, it obtains the product information and geographical area information data in the request data, and matches the insurance product information and specific geographical area information in the database 300 to determine whether it contains the The product area library corresponding to the specific location area. If there is a corresponding product area library, the product configuration rules are searched in the corresponding product area library, and the data required to execute the policy generation is obtained according to the product configuration rules, and the regional classification is determined. If the library rule is successfully matched, step S404 is entered; if there is no regional library corresponding to the specific location area, it is determined that the match with the regional sub-library rule fails, and step S403 is entered.
  • the server 200b obtains and executes a request to generate a city medical insurance policy, it obtains the city medical insurance product information and insurable city information data in the request data, and searches in the database 300 based on the insurance product information and insurable cities to see whether there is a The product and the regional library corresponding to the insurable city. If the corresponding regional library exists, the urban medical insurance product configuration rules are searched in the corresponding regional library, and the data required to execute and generate the policy are obtained according to the urban medical insurance product configuration rules. , it is determined that the matching with the regional sub-library rules is successful; if there is no regional database corresponding to the product and insurable city, it is determined that the matching with the regional sub-library rules fails.
  • the data forwarding module 202 filters the obtained request data and sends it to the interception matching module 203, and the regional rules in the interception matching module 203 match.
  • Module 203b determines whether the match with the regional sub-database rules is successful based on the product information and geographical area information in the request data. If the judgment result is yes, go to step S404; if the judgment result is no, go to step S403.
  • the server 200b determines that the match with the regional sharding rules fails based on the product information and geographical area information in the request data, and then matches the tenant sharding rules based on the tenant information in the request data, that is, based on the tenant information in the request data, the server 200b The tenant information is searched and matched in each tenant database to obtain the data required to perform relevant insurance business.
  • the server 200b determines that the match with the regional sub-database rules fails, and then matches the tenant sub-database rules based on the medical insurance tenant information in the request data, that is, based on the request data.
  • the tenant information in each tenant database is matched and searched to obtain the data required to execute the city's medical insurance policy and the logical data for executing the business.
  • the organizational structure interception module 203c in the interception matching module 203 obtains the tenant information in the request data, and the tenant rule matching module 203b matches the tenant based on the tenant information.
  • the sharding rules match.
  • the insurance business logic is executed based on the data required to execute the insurance business obtained by the regional sub-database rule; if the successfully matched sub-database rule is a tenant sub-database rule, According to the database rules, the insurance business logic is executed based on the data required to execute the insurance business obtained from the tenant sub-database rules.
  • the data required to execute the insurance business includes at least one of the basic element content data on the policy, logical data for generating the policy, querying the status of the insurance business, or executing the review of the insurance document.
  • the business logic for generating a policy will be executed based on the data required to generate a city medical insurance policy obtained from the regional sharding rule; if the successfully matched sharding rule is a tenant sharding rule, Database rules, then execute the business logic of generating the policy based on the data required to generate urban medical insurance policies obtained from the tenant sub-database rules.
  • the execution business logic module 204 executes insurance business logic.
  • FIG. 5 shows a schematic structural diagram of a server 200b according to some embodiments of the present application.
  • the server 200b used to execute the multi-tenant data sharding method shown in Figure 4 provided by this application may include one or more processors 201, system memory 202, non-volatile memory (Non -Volatile Memory (NVM) 203, input/output (I/O) device 204, communication interface 205 and for coupling the processor 201, system memory 202, non-volatile memory 203, communication interface 204 and input/output (System control logic 206 for I/O device 205.
  • processors 201 system memory 202
  • non-volatile memory (NVM) 203 Non -Volatile Memory
  • I/O input/output
  • System control logic 206 for I/O device 205.
  • the processor 201 may include one or more single-core or multi-core processors.
  • processor 201 may include any combination of general-purpose processors and special-purpose processors (eg, graphics processors, applications processors, baseband processors, etc.).
  • the processor 201 can be configured to match the regional sharding rules based on the product information and geographical area information in the request data. If the matching fails, match the tenant sharding rules based on the tenant information in the request data. , execute the insurance business logic based on the matching results of the sub-library rules.
  • the system memory 202 is a volatile memory, such as random access memory (Random-Access Memory, RAM), double data rate synchronous dynamic random access memory (Double Data Rate Synchronous Dynamic Random Access Memory, DDR SDRAM), etc.
  • RAM Random-Access Memory
  • DDR SDRAM Double Data Rate Synchronous Dynamic Random Access Memory
  • the system memory is used to temporarily store data and/or instructions.
  • the system memory 202 can be used to store the above-mentioned executable program for implementing the multi-tenant data sharding method.
  • Non-volatile memory 203 may include one or more tangible, non-transitory computer-readable media for storing data and/or instructions.
  • the non-volatile memory 203 may include any suitable non-volatile memory such as flash memory and/or any suitable non-volatile storage device, such as a hard disk drive (Hard Disk Drive, HDD), optical disk ( Compact Disc (CD), Digital Versatile Disc (DVD), Solid-State Drive (SSD), etc.
  • the non-volatile memory 203 may also be a removable storage medium, such as a Secure Digital (Secure Digital, SD) memory card, etc.
  • system memory 202 and non-volatile memory 203 may include temporary and permanent copies of instructions 207, respectively.
  • Instructions 207 may include, when executed by at least one of the processors 201, causing the server 200 to implement the present application. Please provide program instructions for the multi-tenant data sharding method in each embodiment.
  • Input/output (I/O) device 204 may include a user interface that enables a user to interact with server 200b.
  • the input/output (I/O) device 204 may include an output device such as a display for displaying the software system used in the server 200b, and may also include an input device such as a keyboard, mouse, and touch screen.
  • the maintenance personnel of the server 200b can interact with the server 200b through the user interface and input devices such as keyboard, mouse, and touch screen.
  • Communication interface 205 may include a transceiver for providing a wired or wireless communication interface for server 200b to communicate with any other suitable device over one or more networks.
  • the communication interface 205 can be integrated with other components of the server 200b.
  • the communication interface 205 can be integrated with the processor 201.
  • server 200b may communicate with other devices through communication interface 205.
  • System control logic 206 may include any suitable interface controller to provide any suitable interface to other modules of server 200b.
  • system control logic 206 may include one or more memory controllers to provide an interface to system memory 202 and non-volatile memory 203 .
  • At least one of the processors 201 may be packaged with logic for one or more controllers of the system control logic 206 to form a system in package (SiP). In other embodiments, at least one of the processors 201 may also be integrated on the same chip with the logic of one or more controllers for the system control logic 206 to form a system-on-chip (SoC). ).
  • SiP system in package
  • SoC system-on-chip
  • the server 200b can be any electronic device capable of executing the multi-tenant data sharding method provided by this application, including but not limited to computers, servers, tablets, handheld computers, etc., which are not limited in the embodiments of this application.
  • the structure of the server 200b shown in the embodiment of this application does not constitute a specific limitation on the server 200b.
  • the server 200b may include more or less components than shown in the figures, or some components may be combined, or some components may be separated, or may be arranged differently.
  • the components illustrated may be implemented in hardware, software, or a combination of software and hardware.
  • Embodiments of the mechanisms disclosed in this application may be implemented in hardware, software, firmware, or a combination of these implementation methods.
  • Embodiments of the present application may be implemented as a computer program or program code executing on a programmable system including at least one processor, a storage system (including volatile and non-volatile memory and/or storage elements) , at least one input device and at least one output device.
  • Program code may be applied to input instructions to perform the functions described herein and to generate output information.
  • Output information can be applied to one or more output devices in a known manner.
  • a processing system includes any processor having a processor such as, for example, a Digital Signal Processor (DSP), a microcontroller, an Application Specific Integrated Circuit (ASIC), or a microprocessor. system.
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • Program code may be implemented in a high-level procedural language or an object-oriented programming language to communicate with the processing system.
  • assembly language or machine language can also be used to implement program code.
  • the mechanisms described in this application are not limited to the scope of any particular programming language. In either case, the language may be a compiled or interpreted language.
  • the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof.
  • the disclosed embodiments may also be implemented as instructions carried on or stored on one or more transitory or non-transitory machine-readable (e.g., computer-readable) storage media, which may be operated by one or more processors Read and execute.
  • Instructions may be distributed over a network or through other computer-readable media.
  • machine-readable media may include any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer), including, but not limited to, floppy disks, optical disks, optical disks, read-only memories (CD-ROMs), magnetic Optical disc, Read Only Memory (ROM), Random Access Memory (RAM), Erasable Programmable Read Only Memory (EPROM), Electrically Erasable Programmable Memory Read memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), magnetic or optical card, flash memory, or used to use the Internet to transmit information through electrical, optical, acoustic or other forms of propagation signals (for example, carrier waves, infrared signals, digital signals etc.) tangible machine-readable storage.
  • machine-readable media includes any type of machine-readable media suitable for storing or transmitting electronic instructions or information in a form readable by a machine (eg, computer).
  • each unit/module mentioned in each device embodiment of this application is a logical unit/module.
  • a logical unit/module can be a physical unit/module, or it can be a physical unit/module.
  • Part of the module can also be implemented as a combination of multiple physical units/modules.
  • the physical implementation of these logical units/modules is not the most important.
  • the combination of functions implemented by these logical units/modules is what solves the problem of this application. Key technical issues raised.
  • the above-mentioned equipment embodiments of this application do not introduce units/modules that are not closely related to solving the technical problems raised by this application. This does not mean that the above-mentioned equipment embodiments do not exist. Other units/modules.

Abstract

The present application relates to a multi-tenant data database allocation method, and a program product and an electronic device. The method comprises: acquiring a request for executing an insurance service; on the basis of product information and geographical region information in the request, matching the request with region database information of a product management database; when region database information is matched, acquiring a product configuration rule from a product region database, and acquiring, according to the product configuration rule, data which is required for executing the insurance service; and when the region database information is not matched, acquiring tenant information in the request, and acquiring, from a tenant database, the data which is required for executing the insurance service. In the technical solution of the present application, geographical region information is combined with a database allocation rule, such that the problem of a failure to process an insurance service due to accessing the same database only according to a single multi-tenant database allocation rule can be effectively avoided.

Description

多租户的数据分库方法、程序产品及电子设备Multi-tenant data sharding methods, program products and electronic equipment
本申请要求于2022年6月7日提交中国专利局、申请号为202210637186.6、申请名称为“多租户的数据分库方法、程序产品及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application requests the priority of the Chinese patent application submitted to the China Patent Office on June 7, 2022, with the application number 202210637186.6 and the application name "Multi-tenant data sub-database method, program product and electronic device", and its entire content has been approved This reference is incorporated into this application.
技术领域Technical field
本申请涉及计算机技术领域,特别是涉及一种多租户的数据分库方法、程序产品及电子设备。The present application relates to the field of computer technology, and in particular to a multi-tenant data sharding method, program products and electronic equipment.
背景技术Background technique
目前,随着用户安全意识的提高,用户逐渐意识到保险的重要性,越来越多的用户加入到了购买保险的行列。许多保险公司采用软件即服务(Software as a Service,SaaS)的服务模式。SaaS服务是指SaaS供应商为公司搭建信息化所需要的所有网络基础设施及软件、硬件运作平台,并负责所有前期的实施、后期的维护等一系列服务,公司无需购买软硬件、建设机房、招聘IT人员,即可通过互联网使用信息系统。由于大量保险公司采用SaaS服务开展保险业务,所以SaaS服务供应商的服务器上部署有多个租户项目,各租户项目具有对应的数据库,例如城市医疗保险租户具有对应的城市医疗保险租户数据库、意外保险租户具有对应的意外保险租户数据库等。At present, with the improvement of users' security awareness, users are gradually realizing the importance of insurance, and more and more users are joining the ranks of purchasing insurance. Many insurance companies adopt the Software as a Service (SaaS) service model. SaaS service means that the SaaS provider builds all the network infrastructure, software, and hardware operation platforms required for the company's informatization, and is responsible for a series of services such as all early implementation and later maintenance. The company does not need to purchase software and hardware, build a computer room, Recruiting IT personnel allows you to use information systems through the Internet. Since a large number of insurance companies use SaaS services to carry out insurance business, multiple tenant projects are deployed on the SaaS service provider's server, and each tenant project has a corresponding database. For example, the urban medical insurance tenant has a corresponding urban medical insurance tenant database, accident insurance Tenants have corresponding accident insurance tenant databases, etc.
然而,由于用户较多,在高并发的情况下,服务器中数据库的连接资源比较宝贵,现有的租户分库方法无法随着业务的变化而改变,同一租户不同地域的用户操作同一个租户数据库中的数据,容易造成数据库负载升高,连接数量不足等性能问题,仅仅根据租户信息访问对应的租户数据库无法高效地处理保险业务。例如,对于城市医疗保险项目,如果仅仅根据原有的租户分库方法,大量不同地区的用户同时对服务器请求获取同一租户数据库中的数据,容易造成城市医疗保险对应的数据库负载升高,连接数量不足等性能问题,从而无法高效地处理保险业务。However, due to the large number of users and high concurrency, the connection resources of the database in the server are relatively precious. The existing tenant sharding method cannot change with changes in the business. Users of the same tenant in different regions operate the same tenant database. The data in the database can easily cause performance problems such as increased database load and insufficient number of connections. Simply accessing the corresponding tenant database based on tenant information cannot efficiently handle insurance business. For example, for the urban medical insurance project, if only based on the original tenant sharding method, a large number of users from different regions simultaneously request the server to obtain data in the same tenant database, which will easily cause the database load corresponding to the urban medical insurance to increase and the number of connections to be increased. Insufficient and other performance issues prevent the insurance business from being processed efficiently.
发明内容Contents of the invention
有鉴于此,本申请涉及一种多租户的数据分库方法、程序产品及电子设备。In view of this, this application relates to a multi-tenant data sharding method, program product, and electronic device.
第一方面,本申请实施例提供了一种多租户的数据分库方法,用于包括服务器和作为数据库的存储设备的系统,其中,服务器中配置有拦截匹配模块,拦截匹配模块包括数据拦截模块、区域规则匹配模块、组织架构拦截模块、租户规则匹配模块,上述方法包括:In the first aspect, embodiments of the present application provide a multi-tenant data sharding method for a system including a server and a storage device serving as a database, wherein the server is configured with an interception matching module, and the interception matching module includes a data interception module. , regional rule matching module, organizational structure interception module, tenant rule matching module, the above methods include:
数据拦截模块获取执行保险业务的请求;The data interception module obtains the request to execute the insurance business;
区域规则匹配模块基于数据拦截模块传递的请求中的产品信息以及地理区域信息,将请求与数据库中的产品管理库的区域库信息匹配,其中,产品对应数据库中的多个产 品区域库,产品区域库包括与保险业务实施者对应的产品配置规则;Based on the product information and geographical area information in the request passed by the data interception module, the regional rule matching module matches the request with the regional database information of the product management database in the database, where the product corresponds to multiple products in the database. Product area database, which includes product configuration rules corresponding to insurance business implementers;
在匹配到区域库信息的情况下,区域规则匹配模块在产品区域库中获取产品配置规则,并且根据产品配置规则获取执行保险业务所需的数据;When the regional library information is matched, the regional rule matching module obtains the product configuration rules in the product regional library, and obtains the data required to execute the insurance business according to the product configuration rules;
在未匹配到区域库信息的情况下,组织架构拦截模块获取请求中的租户信息;并且租户规则匹配模块,基于组织架构拦截模块传递的租户信息在数据库中的租户库中获取执行保险业务所需的数据。When the regional library information is not matched, the organizational structure interception module obtains the tenant information in the request; and the tenant rule matching module obtains the tenant information required to execute the insurance business from the tenant library in the database based on the tenant information passed by the organizational structure interception module. The data.
可以理解的,对于相同的保险种类,由于投保人的想要投保的地理区域不同,则对应的保单数据内容是不同的,所以不同的地理区域可以有不同的数据库。本申请实施例提供了一种多租户的数据分库方法,用于包括服务器和作为数据库的存储设备的系统,数据拦截模块获取执行保险业务的请求;区域规则匹配模块基于数据拦截模块传递的请求中的产品信息以及地理区域信息,将请求与数据库中的产品管理库的区域库信息匹配;在匹配到区域库信息的情况下,区域规则匹配模块在数据库中的产品区域库中获取产品配置规则,并且根据产品配置规则获取执行保险业务所需的数据;在未匹配到区域库信息的情况下,组织架构拦截模块获取请求中的租户信息;并且租户规则匹配模块,基于组织架构拦截模块传递的租户信息在数据库中的租户库中获取执行保险业务所需的数据。该方法将地理区域信息与分库方式结合,根据同一个保险产品可以对应不同的区域库的特点,将同一个产品对应的不同的区域划分不同的数据库,在高并发的情况下,对于同一个产品可以访问不同的产品区域库,改进了单一的根据租户信息的分库规则,可以有效避免仅仅根据单一的租户分库规则访问同一数据库,造成保险业务处理失败的问题,进而提高了保险业务的处理效率。It is understandable that for the same type of insurance, since the geographical areas where policyholders want to insure are different, the corresponding policy data content is different, so different geographical areas can have different databases. The embodiment of the present application provides a multi-tenant data sharding method for a system including a server and a storage device as a database. The data interception module obtains a request to execute insurance business; the regional rule matching module is based on the request passed by the data interception module. The product information and geographical area information in the database are matched with the regional library information of the product management library in the database; in the case of matching the regional library information, the regional rule matching module obtains product configuration rules from the product regional library in the database. , and obtain the data required to execute the insurance business according to the product configuration rules; when the regional library information is not matched, the organizational structure interception module obtains the tenant information in the request; and the tenant rule matching module, based on the organizational structure interception module passed Tenant information obtains the data required to perform insurance business from the tenant library in the database. This method combines geographical area information with the sub-database method. According to the characteristics that the same insurance product can correspond to different regional databases, different regions corresponding to the same product are divided into different databases. In the case of high concurrency, for the same insurance product The product can access different product regional libraries, which improves the single database sub-rule based on tenant information, which can effectively avoid the problem of insurance business processing failure caused by accessing the same database only based on a single tenant sub-database rule, thereby improving the efficiency of the insurance business. processing efficiency.
在上述第一方面的一种可能的实现中,数据库中的产品管理库可以为轻量目录访问协议,其中,轻量目录访问协议包括与数据库中的产品区域库对应的产品信息、地理区域信息以及各产品区域库的名称、代号或者路径地址。In a possible implementation of the first aspect above, the product management library in the database may be a lightweight directory access protocol, where the lightweight directory access protocol includes product information and geographical area information corresponding to the product area library in the database. And the name, code name or path address of each product regional library.
可以理解的,轻量目录访问协议可以作为一种特殊的数据库,按照树型结构组织信息,对浏览和查找目录及读取内容进行了专门的优化。产品管理库采用轻量目录访问协议,区域规则匹配模块能够基于数据拦截模块传递的请求中的产品信息以及地理区域信息,更加快速地实现将请求与所述数据库中的产品管理库的区域库信息匹配。It is understandable that the lightweight directory access protocol can be used as a special database that organizes information according to a tree structure and is specially optimized for browsing and searching directories and reading content. The product management library adopts a lightweight directory access protocol. The regional rule matching module can more quickly match the request with the regional library information of the product management library in the database based on the product information and geographical area information in the request passed by the data interception module. match.
在上述第一方面的一种可能的实现中,将请求与数据库中的产品管理库的区域库信息匹配,包括,In a possible implementation of the above first aspect, matching the request with the regional library information of the product management library in the database includes,
基于产品信息以及地理区域信息在产品管理库中搜索,是否找到与产品信息以及地理区域信息对应的产品区域库名称、代号或者路径地址。Search the product management library based on the product information and geographical area information to see if the product area library name, code or path address corresponding to the product information and geographical area information is found.
可以理解的,通过基于产品信息以及地理区域信息在产品管理库中搜索,是否找到与产品信息以及地理区域信息对应的产品区域库名称、代号或者路径地址的方式,能够快速、方便、有效地将请求与所述数据库中的产品管理库的区域库信息匹配,得到匹配结果。It can be understood that by searching in the product management library based on product information and geographical area information, whether the product area library name, code number or path address corresponding to the product information and geographical area information is found can be quickly, conveniently and effectively The request is matched with the regional library information of the product management library in the database to obtain a matching result.
在上述第一方面的一种可能的实现中,区域规则匹配模块在数据库中的产品区域库中获取产品配置规则,并且根据产品配置规则获取执行保险业务所需的数据,包括,In a possible implementation of the first aspect above, the regional rule matching module obtains product configuration rules from the product regional library in the database, and obtains data required to execute the insurance business according to the product configuration rules, including,
区域规则匹配模块通过区域库连接字符串,在数据库中的产品区域库对应的具体区域库中获取产品配置规则,并且根据产品配置规则获取执行保险业务所需的数据。 The regional rule matching module obtains product configuration rules from the specific regional database corresponding to the product regional database in the database through the regional database connection string, and obtains the data required to execute the insurance business based on the product configuration rules.
可以理解的,区域规则匹配模块通过区域库连接字符串,可以快速、高效地在数据库中的产品区域库中获取产品配置规则,并且根据产品配置规则获取执行保险业务所需的数据。It can be understood that the regional rule matching module can quickly and efficiently obtain product configuration rules from the product regional library in the database through the regional library connection string, and obtain the data required to execute the insurance business based on the product configuration rules.
在上述第一方面的一种可能的实现中,产品区域库包括与保险业务实施者对应的产品配置规则为,In a possible implementation of the first aspect above, the product area library includes product configuration rules corresponding to the insurance business implementer as,
产品区域库包括一个保险业务实施者规定的产品配置规则或者多个保险业务实施者规定的多个产品配置规则。The product area library includes product configuration rules specified by one insurance business implementer or multiple product configuration rules specified by multiple insurance business implementers.
可以理解的,产品区域库包括一个保险业务实施者规定的产品配置规则或者多个保险业务实施者规定的多个产品配置规则,对于同一个区域的同一种保险产品提供了多种配置规则,使得区域分库规则更加合理。It can be understood that the product area library includes product configuration rules specified by one insurance business implementer or multiple product configuration rules specified by multiple insurance business implementers. Multiple configuration rules are provided for the same insurance product in the same area, so that Regional sub-library rules are more reasonable.
在上述第一方面的一种可能的实现中,产品信息包括,产品名称或者产品代号。In a possible implementation of the above first aspect, the product information includes a product name or product code.
可以理解的,产品名称或者产品代号是直接有效的表现产品的要素,产品信息包括,产品名称或者产品代号,有助于实现根据产品信息以及区域信息在产品管理库中匹配区域库信息。It can be understood that the product name or product code is a direct and effective element for expressing the product. The product information includes the product name or product code, which helps to match the regional database information in the product management database according to the product information and regional information.
在上述第一方面的一种可能的实现中,地理区域信息包括,产品被划分的所属的行政区域或者根据自定义划分所属的自定义区域。In a possible implementation of the above first aspect, the geographical area information includes the administrative area to which the product is divided or the custom area to which the product is divided based on customization.
可以理解的,地理区域信息包括,产品被划分的所属的行政区域或者根据自定义划分所属的自定义区域,有利于结合产品信息获得产品区域库,并根据产品管理库中的区域信息高效地访问对应的具体区域数据库。It can be understood that the geographical area information includes the administrative area to which the product is divided or the custom area to which the product is divided according to customization, which is conducive to obtaining the product area database in combination with product information, and efficiently accessing it according to the area information in the product management database Corresponding specific regional database.
在上述第一方面的一种可能的实现中,区域库信息,包括产品区域库名称、代号或者路径地址。In a possible implementation of the above first aspect, the regional library information includes product regional library name, code number or path address.
可以理解的,区域库信息,包括具体产品区域库名称、代号或者路径地址,给在产品管理库中获取产品区域库提供了多种表示方式。It can be understood that the regional library information, including the specific product regional library name, code or path address, provides multiple representation methods for obtaining the product regional library in the product management library.
在上述第一方面的一种可能的实现中,执行保险业务所需的数据,包括,In a possible implementation of the first aspect above, the data required to perform insurance business includes,
保单上的基本要素内容数据、执行生成保单、执行查询保险业务状态或者执行审核保险单据的逻辑数据中的至少一种数据。At least one of the basic element content data on the policy, logical data for generating the policy, querying the status of the insurance business, or reviewing the insurance document.
可以理解的,执行保险业务所需的数据,包括了保单上的基本要素内容数据、执行生成保单、执行查询保险业务状态或者执行审核保险单据的逻辑数据中的至少一种数据,在获取前述数据后,可以根据获取的数据有效处理保险业务。It can be understood that the data required for executing the insurance business includes at least one of the basic element content data on the policy, executing the policy generation, executing the query of the insurance business status, or executing the logical data for reviewing the insurance document. After obtaining the aforementioned data Finally, insurance business can be effectively processed based on the obtained data.
在上述第一方面的一种可能的实现中,数据库,包括,In a possible implementation of the first aspect above, the database includes,
产品管理库,产品区域库和租户库。Product management library, product area library and tenant library.
可以理解的,数据库包括产品管理库,产品区域库和租户库,给实现区域分库规则以及租户分库规则提供条件。It can be understood that the database includes a product management library, a product area library and a tenant library, which provide conditions for implementing regional sub-database rules and tenant sub-database rules.
第二方面,本申请实施例提供了一种多租户的数据分库装置,包括,In the second aspect, embodiments of the present application provide a multi-tenant data sharding device, including:
数据接收模块,用于接收数据;Data receiving module, used to receive data;
数据转发模块,用于转发数据;Data forwarding module, used to forward data;
拦截匹配模块,用于拦截数据,并将拦截到的数据与区域分库规则或者租户分库规则进行匹配;The interception matching module is used to intercept data and match the intercepted data with regional sharding rules or tenant sharding rules;
执行业务逻辑模块,用于执行业务逻辑; Execution business logic module, used to execute business logic;
并且,拦截匹配模块,包括,And, the interception matching module includes,
数据拦截模块,用于获取第一数据,其中,第一数据包括产品信息以及地理区域信息;A data interception module, used to obtain the first data, where the first data includes product information and geographical area information;
区域规则匹配模块,用于根据产品信息以及地理区域信息与区域分库规则匹配;The regional rule matching module is used to match regional sub-library rules based on product information and geographical area information;
组织架构拦截模块,用于获取第二数据,其中,第二数据包括租户信息;The organizational structure interception module is used to obtain the second data, where the second data includes tenant information;
租户规则匹配模块,用于根据租户信息与租户分库规则匹配。The tenant rule matching module is used to match tenant sharding rules based on tenant information.
可以理解的,上述第一数据为数据转发模块传递的请求数据;上述第二数据为区域规则匹配模块传递的请求数据。It can be understood that the above-mentioned first data is the request data transmitted by the data forwarding module; the above-mentioned second data is the request data transmitted by the regional rule matching module.
可以理解的,本申请实施例提供的一种多租户的数据分库装置,包括数据接收模块、数据转发模块、拦截匹配模块、执行业务逻辑模块,通过前述各模块可以完成处理保险业务,其中,区域规则匹配模块包括多个实现根据请求中的地理区域信息,完成动态分库规则的子模块,通过各子模块可以有效实现多租户的数据分库方法。It can be understood that the multi-tenant data sharding device provided by the embodiment of the present application includes a data receiving module, a data forwarding module, an interception matching module, and an execution business logic module. The insurance business can be processed through the aforementioned modules, wherein, The regional rule matching module includes multiple sub-modules that implement dynamic sharding rules based on the geographical area information in the request. Each sub-module can effectively implement a multi-tenant data sharding method.
第三方面,本申请实施例提供了一种计算机可读存储介质,计算机可读存储介质上存储有指令,所述指令在电子设备上执行时使所述电子设备执行上述第一方面以及第一方面的各种可能实现中的任意一种多租户的数据分库方法。In a third aspect, embodiments of the present application provide a computer-readable storage medium. Instructions are stored on the computer-readable storage medium. When the instructions are executed on an electronic device, the electronic device causes the electronic device to execute the above first aspect and the first aspect. Any multi-tenant data sharding method among various possible implementations.
第四方面,本申请实施例提供了一种芯片装置,芯片装置包括:In the fourth aspect, embodiments of the present application provide a chip device. The chip device includes:
通信接口,用于输入和/或输出信息;Communication interfaces for inputting and/or outputting information;
处理器,用于执行计算机可执行程序,使得安装有所述芯片装置的电子设备执行上述第一方面以及第一方面的各种可能实现中的任意一种多租户的数据分库方法。A processor, configured to execute a computer executable program, so that the electronic device installed with the chip device executes any one of the multi-tenant data sharding methods of the above-mentioned first aspect and various possible implementations of the first aspect.
第五方面,本申请实施例提供了一种计算机程序产品,其特征在于,所述计算机程序产品包括指令,当所述指令被执行时实现上述第一方面以及第一方面的各种可能实现中的任意一种多租户的数据分库方法。In a fifth aspect, embodiments of the present application provide a computer program product, which is characterized in that the computer program product includes instructions, and when the instructions are executed, the above-mentioned first aspect and various possible implementations of the first aspect are implemented. Any multi-tenant data sharding method.
第六方面,本申请实施例提供了一种电子设备,其特征在于,包括:In a sixth aspect, embodiments of the present application provide an electronic device, which is characterized by including:
存储器,用于存储由电子设备的一个或多个处理器执行的指令,以及memory for storing instructions for execution by one or more processors of the electronic device, and
处理器,当所述指令被所述电子设备的一个或多个处理器执行时,所述处理器用于执行所述存储器中存储的指令,以实现上述第一方面以及第一方面的各种可能实现中的任意一种多租户的数据分库方法。A processor, when the instructions are executed by one or more processors of the electronic device, the processor is configured to execute the instructions stored in the memory to implement the above first aspect and various possibilities of the first aspect. Implement any multi-tenant data sharding method.
基于上述方案,本申请具有如下有益效果:Based on the above solution, this application has the following beneficial effects:
本申请实施例提供的一种多租户的数据分库方法,用于包括服务器和作为数据库的存储设备的系统,数据拦截模块获取执行保险业务的请求;区域规则匹配模块基于数据拦截模块传递的请求中的产品信息以及地理区域信息,将请求与数据库中的产品管理库的区域库信息匹配;在匹配到区域库信息的情况下,区域规则匹配模块在数据库中的产品区域库中获取产品配置规则,并且根据产品配置规则获取执行保险业务所需的数据;在未匹配到区域库信息的情况下,组织架构拦截模块获取请求中的租户信息;并且租户规则匹配模块,基于组织架构拦截模块传递的租户信息在数据库中的租户库中获取执行保险业务所需的数据。该方法将地理区域信息与分库方式结合,根据同一个保险产品可以对应不同的区域库的特点,将同一个产品对应的不同的区域划分不同的数据库,在高并发的情况下,对于同一个产品可以访问不同的产品区域库,改进了单一的根据租户信息的分库规则,可以有效避免仅仅根据单一的租户分库规则访问同一数据库,造成保险 业务处理失败的问题,进而提高了保险业务的处理效率。另外,提供了一种多租户的数据分库装置,该装置有数据接收模块、数据转发模块、拦截匹配模块、执行业务逻辑模块,可以有效完成处理保险业务的流程。其中,区域规则匹配模块包括,数据拦截模块、区域规则匹配模块、组织架构拦截模块、租户规则匹配模块,多个子模块实现根据请求中的产品信息、地理区域信息或者租户信息完成动态分库规则。The embodiment of the present application provides a multi-tenant data sharding method for a system including a server and a storage device as a database. The data interception module obtains a request to execute insurance business; the regional rule matching module is based on the request passed by the data interception module. The product information and geographical area information in the database are matched with the regional library information of the product management library in the database; in the case of matching the regional library information, the regional rule matching module obtains product configuration rules from the product regional library in the database. , and obtain the data required to execute the insurance business according to the product configuration rules; when the regional library information is not matched, the organizational structure interception module obtains the tenant information in the request; and the tenant rule matching module, based on the organizational structure interception module passed Tenant information obtains the data required to perform insurance business from the tenant library in the database. This method combines geographical area information with the sub-database method. According to the characteristics that the same insurance product can correspond to different regional databases, different regions corresponding to the same product are divided into different databases. In the case of high concurrency, for the same insurance product Products can access different product regional libraries, and the single database sub-database rule based on tenant information has been improved, which can effectively avoid accessing the same database only based on a single tenant sub-database rule, causing insurance The problem of business processing failure is solved, thereby improving the processing efficiency of insurance business. In addition, a multi-tenant data sub-database device is provided. The device has a data receiving module, a data forwarding module, an interception matching module, and an execution business logic module, which can effectively complete the process of processing insurance business. Among them, the regional rule matching module includes a data interception module, a regional rule matching module, an organizational structure interception module, and a tenant rule matching module. Multiple sub-modules implement dynamic sub-database rules based on the product information, geographical area information, or tenant information in the request.
附图说明Description of drawings
图1A根据本申请的一些实施例,示出了一种保险业务场景示意图;Figure 1A shows a schematic diagram of an insurance business scenario according to some embodiments of the present application;
图1B根据本申请的一些实施例,示出了一种未完成的保单界面示意图;Figure 1B shows an unfinished policy interface schematic diagram according to some embodiments of the present application;
图1C根据本申请的一些实施例,示出了一种完成的保单界面示意图;Figure 1C shows a schematic diagram of a completed policy interface according to some embodiments of the present application;
图2A根据本申请的一些实施例,示出了一种服务器200b的装置结构示意图;Figure 2A shows a schematic structural diagram of a server 200b according to some embodiments of the present application;
图2B根据本申请的一些实施例,示出了一种拦截匹配模块203的结构示意图;Figure 2B shows a schematic structural diagram of an interception matching module 203 according to some embodiments of the present application;
图2C根据本申请的一些实施例,示出了一种数据库300的结构示意图;Figure 2C shows a schematic structural diagram of a database 300 according to some embodiments of the present application;
图3根据本申请的一些实施例,示出了一种拦截匹配模块203与数据库300中各子数据库的交互过程示意图;Figure 3 shows a schematic diagram of the interaction process between the interception matching module 203 and each sub-database in the database 300 according to some embodiments of the present application;
图4根据本申请的一些实施例,示出了一种多租户的数据分库方法的流程图;Figure 4 shows a flow chart of a multi-tenant data sharding method according to some embodiments of the present application;
图5根据本申请的一些实施例,示出了一种服务器200b的硬件结构示意图。Figure 5 shows a schematic diagram of the hardware structure of a server 200b according to some embodiments of the present application.
具体实施方式Detailed ways
本申请的说明性实施例包括但不限于一种多租户的数据分库方法、程序产品和电子设备。Illustrative embodiments of the present application include, but are not limited to, a multi-tenant data sharding method, program products, and electronic devices.
为使本申请的目的、技术方案和优点更加清楚,下面通过结合附图和实施方案,对本申请实施例的技术方案做进一步地详细描述。显然,所描述的实施例仅是本发明部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions of the embodiments of the present application are further described in detail below by combining the drawings and implementation plans. Obviously, the described embodiments are only some, but not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present invention.
下面结合附图详细说明本申请实施例的技术方案。The technical solutions of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
图1A根据本申请的一些实施例,示出了本申请的技术方案适用的一种保险业务场景。如图1A所示,其中包括投保人、投保人使用的用户终端100、保险公司对应的服务器200a,SaaS服务对应的服务器200b,以及部署于服务器200b上的数据库300。保险公司为降低运营成本,向SaaS供应商购买服务,因而保险公司只需在服务器上部署处理保险业务所需的设施,就可以通过访问服务器200b处理保险业务。Figure 1A shows an insurance business scenario to which the technical solution of the present application is applicable, according to some embodiments of the present application. As shown in Figure 1A, it includes the policy holder, the user terminal 100 used by the policy holder, the server 200a corresponding to the insurance company, the server 200b corresponding to the SaaS service, and the database 300 deployed on the server 200b. In order to reduce operating costs, insurance companies purchase services from SaaS providers. Therefore, the insurance company only needs to deploy the facilities required for processing insurance business on the server, and then it can process the insurance business by accessing the server 200b.
用户终端100可以通过网络与服务器200a连接,服务器200a可以通过网络与服务器200b连接,从而办理保险业务。例如,用户终端100可以通过无线保真(Wireless-Fidelity,Wi-Fi)网络、蓝牙等无线网络和服务器200a进行通信,服务器200a可以通过无线保真(Wireless-Fidelity,Wi-Fi)网络、蓝牙等无线网络和服务器200b进行通信。The user terminal 100 can be connected to the server 200a through the network, and the server 200a can be connected to the server 200b through the network to handle insurance services. For example, the user terminal 100 can communicate with the server 200a through a wireless fidelity (Wireless-Fidelity, Wi-Fi) network, Bluetooth, and other wireless networks, and the server 200a can communicate through a wireless fidelity (Wireless-Fidelity, Wi-Fi) network, Bluetooth, and other wireless networks. Wait for the wireless network to communicate with the server 200b.
具体地,用户终端100可以安装有保险公司的客户端软件,例如保险应用程序(Application,APP),投保人可以通过该用户终端100安装的保险APP访问服务器200a购买自己需要的保险产品,例如购买城市医疗保险、养老保险、车辆保险、意外险等;投保人还可以使用用户终端100中的即时通讯APP扫描各保险对应的二维码购买保险, 办理保险业务。Specifically, the user terminal 100 can be installed with the insurance company's client software, such as an insurance application (Application, APP). The policyholder can access the server 200a through the insurance APP installed on the user terminal 100 to purchase the insurance products he or she needs, such as purchasing Urban medical insurance, pension insurance, vehicle insurance, accident insurance, etc.; policyholders can also use the instant messaging APP in the user terminal 100 to scan the QR code corresponding to each insurance to purchase insurance. Handle insurance business.
服务器200a根据用户终端100发送的请求数据,将数据进行加密,再将加密后的请求数据发送给服务器200b,服务器200b接收到保险业务请求后,根据请求中的保险产品租户信息,识别该保险产品所属的具体租户,根据租户分库规则,在服务器200b中所属租户对应的数据库300中获取存储的数据,执行保险业务内容,并将处理的保险业务结果发送给服务器200a,服务器200a再将处理的保险业务结果数据进行解密,将最终的结果发送给用户终端100,从而完成处理保险业务的流程。The server 200a encrypts the data according to the request data sent by the user terminal 100, and then sends the encrypted request data to the server 200b. After receiving the insurance service request, the server 200b identifies the insurance product based on the insurance product tenant information in the request. The specific tenant to which it belongs obtains the stored data in the database 300 corresponding to the tenant in the server 200b according to the tenant sub-database rules, executes the insurance business content, and sends the processed insurance business results to the server 200a, and the server 200a then sends the processed insurance business results to the server 200a. The insurance business result data is decrypted and the final result is sent to the user terminal 100, thereby completing the insurance business processing process.
可以理解的,由于保险公司租用SaaS服务的供应商提供的软件服务,服务器200b部署有根据保险公司自身业务需要的数据。保险公司根据业务将需要利用软件服务处理的保险业务放在服务器200b上进行处理,这样降低了维护成本,提高了资源的可利用性。It is understandable that since the insurance company rents software services provided by the SaaS service provider, the server 200b is deployed with data according to the insurance company's own business needs. The insurance company places the insurance business that needs to be processed using software services on the server 200b for processing according to the business, which reduces the maintenance cost and improves the availability of resources.
例如,以处理的保险业务为生成城市医疗保险保单为例具体介绍。图1B示出了用户投保时用户终端100的页面101。用户在用户终端100上办理投保业务时,填写完保单所需的信息后,例如,填写完如图1b所示的产品名称、可投保城市、投保金额等数据后,需要生成保单。用户终端100向服务器200a发送生成城市医疗保险保单的请求;服务器200a在接收到投保人通过用户终端100发送的请求之后,将请求数据进行加密,再将加密后的请求数据发送给服务器200b;服务器200b接收到加密后的生成城市医疗保险保单的请求后,识别城市医疗保险产品所属的租户(以下简称“医疗保险租户”),例如,医疗保险租户可以为某保险公司,根据租户分库规则,在数据库300中的医疗保险租户对应子数据库(以下简称“医疗保险租户库”)中获取存储的数据,根据获取的数据执行生成城市医疗保险保单的请求,并将生成的城市医疗保险保单结果发送给服务器200a,服务器200a再将处理的保险业务结果数据根据对应的解密方法进行解密,将最终的结果发送给用户终端100。可以理解,生成城市医疗保险保单的业务请求只是服务器200b处理的保险公司设置在服务器200b中的保险业务中的一种,上述仅仅是作为一种示例。服务器200b处理的保险业务还可以根据投保请求生成空白保单业务,查询保险业务状态、审核保险单据等等。For example, the insurance business handled to generate a city medical insurance policy will be introduced in detail. FIG. 1B shows the page 101 of the user terminal 100 when the user applies for insurance. When the user handles the insurance business on the user terminal 100, after filling in the information required for the policy, for example, after filling in the product name, insurable cities, insurance amount and other data as shown in Figure 1b, a policy needs to be generated. The user terminal 100 sends a request to generate a city medical insurance policy to the server 200a; after receiving the request sent by the policy holder through the user terminal 100, the server 200a encrypts the request data, and then sends the encrypted request data to the server 200b; the server 200b After receiving the encrypted request to generate a city medical insurance policy, 200b identifies the tenant to which the city medical insurance product belongs (hereinafter referred to as the "medical insurance tenant"). For example, the medical insurance tenant can be an insurance company. According to the tenant sub-library rules, Obtain the stored data in the medical insurance tenant corresponding sub-database (hereinafter referred to as the "medical insurance tenant database") in the database 300, execute a request to generate an urban medical insurance policy based on the acquired data, and send the generated urban medical insurance policy result. To the server 200a, the server 200a then decrypts the processed insurance business result data according to the corresponding decryption method, and sends the final result to the user terminal 100. It can be understood that the business request for generating a city medical insurance policy is only one of the insurance services set by the insurance company in the server 200b to be processed by the server 200b, and the above is only an example. The insurance business processed by the server 200b can also generate blank policy business according to the insurance request, query the status of the insurance business, review insurance documents, and so on.
然而,由于在保险业务办理过程中,存在同一时间多数人进行投保操作,多个用户终端100向服务器200a发送投保请求,服务器200a再将加密请求数据发送给服务器200b,服务器200b需要根据多租户分库规则访问同一数据库,容易造成数据库负载升高,连接数量不足等性能问题,因而易造成投保人投保失败,不仅浪费了连接资源,还影响保险业务的处理进程。例如,用户终端100向服务器200a发送生成城市医疗保险保单的请求,服务器200a接收用户终端100发送的请求后,将与隐私安全有关的数据加密后,将加密后的请求数据发送给服务器200b,服务器200b根据获取的数据请求,根据租户分库规则,判断城市医疗保险所属为医疗保险租户后,由于医疗保险租户库连接量较大,连接医疗保险租户库失败,无法生成保险单据,浪费了连接资源,影响了处理城市医疗保险业务进程。However, during the process of insurance business processing, most people perform insurance operations at the same time. Multiple user terminals 100 send insurance requests to the server 200a, and the server 200a then sends the encrypted request data to the server 200b. The server 200b needs to divide the insurance according to the multi-tenant classification. Database rules accessing the same database can easily cause performance problems such as increased database load and insufficient number of connections. This can easily cause policyholders to fail to apply for insurance, which not only wastes connection resources but also affects the processing of insurance business. For example, the user terminal 100 sends a request to generate a city medical insurance policy to the server 200a. After receiving the request sent by the user terminal 100, the server 200a encrypts data related to privacy security and sends the encrypted request data to the server 200b. The server 200b 200b based on the obtained data request and the tenant sub-database rules, determined that the city's medical insurance belongs to the medical insurance tenant. Due to the large number of connections to the medical insurance tenant database, the connection to the medical insurance tenant database failed, and insurance documents could not be generated, which wasted connection resources. , affecting the process of handling urban medical insurance business.
可以理解的,相同的保险种类由于投保人的想要投保的地理区域不同,则对应的保单数据内容是不同的。例如,对于同一种城市医疗保险,不同的城市,城市医疗报销范围以及报销比例、免赔额设置、投保要求、使用地域要求等保障内容都不同。对于同一种城市医疗保险产品,在A城市进行城市医疗保险投保的投保内容与在B城市进行城市 医疗保险投保的投保内容不同。因而,可以将投保产品以及地理区域进行关联,根据投保产品以及地理区域的关联性进行分库。It is understandable that for the same insurance type, the corresponding policy data content will be different due to the different geographical areas where the policy holder wants to insure. For example, for the same type of urban medical insurance, in different cities, the urban medical reimbursement scope and reimbursement ratio, deductible setting, insurance requirements, geographical use requirements and other protection contents are different. For the same urban medical insurance product, the insurance content of urban medical insurance in city A is different from that of urban medical insurance in city B. The coverage content of medical insurance is different. Therefore, insured products and geographical areas can be associated, and the database can be divided according to the correlation between insured products and geographical areas.
为此,本申请提出一种多租户的数据分库方法,服务器200b根据请求中的保险产品信息以及地理区域信息与区域分库规则进行匹配,若匹配成功,则根据区域分库规则获取的与保险公司对应的产品配置规则以及与产品配置规则对应的执行保险业务所需的相关数据,执行保险业务逻辑;若与区域分库规则匹配失败,则根据请求中的租户信息与租户分库规则匹配,匹配成功后,根据租户分库规则获取的执行保险业务的相关数据,执行保险业务逻辑。其中,保险产品对应多个产品区域库,产品区域库包括与保险业务实施者对应的产品配置规则。To this end, this application proposes a multi-tenant data sharding method. The server 200b matches the insurance product information and geographical area information in the request with the regional sharding rules. If the match is successful, the server 200b obtains the data based on the regional sharding rules. The product configuration rules corresponding to the insurance company and the relevant data required to execute the insurance business corresponding to the product configuration rules execute the insurance business logic; if the match with the regional sub-database rules fails, the tenant information in the request is matched with the tenant sub-database rules. , after the matching is successful, the insurance business logic is executed based on the relevant data for executing the insurance business obtained by the tenant sub-database rules. Among them, insurance products correspond to multiple product regional libraries, and the product regional libraries include product configuration rules corresponding to insurance business implementers.
可以理解的,上述地理区域可以理解为不同的行政区,比如按照省、市、区、县划分的区域,也可以是根据经济发展水平、常驻人口数量自定义划分的地理区域。It is understandable that the above-mentioned geographical areas can be understood as different administrative areas, such as areas divided by provinces, cities, districts, and counties, or they can also be customized geographical areas based on the level of economic development and the number of permanent residents.
可以理解的,由于在不同的区域购买相同保险产品的保险内容是不同的,这样将保险产品以及地理区域信息结合起来,对于同一个产品,不同的地理区域,访问不同的产品区域库,在区域库中获取与不同保险公司相关的产品配置规则,从而在高并发的情况下,多个用户终端100在办理保险业务的过程中,针对不同的区域,访问不同的区域库,可以有效避免仅仅根据单一的多租户分库规则访问同一数据库,造成用户处理保险业务失败的问题,减小了单个数据库的压力,进而提高了保险业务的处理效率。It is understandable that since the insurance content of the same insurance product purchased in different regions is different, by combining the insurance product and geographical area information, for the same product in different geographical areas, access to different product area libraries, in the area The product configuration rules related to different insurance companies are obtained from the database, so that in the case of high concurrency, multiple user terminals 100 can access different regional databases for different regions during the process of handling insurance business, which can effectively avoid simply based on A single multi-tenant sub-database rule accesses the same database, causing the problem of users failing to process insurance business, reducing the pressure on a single database, and thus improving the efficiency of insurance business processing.
例如,在上述图1A所示的场景中,用户填写完如图1B所示的保单界面,当服务器200b接收到发送的生成城市医疗保险保单数据的请求后,获取请求中的产品名称以及可投保城市,并根据产品名称“xx城市医疗保险”以及可投保城市“安阳”与区域分库规则进行匹配。若匹配成功,则在安阳对应的区域库(以下简称“安阳库”)中获得与保险公司对应的城市医疗保险产品配置规则,以及与城市医疗保险产品配置规则对应的执行保险业务所需的相关数据,根据获取的数据执行业务逻辑;若与区域分库规则匹配失败,则根据请求中的城市医疗保险产品对应的租户信息与租户分库规则匹配,匹配成功后,根据匹配的租户分库规则获取医疗保险租户库中的与生成保单相关的数据,再根据获取的数据执行生成医疗保险保单的业务逻辑。当服务器200b执行生成医疗保险的业务逻辑之后,将数据发送给服务器200a,服务器200a将数据进行解密,再发送给用户终端100,用户终端100显示如图1C所示的保险单据界面102,此时保险单据界面无法修改。For example, in the scenario shown in Figure 1A above, the user fills out the policy interface shown in Figure 1B. When the server 200b receives the request to generate urban medical insurance policy data, it obtains the product name and insurable data in the request. city, and match the product name "xx city medical insurance" and the insurable city "Anyang" with the regional sub-database rules. If the match is successful, the urban medical insurance product configuration rules corresponding to the insurance company are obtained in the corresponding regional database in Anyang (hereinafter referred to as the "Anyang database"), as well as the relevant information required to execute the insurance business corresponding to the urban medical insurance product configuration rules. data, and execute business logic based on the obtained data; if the match with the regional sharding rules fails, the tenant information corresponding to the urban medical insurance product in the request will be matched with the tenant sharding rules. After the match is successful, the matching tenant sharding rules will be used. Obtain the data related to generating insurance policies from the medical insurance tenant database, and then execute the business logic of generating medical insurance policies based on the acquired data. After the server 200b executes the business logic of generating medical insurance, it sends the data to the server 200a. The server 200a decrypts the data and then sends it to the user terminal 100. The user terminal 100 displays the insurance document interface 102 as shown in Figure 1C. At this time The insurance document interface cannot be modified.
可以理解的,对于相同的城市医疗保险业务,在不同的区域,例如安阳、玉林等城市,它的保险业务不同,当服务器200b接收服务器200a获取的安阳、玉林等地的多个用户终端100的投保请求,服务器200b则可以根据区域分库规则获取安阳库中的与保险公司对应的城市医疗保险产品配置规则,以及与城市医疗保险产品配置规则对应的执行保险业务所需的相关数据,根据获取的数据执行生成城市医疗保险保单业务逻辑;则根据区域分库规则获取玉林对应的区域库(以下简称“玉林库”)中的与保险公司对应的城市医疗保险产品配置规则,以及与城市医疗保险产品配置规则对应的执行保险业务所需的相关数据,根据获取的数据生成城市医疗保险保单。通过投保请求在不同的区域数据库中获取执行保险业务逻辑所需的数据,提高处理保险业务的效率。It is understandable that for the same urban medical insurance business, its insurance services are different in different areas, such as Anyang, Yulin and other cities. When the server 200b receives the information of multiple user terminals 100 in Anyang, Yulin and other places obtained by the server 200a, In the insurance request, the server 200b can obtain the urban medical insurance product configuration rules corresponding to the insurance company in the Anyang database according to the regional sub-database rules, and the relevant data required to execute the insurance business corresponding to the urban medical insurance product configuration rules. According to the obtained The data is executed to generate the urban medical insurance policy business logic; then the urban medical insurance product configuration rules corresponding to the insurance company in the regional database corresponding to Yulin (hereinafter referred to as the "Yulin database") are obtained according to the regional sub-database rules, as well as the urban medical insurance product configuration rules corresponding to the urban medical insurance The product configuration rules correspond to the relevant data required to execute the insurance business, and a city medical insurance policy is generated based on the obtained data. Obtain the data required to execute insurance business logic in different regional databases through insurance requests to improve the efficiency of processing insurance business.
需要说明的是,图1A所示的应用场景中的用户终端100可以是任意一种可以安装保险公司的应用程序,并且具有显示屏的电子设备。服务器200a和服务器200b可以是单独 的服务器,也可以是多个服务器构成的服务器集群。It should be noted that the user terminal 100 in the application scenario shown in FIG. 1A can be any electronic device that can install an insurance company's application program and has a display screen. Server 200a and server 200b may be separate A server can also be a server cluster composed of multiple servers.
为了方便理解本方案,先对服务器200b对应的装置结构进行介绍。In order to facilitate understanding of this solution, the device structure corresponding to the server 200b is first introduced.
如图2A所示,服务器200b包括数据接收模块201、数据转发模块202、拦截匹配模块203、执行业务逻辑模块204。As shown in Figure 2A, the server 200b includes a data receiving module 201, a data forwarding module 202, an interception matching module 203, and an execution business logic module 204.
下面具体介绍服务器200b中各模块的功能及在本申请的一些实施例中的作用。The following is a detailed introduction to the functions of each module in the server 200b and its role in some embodiments of the present application.
具体地,数据接收模块201可以用于接收请求数据。在本申请的一些实施例中,数据接收模块201可以接收服务器200a发送的与保险业务相关的请求数据,并将请求数据发送给数据转发模块202。例如,数据接收模块201接收服务器200a发送的报文,报文中包括与保险业务相关的产品信息、区域信息或者保险产品所属的租户信息中的至少一个字段。Specifically, the data receiving module 201 may be used to receive request data. In some embodiments of the present application, the data receiving module 201 can receive the request data related to the insurance business sent by the server 200a, and send the request data to the data forwarding module 202. For example, the data receiving module 201 receives a message sent by the server 200a. The message includes at least one field of product information related to the insurance business, regional information, or tenant information to which the insurance product belongs.
数据转发模块202可以用于转发请求数据。在本申请的一些实施中,数据转发模块202可以获取数据接收模块201发送的与保险业务相关的请求数据,并将请求数据中无关的数据过滤掉,将过滤后的请求数据发送给拦截匹配模块203。The data forwarding module 202 may be used to forward request data. In some implementations of this application, the data forwarding module 202 can obtain the request data related to the insurance business sent by the data receiving module 201, filter out the irrelevant data in the request data, and send the filtered request data to the interception matching module. 203.
拦截匹配模块203可以用于拦截数据,并根据拦截到的数据与区域分库规则或者租户分库规则进行匹配。在本申请的一些实施例中,拦截匹配模块203可以接收数据转发模块202发送的数据,根据请求数据中的产品信息以及地理区域信息进行区域分库规则匹配,若匹配成功,则将匹配获得的结果数据发送给执行业务逻辑模块204;若匹配失败,则获取请求中的租户信息,根据租户信息匹配租户分库规则,将匹配获得的结果数据发送给执行业务逻辑模块204。The interception matching module 203 can be used to intercept data, and match the intercepted data with regional sharding rules or tenant sharding rules. In some embodiments of the present application, the interception matching module 203 can receive the data sent by the data forwarding module 202, and perform regional sub-library rule matching based on the product information and geographical area information in the request data. If the matching is successful, the obtained data will be matched. The result data is sent to the execution business logic module 204; if the matching fails, the tenant information in the request is obtained, the tenant sharding rules are matched according to the tenant information, and the result data obtained by matching is sent to the execution business logic module 204.
可以理解的,根据获取的请求中的地理区域信息或者租户信息匹配对应的分库策略,这样改进了原有单一的租户分库方式,从而在高并发的情况下,对于相同的保险产品,由于采用区域分库策略,访问不同的子数据库,避免访问同一保单库而获取数据失败的问题,从而提高处理保险业务的效率。可以理解的,在一些实现方式中,拦截匹配模块203可以为链式多拦截器。It is understandable that the corresponding sharding strategy is matched based on the geographical area information or tenant information in the obtained request, which improves the original single tenant sharding method, so that under high concurrency conditions, for the same insurance product, due to Adopt a regional sub-database strategy to access different sub-databases to avoid the problem of failure to obtain data when accessing the same policy database, thereby improving the efficiency of processing insurance business. It can be understood that in some implementations, the interception matching module 203 may be a chained multi-interceptor.
执行业务逻辑模块204用于执行业务逻辑。在本申请的一些实施例中,执行业务逻辑模块204可以接收拦截匹配模块203匹配成功得到的保险业务数据,执行保险业务。例如,执行生成保险单据的业务、审核保险单据的业务、查询保险业务状态等。The business logic execution module 204 is used to execute business logic. In some embodiments of the present application, the business execution logic module 204 can receive the insurance business data successfully matched by the interception matching module 203 and execute the insurance business. For example, execute the business of generating insurance documents, reviewing insurance documents, querying the status of insurance business, etc.
为了更加清楚地阐述拦截匹配模块203匹配分库规则的方式,先介绍本申请的一些实施例中拦截匹配模块203具体可包括的功能模块以及数据库300包括的各子数据库。In order to more clearly explain the way in which the interception matching module 203 matches the sub-database rules, the specific functional modules that the interception matching module 203 may include and each sub-database included in the database 300 in some embodiments of the present application will be introduced first.
如图2B所示,拦截匹配模块203可以包括数据拦截模块203a、区域规则匹配模块203b、组织架构拦截模块203c、租户规则匹配模块203d。As shown in Figure 2B, the interception matching module 203 may include a data interception module 203a, a regional rule matching module 203b, an organizational structure interception module 203c, and a tenant rule matching module 203d.
数据拦截模块203a获取数据转发模块202转发的请求数据,并将请求数据发送给区域规则匹配模块203b。可以理解的,在一些实现方式中,数据拦截模块203a可以为数据拦截器。The data interception module 203a obtains the request data forwarded by the data forwarding module 202, and sends the request data to the regional rule matching module 203b. It can be understood that in some implementations, the data interception module 203a may be a data interceptor.
区域规则匹配模块203b可以接收数据拦截模块203a发送的请求数据,根据请求数据中的产品信息以及区域信息先在数据库300中的产品管理库进行搜索,若在产品管理库中找到该产品所对应的具体区域库信息,根据区域库信息在数据库300中的产品区域库中进行搜索,获取该产品区域库与保险业务实施者对应的产品配置规则以及与产品配置规则对应的数据,则匹配成功,若在产品管理库中未找到该产品所对应的具体区域,则匹配 失败。The regional rule matching module 203b can receive the request data sent by the data interception module 203a, and first searches the product management library in the database 300 according to the product information and regional information in the request data. If the product corresponding to the product is found in the product management library, For specific regional library information, search the product regional library in the database 300 based on the regional library information to obtain the product configuration rules corresponding to the product regional library and the insurance business implementer and the data corresponding to the product configuration rules. If the match is successful, If the specific area corresponding to the product is not found in the product management library, then the match fail.
组织架构拦截模块203c获取区域规则匹配模块203b发送的请求数据,并根据请求数据获取租户信息,并将租户信息发送给租户规则匹配模块203d。其中,租户信息可以为保险产品或者保险产品对应的保险公司的信息。可以理解的,在一些实现方式中,组织架构拦截模块203c可以为组织架构拦截器。The organizational structure interception module 203c obtains the request data sent by the area rule matching module 203b, obtains the tenant information according to the request data, and sends the tenant information to the tenant rule matching module 203d. The tenant information may be information about insurance products or insurance companies corresponding to the insurance products. It can be understood that in some implementations, the organizational structure interception module 203c can be an organizational structure interceptor.
租户规则匹配模块203d接收组织架构拦截模块203c发送的数据,根据获取的数据中的租户信息在数据库300中的租户库中匹配,获得该租户对应的执行保险业务的执行业务逻辑数据或者保单数据等,将搜索到的数据发送给执行业务逻辑模块204。The tenant rule matching module 203d receives the data sent by the organizational structure interception module 203c, matches the tenant information in the acquired data in the tenant library in the database 300, and obtains the execution business logic data or policy data of the insurance business corresponding to the tenant. , sending the searched data to the execution business logic module 204.
如图2C所示,数据库300包括产品管理库301、产品区域库302以及租户库303。As shown in FIG. 2C , the database 300 includes a product management database 301 , a product area database 302 and a tenant database 303 .
可以理解的,数据库300中的各子数据库可以是关系型数据库,也可以为轻量目录访问协议(Lightweight Directory Access Protocol,LDAP)。其中,LDAP可以作为一种特殊的数据库,按照树型结构组织信息,对浏览和查找目录及读取内容进行了专门的优化,是一种层次型数据库,具有非常好的读取数据能力,比从关系型数据库读取数据快一个数量级。It can be understood that each sub-database in the database 300 can be a relational database or a lightweight directory access protocol (Lightweight Directory Access Protocol, LDAP). Among them, LDAP can be used as a special database that organizes information according to a tree structure. It is specially optimized for browsing and searching directories and reading content. It is a hierarchical database with very good data reading capabilities. Reading data from a relational database is an order of magnitude faster.
LDAP目录以一系列“属性对”的形式来存储记录项,每一个记录项包括属性类型和属性值。例如,产品管理库301可以为LDAP数据库,产品管理库301中保存的区域库信息可以为与产品区域库302对应的保险产品信息、区域信息以及产品区域库的名称、代号或者路径地址。具体地,产品管理库301中的记录项的属性可以自定义有产品名称属性,区域属性,具体产品区域库名称、代号或者具体区域库对应的路径地址属性,根据属性获取对应的属性值。The LDAP directory stores record items in the form of a series of "attribute pairs". Each record item includes an attribute type and an attribute value. For example, the product management database 301 may be an LDAP database, and the regional database information stored in the product management database 301 may be insurance product information, regional information, and the name, code, or path address of the product regional database corresponding to the product regional database 302. Specifically, the attributes of the record items in the product management library 301 can be customized with product name attributes, region attributes, specific product regional library names, codes, or path address attributes corresponding to specific regional libraries, and corresponding attribute values are obtained according to the attributes.
具体地,产品管理库301包括各产品以及各产品对应的多个区域库的信息,比如产品区域库名称、代号或者路径地址等。例如,产品为K保险产品,则该产品在A、B、C城市销售,就会有K保险产品对应的A城市库名称、代号或者区域库路径地址,K保险产品对应的B城市库名称、代号或者区域库路径地址,K保险产品对应的C城市库名称、代号或者产品区域库路径地址等,多个产品中每一个产品都会有对应的多个区域库。例如,对于城市医疗保险产品,可以在玉林、安阳等多个城市销售,则产品匹配库301可以包括城市医疗保险产品在玉林与安阳等地对应的数据库名称、代号或者路径地址。Specifically, the product management database 301 includes information about each product and multiple regional libraries corresponding to each product, such as product regional library names, codes, or path addresses. For example, if the product is K insurance product, then the product is sold in cities A, B, and C. There will be the A city library name, code or regional library path address corresponding to the K insurance product, and the B city library name, corresponding to the K insurance product. Code name or regional library path address, C city library name, code name or product regional library path address corresponding to the K insurance product, etc. Each of the multiple products will have multiple corresponding regional libraries. For example, for urban medical insurance products that can be sold in multiple cities such as Yulin and Anyang, the product matching database 301 may include the database names, codes or path addresses corresponding to the urban medical insurance products in Yulin, Anyang and other places.
产品区域库302包括多个产品对应的区域数据库,产品区域库中的各子数据库与产品管理库中获得的产品区域库的名称或者路径地址相对应。例如,对于K保险产品,各子数据库包括K保险产品对应的A城市库或者A城市库对应的路径地址、K保险产品对应的B城市库或者B城市库对应的路径地址、K保险产品对应的C城市库或者C城市库对应的路径地址等。例如,对于城市医疗保险产品,对应的多个产品区域库,包括威海库、玉林库、安阳库等区域库。各产品区域库中包括与保险业务实施者对应的产品配置规则,其中一个产品区域库中可以包括多个不同保险公司对应的产品配置规则,具体地,一个保险公司规定的多个产品配置规则或者一个保险公司规定的一个产品配置规则或者多个保险公司规定的一个产品配置规则等,具体情况不做限制。例如,玉林库中包括多个保险公司分别设定的城市医疗保险产品配置规则。The product area database 302 includes multiple area databases corresponding to products, and each sub-database in the product area database corresponds to the name or path address of the product area database obtained from the product management database. For example, for K insurance products, each sub-database includes the A city library corresponding to K insurance product or the path address corresponding to A city library, the B city library corresponding to K insurance product or the path address corresponding to B city library, the K insurance product corresponding C city library or the path address corresponding to the C city library, etc. For example, for urban medical insurance products, there are multiple corresponding product regional libraries, including Weihai library, Yulin library, Anyang library and other regional libraries. Each product area library includes product configuration rules corresponding to insurance business implementers. One product area library may include product configuration rules corresponding to multiple different insurance companies. Specifically, multiple product configuration rules specified by an insurance company or A product configuration rule stipulated by one insurance company or a product configuration rule stipulated by multiple insurance companies, etc. There are no restrictions on specific circumstances. For example, the Yulin library includes urban medical insurance product configuration rules set by multiple insurance companies.
租户库303包括多个租户库,例如A租户库、B租户库、C租户库等。每个租户库可以存储同一个保险公司的同一个产品所需的数据,也可以存储同一个保险公司的多个产 品所需的数据。例如,租户库303可以包括城市医疗保险租户库。The tenant library 303 includes multiple tenant libraries, such as A tenant library, B tenant library, C tenant library, etc. Each tenant library can store the data required for the same product of the same insurance company, or can store multiple products of the same insurance company. data required for the product. For example, tenant database 303 may include a city health insurance tenant database.
可以理解的,上述服务器200b所示的结构图仅仅是一种示意,在其他一些实施例中,还可以在此基础上增加或减少相应的模块,具体结构在此不做要求。例如,还可以包括用户管理模块、用户配置模块、保单管理模块等。上述数据库300包括的数据库各子数据库仅仅是一种示例,在其他一些实施例中,还可以在此基础上增加或减少相应的子数据库,具体结构在此不做要求。It can be understood that the structural diagram shown in the above server 200b is only a schematic. In some other embodiments, corresponding modules can be added or deleted on this basis, and the specific structure is not required here. For example, it may also include a user management module, a user configuration module, a policy management module, etc. Each sub-database of the database included in the above-mentioned database 300 is only an example. In other embodiments, corresponding sub-databases can also be added or reduced on this basis, and the specific structure is not required here.
为了更好地理解本申请方案中拦截匹配模块203在匹配区域分库规则或者租户分库规则的过程中,与数据库300中各子数据库的交互过程。下面以执行的保险业务为生成保单为例,阐述拦截匹配模块203中各子模块与数据库300中各子数据库之间的交互过程。图3示出了具体交互过程,包括以下步骤:In order to better understand the interaction process between the interception matching module 203 and each sub-database in the database 300 in the process of matching regional sub-database rules or tenant sub-database rules in the solution of this application. Taking the execution of insurance business as an example to generate a policy, the following describes the interaction process between each sub-module in the interception matching module 203 and each sub-database in the database 300. Figure 3 shows the specific interaction process, including the following steps:
S301:数据拦截模块203a拦截生成保单的请求。S301: The data interception module 203a intercepts the request to generate a policy.
可以理解的,数据拦截模块203a拦截的生成保单的请求中,包括能够表征保险产品信息、投保人信息、可投保的地理区域信息、产品销售渠道等,在此不做赘述。It can be understood that the requests to generate insurance policies intercepted by the data interception module 203a include information that can characterize insurance products, policyholders' information, insurable geographical area information, product sales channels, etc., which will not be described in detail here.
可以理解的,产品信息可以包括产品代号或者名称等信息,可投保的地理区域信息可以为不同的行政区,比如按照省、市、区、县划分的区域,也可以是根据经济发展水平、常驻人口数量自定义划分的地理区域。其中,产品信息以及可投保城市经过服务器200a加密后,可以通过数字、字母等方式标识,具体标识方式不做规定。It is understandable that product information can include product code or name, and the geographical area information that can be insured can be different administrative regions, such as areas divided by provinces, cities, districts, and counties, or it can also be based on economic development level, resident status, etc. Geographic areas divided into customizable populations. Among them, product information and insurable cities can be identified by numbers, letters, etc. after being encrypted by the server 200a. The specific identification method is not specified.
例如,数据拦截模块203a拦截的生成城市医疗保险保单的请求,请求中包括能够表征城市医疗保险产品的信息、投保人信息以及可投保城市信息等。For example, the data interception module 203a intercepts a request to generate a city medical insurance policy. The request includes information that can characterize the city's medical insurance product, policyholder information, and insurable city information.
S302:数据拦截模块203a向区域规则匹配模块203b发送生成保单请求。S302: The data interception module 203a sends a policy generation request to the regional rule matching module 203b.
例如,数据拦截模块203a向区域规则匹配模块203b发送生成城市医疗保险保单的请求。For example, the data interception module 203a sends a request to generate a city medical insurance policy to the regional rule matching module 203b.
S303:区域规则匹配模块203b根据请求数据,获取产品信息以及地理区域信息。S303: The regional rule matching module 203b obtains product information and geographical area information according to the request data.
例如,区域规则匹配模块203b根据获取的生成城市医疗保险保单的请求,获取城市医疗保险产品的代号为01以及可投保城市安阳市标识为AY。For example, the regional rule matching module 203b obtains the code of the city medical insurance product as 01 and the identifier of the insurable city Anyang as AY based on the obtained request to generate a city medical insurance policy.
S304:区域规则匹配模块203b向产品管理库301发送获取产品对应的具体区域库信息请求。S304: The regional rule matching module 203b sends a request to obtain the specific regional database information corresponding to the product to the product management database 301.
可以理解的,在一些实施例中,区域规则匹配模块203b可以为通过特定领域语言,即共识的语言来规定与区域规则匹配。It can be understood that in some embodiments, the regional rule matching module 203b may be configured to match regional rules through a specific domain language, that is, a consensus language.
例如,规则{规则名='区域分库规则'For example, rule {rule name = 'regional sub-library rule'
通过{在产品区域库中获得数据}}Get data through {get data in product area library}}
可以理解的,上述规定的与区域规则分库匹配只是一种示例,在其他一些实施例中可以包括更多的实现方式。It can be understood that the above-mentioned matching with regional rule libraries is just an example, and more implementation methods may be included in some other embodiments.
可以理解的,在进行区域分库规则匹配的过程中,需要获取具体区域库信息。区域规则匹配模块203b根据获取的产品信息以及地理区域信息向产品管理库301发送获取产品对应的具体的区域库信息请求,请求中可以包括获取该保险产品对应的产品区域库的名称、代号或者路径地址等信息。It is understandable that in the process of matching regional database rules, specific regional database information needs to be obtained. The regional rule matching module 203b sends a request to obtain the specific regional database information corresponding to the product to the product management database 301 based on the obtained product information and geographical area information. The request may include obtaining the name, code or path of the product regional database corresponding to the insurance product. Address and other information.
例如,区域规则匹配模块203b向产品管理库301发送获取城市医疗保险产品的代号为01,可投保城市安阳市标识为AY,在产品管理库301中该产品具体所对应的产品区域 库名称、代号或者路径地址。For example, the regional rule matching module 203b sends the city medical insurance product code 01 to the product management library 301, the insurable city Anyang is identified as AY, and the product area corresponding to the product in the product management library 301 Library name, code or path address.
S305:产品管理库301是否能匹配到区域库信息。若是,进行步骤314;若否,进行步骤306。S305: Whether the product management database 301 can match the regional database information. If yes, proceed to step 314; if not, proceed to step 306.
在一些实施例中,产品管理库301根据请求中获取的产品信息以及地理区域信息,在库中进行搜索,查看数据库中是否有产品以及地理区域信息对应的区域库信息。若是,进行步骤314,获取产品对应的具体区域库信息;若否,进行步骤306,返回区域分库规则匹配失败消息。In some embodiments, the product management database 301 searches in the database based on the product information and geographical area information obtained in the request, and checks whether there is regional database information corresponding to the product and geographical area information in the database. If yes, proceed to step 314 to obtain the specific regional database information corresponding to the product; if not, proceed to step 306 to return a regional branch database rule matching failure message.
例如,产品管理库301根据请求中获取的城市医疗保险产品代码01以及可投保城市安阳市AY,查看数据库中是否有保险产品代号01以及投保城市安阳市AY对应的区域库。若是,进行步骤314,获取产品对应的具体区域库名称、代号或者路径地址;若否,进行步骤306,返回区域分库匹配失败消息。For example, the product management database 301 checks whether there is a regional database corresponding to the insurance product code 01 and the insurable city Anyang AY in the database based on the city medical insurance product code 01 and the insurable city Anyang AY obtained in the request. If yes, proceed to step 314 to obtain the specific regional library name, code or path address corresponding to the product; if not, proceed to step 306 to return a regional sub-library matching failure message.
S306:产品管理库301向区域规则匹配模块203b发送不存在匹配的区域库信息的消息。S306: The product management library 301 sends a message that there is no matching regional library information to the regional rule matching module 203b.
在一些实施例中,产品管理库301中没有对应的区域库信息,则向区域规则匹配模块203b发送不存在匹配的区域库信息的消息。In some embodiments, if there is no corresponding regional library information in the product management library 301, a message that there is no matching regional library information is sent to the regional rule matching module 203b.
例如,产品管理库301没有在数据库中匹配到产品代号为01以及可投保城市安阳市AY对应的区域库名称、代号或者路径地址,向区域规则匹配模块203b发送不存在匹配的区域库信息的消息。For example, the product management database 301 does not match the regional database name, code or path address corresponding to the product code 01 and the insurable city Anyang City AY in the database, and sends a message that there is no matching regional database information to the regional rule matching module 203b. .
S307:区域规则匹配模块203b向组织架构拦截模块203c发送生成保单的请求。S307: The regional rule matching module 203b sends a request to generate a policy to the organizational structure interception module 203c.
在一些实施例中,区域规则匹配模块203b接收产品管理库301发送的不存在匹配的区域库信息的消息,确定匹配区域分库规则失败,则向组织架构拦截模块203c发送生成保单的请求。In some embodiments, the regional rule matching module 203b receives the message sent by the product management library 301 that there is no matching regional library information, determines that the matching of regional sub-library rules fails, and then sends a request to generate a policy to the organizational structure interception module 203c.
例如,区域规则匹配模块203b接收产品管理库301发送的不存在匹配的区域库信息的消息,确定匹配区域分库规则失败,向组织架构拦截模块203c发送生成城市医疗保险保单的请求。For example, the regional rule matching module 203b receives the message sent by the product management library 301 that there is no matching regional library information, determines that the matching of regional sub-database rules fails, and sends a request to generate a city medical insurance policy to the organizational structure interception module 203c.
S308:组织架构拦截模块203c向租户规则匹配模块203d发送生成保单的请求,其中,请求中包括租户信息。S308: The organizational structure interception module 203c sends a request to generate a policy to the tenant rule matching module 203d, where the request includes tenant information.
在一些实施例中,组织架构拦截模块203c获取区域规则匹配模块203b发送的生成保单的请求后,获取请求数据中的租户信息,将租户信息发送给租户规则匹配模块203d。其中,租户信息可以包括租户名称或者代号等,表征方式可以为数字、字母或者其他字符等,在此不做具体限制。租户名称和代号可以为保险产品对应的保险公司的名称或者代号等。In some embodiments, after the organizational structure interception module 203c obtains the request to generate a policy sent by the regional rule matching module 203b, it obtains the tenant information in the request data and sends the tenant information to the tenant rule matching module 203d. Among them, the tenant information can include the tenant name or code, etc., and the representation method can be numbers, letters, or other characters, etc., and there is no specific limit here. The tenant's name and code may be the name or code of the insurance company corresponding to the insurance product, etc.
例如,组织架构拦截模块203c获取区域规则匹配模块203b发送的生成城市医疗保险保单的请求后,根据请求数据获取该城市医疗保险租户信息,并将医疗保险租户信息发送给租户规则匹配模块203d。其中,城市医疗保险产品租户库对应的租户名称可以为HMB租户。For example, after the organizational structure interception module 203c obtains the request to generate a city medical insurance policy sent by the regional rule matching module 203b, it obtains the city's medical insurance tenant information based on the request data, and sends the medical insurance tenant information to the tenant rule matching module 203d. Among them, the tenant name corresponding to the urban medical insurance product tenant database can be HMB tenant.
S309:租户规则匹配模块203d获取生成保单的请求。S309: The tenant rule matching module 203d obtains a request to generate a policy.
可以理解的,租户规则匹配模块203d获取组织架构拦截模块203c发送的生成保单的请求。It can be understood that the tenant rule matching module 203d obtains the request to generate a policy sent by the organizational structure interception module 203c.
例如,租户规则匹配模块203d获取组织架构拦截模块203c发送的生成城市医疗保险 保单的请求。For example, the tenant rule matching module 203d obtains the generated city medical insurance sent by the organizational structure interception module 203c. Policy Request.
S310:租户规则匹配模块203d向租户库303发送在相应租户库中,获取执行生成保单所需数据的请求。S310: The tenant rule matching module 203d sends a request to the tenant library 303 to obtain the data required to generate the policy in the corresponding tenant library.
可以理解的,在一些实施例中,租户规则匹配模块203d可以为通过特定领域语言,即共识的语言来规定与租户分库规则匹配。It can be understood that in some embodiments, the tenant rule matching module 203d may specify matching with tenant sub-library rules through a specific domain language, that is, a consensus language.
例如,规则{规则名='租户分库规则'For example, rule {rule name = 'tenant sub-database rule'
通过{在租户库中获得数据}}Get data in tenant library through {}}
可以理解的,上述规定的与租户分库规则只是一种示例,在其他一些实施例中可以包括更多的实现方式。It can be understood that the above-mentioned sharding rules with tenants are only an example, and more implementation methods may be included in some other embodiments.
可以理解的,租户规则匹配模块203d根据请求中的租户信息,向租户库303发送在相应租户库中,获取执行生成保单所需数据的请求。It can be understood that the tenant rule matching module 203d sends a request to the tenant library 303 to obtain the data required to generate the policy in the corresponding tenant library according to the tenant information in the request.
例如,租户规则匹配模块203d根据请求中的城市医疗保险租户信息,向租户库303发送在HMB租户库中,获取执行生成城市医疗保险保单所需数据的请求。For example, the tenant rule matching module 203d sends a request to the tenant library 303 to obtain the data required to generate a city medical insurance policy in the HMB tenant library according to the city medical insurance tenant information in the request.
S311:租户库303获取执行生成保单所需的数据。S311: The tenant database 303 obtains the data required to generate the policy.
在一些实施例中,租户库303根据获取的租户信息,在对应租户库中搜索执行生成保单所需的数据。可以理解的,执行生成保单所需的数据可以包括保单上基本要素内容以及执行生成保单的逻辑数据。In some embodiments, the tenant database 303 searches the corresponding tenant database for data required to generate a policy based on the acquired tenant information. It can be understood that the data required to generate the policy may include the basic elements of the policy and the logical data to generate the policy.
例如,租户库303根据租户信息,在HMB租户库中搜索执行生成城市医疗保险保单所需的数据。For example, the tenant database 303 searches the HMB tenant database for data required to generate a city medical insurance policy based on the tenant information.
S312:租户库303向租户规则匹配模块203d发送执行生成保单所需的数据。S312: The tenant database 303 sends the data required to generate a policy to the tenant rule matching module 203d.
在一些实施例中,租户库303在相应的租户库中搜索到执行生成保单所需的数据后,向租户规则匹配模块203d发送获取的数据。In some embodiments, after the tenant library 303 searches the corresponding tenant library for the data required to generate the policy, it sends the obtained data to the tenant rule matching module 203d.
例如,租户库303在HMB租户库中搜索到执行生成城市医疗保险保单所需的数据后,向租户规则匹配模块203d发送获取的数据。For example, after the tenant database 303 searches the HMB tenant database for data required to generate a city medical insurance policy, it sends the acquired data to the tenant rule matching module 203d.
S313:租户规则匹配模块203d确定匹配租户分库规则成功。S313: The tenant rule matching module 203d determines that the tenant sub-database rule is successfully matched.
在一些实施例中,租户规则匹配模块203d获取到数据后,确定匹配租户分库规则成功。In some embodiments, after obtaining the data, the tenant rule matching module 203d determines that the tenant sub-database rule is successfully matched.
S314:产品管理库301获取产品对应的具体区域库信息。S314: The product management database 301 obtains specific regional database information corresponding to the product.
在一些实施例中,产品管理库301根据产品信息以及地理区域信息在数据库中搜索到对应的区域库信息。可以理解的,对应的区域库信息可以包括与保险产品以及地理区域信息对应的产品区域库的名称、代号或者路径地址等,具体表征方式可以为数字和字母等,在此不做具体限制。In some embodiments, the product management library 301 searches the database for corresponding regional library information based on product information and geographical area information. It can be understood that the corresponding regional library information may include the name, code or path address of the product regional library corresponding to the insurance product and geographical area information. The specific representation method may be numbers, letters, etc., which are not specifically limited here.
例如,产品管理库301在数据库中搜索城市医疗产品代号为01,可投保城市安阳市标识为AY,在产品管理库301中所对应的产品区域库名称为安阳库。For example, the product management database 301 searches for the city medical product code 01 in the database, the insurable city Anyang city identifier is AY, and the corresponding product area database name in the product management database 301 is Anyang database.
S315:产品管理库301向区域规则匹配模块203b发送产品对应的具体区域库信息。S315: The product management library 301 sends the specific regional library information corresponding to the product to the regional rule matching module 203b.
例如,产品管理库301向区域规则匹配模块203b发送城市医疗保险产品对应可获取生成保单数据的区域库为安阳库。For example, the product management database 301 sends the urban medical insurance product corresponding to the regional database where policy data can be obtained and generated to the regional rule matching module 203b. The regional database is the Anyang database.
S316:区域规则匹配模块203b向产品区域库302发送在相应产品区域库中,获取产品配置规则,并且根据产品配置规则获取执行生成保单所需数据的请求。 S316: The regional rule matching module 203b sends a request to the product regional database 302 to obtain the product configuration rules in the corresponding product regional database, and obtain the data required to generate the policy according to the product configuration rules.
在一些实施例中,区域规则匹配模块203b获取保险产品对应的区域库信息后,向产品区域库302发送在相应产品区域库中,获取产品配置规则,并且根据产品配置规则获取执行生成保单所需数据的请求。其中,一个产品区域库中可以包括多个不同保险公司对应的产品配置规则;具体地,一个保险公司规定的多个产品配置规则或者一个保险公司规定的一个产品配置规则或者多个保险公司规定的一个产品配置规则等,具体情况不做限制。In some embodiments, after obtaining the regional library information corresponding to the insurance product, the regional rule matching module 203b sends it to the product regional library 302 to obtain the product configuration rules in the corresponding product regional library, and obtains the requirements for executing the policy generation according to the product configuration rules. Data requests. Among them, one product area library may include product configuration rules corresponding to multiple different insurance companies; specifically, multiple product configuration rules stipulated by one insurance company or one product configuration rule stipulated by one insurance company or multiple product configuration rules stipulated by multiple insurance companies. A product configuration rule, etc., there are no restrictions on specific circumstances.
例如,区域规则匹配模块203b获取城市医疗保险产品对应的产品区域库为安阳库后,通过区域库连接字符串,向产品区域库302发送,在安阳库中,获取城市医疗保险产品配置规则并且根据产品配置规则获取执行生成城市医疗保险保单所需数据的请求。For example, after the regional rule matching module 203b obtains the product regional library corresponding to the urban medical insurance product as the Anyang library, it sends it to the product regional library 302 through the regional library connection string. In the Anyang library, the urban medical insurance product configuration rules are obtained and based on The product configuration rule obtains a request to perform the data required to generate a city health insurance policy.
S317:产品区域库302获取产品配置规则,并且根据产品配置规则获取执行生成保单所需的数据。S317: The product area database 302 obtains product configuration rules, and obtains data required to generate a policy according to the product configuration rules.
在一些实施例中,产品区域库302根据请求,在相应的区域库中进行搜索,获取产品配置规则,并且根据产品配置规则获取执行生成保单所需的数据。In some embodiments, the product area library 302 searches in the corresponding area library according to the request, obtains product configuration rules, and obtains data required to generate a policy according to the product configuration rules.
例如,产品区域库302根据请求中的区域库连接字符串,在安阳库中进行搜索,获取城市医疗保险产品配置规则,并且根据产品配置规则获取生成城市医疗保险保单所需的数据。For example, the product area database 302 searches the Anyang database according to the area database connection string in the request, obtains the urban medical insurance product configuration rules, and obtains the data required to generate the urban medical insurance policy according to the product configuration rules.
S318:产品区域库302向区域规则匹配模块203b发送获取的产品配置规则,以及与产品配置规则对应的执行生成保单所需的数据。S318: The product area database 302 sends the obtained product configuration rules to the area rule matching module 203b, as well as the data corresponding to the product configuration rules required to execute the policy generation.
在一些实施例中,产品区域库302在获取到产品配置规则,以及根据产品配置规则对应的执行生成保单所需的数据,向区域规则匹配模块203b发送获取的产品配置规则,以及与产品配置规则对应的执行生成保单所需的数据。In some embodiments, after acquiring the product configuration rules and generating the data required for the insurance policy according to the execution corresponding to the product configuration rules, the product regional database 302 sends the acquired product configuration rules and the corresponding product configuration rules to the regional rule matching module 203b. The corresponding execution generates the data required for the policy.
例如,产品区域库302在获取城市医疗保险产品配置规则,以及根据产品配置规则对应的生成城市医疗保险保单所需的数据后,向区域规则匹配模块203b发送获取的城市医疗保险产品配置规则,以及与产品配置规则对应的生成城市医疗保险保单所需的数据。For example, after acquiring the urban medical insurance product configuration rules and the data required to generate urban medical insurance policies according to the product configuration rules, the product regional database 302 sends the acquired urban medical insurance product configuration rules to the regional rule matching module 203b, and Data required to generate urban medical insurance policies corresponding to product configuration rules.
S319:区域规则匹配模块203b确定区域分库规则匹配成功。S319: The regional rule matching module 203b determines that the regional sub-library rules are successfully matched.
在一些实施例中,区域规则匹配模块203b获取到数据后,确定区域分库规则匹配成功。In some embodiments, after obtaining the data, the regional rule matching module 203b determines that the regional sub-database rules are successfully matched.
例如,区域规则匹配模块203b获取到与生成城市医疗保险保单的相关数据后,确定区域分库规则匹配成功。For example, after obtaining relevant data for generating urban medical insurance policies, the regional rule matching module 203b determines that the regional sub-database rules are successfully matched.
可以理解,上述步骤S301至步骤S319的执行顺序只是一种示例,在另一些实施例中,也可以采用其他执行顺序,还可以拆分或合并部分步骤,在此不做限定。It can be understood that the execution order of the above steps S301 to S319 is just an example. In other embodiments, other execution orders can also be adopted, and some steps can also be split or combined, which is not limited here.
可以理解的,上述执行的保险业务处理生成保单之外,还可以为审核保险单据的业务、查询保险业务状态、在线理赔、退保等保险业务,具体处理的保险业务在此不做要求。It is understandable that in addition to generating insurance policies through the above-mentioned insurance business processing, it can also be used for insurance business such as reviewing insurance documents, querying insurance business status, online claims settlement, surrender, etc. The specific insurance business processed is not required here.
根据上述图1所示场景,图4示出了以服务器200b为执行主体,执行本申请实施例中多租户的数据分库方法的流程图。具体流程包括以下各个步骤:According to the scenario shown in Figure 1 above, Figure 4 shows a flow chart of using the server 200b as the execution subject to execute the multi-tenant data sharding method in the embodiment of the present application. The specific process includes the following steps:
S401:获取执行相关保险业务的请求。S401: Obtain a request to perform relevant insurance business.
在一些实施例中,用户终端100向服务器200a发送执行相关保险业务的请求;服务器200a在接收到用户终端100发送的请求之后,将请求数据进行加密,将加密后的请求 发送给服务器200b;服务器200b获取执行相关保险业务的请求。可以理解的,执行相关保险业务可以包括生成保险保单、计算保费、查询当前保险业务状态、审核保险单据的业务、退保以及在线理赔等。In some embodiments, the user terminal 100 sends a request to perform relevant insurance services to the server 200a; after receiving the request sent by the user terminal 100, the server 200a encrypts the request data and converts the encrypted request Sent to the server 200b; the server 200b obtains the request to execute the relevant insurance business. It can be understood that executing relevant insurance business may include generating insurance policies, calculating premiums, querying the current insurance business status, reviewing insurance documents, surrendering insurance, and online claims settlement, etc.
例如,用户终端100向服务器200a发送生成城市医疗保险保单的请求;服务器200a在接收到用户通过用户终端100发送的请求之后,将请求数据进行加密,将加密后的请求发送给服务器200b;服务器200b获取执行生成城市医疗保险保单的请求。For example, the user terminal 100 sends a request to generate a city medical insurance policy to the server 200a; after receiving the request sent by the user through the user terminal 100, the server 200a encrypts the request data and sends the encrypted request to the server 200b; the server 200b Gets a request to execute a city health insurance policy.
可以理解的,在一些实现方式中,如图2A所示的装置图中,数据接收模块201获取服务器200a发送的执行相关保险业务的请求。数据转发模块202将请求中的数据进行过滤。It can be understood that in some implementations, as shown in the device diagram of FIG. 2A , the data receiving module 201 obtains a request for executing relevant insurance services sent by the server 200a. The data forwarding module 202 filters the data in the request.
S402:根据请求数据中的产品信息以及地理区域信息,判断是否与区域分库规则匹配成功。若判断结果为是,则进入步骤S404;若判断结果为否,则进入步骤S403。S402: Based on the product information and geographical area information in the request data, determine whether it successfully matches the regional sub-library rules. If the judgment result is yes, go to step S404; if the judgment result is no, go to step S403.
在一些实施例中,服务器200b获取执行相关保险业务的请求后,获取请求数据中的产品信息以及地理区域信息数据,根据保险产品信息以及具体地理区域信息在数据库300中匹配,是否存在包含了该具体位置区域所对应的产品区域库,若存在对应的产品区域库,则在相应的产品区域库中搜索到产品配置规则,并且根据产品配置规则获取执行生成保单所需的数据,确定与区域分库规则匹配成功,进入步骤S404;若不存在该具体位置区域所对应的区域库,则确定与区域分库规则匹配失败,进入步骤S403。In some embodiments, after the server 200b obtains the request to execute the relevant insurance business, it obtains the product information and geographical area information data in the request data, and matches the insurance product information and specific geographical area information in the database 300 to determine whether it contains the The product area library corresponding to the specific location area. If there is a corresponding product area library, the product configuration rules are searched in the corresponding product area library, and the data required to execute the policy generation is obtained according to the product configuration rules, and the regional classification is determined. If the library rule is successfully matched, step S404 is entered; if there is no regional library corresponding to the specific location area, it is determined that the match with the regional sub-library rule fails, and step S403 is entered.
例如,服务器200b获取执行生成城市医疗保险保单的请求后,获取请求数据中的城市医疗保险产品信息以及可投保城市信息数据,根据保险产品信息以及可投保城市在数据库300中查找,是否存在包含与产品以及可投保城市所对应的区域库,若存在对应的区域库,则在相应的区域库中搜索到城市医疗保险产品配置规则,并且根据城市医疗保险产品配置规则获取执行生成保单所需的数据,确定与区域分库规则匹配成功;若不存在与产品以及可投保城市所对应的区域库,则确定与区域分库规则匹配失败。For example, after the server 200b obtains and executes a request to generate a city medical insurance policy, it obtains the city medical insurance product information and insurable city information data in the request data, and searches in the database 300 based on the insurance product information and insurable cities to see whether there is a The product and the regional library corresponding to the insurable city. If the corresponding regional library exists, the urban medical insurance product configuration rules are searched in the corresponding regional library, and the data required to execute and generate the policy are obtained according to the urban medical insurance product configuration rules. , it is determined that the matching with the regional sub-library rules is successful; if there is no regional database corresponding to the product and insurable city, it is determined that the matching with the regional sub-library rules fails.
可以理解的,在一些实现方式中,如图2A和2B所示的模块图中,数据转发模块202将获取的请求数据进行过滤,发送给拦截匹配模块203,拦截匹配模块203中的区域规则匹配模块203b根据请求数据中的产品信息以及地理区域信息,判断与区域分库规则匹配是否成功。若判断结果为是,则进入步骤S404;若判断结果为否,则进入步骤S403。It can be understood that in some implementations, as shown in the module diagrams of Figures 2A and 2B, the data forwarding module 202 filters the obtained request data and sends it to the interception matching module 203, and the regional rules in the interception matching module 203 match. Module 203b determines whether the match with the regional sub-database rules is successful based on the product information and geographical area information in the request data. If the judgment result is yes, go to step S404; if the judgment result is no, go to step S403.
S403:根据请求数据中的租户信息与租户分库规则进行匹配。S403: Match the tenant information in the request data with the tenant sharding rules.
在一些实施例中,服务器200b根据请求数据中的产品信息以及地理区域信息,判断与区域分库规则匹配失败后,根据请求数据中的租户信息与租户分库规则进行匹配,即根据请求数据中的租户信息在各租户库中进行搜索匹配,获得执行相关保险业务所需的数据。In some embodiments, the server 200b determines that the match with the regional sharding rules fails based on the product information and geographical area information in the request data, and then matches the tenant sharding rules based on the tenant information in the request data, that is, based on the tenant information in the request data, the server 200b The tenant information is searched and matched in each tenant database to obtain the data required to perform relevant insurance business.
例如,服务器200b根据请求数据中的城市医疗保险产品信息以及可投保城市,判断与区域分库规则匹配失败后,根据请求数据中的医疗保险租户信息与租户分库规则进行匹配,即根据请求数据中的租户信息在各租户库中进行匹配搜索,获得执行城市医疗保险保单所需的数据以及执行业务的逻辑数据。For example, based on the city medical insurance product information and insurable cities in the request data, the server 200b determines that the match with the regional sub-database rules fails, and then matches the tenant sub-database rules based on the medical insurance tenant information in the request data, that is, based on the request data The tenant information in each tenant database is matched and searched to obtain the data required to execute the city's medical insurance policy and the logical data for executing the business.
可以理解的,在一些实现方式中,如图2B所示的结构图中,拦截匹配模块203中的组织架构拦截模块203c获取请求数据中的租户信息,租户规则匹配模块203b根据租户信息,与租户分库规则匹配。 It can be understood that in some implementations, as shown in the structure diagram of Figure 2B, the organizational structure interception module 203c in the interception matching module 203 obtains the tenant information in the request data, and the tenant rule matching module 203b matches the tenant based on the tenant information. The sharding rules match.
S404:基于匹配成功的分库规则,执行保险业务逻辑。S404: Execute the insurance business logic based on the successfully matched sub-database rules.
在一些实施例中,若匹配成功的分库规则为区域分库规则,则根据区域分库规则获得的执行保险业务所需的数据,执行保险业务逻辑;若匹配成功的分库规则为租户分库规则,则根据租户分库规则获得的执行保险业务所需的数据,执行保险业务逻辑。其中,执行保险业务所需的数据,包括,保单上的基本要素内容数据、执行生成保单、执行查询保险业务状态或者执行审核保险单据的逻辑数据中的至少一种数据。In some embodiments, if the successfully matched sub-database rule is a regional sub-database rule, the insurance business logic is executed based on the data required to execute the insurance business obtained by the regional sub-database rule; if the successfully matched sub-database rule is a tenant sub-database rule, According to the database rules, the insurance business logic is executed based on the data required to execute the insurance business obtained from the tenant sub-database rules. Among them, the data required to execute the insurance business includes at least one of the basic element content data on the policy, logical data for generating the policy, querying the status of the insurance business, or executing the review of the insurance document.
例如,若匹配成功的分库规则为区域分库规则,则根据区域分库规则获得的生成城市医疗保险保单所需的数据,执行生成保单的业务逻辑;若匹配成功的分库规则为租户分库规则,则根据租户分库规则获得的生成城市医疗保险保单所需的数据,执行生成保单的业务逻辑。For example, if the successfully matched sharding rule is a regional sharding rule, the business logic for generating a policy will be executed based on the data required to generate a city medical insurance policy obtained from the regional sharding rule; if the successfully matched sharding rule is a tenant sharding rule, Database rules, then execute the business logic of generating the policy based on the data required to generate urban medical insurance policies obtained from the tenant sub-database rules.
可以理解的,在一些实现方式中,如图2A所示的结构图中,执行业务逻辑模块204执行保险业务逻辑。It can be understood that in some implementations, as shown in the structure diagram of FIG. 2A , the execution business logic module 204 executes insurance business logic.
可以理解,上述步骤S401至步骤S404的执行顺序只是一种示例,在另一些实施例中,也可以采用其他执行顺序,还可以拆分或合并部分步骤,在此不做限定。It can be understood that the execution order of the above-mentioned steps S401 to S404 is just an example. In other embodiments, other execution orders can also be adopted, and some steps can also be split or combined, which is not limited here.
为便于理解本申请各实施的技术方案,下面对服务器200b的硬件结构进行介绍。In order to facilitate understanding of the technical solutions implemented in this application, the hardware structure of the server 200b is introduced below.
进一步,图5根据本申请的一些实施例,示出了一种服务器200b的结构示意图。如图5所示,用于执行本申请提供的如图4所示的多租户的数据分库方法的服务器200b可以包括一个或多个处理器201、系统内存202、非易失性存储器(Non-Volatile Memory,NVM)203、输入/输出(I/O)设备204、通信接口205以及用于耦接处理器201、系统内存202、非易失性存储器203、通信接口204和输入/输出(I/O)设备205的系统控制逻辑206。Further, FIG. 5 shows a schematic structural diagram of a server 200b according to some embodiments of the present application. As shown in Figure 5, the server 200b used to execute the multi-tenant data sharding method shown in Figure 4 provided by this application may include one or more processors 201, system memory 202, non-volatile memory (Non -Volatile Memory (NVM) 203, input/output (I/O) device 204, communication interface 205 and for coupling the processor 201, system memory 202, non-volatile memory 203, communication interface 204 and input/output ( System control logic 206 for I/O device 205.
其中:处理器201可以包括一个或多个单核或多核处理器。在一些实施例中,处理器201可以包括通用处理器和专用处理器(例如,图形处理器,应用处理器,基带处理器等)的任意组合。在一些实施例中,处理器201可以用于执行根据请求数据中的产品信息以及地理区域信息与区域分库规则匹配,若匹配失败后,再根据请求数据中的租户信息与租户分库规则匹配,通过分库规则匹配的结果执行保险业务逻辑。Wherein: the processor 201 may include one or more single-core or multi-core processors. In some embodiments, processor 201 may include any combination of general-purpose processors and special-purpose processors (eg, graphics processors, applications processors, baseband processors, etc.). In some embodiments, the processor 201 can be configured to match the regional sharding rules based on the product information and geographical area information in the request data. If the matching fails, match the tenant sharding rules based on the tenant information in the request data. , execute the insurance business logic based on the matching results of the sub-library rules.
系统内存202是易失性存储器,例如随机存取存储器(Random-Access Memory,RAM),双倍数据率同步动态随机存取存储器(Double Data Rate Synchronous Dynamic Random Access Memory,DDR SDRAM)等。系统内存用于临时存储数据和/或指令,例如,在一些实施例中,系统内存202可以用于存储上述用于实现多租户的数据分库方法的可执行程序。The system memory 202 is a volatile memory, such as random access memory (Random-Access Memory, RAM), double data rate synchronous dynamic random access memory (Double Data Rate Synchronous Dynamic Random Access Memory, DDR SDRAM), etc. The system memory is used to temporarily store data and/or instructions. For example, in some embodiments, the system memory 202 can be used to store the above-mentioned executable program for implementing the multi-tenant data sharding method.
非易失性存储器203可以包括用于存储数据和/或指令的一个或多个有形的、非暂时性的计算机可读介质。在一些实施例中,非易失性存储器203可以包括闪存等任意合适的非易失性存储器和/或任意合适的非易失性存储设备,例如硬盘驱动器(Hard Disk Drive,HDD)、光盘(Compact Disc,CD)、数字通用光盘(Digital Versatile Disc,DVD)、固态硬盘(Solid-State Drive,SSD)等。在一些实施例中,非易失性存储器203也可以是可移动存储介质,例如安全数字(Secure Digital,SD)存储卡等。Non-volatile memory 203 may include one or more tangible, non-transitory computer-readable media for storing data and/or instructions. In some embodiments, the non-volatile memory 203 may include any suitable non-volatile memory such as flash memory and/or any suitable non-volatile storage device, such as a hard disk drive (Hard Disk Drive, HDD), optical disk ( Compact Disc (CD), Digital Versatile Disc (DVD), Solid-State Drive (SSD), etc. In some embodiments, the non-volatile memory 203 may also be a removable storage medium, such as a Secure Digital (Secure Digital, SD) memory card, etc.
特别地,系统内存202和非易失性存储器203可以分别包括:指令207的临时副本和永久副本。指令207可以包括:由处理器201中的至少一个执行时使服务器200实现本申 请各实施例提供的多租户的数据分库方法的程序指令。In particular, system memory 202 and non-volatile memory 203 may include temporary and permanent copies of instructions 207, respectively. Instructions 207 may include, when executed by at least one of the processors 201, causing the server 200 to implement the present application. Please provide program instructions for the multi-tenant data sharding method in each embodiment.
输入/输出(I/O)设备204可以包括用户界面,使得用户能够与服务器200b进行交互。例如,在一些实施例中,输入/输出(I/O)设备204可以包括显示器等输出设备,用于显示服务器200b中使用到的软件系统,还可以包括键盘、鼠标、触摸屏等输入设备。服务器200b的维护人员可以通过用户界面以及键盘、鼠标、触摸屏等输入设备与服务器200b进行交互。Input/output (I/O) device 204 may include a user interface that enables a user to interact with server 200b. For example, in some embodiments, the input/output (I/O) device 204 may include an output device such as a display for displaying the software system used in the server 200b, and may also include an input device such as a keyboard, mouse, and touch screen. The maintenance personnel of the server 200b can interact with the server 200b through the user interface and input devices such as keyboard, mouse, and touch screen.
通信接口205可以包括收发器,用于为服务器200b提供有线或无线通信接口,进而通过一个或多个网络与任意其他合适的设备进行通信。在一些实施例中,通信接口205可以集成于服务器200b的其他组件,例如通信接口205可以集成于处理器201中。在一些实施例中,服务器200b可以通过通信接口205和其他设备通信。Communication interface 205 may include a transceiver for providing a wired or wireless communication interface for server 200b to communicate with any other suitable device over one or more networks. In some embodiments, the communication interface 205 can be integrated with other components of the server 200b. For example, the communication interface 205 can be integrated with the processor 201. In some embodiments, server 200b may communicate with other devices through communication interface 205.
系统控制逻辑206可以包括任意合适的接口控制器,以服务器200b的其他模块提供任意合适的接口。例如在一些实施例中,系统控制逻辑206可以包括一个或多个存储器控制器,以提供连接到系统内存202和非易失性存储器203的接口。System control logic 206 may include any suitable interface controller to provide any suitable interface to other modules of server 200b. For example, in some embodiments, system control logic 206 may include one or more memory controllers to provide an interface to system memory 202 and non-volatile memory 203 .
在一些实施例中,处理器201中的至少一个可以与用于系统控制逻辑206的一个或多个控制器的逻辑封装在一起,以形成系统封装(System in Package,SiP)。在另一些实施例中,处理器201中的至少一个还可以与用于系统控制逻辑206的一个或多个控制器的逻辑集成在同一芯片上,以形成片上系统(System-on-Chip,SoC)。In some embodiments, at least one of the processors 201 may be packaged with logic for one or more controllers of the system control logic 206 to form a system in package (SiP). In other embodiments, at least one of the processors 201 may also be integrated on the same chip with the logic of one or more controllers for the system control logic 206 to form a system-on-chip (SoC). ).
可以理解,服务器200b可以是能够执行本申请提供的多租户的数据分库方法的任意一种电子设备,包括但不限于计算机、服务器、平板电脑、手持计算机等,本申请实施例不做限定。It can be understood that the server 200b can be any electronic device capable of executing the multi-tenant data sharding method provided by this application, including but not limited to computers, servers, tablets, handheld computers, etc., which are not limited in the embodiments of this application.
可以理解,本申请实施例示出的服务器200b的结构并不构成对服务器200b的具体限定。在本申请另一些实施例中,服务器200b可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structure of the server 200b shown in the embodiment of this application does not constitute a specific limitation on the server 200b. In other embodiments of the present application, the server 200b may include more or less components than shown in the figures, or some components may be combined, or some components may be separated, or may be arranged differently. The components illustrated may be implemented in hardware, software, or a combination of software and hardware.
本申请公开的机制的各实施例可以被实现在硬件、软件、固件或这些实现方法的组合中。本申请的实施例可实现为在可编程系统上执行的计算机程序或程序代码,该可编程系统包括至少一个处理器、存储系统(包括易失性和非易失性存储器和/或存储元件)、至少一个输入设备以及至少一个输出设备。Various embodiments of the mechanisms disclosed in this application may be implemented in hardware, software, firmware, or a combination of these implementation methods. Embodiments of the present application may be implemented as a computer program or program code executing on a programmable system including at least one processor, a storage system (including volatile and non-volatile memory and/or storage elements) , at least one input device and at least one output device.
可将程序代码应用于输入指令,以执行本申请描述的各功能并生成输出信息。可以按已知方式将输出信息应用于一个或多个输出设备。为了本申请的目的,处理系统包括具有诸如例如数字信号处理器(Digital Signal Processor,DSP)、微控制器、专用集成电路(Application Specific Integrated Circuit,ASIC)或微处理器之类的处理器的任何系统。Program code may be applied to input instructions to perform the functions described herein and to generate output information. Output information can be applied to one or more output devices in a known manner. For the purposes of this application, a processing system includes any processor having a processor such as, for example, a Digital Signal Processor (DSP), a microcontroller, an Application Specific Integrated Circuit (ASIC), or a microprocessor. system.
程序代码可以用高级程序化语言或面向对象的编程语言来实现,以便与处理系统通信。在需要时,也可用汇编语言或机器语言来实现程序代码。事实上,本申请中描述的机制不限于任何特定编程语言的范围。在任一情形下,该语言可以是编译语言或解释语言。Program code may be implemented in a high-level procedural language or an object-oriented programming language to communicate with the processing system. When necessary, assembly language or machine language can also be used to implement program code. In fact, the mechanisms described in this application are not limited to the scope of any particular programming language. In either case, the language may be a compiled or interpreted language.
在一些情况下,所公开的实施例可以以硬件、固件、软件或其任何组合来实现。所公开的实施例还可以被实现为由一个或多个暂时或非暂时性机器可读(例如,计算机可读)存储介质承载或存储在其上的指令,其可以由一个或多个处理器读取和执行。例如, 指令可以通过网络或通过其他计算机可读介质分发。因此,机器可读介质可以包括用于以机器(例如,计算机)可读的形式存储或传输信息的任何机制,包括但不限于,软盘、光盘、光碟、只读存储器(CD-ROMs)、磁光盘、只读存储器(Read Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、可擦除可编程只读存储器(Erasable Programmable Read Only Memory,EPROM)、电可擦除可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、磁卡或光卡、闪存、或用于利用因特网以电、光、声或其他形式的传播信号来传输信息(例如,载波、红外信号数字信号等)的有形的机器可读存储器。因此,机器可读介质包括适合于以机器(例如计算机)可读的形式存储或传输电子指令或信息的任何类型的机器可读介质。In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried on or stored on one or more transitory or non-transitory machine-readable (e.g., computer-readable) storage media, which may be operated by one or more processors Read and execute. For example, Instructions may be distributed over a network or through other computer-readable media. Thus, machine-readable media may include any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer), including, but not limited to, floppy disks, optical disks, optical disks, read-only memories (CD-ROMs), magnetic Optical disc, Read Only Memory (ROM), Random Access Memory (RAM), Erasable Programmable Read Only Memory (EPROM), Electrically Erasable Programmable Memory Read memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), magnetic or optical card, flash memory, or used to use the Internet to transmit information through electrical, optical, acoustic or other forms of propagation signals (for example, carrier waves, infrared signals, digital signals etc.) tangible machine-readable storage. Thus, machine-readable media includes any type of machine-readable media suitable for storing or transmitting electronic instructions or information in a form readable by a machine (eg, computer).
在附图中,可以以特定布置和/或顺序示出一些结构或方法特征。然而,应该理解,可能不需要这样的特定布置和/或排序。而是,在一些实施例中,这些特征可以以不同于说明性附图中所示的方式和/或顺序来布置。另外,在特定图中包括结构或方法特征并不意味着暗示在所有实施例中都需要这样的特征,并且在一些实施例中,可以不包括这些特征或者可以与其他特征组合。In the drawings, some structural or methodological features may be shown in specific arrangements and/or orders. However, it should be understood that such specific arrangement and/or ordering may not be required. Rather, in some embodiments, the features may be arranged in a different manner and/or order than shown in the illustrative figures. Additionally, the inclusion of structural or methodological features in a particular figure is not meant to imply that such features are required in all embodiments, and in some embodiments these features may not be included or may be combined with other features.
需要说明的是,本申请各设备实施例中提到的各单元/模块都是逻辑单元/模块,在物理上,一个逻辑单元/模块可以是一个物理单元/模块,也可以是一个物理单元/模块的一部分,还可以以多个物理单元/模块的组合实现,这些逻辑单元/模块本身的物理实现方式并不是最重要的,这些逻辑单元/模块所实现的功能的组合才是解决本申请所提出的技术问题的关键。此外,为了突出本申请的创新部分,本申请上述各设备实施例并没有将与解决本申请所提出的技术问题关系不太密切的单元/模块引入,这并不表明上述设备实施例并不存在其它的单元/模块。It should be noted that each unit/module mentioned in each device embodiment of this application is a logical unit/module. Physically, a logical unit/module can be a physical unit/module, or it can be a physical unit/module. Part of the module can also be implemented as a combination of multiple physical units/modules. The physical implementation of these logical units/modules is not the most important. The combination of functions implemented by these logical units/modules is what solves the problem of this application. Key technical issues raised. In addition, in order to highlight the innovative part of this application, the above-mentioned equipment embodiments of this application do not introduce units/modules that are not closely related to solving the technical problems raised by this application. This does not mean that the above-mentioned equipment embodiments do not exist. Other units/modules.
需要说明的是,在本专利的示例和说明书中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that in the examples and descriptions of this patent, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply There is no such actual relationship or sequence between these entities or operations. Furthermore, the terms "comprises," "comprises," or any other variations thereof are intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus that includes a list of elements includes not only those elements, but also those not expressly listed other elements, or elements inherent to the process, method, article or equipment. Without further limitation, an element defined by the statement "comprises a" does not exclude the presence of additional identical elements in a process, method, article, or device that includes the stated element.
虽然通过参照本申请的某些优选实施例,已经对本申请进行了图示和描述,但本领域的普通技术人员应该明白,可以在形式上和细节上对其作各种改变,而不偏离本申请的精神和范围。 Although the present application has been illustrated and described with reference to certain preferred embodiments thereof, it will be understood by those of ordinary skill in the art that various changes may be made in form and detail without departing from the present invention. The spirit and scope of the application.

Claims (15)

  1. 一种多租户的数据分库方法,用于包括服务器和作为数据库的存储设备的系统,其中,所述服务器中配置有拦截匹配模块,所述拦截匹配模块包括数据拦截模块、区域规则匹配模块、组织架构拦截模块、租户规则匹配模块,其特征在于,所述方法包括:A multi-tenant data sharding method for a system including a server and a storage device as a database, wherein the server is configured with an interception matching module, and the interception matching module includes a data interception module, a regional rule matching module, The organizational structure interception module and the tenant rule matching module are characterized in that the method includes:
    所述数据拦截模块获取执行保险业务的请求;The data interception module obtains a request to execute insurance business;
    所述区域规则匹配模块基于所述数据拦截模块传递的所述请求中的产品信息以及地理区域信息,将所述请求与所述数据库中的产品管理库的区域库信息匹配,其中,产品对应所述数据库中的多个产品区域库,所述产品区域库包括与保险业务实施者对应的产品配置规则;The regional rule matching module matches the request with the regional library information of the product management library in the database based on the product information and geographical area information in the request passed by the data interception module, where the product corresponds to the A plurality of product area libraries in the database, the product area library includes product configuration rules corresponding to insurance business implementers;
    在匹配到所述区域库信息的情况下,所述区域规则匹配模块在所述产品区域库中获取所述产品配置规则,并且根据所述产品配置规则获取执行保险业务所需的数据;In the case of matching the regional library information, the regional rule matching module obtains the product configuration rules in the product regional library, and obtains the data required to execute the insurance business according to the product configuration rules;
    在未匹配到所述区域库信息的情况下,所述组织架构拦截模块获取所述请求中的租户信息;并且所述租户规则匹配模块,基于所述组织架构拦截模块传递的所述租户信息在所述数据库中的租户库中获取执行保险业务所需的数据。If the regional library information is not matched, the organizational structure interception module obtains the tenant information in the request; and the tenant rule matching module, based on the tenant information passed by the organizational structure interception module, The data required for executing insurance business is obtained from the tenant library in the database.
  2. 根据权利要求1所述的方法,其特征在于,所述数据库中的产品管理库可以为轻量目录访问协议,其中,所述轻量目录访问协议包括与所述数据库中的产品区域库对应的产品信息、地理区域信息以及各产品区域库的名称、代号或者路径地址。The method according to claim 1, characterized in that the product management library in the database can be a lightweight directory access protocol, wherein the lightweight directory access protocol includes a product management library corresponding to the product area library in the database. Product information, geographical area information, and the name, code or path address of each product area library.
  3. 根据权利要求2所述的方法,其特征在于,其中,将所述请求与所述数据库中的产品管理库的区域库信息匹配,包括,The method according to claim 2, wherein matching the request with regional library information of the product management library in the database includes:
    基于所述产品信息以及所述地理区域信息在产品管理库中搜索,是否找到与所述产品信息以及地理区域信息对应的具体产品区域库名称、代号或者路径地址。Search the product management library based on the product information and the geographical area information to determine whether the specific product area library name, code or path address corresponding to the product information and geographical area information is found.
  4. 根据权利要求1或3所述的方法,其特征在于,所述区域规则匹配模块在所述数据库中的产品区域库中获取所述产品配置规则,并且根据所述产品配置规则获取执行保险业务所需的数据,包括,The method according to claim 1 or 3, characterized in that the regional rule matching module obtains the product configuration rules from the product regional library in the database, and obtains the requirements for executing the insurance business according to the product configuration rules. The required data includes,
    所述区域规则匹配模块通过区域库连接字符串,在所述数据库中的产品区域库对应的具体区域库中获取所述产品配置规则,并且根据所述产品配置规则获取执行保险业务所需的数据。The regional rule matching module obtains the product configuration rules in the specific regional library corresponding to the product regional library in the database through the regional library connection string, and obtains the data required to execute the insurance business according to the product configuration rules. .
  5. 根据权利要求1所述的方法,其特征在于,所述产品区域库包括与保险业务实施者对应的产品配置规则为,The method according to claim 1, characterized in that the product area library includes product configuration rules corresponding to insurance business implementers:
    所述产品区域库包括一个所述保险业务实施者规定的产品配置规则或者多个所述保险业务实施者规定的多个产品配置规则。The product area library includes one product configuration rule specified by the insurance business implementer or multiple product configuration rules specified by multiple insurance business implementers.
  6. 根据权利要求1所述的方法,其特征在于,所述产品信息包括,产品名称或者产品代号。 The method of claim 1, wherein the product information includes product name or product code.
  7. 根据权利要求6所述的方法,其特征在于,所述地理区域信息包括,所述产品被划分的所属的行政区域或者根据自定义划分所属的自定义区域。The method according to claim 6, wherein the geographical area information includes an administrative area to which the product is divided or a custom area to which the product is divided according to a customization.
  8. 根据权利要求7所述的方法,其特征在于,所述区域库信息包括,产品区域库名称、代号或者路径地址。The method according to claim 7, characterized in that the regional library information includes product regional library name, code number or path address.
  9. 根据权利要求7或8所述的方法,其特征在于,所述执行保险业务所需的数据,包括,The method according to claim 7 or 8, characterized in that the data required for executing insurance business includes:
    保单上的基本要素内容数据、执行生成保单、执行查询保险业务状态或者执行审核保险单据的逻辑数据中的至少一种数据。At least one of the basic element content data on the policy, logical data for generating the policy, querying the status of the insurance business, or reviewing the insurance document.
  10. 根据权利要求1所述的方法,其特征在于,所述数据库,包括,The method according to claim 1, characterized in that the database includes:
    所述产品管理库,所述产品区域库和所述租户库。The product management library, the product area library and the tenant library.
  11. 一种多租户的数据分库装置,其特征在于,包括,A multi-tenant data sharding device, characterized by:
    数据接收模块,用于接收数据;Data receiving module, used to receive data;
    数据转发模块,用于转发数据;Data forwarding module, used to forward data;
    拦截匹配模块,用于拦截数据,并将拦截到的数据与区域分库规则或者租户分库规则进行匹配;The interception matching module is used to intercept data and match the intercepted data with regional sharding rules or tenant sharding rules;
    执行业务逻辑模块,用于执行业务逻辑;Execution business logic module, used to execute business logic;
    并且,所述拦截匹配模块,包括,And, the interception matching module includes,
    数据拦截模块,用于获取第一数据,其中,所述第一数据包括产品信息以及地理区域信息;A data interception module, used to obtain first data, where the first data includes product information and geographical area information;
    区域规则匹配模块,用于根据所述产品信息以及地理区域信息与区域分库规则匹配;A regional rule matching module, used to match regional sub-library rules based on the product information and geographical area information;
    组织架构拦截模块,用于获取第二数据,其中,所述第二数据包括租户信息;The organizational structure interception module is used to obtain second data, where the second data includes tenant information;
    租户规则匹配模块,用于根据所述租户信息与租户分库规则匹配。A tenant rule matching module is used to match tenant sharding rules based on the tenant information.
  12. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有指令,所述指令在电子设备上执行时使所述电子设备执行权利要求1-10中任一项所述的多租户的数据分库方法。A computer-readable storage medium, characterized in that instructions are stored on the computer-readable storage medium, and when the instructions are executed on an electronic device, the electronic device causes the electronic device to execute any one of claims 1-10. Multi-tenant data sharding method.
  13. 一种芯片装置,其特征在于,所述芯片装置包括:A chip device, characterized in that the chip device includes:
    通信接口,用于输入和/或输出信息;Communication interfaces for inputting and/or outputting information;
    处理器,用于执行计算机可执行程序,使得安装有所述芯片装置的电子设备执行如权利要求1-10中任一项所述的多租户的数据分库方法。A processor, configured to execute a computer executable program, so that the electronic device installed with the chip device executes the multi-tenant data sharding method according to any one of claims 1-10.
  14. 一种计算机程序产品,其特征在于,所述计算机程序产品包括指令,当所述指令被执行时实现如权利要求1-10中任一项所述的多租户的数据分库方法。 A computer program product, characterized in that the computer program product includes instructions, and when the instructions are executed, the multi-tenant data sharding method according to any one of claims 1-10 is implemented.
  15. 一种电子设备,其特征在于,包括:An electronic device, characterized by including:
    存储器,用于存储由电子设备的一个或多个处理器执行的指令,以及memory for storing instructions for execution by one or more processors of the electronic device, and
    处理器,当所述指令被所述电子设备的一个或多个处理器执行时,所述处理器用于执行所述存储器中存储的指令,以实现权利要求1-10中任一项所述的多租户的数据分库方法。 A processor, when the instructions are executed by one or more processors of the electronic device, the processor is configured to execute instructions stored in the memory to implement any one of claims 1-10 Multi-tenant data sharding method.
PCT/CN2023/095171 2022-06-07 2023-05-19 Multi-tenant data database allocation method, and program product and electronic device WO2023236756A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210637186.6 2022-06-07
CN202210637186.6A CN115080537B (en) 2022-06-07 2022-06-07 Multi-tenant database separation method and device, storage medium, chip device and electronic equipment

Publications (1)

Publication Number Publication Date
WO2023236756A1 true WO2023236756A1 (en) 2023-12-14

Family

ID=83252286

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/095171 WO2023236756A1 (en) 2022-06-07 2023-05-19 Multi-tenant data database allocation method, and program product and electronic device

Country Status (2)

Country Link
CN (1) CN115080537B (en)
WO (1) WO2023236756A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115080537B (en) * 2022-06-07 2023-11-10 易保网络技术(上海)有限公司 Multi-tenant database separation method and device, storage medium, chip device and electronic equipment
CN116401231B (en) * 2023-03-20 2024-04-26 一临云(深圳)科技有限公司 Data source management method, device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180176176A1 (en) * 2016-12-21 2018-06-21 International Business Machines Corporation Dns resolution of overlapping domains in a mutli-tenant computing environment
CN112367408A (en) * 2021-01-13 2021-02-12 树根互联技术有限公司 Management system and method for multi-tenant data of Internet of things
CN112860451A (en) * 2021-01-21 2021-05-28 中国建设银行股份有限公司 Multi-tenant data processing method and device based on SaaS
CN112905708A (en) * 2021-03-31 2021-06-04 浙江太美医疗科技股份有限公司 Database operation method and system based on software as a service (SaaS) system
CN115080537A (en) * 2022-06-07 2022-09-20 易保网络技术(上海)有限公司 Multi-tenant data partitioning method, program product and electronic device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8423524B1 (en) * 2008-09-12 2013-04-16 Salesforce.Com, Inc. System, method and computer program product for storing reports for use by tenants of a multi-tenant on-demand database service
US11222035B2 (en) * 2020-03-03 2022-01-11 Sap Se Centralized multi-tenancy as a service in cloud-based computing environment
CN113239047A (en) * 2021-05-24 2021-08-10 中国建设银行股份有限公司 Database allocation method, service processing method, device and equipment
CN114547043A (en) * 2022-02-28 2022-05-27 山东浪潮通软信息科技有限公司 Method and device for database and table division of application system in multi-tenant scene

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180176176A1 (en) * 2016-12-21 2018-06-21 International Business Machines Corporation Dns resolution of overlapping domains in a mutli-tenant computing environment
CN112367408A (en) * 2021-01-13 2021-02-12 树根互联技术有限公司 Management system and method for multi-tenant data of Internet of things
CN112860451A (en) * 2021-01-21 2021-05-28 中国建设银行股份有限公司 Multi-tenant data processing method and device based on SaaS
CN112905708A (en) * 2021-03-31 2021-06-04 浙江太美医疗科技股份有限公司 Database operation method and system based on software as a service (SaaS) system
CN115080537A (en) * 2022-06-07 2022-09-20 易保网络技术(上海)有限公司 Multi-tenant data partitioning method, program product and electronic device

Also Published As

Publication number Publication date
CN115080537B (en) 2023-11-10
CN115080537A (en) 2022-09-20

Similar Documents

Publication Publication Date Title
US20240045877A1 (en) Facilitating queries of encrypted sensitive data via encrypted variant data objects
WO2023236756A1 (en) Multi-tenant data database allocation method, and program product and electronic device
CN107209787B (en) Improving searching ability of special encrypted data
US11328083B2 (en) Facilitating entity resolution via secure entity resolution database
US11308031B2 (en) Resolving in-memory foreign keys in transmitted data packets from single-parent hierarchies
US20110307486A1 (en) Managing Sensitive Data in Cloud Computing Environments
CN102236701A (en) Dependency graphs for multiple domains
CN113094334B (en) Digital service method, device, equipment and storage medium based on distributed storage
US11394764B2 (en) System and method for anonymously transmitting data in a network
US11388148B2 (en) System and method of anonymous sending of data from a user device to a recipient device
US11397833B2 (en) System and method for anonymously collecting malware related data from client devices
US9002870B2 (en) System, method and computer program product for EDI-to-EDI translations
EP3716124B1 (en) System and method of transmitting confidential data
JP7351685B2 (en) Information linkage system, information linkage method, and access control server
CN116472694A (en) System and method for generating, protecting and maintaining digital tokens of emoticon sequence
US11151110B2 (en) Identification of records for post-cloning tenant identifier translation
CN115022242B (en) Network layer identification method and device, computer equipment and storage medium
JP7399838B2 (en) Information processing method, information processing system and computer program
CN113194127B (en) Data storage method, data transmission method and computing equipment
EP3872668A1 (en) System and method of anonymous sending of data from a user device to a recipient device
EP3757845A1 (en) Systems and methods for anonymous and consistent data routing in a client-server architecture
CN115705435A (en) Data processing method, device, equipment and medium for cloud service

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23818921

Country of ref document: EP

Kind code of ref document: A1