Order processing method and device, electronic equipment and storage medium

Through Redis cluster shard storage and hash function encoding order data, the slow response and settlement lag problems in massive insurance order processing are solved, and fast and accurate order processing and faster response speed are achieved.

CN119250927APending Publication Date: 2025-01-03CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411278146.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-12
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

When the existing automotive insurance back-end system handles massive insurance orders, it has problems such as storage system crashes, slow response, data confusion and settlement lag, making it difficult to quickly and accurately handle pending orders.

Method used

The Redis cluster is used to store order data fragments, and calculate the hash value and hash interval of the server node through the pre-established hash function, assign task encoding to the order data, determine the server node corresponding to the pending order task, and encode the task The and hash values ​​are added to the pending task queue, and the cache hot data mechanism is used to improve the cache hit rate and reduce access to the backend database.

Benefits of technology

It improves the response speed of order processing, reduces system load, provides faster user experience, flexibly prioritizes emergency orders, and speeds up the progress of insurance and settlement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119250927A_ABST
    Figure CN119250927A_ABST
Patent Text Reader

Abstract

The invention discloses an order processing method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining a plurality of pieces of order data, storing the order data in a redis cluster, and carrying out the fragmentation processing of the order data, so as to achieve the fragmentation storage of the order data in a plurality of different server nodes; calculating a hash value of each server node based on a pre-established hash function, and obtaining a hash interval of each server node through the hash value; on the basis of the hash intervals of the server nodes, task codes are given to order data of the server nodes; obtaining a to-be-processed task table; based on the hash value of each to-be-processed order task, determining a server node corresponding to each to-be-processed order task; and determining a task code of the to-be-processed order task based on the server node, and adding the task code and the corresponding hash value into a to-be-processed task queue. The technical problem that the to-be-processed insurance order cannot be quickly and accurately positioned at present is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of order processing, and in particular to an order processing method, device, electronic equipment and storage medium. Background Art

[0002] With the continuous growth of the total number of motor vehicles and the development of the economy and society, motor vehicle insurance has become the largest insurance type in the entire property insurance market. As the Internet gradually integrates into social life, the Internet application scenarios are becoming more and more abundant, creating a foundation for the rapid development of Internet auto insurance. Internet auto insurance has the advantages of breaking through time and space constraints, more transparent products, and closer ties with customers.

[0003] However, with a large number of insurance orders, whether the insurance cases can be processed quickly and accurately has become a major problem faced by the current system. At present, most of the back-end systems of auto insurance still have the following defects:

[0004] Massive data caused the insurance system's backend storage system to crash, and the computer room was not expanded in time;

[0005] When users use the APP to request insurance, report a case, or claim compensation during peak hours, they encounter slow backend responses and garbled data displayed on the interface.

[0006] After the user reports the case, the claims system does not respond promptly, and order settlement is delayed. Summary of the invention

[0007] The purpose of the present invention is to overcome the above-mentioned technical deficiencies and provide an order processing method, device, electronic device and storage medium suitable for financial technology or other related technical fields, so as to solve the technical problem that the prior art cannot quickly and accurately locate the insurance orders to be processed.

[0008] In order to achieve the above technical objectives, the present invention adopts the following technical solutions:

[0009] In a first aspect, the present invention provides an order processing method, comprising the following steps:

[0010] Acquire a number of order data, store the order data in a redis cluster, and perform sharding on the order data to store the order data shards in a number of different server nodes;

[0011] Based on a pre-established hash function, a hash value of each of the server nodes is calculated, and a hash interval of each of the server nodes is obtained through the hash value of each of the server nodes;

[0012] Based on the hash interval of each of the server nodes, assigning a task code to each of the order data of each of the server nodes;

[0013] Obtain a pending task list, wherein the pending task list has a plurality of pending order tasks with unique hash values;

[0014] Based on the hash value of each pending order task, determine the server node corresponding to each pending order task;

[0015] The task code of the order task to be processed is determined based on the server node, and the task code and the corresponding hash value are added to the queue of tasks to be processed.

[0016] In some embodiments, the calculating of the hash value of each of the server nodes based on a pre-established hash function, and obtaining the hash interval of each of the server nodes through the hash value of each of the server nodes, includes:

[0017] Calculate the hash value of each server node based on a pre-established hash function;

[0018] Based on the virtual hash ring corresponding to the hash function and the hash value of each of the server nodes, determining the position of each of the server nodes in the virtual hash ring;

