CN114138781A - Policy data updating method and device, computer equipment and readable storage medium - Google Patents

Policy data updating method and device, computer equipment and readable storage medium Download PDF

Info

Publication number
CN114138781A
CN114138781A CN202111439180.XA CN202111439180A CN114138781A CN 114138781 A CN114138781 A CN 114138781A CN 202111439180 A CN202111439180 A CN 202111439180A CN 114138781 A CN114138781 A CN 114138781A
Authority
CN
China
Prior art keywords
policy
partition
hash
transaction number
policy data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111439180.XA
Other languages
Chinese (zh)
Inventor
刁秀晖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN202111439180.XA priority Critical patent/CN114138781A/en
Publication of CN114138781A publication Critical patent/CN114138781A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • 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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24553Query execution of query operations
    • G06F16/24554Unary operations; Data partitioning operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/08Insurance

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Finance (AREA)
  • Software Systems (AREA)
  • Accounting & Taxation (AREA)
  • Computational Linguistics (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a policy data updating method, which is applied to the technical field of data processing and is used for solving the technical problem that in the prior art, most policy data are inquired and updated only by taking a transaction number as an inquiry condition, so that a system is crashed in a service peak period, and the method provided by the invention comprises the following steps: inquiring in a preset Hash partition main table through the transaction number to obtain a corresponding Hash partition sub table; inquiring the policy updating time corresponding to the transaction number according to the Hash partition sub-table; and updating the policy data in the preset policy partition main table through the transaction number and the policy updating time. By the method, the problem of scanning all the partition tables of the policy under the condition of query or update is avoided, and meanwhile, the database server does not need to put a large amount of operation resources into the query operation process of the non-target partition sub-table, so that the problem of overhigh CPU utilization rate caused by scanning all the partition tables of the policy is avoided. Meanwhile, the invention also relates to a block chain technology.

Description

Policy data updating method and device, computer equipment and readable storage medium
Technical Field
The invention relates to the technical field of data processing, in particular to a policy data updating method, a policy data updating device, computer equipment and a readable storage medium.
Background
Insurance, one kind is that the applicant pays insurance premium to the insurer according to the contract agreement, the insurer undertakes the responsibility for compensating insurance fund for the property loss caused by the accident that may happen due to the contract agreement, or undertakes the business insurance action for paying insurance fund when the insured disease or the condition of the contract agreement age, time limit, etc. is reached.
In the daily use process of the existing insurance system, the policy data needs to be updated and checked frequently, so how to ensure the updating and query speed of huge amount of policy data is very important.
Most of the prior art only uses the transaction number as a query condition to query and update policy data, however, in the above query process, the database scans all partition tables stored therein every time policy data is updated, and in the process of scanning all partition tables, a large amount of computing resources of the database are consumed, so that the load degree of the processor is greatly increased, the system is crashed in a business peak period, and the use experience of a user is reduced.
Disclosure of Invention
Embodiments of the present invention provide a policy data updating method, apparatus, computer device, and readable storage medium, so as to solve the technical problem in the prior art that most policy data is queried and updated only by using a transaction number as a query condition, so that a system may crash during a business peak.
In order to achieve the above object, the present invention provides a policy data updating method, including:
inquiring in a preset Hash partition main table through the transaction number to obtain a corresponding Hash partition sub table;
inquiring the policy updating time corresponding to the transaction number according to the Hash partition sub-table;
and inquiring a corresponding policy partition sub-table in a preset policy partition main table according to the policy updating time, and replacing the policy data corresponding to the policy updating time with the initial policy data in the policy partition sub-table to complete the updating of the policy data.
In one embodiment, before the step of querying the preset hash partition main table by the transaction number to obtain the corresponding hash partition sub-table, the method includes:
taking the transaction number corresponding to each policy as a partition field of the hash partition main table, wherein the transaction number has uniqueness;
partitioning the main hash partition table according to the partition fields by means of a preset hash partition function to obtain a plurality of sub hash partition tables.
In one embodiment, the step of querying in the preset hash partition main table by the transaction number to obtain the corresponding hash partition sub-table includes:
preprocessing the transaction number through a preset function and generating a corresponding integer value;
and obtaining the number of the Hash partition sublist by the remainder of the integer value to the preset partition number so as to determine the target Hash partition sublist.
In one embodiment, the step of querying in the preset hash partition main table by the transaction number to obtain the corresponding hash partition sub-table includes:
and when the corresponding hash partition sub-table is not inquired in the hash partition main table through the transaction number, judging that the policy data corresponding to the current transaction number does not exist in the policy partition main table, and directly inserting the policy data corresponding to the current transaction number into the policy partition main table.
In one embodiment, after the step of querying a corresponding policy partition sub-table in a preset policy partition main table according to the policy update time and replacing the initial policy data with the policy data corresponding to the policy update time in the policy partition sub-table to complete update of the policy data, the method further includes:
and calling a preset program to send the updated policy data to the mobile terminal of the user.
In one embodiment, the result of the policy data update method may be uploaded to a blockchain, so that the blockchain stores the result of the policy data update method in an encrypted manner.
In order to achieve the above object, the present invention further provides a policy data updating apparatus, including:
the acquisition module is used for inquiring in a preset Hash partition main table through a transaction number so as to acquire a corresponding Hash partition sub-table;
the inquiry module is used for inquiring the policy updating time corresponding to the transaction number according to the Hash partition sub-table;
and the updating module is used for inquiring the corresponding policy partition sub-table in a preset policy partition main table according to the policy updating time, and replacing the initial policy data with the policy data corresponding to the policy updating time in the policy partition sub-table so as to complete the updating of the policy data.
In the policy data updating apparatus, the policy data updating apparatus further includes a partitioning module, where the partitioning module is specifically configured to:
taking the transaction number corresponding to each policy as a partition field of the hash partition main table, wherein the transaction number has uniqueness;
partitioning the main hash partition table according to the partition fields by means of a preset hash partition function to obtain a plurality of sub hash partition tables.
In the policy data updating apparatus, the obtaining module is specifically configured to:
preprocessing the transaction number through a preset function and generating a corresponding integer value;
and obtaining the number of the Hash partition sublist by the remainder of the integer value to the preset partition number so as to determine the target Hash partition sublist.
In the policy data updating apparatus, the obtaining module is further specifically configured to:
and when the corresponding hash partition sub-table is not inquired in the hash partition main table through the transaction number, judging that the policy data corresponding to the current transaction number does not exist in the policy partition main table, and directly inserting the policy data corresponding to the current transaction number into the policy partition main table.
In the policy data updating apparatus, the updating module is specifically configured to:
inquiring a corresponding policy partition sub-table in the policy partition main table according to the policy updating time;
and replacing the policy data corresponding to the policy updating time with the initial policy data in the policy partition sub-table to complete the updating of the policy data.
A computer device comprising a memory, a processor and a computer program stored in said memory and executable on said processor, said processor implementing the steps of the policy data updating method described above when executing said computer program.
A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the policy data updating method described above.
The policy data updating method, the policy data updating device, the computer equipment and the readable storage medium provided by the invention have the advantages that the transaction number is firstly used for inquiring in the preset hash partition main table to obtain the hash partition sub table corresponding to the current transaction number, further, the policy updating time corresponding to the current transaction number is inquired according to the hash partition sub table, and finally, the policy data can be updated in the policy partition main table through the current transaction number and the correspondingly inquired policy updating time. By the method, the problem of scanning all the policy partition tables when the time condition of the policy partition table cannot be provided in the query or update condition is solved, and meanwhile, the database server does not need to put a large amount of operation resources into the query operation process of the non-target partition sub-table, so that the problem of overhigh CPU utilization rate caused by scanning all the policy partition tables is solved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.
FIG. 1 is a diagram illustrating an application environment of a policy data update method according to an embodiment of the present invention;
FIG. 2 is a flowchart of a policy data updating method according to an embodiment of the present invention;
FIG. 3 is a flowchart of a policy data updating method according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of an insurance policy data updating apparatus according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a computer device according to an embodiment of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
To facilitate an understanding of the invention, the invention will now be described more fully with reference to the accompanying drawings. Several embodiments of the invention are presented in the drawings. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
The policy data updating method provided by the application can be applied to the application environment as shown in fig. 1, wherein the computer device can communicate with the server through the network. The computer device includes, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices. The server may be implemented as a stand-alone server or as a server cluster consisting of a plurality of servers.
Most of the prior art only uses the transaction number as a query condition to query and update policy data, however, in the above query process, the database scans all partition tables stored therein every time policy data is updated, and in the process of scanning all partition tables, a large amount of computing resources of the database are consumed, so that the load degree of the processor is greatly increased, the system is crashed in a business peak period, and the use experience of a user is reduced.
In an embodiment, as shown in fig. 2, a policy data updating method is provided, which is described by taking the computer device in fig. 1 as an example, and includes the following steps S101 to S103.
S101: and inquiring in a preset Hash partition main table through the transaction number to obtain a corresponding Hash partition sub table.
Specifically, the policy data updating method provided in this embodiment is performed based on a database server, and the database adopted in this embodiment is PostgreSQL, specifically, PostgreSQL is an object-relational database management system (ordms) of free software with very complete characteristics, and is an object-relational database management system based on post tgres. Among them, many of the leading concepts of POSTGRES appear in commercial web site databases only relatively late. PostgreSQL is able to support most SQL standards and offers many other modern features such as complex queries, foreign keys, triggers, views, transaction integrity, multi-version concurrency control, etc. Likewise, PostgreSQL may also be extended in many ways, such as by adding new data types, functions, operators, aggregation functions, indexing methods, procedural languages, and the like. In addition, because of the flexibility of the license, PostgreSQL can be modified and distributed as needed and has a generic plug-in pg _ pathman built into it. Specifically, pg _ pathman is a PostgreSQL high performance table partitioning plugin. HASH partitions, RANGE partitions and automatic expansion partitions are supported, and the HASH partitions, the RANGE partitions and the automatic expansion partitions can be mounted, removed and partitioned through built-in functions.
Further, it should be noted that, in the field of security technologies, each policy corresponds to a transaction number, and the transaction number is a globally unique UUID, that is, each transaction number is an irregular string ID, and is not set repeatedly.
Therefore, in this step, a query is performed in a hash partition main table preset in the database according to a known transaction number, where a plurality of hash partition sub-tables are already set in the hash partition main table, so that a hash partition sub-table corresponding to one of the hash partition sub-tables can be obtained according to each transaction number. Specifically, Hash, i.e. Hash, is generally translated as a Hash, or transliteration to a Hash, which is to convert an input of arbitrary length (also called pre-mapped pre-image) into an output of fixed length by a Hash algorithm, where the output is a Hash value. This transformation is a kind of compression mapping, i.e. the space of hash values is usually much smaller than the space of inputs, different inputs may hash to the same output, so it is not possible to determine a unique input value from a hash value. In short, it is a function of compressing a message of an arbitrary length to a message digest of a certain fixed length.
In addition, the Hash algorithm can convert a data into a flag, which is closely related to each byte of the source data. The Hash algorithm also has a characteristic that it is difficult to find a reverse rule.
The Hash algorithm is a generalized algorithm and can also be considered as an idea, the utilization rate of a storage space can be improved by using the Hash algorithm, the query efficiency of data can be improved, and the safety of data transmission can be guaranteed by making a digital signature. The Hash algorithm is widely used in internet applications.
The Hash algorithm is also called a Hash algorithm, and although it is called an algorithm, it is actually more like an idea. The Hash algorithm does not have a fixed formula, and the algorithm conforming to the Hash idea can be called the Hash algorithm.
S102: and inquiring the policy updating time corresponding to the transaction number according to the Hash partition sub-table.
It should be noted that, the main fields of the hash partition main table provided in this embodiment are the transaction number and the policy update time, and therefore, the classification of the hash partition main table provided in this embodiment is based on the field of the transaction number, that is, the hash partition main table is divided into a plurality of hash partition sub-tables according to the field type of the transaction number, and each hash partition sub-table stores the policy update time corresponding to each transaction number. Preferably, the present embodiment divides the hash partition main table into 20 hash partition sub-tables.
Therefore, in this step, the database server can correspondingly query the policy update time corresponding to the current transaction number in the queried hash partition word table.
S103: and inquiring a corresponding policy partition sub-table in a preset policy partition main table according to the policy updating time, and replacing the policy data corresponding to the policy updating time with the initial policy data in the policy partition sub-table to complete the updating of the policy data.
Finally, it should be noted that, a plurality of policy partition sub-tables are also partitioned in the policy partition main table, and further, policy data corresponding to each known transaction number is stored in each policy partition sub-table, and the policy data changes as needed.
Therefore, in this step, after the policy update time corresponding to the known transaction number is obtained, in this embodiment, the corresponding policy partition sub-table is first queried and located in the policy partition main table according to the queried policy update time, and further, the policy data corresponding to the policy partition sub-table is updated in the policy partition sub-table located in the policy partition main table according to the known transaction number, so that the update of the policy data can be completed quickly, and scanning of all policy partition sub-tables is avoided.
It should be noted that the above implementation procedure is only for illustrating the applicability of the present application, but this does not represent that the policy data updating method of the present application has only the above implementation flow, and on the contrary, the policy data updating method of the present application can be incorporated into the feasible embodiments of the present application as long as the policy data updating method of the present application can be implemented.
In another embodiment, the policy data updating method includes at least steps S201-S205.
S201: taking the transaction number corresponding to each policy as a partition field of the hash partition main table, wherein the transaction number has uniqueness; partitioning the main hash partition table according to the partition fields by means of a preset hash partition function to obtain a plurality of sub hash partition tables.
In this embodiment, it should be noted that, in the process of each insurance transaction, a unique transaction number is generated and is known. In addition, in the present embodiment, the database is a "warehouse that organizes, stores, and manages data by data structure". Is an organized, sharable, uniformly managed collection of large amounts of data that is stored long term within a computer. A database is a repository where data is stored. The storage space is large, and millions, millions and hundreds of millions of data can be stored. However, the database does not store data randomly, and has certain rules, otherwise, the query efficiency is low. The world today is an internet world that is full of data, which is flooded with large amounts of data. I.e. the internet world is the data world. The sources of data are many, such as travel records, consumption records, web pages viewed, messages sent, and so forth. In addition to text type data, images, music, and sounds are data. A database is a computer software system that stores and manages data in a data structure. The concept of a database actually includes two layers of meaning: (1) the database is an entity, which is a "warehouse" capable of reasonably keeping data, in which a user stores transaction data to be managed, and the two concepts of "data" and "library" are combined into the database. (2) Databases are new methods and techniques for data management that enable more appropriate organization of data, more convenient maintenance of data, tighter control of data, and more efficient use of data.
Specifically, in this embodiment, a hash partition master table with a known transaction number as a partition field is first designed through a database server, and a policy partition master table is preset in the database server, preferably, the database server is PostgreSQL.
In this embodiment, the transaction numbers corresponding to the respective policies are used as the partition fields, i.e., the partition bases, of the hash partition main table, and it can be understood that each transaction number provided in this embodiment is unique, i.e., has uniqueness, and each transaction number is an irregular character string ID and cannot be set repeatedly.
In addition, a general plug-in pg _ pathman is built in the database server, and further, in this embodiment, the hash partitioning main table is partitioned according to the partition field through a hash partitioning function in the pg _ pathman. Preferably, the present embodiment divides the hash partition main table into 20 hash partition sub-tables.
S202: preprocessing the transaction number through a preset function and generating a corresponding integer value; and obtaining the number of the Hash partition sublist by the remainder of the integer value to the preset partition number so as to determine the target Hash partition sublist.
After the hash partition main table and the policy partition main table are set in the database server, the database server calls a hash _ code function inside the database server to preprocess a known transaction number and generate a corresponding integer value, and further, the known partition number is weighed and balanced by the integer value to obtain a required number of the hash partition sub table, so that a target hash partition sub table can be determined.
The hash code is a coding mode, each object in Java has a hash code, and Java can identify one object through the hash code. As for the specific encoding mode of hashcode, the encoding is complex (the encoding can be rewritten through inheritance and interface implementation). Structures such as hashtable realize fast key object lookup through the hash. This is an internal connection between the two.
Specifically, when the hash code function is used, a fixed number n of partition sub-tables (the number is unchanged after creation) are generally created in the database, and each partition sub-table corresponds to the numbers 1 to n. By embedding a hash _ code () function in data, an integer value can be obtained, and the remainder i can be obtained by dividing the integer value by n, wherein the remainder i is necessarily a certain value between 1 and n, so that the remainder i can be used for determining a target hash partition sublist.
In this embodiment, after the query of the hash partition sub-table is completed, the latest policy data is used to asynchronously update the information in the hash partition table (update the policy update time corresponding to the transaction number), and the logic of the location hash partition sub-table of the update data is consistent with the query.
S203: and when the corresponding hash partition sub-table is not inquired in the hash partition main table through the transaction number, judging that the policy data corresponding to the current transaction number does not exist in the policy partition main table, and directly inserting the policy data corresponding to the current transaction number into the policy partition main table.
Specifically, in this step, in the process of querying the hash partition sub-table corresponding to the current transaction number through the hash code function, if the database server does not query the corresponding hash partition sub-table in the hash partition main table, it indicates that the current transaction number is a brand new transaction number, and the policy data corresponding to the transaction number is also recorded in the policy partition main table.
Therefore, in this step, when the corresponding hash partition sub-table is not found in the hash partition main table, the policy data corresponding to the current transaction number is directly inserted into the policy partition main table to complete the current policy partition main table.
S204: and inquiring the policy updating time corresponding to the transaction number according to the Hash partition sub-table.
It should be noted that, the main fields of the hash partition main table provided in this embodiment are the transaction number and the policy update time, and therefore, the classification of the hash partition main table provided in this embodiment is based on the field of the transaction number, that is, the hash partition main table is divided into a plurality of hash partition sub-tables according to the field type of the transaction number, and each hash partition sub-table stores the policy update time corresponding to each transaction number. Preferably, the present embodiment divides the hash partition main table into 20 hash partition sub-tables.
Therefore, in this step, the database server can correspondingly query the policy update time corresponding to the current transaction number in the queried hash partition word table.
S205: and calling a preset program to send the updated policy data to the mobile terminal of the user.
Specifically, in this step, after acquiring the policy update time corresponding to the current transaction number through the above steps, the policy sub-table corresponding to the current transaction number can be queried in the policy sub-table through the policy update time, further, the policy data corresponding to the current transaction number can be updated in the policy sub-table, and finally, the database calls a preset program to send the updated policy data to the mobile terminal of the user, so that the user can observe the update result in real time.
Therefore, the embodiment can simply and quickly update the policy data corresponding to the current transaction number, and meanwhile, the problem of scanning all the partition tables of the policy when the time condition of the policy partition table cannot be provided in the query or update condition can be avoided, and meanwhile, the database server does not need to put a large amount of operation resources into the query operation process of the non-target partition sub-table, so that the problem of overhigh CPU utilization rate caused by scanning all the policy partition tables is avoided, and the wide popularization and use are facilitated.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
In summary, the policy data updating method provided by the application avoids the problem of scanning all the partition tables of the policy when the time condition of the policy partition table cannot be provided in the query or update condition. Therefore, the database server does not need to put a large amount of operation resources into the query operation process of the non-target partition sub-table, and the problem of overhigh CPU utilization rate caused by scanning all the policy partition tables is avoided. In the technical scheme, only one query on the Hash partition table is added in the process of updating and querying the policy partition table, so that excessive resource consumption can not be increased even in the service peak period, and the efficiency of the process of querying and updating policy data is ensured.
In an optional embodiment, the result of the policy data updating method may also be uploaded to the blockchain.
Specifically, the corresponding digest information is obtained based on the result of the policy data updating method, and specifically, the digest information is obtained by hashing the result of the policy data updating method, for example, using the sha256s algorithm. Uploading summary information to the blockchain can ensure the safety and the fair transparency of the user. The user may download the summary information from the blockchain to verify that the results of the policy data update method have been tampered with. The blockchain referred to in this example is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
In one embodiment, there is provided an insurance policy data updating apparatus 100, the insurance policy data updating apparatus 100 corresponds to the insurance policy data updating method in the above embodiment one to one, as shown in fig. 4, the insurance policy data updating apparatus 100 includes: an acquisition module 11, a query module 12, an update module 13, and a partition module 14. The detailed description of each functional module is as follows:
the acquisition module 11 is configured to query the preset hash partition main table through the transaction number to acquire a corresponding hash partition sub-table;
the query module 12 is configured to query the policy update time corresponding to the transaction number according to the hash partition sub-table;
and the updating module 13 is configured to query a corresponding policy partition sub-table in a preset policy partition main table according to the policy update time, and replace the initial policy data with the policy data corresponding to the policy update time in the policy partition sub-table to complete update of the policy data.
The above modules may be functional modules or program modules, and may be implemented by software or hardware. For a module implemented by hardware, the modules may be located in the same processor; or the modules can be respectively positioned in different processors in any combination.
In the policy data updating apparatus 100, the policy data updating apparatus 100 further includes a partitioning module 14, where the partitioning module 14 is specifically configured to:
taking the transaction number corresponding to each policy as a partition field of the hash partition main table, wherein the transaction number has uniqueness;
partitioning the main hash partition table according to the partition fields by means of a preset hash partition function to obtain a plurality of sub hash partition tables.
In the policy data updating apparatus 100, the obtaining module 11 is specifically configured to:
preprocessing the transaction number through a preset function and generating a corresponding integer value;
and obtaining the number of the Hash partition sublist by the remainder of the integer value to the preset partition number so as to determine the target Hash partition sublist.
In the policy data updating apparatus 100, the obtaining module 11 is further specifically configured to:
and when the corresponding hash partition sub-table is not inquired in the hash partition main table through the transaction number, judging that the policy data corresponding to the current transaction number does not exist in the policy partition main table, and directly inserting the policy data corresponding to the current transaction number into the policy partition main table.
In the policy data updating apparatus 100, the updating module 13 is specifically configured to:
inquiring a corresponding policy partition sub-table in the policy partition main table according to the policy updating time;
and replacing the policy data corresponding to the policy updating time with the initial policy data in the policy partition sub-table to complete the updating of the policy data.
With the policy data updating device 100 according to this embodiment, the transaction number is first used to query the preset hash partition main table to obtain the hash partition sub table corresponding to the current transaction number, further, the policy updating time corresponding to the current transaction number is queried according to the hash partition sub table, and finally, the policy data can be updated in the policy partition main table according to the current transaction number and the policy updating time queried correspondingly. By the method, the problem of scanning all the policy partition tables when the time condition of the policy partition table cannot be provided in the query or update condition is solved, and meanwhile, the database server does not need to put a large amount of operation resources into the query operation process of the non-target partition sub-table, so that the problem of overhigh CPU utilization rate caused by scanning all the policy partition tables is solved.
A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the policy data updating method provided in any of the above embodiments when executing the computer program.
A computer-readable storage medium, which stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the policy data updating method provided in any one of the above embodiments.
Wherein the meaning of "first" and "second" in the above modules/units is only to distinguish different modules/units, and is not used to define which module/unit has higher priority or other defining meaning. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or modules is not necessarily limited to those steps or modules explicitly listed, but may include other steps or modules not explicitly listed or inherent to such process, method, article, or apparatus, and such that a division of modules presented in this application is merely a logical division and may be implemented in a practical application in a further manner.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
For specific limitations of the policy data updating device, reference may be made to the above limitations of the policy data updating method, which are not described herein again. All or part of the modules in the device for detecting the living human face image can be realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 5. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external server through a network connection. The computer program is executed by a processor to implement a policy data update method.
In one embodiment, there is provided a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor when executing the computer program implementing the steps of the policy data updating method of the above embodiments, such as the steps 101 to 103 shown in fig. 2 and other extensions of the method and related steps. Alternatively, the processor, when executing the computer program, realizes the functions of the respective modules/units of the detection apparatus of a living body face image in the above-described embodiment, for example, the functions of the modules 11 to 14 shown in fig. 4. To avoid repetition, further description is omitted here.
The Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like which is the control center for the computer device and which connects the various parts of the overall computer device using various interfaces and lines.
The memory may be used to store the computer programs and/or modules, and the processor may implement various functions of the computer device by running or executing the computer programs and/or modules stored in the memory and invoking data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, video data, etc.) created according to the use of the cellular phone, etc.
The memory may be integrated in the processor or may be provided separately from the processor.
In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, which when executed by a processor implements the steps of the policy data updating method in the above embodiments, such as the steps 101 to 103 shown in fig. 2 and extensions of other extensions and related steps of the method. Alternatively, the computer program when executed by the processor implements the functions of the respective modules/units of the detection apparatus of a living body face image in the above-described embodiment, for example, the functions of the modules 11 to 14 shown in fig. 4. To avoid repetition, further description is omitted here.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. A policy data update method, the method comprising:
inquiring in a preset hash partition main table through a transaction number to obtain a corresponding hash partition sub-table, wherein the transaction number is a number correspondingly generated by each transacted policy;
inquiring the policy updating time corresponding to the transaction number according to the Hash partition sub-table;
and inquiring a corresponding policy partition sub-table in a preset policy partition main table according to the policy updating time, and replacing the policy data corresponding to the policy updating time with the initial policy data in the policy partition sub-table to complete the updating of the policy data.
2. The policy data updating method according to claim 1, wherein before the step of querying the preset hash partition main table by the transaction number to obtain the corresponding hash partition sub-table, the method comprises:
taking the transaction number corresponding to each policy as a partition field of the hash partition main table, wherein the transaction number has uniqueness;
partitioning the main hash partition table according to the partition fields by means of a preset hash partition function to obtain a plurality of sub hash partition tables.
3. The policy data updating method according to claim 1, wherein the step of querying the preset hash partition main table by the transaction number to obtain the corresponding hash partition sub-table comprises:
preprocessing the transaction number through a preset function and generating a corresponding integer value;
and obtaining the number of the Hash partition sublist by the remainder of the integer value to the preset partition number so as to determine the target Hash partition sublist.
4. The policy data updating method according to claim 1, wherein the step of querying the preset hash partition main table by the transaction number to obtain the corresponding hash partition sub-table comprises:
and when the corresponding hash partition sub-table is not inquired in the hash partition main table through the transaction number, judging that the policy data corresponding to the current transaction number does not exist in the policy partition main table, and directly inserting the policy data corresponding to the current transaction number into the policy partition main table.
5. The policy data updating method according to claim 1, wherein after the step of querying the corresponding policy partition sub-table in a preset policy partition main table according to the policy updating time and replacing the initial policy data with the policy data corresponding to the policy updating time in the policy partition sub-table to complete updating of the policy data, the method further comprises:
and calling a preset program to send the updated policy data to the mobile terminal of the user.
6. An apparatus for policy data update, the apparatus comprising:
the acquisition module is used for inquiring in a preset Hash partition main table through a transaction number so as to acquire a corresponding Hash partition sub-table;
the inquiry module is used for inquiring the policy updating time corresponding to the transaction number according to the Hash partition sub-table;
and the updating module is used for inquiring the corresponding policy partition sub-table in a preset policy partition main table according to the policy updating time, and replacing the initial policy data with the policy data corresponding to the policy updating time in the policy partition sub-table so as to complete the updating of the policy data.
7. The policy data updating apparatus according to claim 6, wherein the policy data updating apparatus further comprises a partitioning module, the partitioning module being specifically configured to:
taking the transaction number corresponding to each policy as a partition field of the hash partition main table, wherein the transaction number has uniqueness;
partitioning the main hash partition table according to the partition fields by means of a preset hash partition function to obtain a plurality of sub hash partition tables.
8. The policy data updating device according to claim 6, wherein the obtaining module is specifically configured to:
preprocessing the transaction number through a preset function and generating a corresponding integer value;
and obtaining the number of the Hash partition sublist by the remainder of the integer value to the preset partition number so as to determine the target Hash partition sublist.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the policy data updating method according to any one of claims 1 to 5 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the policy data updating method according to any one of claims 1 to 5.
CN202111439180.XA 2021-11-29 2021-11-29 Policy data updating method and device, computer equipment and readable storage medium Pending CN114138781A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111439180.XA CN114138781A (en) 2021-11-29 2021-11-29 Policy data updating method and device, computer equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111439180.XA CN114138781A (en) 2021-11-29 2021-11-29 Policy data updating method and device, computer equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN114138781A true CN114138781A (en) 2022-03-04