[0019] Based on the position of each of the server nodes in the virtual hash ring, a hash interval of each of the server nodes is determined.

[0020] In some embodiments, assigning a task code to each order data of each server node based on the hash interval of each server node includes:

[0021] Based on the preset hash function, a hash value of each order data is calculated;

[0022] Based on the hash value of each of the order data and the hash interval of the server node, a task code is assigned to each of the order data of each of the server nodes.

[0023] In some embodiments, the server nodes include physical nodes and virtual nodes, and the virtual nodes have a mapping relationship with at least one of the server nodes.

[0024] In some embodiments, determining the server node corresponding to each pending order task based on the hash value of each pending order task includes:

[0025] Based on the hash value of each pending order task, determine the hash interval to which the hash value belongs;

[0026] Based on the determined hash interval, determine the server node corresponding to the hash interval, and judge whether the server node is a virtual node. When the server node is a virtual node, obtain the physical node corresponding to the virtual node, and use the physical node as the server node corresponding to the pending order task.

[0027] In some embodiments, the method further comprises:

[0028] The order data slice corresponding to each of the server nodes is split into a plurality of sub-slices.

[0029] In some embodiments, the method further comprises:

[0030] Based on the hash value of each pending order task in the pending task queue, the pending order tasks in the pending task queue are sorted.

[0031] In a second aspect, the present invention further provides an order processing device, comprising:

[0032] A shard storage module is used to obtain a number of order data, store the order data in a redis cluster, and perform sharding processing on the order data to store the order data in a number of different server nodes;

[0033] A hash interval determination module, used to calculate the hash value of each of the server nodes based on a pre-established hash function, and obtain the hash interval of each of the server nodes through the hash value of each of the server nodes;

[0034] A task code determination module, used for assigning a task code to each order data of each server node based on the hash interval of each server node;

[0035] A task acquisition module is used to acquire a pending task list, wherein the pending task list has a plurality of pending order tasks with unique hash values;

[0036] A node determination module, used to determine the server node corresponding to each pending order task based on the hash value of each pending order task;

[0037] The queue establishment module is used to determine the task code of the pending order task based on the server node, and add the task code and the corresponding hash value to the pending task queue.

[0038] In a third aspect, the present invention further provides an electronic device, comprising: a processor and a memory;

[0039] The memory stores a computer program executable by the processor;

[0040] When the processor executes the computer program, the steps in the order processing method described above are implemented.

[0041] In a fourth aspect, the present invention further provides a computer-readable storage medium storing one or more programs, wherein the one or more programs can be executed by one or more processors to implement the steps in the order processing method as described above.

[0042] Compared with the prior art, the order processing method, device, electronic device and storage medium provided by the present invention first obtain several order data, store several order data in a redis cluster, and perform sharding processing on several order data to store several order data shards in several different server nodes; then based on a pre-established hash function, calculate the hash value of each server node, and obtain the hash interval of each server node through the hash value of each server node; then based on the hash interval of each server node, assign task codes to each order data of each server node; then obtain a pending task table, wherein the pending order tasks in the pending task table have several unique hash values; then based on the hash value of each pending order task, determine the server node corresponding to each pending order task; finally determine the task code of the pending order task based on the server node, and add the task code and the corresponding hash value to the pending task queue. The present invention utilizes a cache hot data mechanism to effectively improve the cache hit rate. Reduce access to the back-end database and reduce system load. When users request these hot data, they can get a faster response speed, improve user experience, use hash algorithms to cache pending insurance orders, speed up the search for pending orders, identify urgent issues more quickly, flexibly prioritize the needs of more urgent customers, and speed up the progress of insurance issuance and settlement. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 is a flow chart of an order processing method provided by an embodiment of the present invention;

[0044] Figure 2 is a flowchart of step S200 in the order processing method provided by an embodiment of the present invention;

[0045] Figure 3 is a flowchart of step S300 in the order processing method provided by an embodiment of the present invention;

[0046] Figure 4 is a flowchart of step S500 in the order processing method provided by an embodiment of the present invention;

[0047] Figure 5 is a schematic diagram of functional modules of an order processing device provided by an embodiment of the present invention;

[0048] Figure 6 It is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0050] With the continuous growth of the total number of motor vehicles and the development of the economy and society, motor vehicle insurance has become the largest insurance type in the entire property insurance market. As the Internet gradually integrates into social life, Internet application scenarios have become more abundant, creating a foundation for the rapid development of Internet auto insurance. Internet auto insurance has the advantages of breaking through time and space constraints, more transparent products, and closer contact with customers. However, for massive insurance orders, whether it can quickly and accurately handle insurance cases for the insured has become a major problem facing the current system. At present, most of the back-end systems of auto insurance have many problems, such as massive data causing the back-end storage system of the insurance system to crash, the problem of untimely expansion of the computer room, and the problem of slow back-end response and disordered data display on the interface when users use APP to request insurance, report, and claim during peak hours. After the user reports the case, the claim system does not respond in time, and the order settlement is delayed and "delayed".

[0051] Based on this, see Figure 1 , Figure 1 It is a flowchart of an order processing method provided by an embodiment of the present invention. The order processing method involved in the present invention can be used for order processing in the financial field to quickly and accurately locate pending orders for processing. For the convenience of explanation, the embodiments of the present invention use insurance orders as an example to explain the technical solution of the present invention in detail. However, it can be understood that the method described in the present invention is not limited to insurance orders. In other embodiments, it can also be applied to other business order processing. The order processing method involved in the present invention can be executed by an electronic device that can perform operations such as receiving or sending data, and can be various electronic devices with a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, portable computers, desktop servers, etc. Figure 1 As shown, the method specifically includes the following steps S100 to S600.

[0052] S100, obtaining a plurality of order data, storing the plurality of order data in a redis cluster, and sharding the plurality of order data to store the plurality of order data shards in a plurality of different server nodes.

[0053] In this embodiment, for hot order data, such as orders within the last six months, it is placed in a dedicated high-speed disk array (SSD). The database uses a MySQL cluster. At the same time, this part of the data is placed in a Redis cluster, and the data is sharded by month to improve the efficiency of searching and updating. Among them, the order data can be data of types such as insurance claim orders, insurance orders, and report orders.

[0054] Redis cluster is a technology that connects multiple Redis nodes together to achieve high availability, data sharding, and load balancing. It allows Redis services to be provided on different nodes at the same time, thereby improving overall performance and reliability. It includes the following modes:

[0055] Master-Slave replication mode: Master-Slave replication mode is one of the basic cluster modes of Redis. It achieves data redundancy and backup by replicating the data of a Redis node (master node) to one or more other Redis nodes (slave nodes). In this mode, the master node is responsible for processing the client's write operations, while the slave node synchronizes the master node's data in real time. The client can read data from the slave node, thereby separating read and write operations and improving system performance.

[0056] Sentinel mode: Sentinel mode adds sentinel nodes to master-slave replication to achieve automatic failover. When the master node fails, the sentinel node will automatically elect a new master node from the slave nodes and notify other slave nodes and clients to achieve failover. This mode improves the high availability of the system and has all the advantages of master-slave replication mode, such as data redundancy and read-write separation.

[0057] Cluster mode: Cluster mode is an advanced cluster mode of Redis, which achieves load balancing and high availability through data sharding and distributed storage. In this mode, all key-value data is distributed on multiple nodes, and each node is responsible for a part of the data (called slots). By sharding the data, Cluster mode can break through the memory limitations of a single node and achieve larger-scale data storage.

[0058] S200. Based on a pre-established hash function, a hash value of each of the server nodes is calculated, and a hash interval of each of the server nodes is obtained through the hash value of each of the server nodes.

[0059] In this embodiment, the hash interval is determined by a consistent hashing algorithm. By calculating the hash value of each server node, each server node can be formed into several hash intervals in a virtual hash ring. Each hash interval includes several hash values. Each hash value corresponds to the order data stored under the server node. Then, the server where each order data is stored can be quickly determined by the hash value of each order data, and the order data can be quickly found.

[0060] S300: assigning a task code to each order data of each server node based on the hash interval of each server node.

[0061] In this embodiment, in order to facilitate the search for specific task content of an order task, in this embodiment, a task code is assigned to each order data, and the task code corresponds to the hash value of the order data. Therefore, the task code can be quickly found through the hash value. The task code also corresponds to a unique task content. Therefore, after obtaining the task code, the order task content can be obtained for execution.

[0062] S400: Obtain a pending task list, wherein the pending task list includes a plurality of pending order tasks with unique hash values.

[0063] In this embodiment, after the task is created, the task table also has the hash value of each order task. Therefore, the embodiment of the present invention can obtain the task code required subsequently through hash inverse operation, and then query the response task content according to the task code for processing.

[0064] S500: Determine the server node corresponding to each pending order task based on the hash value of each pending order task.