Family

ID=80389672

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111439180.XA Pending CN114138781A (en) 2021-11-29 2021-11-29 Policy data updating method and device, computer equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN114138781A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116523478A (en) * 2023-07-05 2023-08-01 北京码动摩登科技有限公司 Policy data management method, system, equipment and storage medium
CN116842031A (en) * 2023-09-01 2023-10-03 北京车与车科技有限公司 Data updating method, device and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116523478A (en) * 2023-07-05 2023-08-01 北京码动摩登科技有限公司 Policy data management method, system, equipment and storage medium
CN116523478B (en) * 2023-07-05 2023-09-01 北京码动摩登科技有限公司 Policy data management method, system, equipment and storage medium
CN116842031A (en) * 2023-09-01 2023-10-03 北京车与车科技有限公司 Data updating method, device and storage medium
CN116842031B (en) * 2023-09-01 2023-12-05 北京车与车科技有限公司 Data updating method, device and storage medium

Similar Documents

Publication Publication Date Title
US10698885B2 (en) Method and device for writing service data in block chain system
CN109791591B (en) Method and system for identity and credential protection and verification via blockchain
CN108694189B (en) Management of commonly owned database systems
CN111538786B (en) Block chain data desensitization and tracing storage method and device
CN114138781A (en) Policy data updating method and device, computer equipment and readable storage medium
CA3160594A1 (en) Cross-partition calls in partitioned, tamper-evident data stores
CN112256662A (en) Storage and tracing method, device, equipment and storage medium for agricultural product information block chain
CN111340483A (en) Data management method based on block chain and related equipment
CN109271564A (en) Declaration form querying method and equipment
CN114138849A (en) Multi-tenant data authority control method and device, computer and readable storage medium
US20240202185A1 (en) Method and system for pruning blocks from a blockchain
CN110795432A (en) Characteristic data retrieval method and device and storage medium
CN115599787A (en) Level sub-metering method and device, electronic equipment and storage medium
EP3779755A1 (en) A computer-implemented method for cross-chain-interoperability
CN116842012A (en) Method, device, equipment and storage medium for storing Redis cluster in fragments
CN111198880A (en) Data storage method and device based on redis and electronic equipment
CN115408481A (en) Multi-dimensional address processing method and device, computer equipment and storage medium
CN116208676A (en) Data back-source method, device, computer equipment, storage medium and program product
CN115221559A (en) Data account access authorization method and device
CN112632080B (en) Data storage method, device and equipment based on block chain
CN112905601A (en) Routing method and device for database sub-tables
CN112291241A (en) Firewall wall opening method, firewall wall opening device and terminal equipment
CN112181921A (en) Data processing method and device
CN111611056A (en) Data processing method and device, computer equipment and storage medium
CN112100249B (en) Data mining method and system

Legal Events

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