[0065] In this embodiment, the server node is determined by a hash inverse operation. Specifically, since each pending order task does not know the node to which it belongs, in order to obtain the task code, it is necessary to first determine the current server node. Therefore, this application uses the hash value and the hash interval of each server node to determine the server node corresponding to the pending order task, thereby realizing the subsequent task content query function.

[0066] S600: Determine the task code of the pending order task based on the server node, and add the task code and the corresponding hash value to a pending task queue.

[0067] In this embodiment, after the task code is obtained, the task code and the hash value calculated by the FVN hash algorithm are added to the task queue Sorted Set as the member and score of the Sorted Set respectively, and then the data in the task queue to be processed is processed one by one, thereby realizing the orderly progress of the tasks.

[0068] In an embodiment of the present invention, a plurality of order data are first obtained, and the plurality of order data are stored in a redis cluster, and the plurality of order data are sharded to store the plurality of order data shards in a plurality of different server nodes; then, based on a pre-established hash function, the hash value of each server node is calculated, and the hash interval of each server node is obtained through the hash value of each server node; then, based on the hash interval of each server node, a task code is assigned to each order data of each server node; then, a pending task table is obtained, wherein the pending order tasks in the pending task table have a plurality of unique hash values; then, based on the hash value of each pending order task, the server node corresponding to each pending order task is determined; finally, the task code of the pending order task is determined based on the server node, and the task code and the corresponding hash value are added to the pending task queue. The present invention utilizes a cache hot data mechanism to effectively improve the cache hit rate. Reduce access to the back-end database and reduce system load. When users request these hot data, they can get a faster response speed, improve user experience, use hash algorithms to cache pending insurance orders, speed up the search for pending orders, identify urgent issues more quickly, flexibly prioritize the needs of more urgent customers, and speed up the progress of insurance issuance and settlement.

[0069] In some embodiments, see Figure 2 , the step S200 specifically includes:

[0070] S210, calculating the hash value of each of the server nodes based on a pre-established hash function;

[0071] S220, determining the position of each of the server nodes in the virtual hash ring based on the virtual hash ring corresponding to the hash function and the hash value of each of the server nodes;

[0072] S230: Determine a hash interval of each of the server nodes based on a position of each of the server nodes in the virtual hash ring.

[0073] In this embodiment, the determination of the hash interval is realized based on the consistent hashing algorithm. Specifically, the consistent hashing organizes the entire hash value space into a virtual ring. For example, assuming that the value space of a hash function H is 0-2^32-1 (that is, the hash value is a 32-bit unsigned integer), the entire hash ring is organized in a clockwise direction, and 0 and 2^32-1 coincide in the direction at zero. The next step is to use H to perform a hash on each server. Specifically, the server's IP or host name can be selected as a keyword for hashing, so that each machine can determine its position on the hash ring. When it is necessary to locate the server, it is only necessary to use the same hash function to calculate the hash value, and then locate the position of this data on the hash ring through the hash value. From this position, walk clockwise, and the first server encountered is the server it should locate. Therefore, the interval between two clockwise adjacent servers on the hash ring is the hash interval of the next server node. All data under this interval is ultimately located to this server, so that the server corresponding to the data can be quickly found.

[0074] In some embodiments, see Figure 3 , the step S300 specifically includes:

[0075] S310, calculating a hash value of each of the order data based on the preset hash function;

[0076] S320: assigning a task code to each order data of each server node based on the hash value of each order data and the hash interval of the server node.

[0077] In this embodiment, the same hash function is used to calculate the hash value of each order data, and then a task code is assigned to the hash value. That is, each hash value corresponds to a task code in the hash interval to which it belongs. Therefore, after obtaining the hash value, the hash interval to which it belongs can be determined, and the area to which it belongs can be determined. Then, its task code can be determined based on the area, which can facilitate the subsequent acquisition of task content.

[0078] In some embodiments, the server nodes include physical nodes and virtual nodes, and the virtual nodes have a mapping relationship with at least one of the server nodes.

[0079] In this embodiment, when the consistent hash algorithm has too few service nodes, it is easy to cause data skew problems due to uneven node distribution. At this time, a large amount of data is concentrated on node A, while node B has only a small amount of data. In order to solve the data skew problem, the present invention introduces a virtual node mechanism in the consistent hash algorithm, that is, multiple hashes are calculated for each server node, and a service node is placed at each calculation result position, which is called a virtual node.

[0080] For example, when no virtual nodes are added, there are only 3 nodes (called physical nodes). After the order data obtains a certain value through the hash algorithm, it finds the nearest server groupX node clockwise. The data to be calculated is evenly distributed after being calculated by the hash function. However, due to too few nodes, most of the order data (or tasks) will find the group1 node clockwise. There are fewer tasks on other nodes, and the data is tilted toward group1. Therefore, when adding virtual nodes at this time, 3 virtual nodes will be added to the ring in group1, and 3 virtual nodes will also be added to other nodes. The data is "calculated" to belong to the virtual node through the hash function, and through the mapping table of virtual nodes and real nodes (this layer of mapping is stored in the hash table when the virtual node is generated), it can be executed on the real physical node, avoiding the data tilt problem of physical nodes.

[0081] In some embodiments, see Figure 4 , the step S500 specifically includes:

[0082] S510, based on the hash value of each pending order task, determining the hash interval to which the hash value belongs;

[0083] S520. Based on the determined hash interval, determine the server node corresponding to the hash interval, and determine whether the server node is a virtual node. When the server node is a virtual node, obtain the physical node corresponding to the virtual node, and use the physical node as the server node corresponding to the pending order task.

[0084] In this embodiment, when calculating the task code, it is essentially the reverse use of the consistent hash algorithm. Since the specific number of shards during execution is unknown when the task is created, it is impossible to calculate on which machine the task is executed. Therefore, in this embodiment of the present invention, when calculating the task code, the hash value is first inserted into the hash ring. When the task is executed, the hash intervals of all server nodes are calculated according to the total number of shards, and then the hash value of the current task is compared with each hash interval to determine the hash interval to which the current hash value belongs. In this way, the server node corresponding to the current order task can be obtained. At the same time, since the server nodes are divided into virtual nodes and physical nodes, if the node obtained at this time is a physical node, the node can be directly used as a server node. If the node obtained at this time is a virtual node, it is also necessary to convert the virtual node and the physical node. Through the mapping relationship between the virtual node and the physical node, the physical node corresponding to the virtual node can be obtained, and then the physical node can be used as the corresponding server node.

[0085] For example, to prevent unbalanced task load, the number of virtual nodes is set to 2 (except for the head node, which queries redis the number of virtual nodes + 1, and the number of queries for other nodes is the number of virtual nodes. Although setting it too large will be more balanced, it will also lead to too many queries). Before querying redis, the connected intervals are merged to reduce the number of queries to redis.

[0086] In some embodiments, the method further comprises:

[0087] The order data slice corresponding to each of the server nodes is split into a plurality of sub-slices.

[0088] In this embodiment, in order to improve the throughput of the system, improve the concurrent scheduling capability of the Scheduler, and avoid the pressure on the system caused by scheduling a large number of tasks at a certain hot moment, thereby affecting the accuracy of task scheduling, the embodiment of the present invention designs two levels of concurrency, which are as follows:

[0089] The first level is to increase the parallel computing capability by expanding the capacity of the Job nodes;

[0090] At the second level, the concept of multiple partitions is introduced, splitting the single partition of each time slice into multiple time slice partitions to increase the capability of parallel computing.

[0091] This can maximize the use of existing resources. For hot data, a more frequent timing trigger mechanism can be configured to allow hot data to be processed faster. For non-hot data, it can be configured to run in the idle time slice of the machine, which will not affect the performance of the system during peak hours and can ensure the logical isolation of data processing.

[0092] In some embodiments, the method further comprises:

[0093] Based on the hash value of each pending order task in the pending task queue, the pending order tasks in the pending task queue are sorted.

[0094] In this embodiment, in order to ensure that the tasks in the pending task queue can be processed in order, the task code and the hash value calculated by the task code using the FVN hash algorithm are added to the task queue Sorted Set as the member and score of the Sorted Set respectively. Therefore, the tasks in the pending task queue can store data in order through the score, and process the order tasks according to the arrangement order.

[0095] The technical solution provided by the present invention first obtains several order data, stores several order data in a redis cluster, and performs sharding processing on several order data to store several order data shards in several different server nodes; then based on a pre-established hash function, calculates the hash value of each server node, and obtains the hash interval of each server node through the hash value of each server node; then based on the hash interval of each server node, assigns a task code to each order data of each server node; then obtains a pending task table, wherein the pending order tasks in the pending task table have several unique hash values; then based on the hash value of each pending order task, determines the server node corresponding to each pending order task; finally determines the task code of the pending order task based on the server node, and adds the task code and the corresponding hash value to the pending task queue. The present invention utilizes a cache hot data mechanism to effectively improve the cache hit rate. Reduce access to the back-end database and reduce system load. When users request these hot data, they can get a faster response speed, improve user experience, use hash algorithms to cache pending insurance orders, speed up the search for pending orders, identify urgent issues more quickly, flexibly prioritize the needs of more urgent customers, and speed up the progress of insurance issuance and settlement.

[0096] Another embodiment of the present invention provides an order processing device, see Figure 5 The order processing device includes a shard storage module 11, a hash interval determination module 12, a task code determination module 13, a task acquisition module 14, a node determination module 15 and a queue establishment module 16.

[0097] The shard storage module 11 is used to obtain a number of order data, store the order data in a redis cluster, and perform sharding processing on the order data to store the order data in shards in a number of different server nodes.

[0098] The hash interval determination module 12 is used to calculate the hash value of each of the server nodes based on a pre-established hash function, and obtain the hash interval of each of the server nodes through the hash value of each of the server nodes.

[0099] The task code determination module 13 is used to assign a task code to each order data of each server node based on the hash interval of each server node.

[0100] The task acquisition module 14 is used to acquire a pending task table, wherein the pending task table has a plurality of pending order tasks with unique hash values.

[0101] The node determination module 15 is used to determine the server node corresponding to each pending order task based on the hash value of each pending order task.

[0102] The queue establishment module 16 is used to determine the task code of the pending order task based on the server node, and add the task code and the corresponding hash value to the pending task queue.

[0103] In this embodiment, first obtain several order data, store several order data in redis cluster, and perform sharding processing on several order data, so as to store several order data shards in several different server nodes; then calculate the hash value of each server node based on the pre-established hash function, and obtain the hash interval of each server node through the hash value of each server node; then assign task code to each order data of each server node based on the hash interval of each server node; then obtain the pending task table, wherein the pending order tasks with several unique hash values ​​in the pending task table; then determine the server node corresponding to each pending order task based on the hash value of each pending order task; finally determine the task code of the pending order task based on the server node, and add the task code and the corresponding hash value to the pending task queue. The present invention utilizes the cache hot data mechanism to effectively improve the cache hit rate. Reduce access to the back-end database and reduce system load. When users request these hot data, they can get a faster response speed, improve user experience, use hash algorithms to cache pending insurance orders, speed up the search for pending orders, identify urgent issues more quickly, flexibly prioritize the needs of more urgent customers, and speed up the progress of insurance issuance and settlement.

[0104] In some embodiments, the hash interval determination module 12 is specifically used to:

[0105] Calculate the hash value of each server node based on a pre-established hash function;

[0106] Based on the virtual hash ring corresponding to the hash function and the hash value of each of the server nodes, determining the position of each of the server nodes in the virtual hash ring;

[0107] Based on the position of each of the server nodes in the virtual hash ring, a hash interval of each of the server nodes is determined.

[0108] In some embodiments, the task code determination module 13 is specifically used to:

[0109] Based on the preset hash function, a hash value of each order data is calculated;

[0110] Based on the hash value of each of the order data and the hash interval of the server node, a task code is assigned to each of the order data of each of the server nodes.

[0111] In some embodiments, the server nodes include physical nodes and virtual nodes, and the virtual nodes have a mapping relationship with at least one of the server nodes.

[0112] In some embodiments, the node determination module 15 is specifically used to:

[0113] Based on the hash value of each pending order task, determine the hash interval to which the hash value belongs;

[0114] Based on the determined hash interval, determine the server node corresponding to the hash interval, and judge whether the server node is a virtual node. When the server node is a virtual node, obtain the physical node corresponding to the virtual node, and use the physical node as the server node corresponding to the pending order task.

[0115] In some embodiments, the order processing device further includes:

[0116] The splitting module is used to split the order data slice corresponding to each of the server nodes into a plurality of sub-slices.

[0117] In some embodiments, the order processing device further includes:

[0118] The sorting module is used to sort the pending order tasks in the pending task queue based on the hash value of each pending order task in the pending task queue.

[0119] Another embodiment of the present invention provides an electronic device, such as Figure 6 As shown, the electronic device 10 includes:

[0120] One or more processors 110 and memory 120, Figure 6 A processor 110 is used as an example for description. The processor 110 and the memory 120 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.

[0121] The processor 110 is used to complete various control logics of the electronic device 10. It can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a single-chip microcomputer, an ARM (Acorn RISC Machine) or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or any combination of these components. In addition, the processor 110 can also be any traditional processor, microprocessor or state machine. The processor 110 can also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a DSP and / or any other such configuration.

[0122] The memory 120 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions corresponding to the order processing method in the embodiment of the present invention. The processor 110 executes various functional applications and data processing of the electronic device 10 by running the non-volatile software programs, instructions and units stored in the memory 120, that is, implements the order processing method in the above method embodiment.

[0123] The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store an operating platform, an application required for at least one function; the data storage area may store data created according to the use of the electronic device 10, etc. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 120 may optionally include a memory remotely arranged relative to the processor 110, and these remote memories may be connected to the electronic device 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0124] One or more units are stored in the memory 120, and when executed by one or more processors 110, the order processing method in any of the above method embodiments is executed, for example, the order processing method described above is executed. Figure 1 Method steps in:

[0125] Acquire a number of order data, store the order data in a redis cluster, and perform sharding on the order data to store the order data shards in a number of different server nodes;

[0126] Based on a pre-established hash function, a hash value of each of the server nodes is calculated, and a hash interval of each of the server nodes is obtained through the hash value of each of the server nodes;

[0127] Based on the hash interval of each of the server nodes, assigning a task code to each of the order data of each of the server nodes;

[0128] Obtain a pending task list, wherein the pending task list has a plurality of pending order tasks with unique hash values;

[0129] Based on the hash value of each pending order task, determine the server node corresponding to each pending order task;

[0130] The task code of the order task to be processed is determined based on the server node, and the task code and the corresponding hash value are added to the queue of tasks to be processed.

[0131] In some embodiments, the calculating of the hash value of each of the server nodes based on a pre-established hash function, and obtaining the hash interval of each of the server nodes through the hash value of each of the server nodes, includes:

[0132] Calculate the hash value of each server node based on a pre-established hash function;

[0133] Based on the virtual hash ring corresponding to the hash function and the hash value of each of the server nodes, determining the position of each of the server nodes in the virtual hash ring;

[0134] Based on the position of each of the server nodes in the virtual hash ring, a hash interval of each of the server nodes is determined.

[0135] In some embodiments, assigning a task code to each order data of each server node based on the hash interval of each server node includes:

[0136] Based on the preset hash function, a hash value of each order data is calculated;

[0137] Based on the hash value of each of the order data and the hash interval of the server node, a task code is assigned to each of the order data of each of the server nodes.

[0138] In some embodiments, the server nodes include physical nodes and virtual nodes, and the virtual nodes have a mapping relationship with at least one of the server nodes.

[0139] In some embodiments, determining the server node corresponding to each pending order task based on the hash value of each pending order task includes:

[0140] Based on the hash value of each pending order task, determine the hash interval to which the hash value belongs;

[0141] Based on the determined hash interval, determine the server node corresponding to the hash interval, and judge whether the server node is a virtual node. When the server node is a virtual node, obtain the physical node corresponding to the virtual node, and use the physical node as the server node corresponding to the pending order task.

[0142] In some embodiments, when executed by one or more processors 110, the following steps are further performed:

[0143] The order data slice corresponding to each of the server nodes is split into a plurality of sub-slices.

[0144] In some embodiments, when executed by one or more processors 110, the following steps are further performed:

[0145] Based on the hash value of each pending order task in the pending task queue, the pending order tasks in the pending task queue are sorted.

[0146] Those skilled in the art will understand that Figure 6 The embodiments of the electronic device shown in the figure do not constitute a limitation on the specific composition of the electronic device. In other embodiments, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. For example, in some embodiments, the electronic device may include a memory, a processor, and a network interface. In such embodiments, the structure and function of the memory and the processor are similar to those in the figure. Figure 6 The embodiments shown are consistent and will not be described again here.

[0147] In another embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the automatic question-answering method disclosed in the embodiment of the present invention is implemented.

[0148] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the above-described equipment, devices and units can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. Those of ordinary skill in the art can appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0149] In the several embodiments provided by the present invention, it should be understood that the disclosed equipment, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. Units with the same function may also be combined into one unit. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices or units, or may be electrical, mechanical or other forms of connection.

[0150] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.

[0151] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0152] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a background server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), disk or optical disk and other media that can store program codes.

[0153] In summary, the order processing method, device, electronic device and storage medium provided by the present invention first obtain several order data, store several order data in a redis cluster, and perform sharding processing on several order data to store several order data shards in several different server nodes; then based on a pre-established hash function, calculate the hash value of each server node, and obtain the hash interval of each server node through the hash value of each server node; then based on the hash interval of each server node, assign task codes to each order data of each server node; then obtain a pending task table, wherein the pending order tasks in the pending task table have several unique hash values; then based on the hash value of each pending order task, determine the server node corresponding to each pending order task; finally determine the task code of the pending order task based on the server node, and add the task code and the corresponding hash value to the pending task queue. The present invention utilizes a cache hot data mechanism to effectively improve the cache hit rate. Reduce access to the back-end database and reduce system load. When users request these hot data, they can get a faster response speed, improve user experience, use hash algorithms to cache pending insurance orders, speed up the search for pending orders, identify urgent issues more quickly, flexibly prioritize the needs of more urgent customers, and speed up the progress of insurance issuance and settlement.

[0154] The specific implementation of the present invention described above does not constitute a limitation on the protection scope of the present invention. Any other corresponding changes and modifications made based on the technical concept of the present invention should be included in the protection scope of the claims of the present invention.

Claims

1. An order processing method, characterized in that: The steps include: Acquire a number of order data, store the order data in a redis cluster, and perform sharding on the order data to store the order data shards in a number of different server nodes; Based on a pre-established hash function, a hash value of each of the server nodes is calculated, and a hash interval of each of the server nodes is obtained through the hash value of each of the server nodes; Based on the hash interval of each of the server nodes, assigning a task code to each of the order data of each of the server nodes; Obtain a pending task list, wherein the pending task list has a plurality of pending order tasks with unique hash values; Based on the hash value of each pending order task, determine the server node corresponding to each pending order task; The task code of the order task to be processed is determined based on the server node, and the task code and the corresponding hash value are added to the queue of tasks to be processed.

2. The order processing method according to claim 1, characterized in that: The step of calculating the hash value of each server node based on a pre-established hash function and obtaining the hash interval of each server node through the hash value of each server node includes: Calculate the hash value of each server node based on a pre-established hash function; Based on the virtual hash ring corresponding to the hash function and the hash value of each of the server nodes, determining the position of each of the server nodes in the virtual hash ring; Based on the position of each of the server nodes in the virtual hash ring, a hash interval of each of the server nodes is determined.

3. The order processing method according to claim 1, characterized in that: The step of assigning a task code to each order data of each server node based on the hash interval of each server node includes: Based on the preset hash function, a hash value of each order data is calculated; Based on the hash value of each of the order data and the hash interval of the server node, a task code is assigned to each of the order data of each of the server nodes.

4. The order processing method according to claim 1, characterized in that: The server nodes include physical nodes and virtual nodes, and the virtual nodes have a mapping relationship with at least one of the server nodes.

5. The order processing method according to claim 4, characterized in that: The determining of the server node corresponding to each pending order task based on the hash value of each pending order task includes: Based on the hash value of each pending order task, determine the hash interval to which the hash value belongs; Based on the determined hash interval, determine the server node corresponding to the hash interval, and judge whether the server node is a virtual node. When the server node is a virtual node, obtain the physical node corresponding to the virtual node, and use the physical node as the server node corresponding to the pending order task.

6. The order processing method according to claim 1, characterized in that: The method further comprises: The order data slice corresponding to each of the server nodes is split into a plurality of sub-slices.

7. The order processing method according to claim 1, characterized in that: The method further comprises: Based on the hash value of each pending order task in the pending task queue, the pending order tasks in the pending task queue are sorted.

8. An order processing device, characterized in that: include: A shard storage module is used to obtain a number of order data, store the order data in a redis cluster, and perform sharding processing on the order data to store the order data in a number of different server nodes; A hash interval determination module, used to calculate the hash value of each of the server nodes based on a pre-established hash function, and obtain the hash interval of each of the server nodes through the hash value of each of the server nodes; A task code determination module, used for assigning a task code to each order data of each server node based on the hash interval of each server node; A task acquisition module is used to acquire a pending task list, wherein the pending task list has a plurality of pending order tasks with unique hash values; A node determination module, used to determine the server node corresponding to each pending order task based on the hash value of each pending order task; The queue establishment module is used to determine the task code of the pending order task based on the server node, and add the task code and the corresponding hash value to the pending task queue.

9. An electronic device, characterized in that: include: Processor and memory; The memory stores a computer program executable by the processor; When the processor executes the computer program, the steps of the order processing method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: include: Processor and memory; The memory stores a computer program executable by the processor; When the processor executes the computer program, the steps of the order processing method according to any one of claims 1 to 7 are implemented.