An algorithm and device for real-time retrieval of online car-hailing fare estimation based on sharding storage

By slicing the database into multiple data pieces and generating estimated cost codes, the problem of massive data storage and real-time retrieval in ride-hailing cost estimation methods is solved, achieving efficient data management and improved user experience.

CN114219153BActive Publication Date: 2025-10-24广州宸祺出行科技有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111544887.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-16
Publication Date
2025-10-24
Estimated Expiration
2041-12-16

AI Technical Summary

Technical Problem

Existing ride-hailing fare estimation methods cannot meet the needs of storing and retrieving massive amounts of data in real time, resulting in a decline in user experience.

Method used

By adopting a sharded storage architecture, the database is divided into multiple data shards, and an estimated cost code is generated. Data is stored and retrieved by the data shard number and code, achieving efficient estimated cost data management.

Benefits of technology

It improves data storage efficiency and real-time retrieval accuracy, significantly enhancing the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114219153B_ABST
    Figure CN114219153B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on fragment storage implementation real-time retrieval's online car-hailing cost estimation algorithm and device, wherein method includes: database forms the architecture of multiple data fragments, the data fragment has corresponding data fragment number;Obtain online car-hailing cost estimation instruction, based on online car-hailing order data combines cost estimation rule to carry out cost estimation to obtain estimated cost data;The estimated cost data corresponding estimated cost code is generated, and the data fragment number that should be written in is calculated based on estimated cost code;Based on data fragment number routing to corresponding data fragment, estimated cost data is written to data fragment;Obtain online car-hailing cost retrieval instruction, and the corresponding data fragment number is calculated based on estimated cost code;Routing to corresponding data fragment, and after estimated cost data inquiry, query result is returned.The application is stored by using the storage mode of fragment storage, so that online car-hailing platform can provide real-time retrieval while a large number of storage estimated cost data.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of storage and retrieval of online car-hailing estimated fees, and in particular to an algorithm and device for online car-hailing fee estimation based on sharded storage for real-time retrieval. BACKGROUND

[0002] With the development of transportation, people's travel frequency and distance are also growing, and buses, subways and taxis have been difficult to fully meet people's travel needs. At the same time, with the popularity of mobile devices and wireless networks, more convenient instant taxi software and its corresponding online car-hailing platform have emerged to provide timely and convenient online car-hailing services.

[0003] Before online car-hailing services, users will input the starting point and the destination through the user terminal, and generally estimate the cost of online car-hailing services, and display the corresponding estimated cost. The user then selects whether to issue an online car-hailing order and the specific type of online car-hailing service based on the estimated cost.

[0004] After the user terminal opens the online car-hailing application and inputs the starting point and the destination, the server needs to quickly calculate the estimated cost and store the estimated cost data in the database for subsequent user profiling. Therefore, the huge estimated cost data needs to be stored, and the database also needs to meet the rapid real-time retrieval needs of a large number of users. When there is a surge in users in a short period of time, the existing online car-hailing fee estimation algorithm cannot meet the simultaneous calculation of a large number of estimated fees and the real-time retrieval of a large number of estimated fees. The delay in the calculation and retrieval of estimated fees will affect the user experience. Therefore, there is an urgent need to invent a method that can simultaneously meet the storage of a large amount of estimated cost data and the real-time retrieval of a large amount of estimated cost data. SUMMARY

[0005] In order to overcome the technical defects of the prior art that cannot meet the large storage and real-time retrieval of online car-hailing estimated cost data, the present application provides an algorithm and device for online car-hailing fee estimation based on sharded storage for real-time retrieval.

[0006] In order to solve the above problems, the present application is implemented according to the following technical scheme:

[0007] In a first aspect, the present application discloses an algorithm for online car-hailing fee estimation based on sharded storage for real-time retrieval, comprising the following steps:

[0008] The database forms an architecture of multiple data shards, and the data shards have corresponding data shard numbers;

[0009] An online car-hailing fee estimation instruction is obtained, and the fee estimation is performed based on online car-hailing order data combined with fee estimation rules to obtain estimated cost data;

[0010] generating an estimated cost code corresponding to the estimated cost data, and calculating a data shard number to be written based on the estimated cost code;

[0011] routing to the corresponding data shard based on the data shard number, and writing the estimated cost data to the data shard;

[0012] obtaining a ride-hailing cost retrieval instruction, and calculating a corresponding data shard number based on the estimated cost code;

[0013] routing to the corresponding data shard, and returning the query result after querying the estimated cost data.

[0014] As a preferred embodiment, the estimated cost data includes a total cost and a sub-cost, wherein the sub-cost includes a distance cost, a time length cost, a long-distance cost, a vehicle type cost, a peak period cost, a bridge crossing cost, a road crossing cost, and a parking cost; and the cost estimation rule includes a sub-cost discrimination rule, a sub-cost unit rule, and a sub-cost base rule.

[0015] As a preferred embodiment, after the cost estimation based on the ride-hailing order data and the cost estimation rule to obtain the estimated cost data, the method further includes: further slicing the data shard based on the sub-cost to divide into corresponding sub-shards, writing the sub-cost into the sub-shards respectively, and generating a corresponding sub-shard query code for each sub-shard.

[0016] As a preferred embodiment, after obtaining the estimated cost data, the method further includes:

[0017] determining whether there is a same ride-hailing order in the database;

[0018] if there is, routing to the corresponding data shard and updating the estimated cost data;

[0019] if there is not, performing the generating of the estimated cost code corresponding to the estimated cost data.

[0020] As a preferred embodiment, the estimated cost code is specifically a sequential superposition of a current date and a plurality of self-incrementing serial numbers, and the calculation of the data shard number is based on the remainder obtained by dividing the estimated cost code by the total number of data shards.

[0021] In a second aspect, the application also discloses a device for ride-hailing cost estimation based on shard storage for real-time retrieval, comprising:

[0022] a data shard module for forming a database architecture with a plurality of data shards, wherein the data shards have corresponding data shard numbers;

[0023] An estimated cost module is configured to obtain a network car cost estimation instruction, estimate a cost based on network car order data and cost estimation rules to obtain estimated cost data;

[0024] A data encoding module is configured to generate an estimated cost code corresponding to the estimated cost data, and calculate a data shard number to be written based on the estimated cost code;

[0025] A data writing module is configured to route to a corresponding data shard based on the data shard number, and write the estimated cost data to the data shard;

[0026] A cost retrieval module is configured to obtain a network car cost retrieval instruction, and calculate a corresponding data shard number based on the estimated cost code;

[0027] A data query module is configured to route to a corresponding data shard, and return a query result after querying the estimated cost data.

[0028] As a preferred embodiment, the estimated cost data includes a total cost and a sub-cost, wherein the sub-cost includes a distance cost, a time length cost, a long-distance cost, a car type cost, a peak period cost, a bridge crossing cost, a road crossing cost, and a parking cost;

[0029] The cost estimation rules include a sub-cost discrimination rule, a sub-cost unit rule, and a sub-cost base rule.

[0030] As a preferred embodiment, the estimated cost module further includes:

[0031] A sub-shard setting unit is configured to further slice the data shard based on the sub-cost to divide the data shard into corresponding sub-shards, write the sub-cost into the sub-shards respectively, and generate a corresponding sub-shard query code for each sub-shard.

[0032] As a preferred embodiment, the estimated cost module further includes:

[0033] An order discrimination unit is configured to discriminate whether there is a same network car order in the database;

[0034] If there is, route to a corresponding data shard and update the estimated cost data;

[0035] If there is not, execute the generation of the estimated cost code corresponding to the estimated cost data.

[0036] As a preferred embodiment, the estimated cost code is specifically a sequential superposition of a current date and a plurality of self-incrementing serial numbers, and the calculation of the data shard number is based on a remainder obtained by dividing the estimated cost code by the total number of data shards.

[0037] Compared with the prior art, the present application has the following advantages:

[0038] The application stores the estimated cost data of the online car-hailing service in the data shards by slicing the database into multiple data shards, and generates corresponding estimated cost codes for storage and retrieval. The data shard number is associated with the estimated cost code, so that the data shard can efficiently meet the real-time retrieval needs of a large number of users while storing a large amount of estimated cost data. Based on the data shard number and the estimated cost code, the corresponding estimated cost retrieval result can be accurately and efficiently obtained, thereby significantly improving the user experience. BRIEF DESCRIPTION OF DRAWINGS

[0039] The specific embodiments of the application will be further described in detail below with reference to the accompanying drawings, in which:

[0040] Figure 1 is a flowchart of the algorithm for online car-hailing cost estimation based on shard storage for real-time retrieval according to the application;

[0041] Figure 2 is a structural diagram of the device for online car-hailing cost estimation based on shard storage for real-time retrieval according to the application. DETAILED DESCRIPTION

[0042] Preferred embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings. Although preferred embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.

[0043] The term "comprising" and its variants as used herein mean "including but not limited to". Unless specifically stated, the term "or" means "and / or". The term "based on" means "based at least in part on". The terms "one example embodiment" and "an embodiment" mean "at least one example embodiment". The term "another embodiment" means "at least one additional embodiment". The terms "first", "second", etc. can refer to different or the same objects. Further explicit and implicit definitions can also be included below.

[0044] The access device and server can be connected directly or indirectly via wired or wireless communication. The access device can be a terminal or a server. The target application is running on the access device. The target application is an application program capable of initiating data requests to the server, such as a social networking application, a payment application, or a gaming application. The server can be an application server providing services for the target application, or a proxy server distinct from the application server corresponding to the target application. The server is responsible for identifying whether each access device is a malicious device and intercepting data packets from malicious devices. When the server is a proxy server, the proxy server forwards data packets that are not from malicious devices to the application server. The terminal can be a desktop terminal or a mobile terminal. Mobile terminals can be, but are not limited to, smartphones, tablets, laptops, desktop computers, smart speakers, smart watches, etc. The server can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0045] Example 1

[0046] like Figure 1 As shown, in the first aspect, the present invention discloses an algorithm for estimating online car-hailing fares based on sharded storage and real-time retrieval, which specifically includes the following steps:

[0047] Step S1: The database forms a structure of multiple data shards, each of which has a corresponding data shard number.

[0048] Specifically, before storing the estimated cost data, the server architecture needs to be configured accordingly. The server issues a database slicing instruction to the database, slicing the database to form an architecture consisting of multiple data shards. The concept of data sharding is to divide the data set into relatively independent data subsets according to certain rules, and then distribute the data subsets to different nodes, which can be logical nodes or physical nodes. Then, corresponding data shard numbers are generated. The number of data shard numbers is adapted to the preset number of data shards. The data shard numbers are sequentially increased and associated with the data shards in turn until all data shard numbers are associated, so that each data shard has a unique corresponding data shard number.

[0049] Data shards need to follow certain rules, different distributed scenarios need to design different rules, but basically follow the same principle: according to the most important and most frequently used access mode to shard. In the present application, the most important and most frequently used access mode of the online car-hailing estimated cost data is used for sharding, so that the data shards are more efficient in storing and retrieving a large amount of estimated cost data.

[0050] Step S2: Obtain the online car-hailing cost estimation instruction, and estimate the cost based on the online car-hailing order data and the cost estimation rules to obtain the estimated cost data.

[0051] Specifically, the server obtains online car-hailing order data from the user terminal through the network, which includes the starting point and the ending point input by the user through the user terminal. The server plans the route between the starting point and the ending point, and estimates the cost based on the cost estimation rules to obtain the estimated cost data of the starting point and the ending point at the current time.

[0052] The estimated cost data includes total cost and sub-cost, and the sub-cost includes distance cost, time cost, long-distance cost, vehicle type cost, peak period cost, bridge cost, road cost, parking cost, and other costs. The cost estimation rules include sub-cost discrimination rules, sub-cost unit rules, and sub-cost base rules. First, based on the cost estimation rules, it is determined whether the sub-cost exists, including vehicle type cost, peak period cost, bridge cost, road cost, and parking cost. If it exists, it needs to be calculated, and if it does not exist, the calculation of this part of the sub-cost is omitted. Then, based on the sub-cost unit rules and the sub-cost base rules, the calculation standard of the sub-cost is obtained, such as the unit of distance, the price per KM, the additional long-distance charging rule for exceeding distance, and the estimated driving time, to calculate the additional charge for exceeding the preset time, etc. Then, the corresponding data in the online car-hailing order data is analyzed and extracted, and is substituted into the cost estimation rules respectively, to calculate the corresponding sub-cost of each item, and the sub-cost is superimposed to obtain the total cost of the estimated cost data.

[0053] Based on the sub-cost, further slicing is performed on the data shards to divide them into corresponding sub-shards, and the sub-cost is written into the sub-shards, and the corresponding sub-shard query codes are generated for the sub-shards. After storing the sub-cost and the total cost in sequence, they can be taken out and displayed at the same time during retrieval, so that the user can quickly obtain the retrieval result and know the cost details at the same time.

[0054] In order to provide a reference for cost estimation and speed up the efficiency of cost estimation, before performing the cost estimation calculation, a sub-step S21 is further performed: determining whether there is an online car-hailing order with the same starting point and ending point in the database.

[0055] If exists, route to the corresponding data shard to read the cost of the online car-hailing order as the reference of the estimated cost;

[0056] If not exists, continue to acquire the estimated cost data.

[0057] Search through the start point and the end point, if there are the same or similar start point and end point in the database, especially in the historical online car-hailing orders associated with the same user, search through the online car-hailing order data with the same or similar start point and end point, take the final cost of the online car-hailing order data as the reference data of the estimated cost of this time, and combine the judgment information of the sub-cost, based on the reference of the estimated cost, make specific calculation and correction, and correct the differences in the specific sub-cost data, such as the deviation of the travel time, the peak period, and the change of the toll fee, so as to quickly calculate and acquire the estimated cost data based on the reference data of the estimated cost.

[0058] In order to further reduce the database space occupied by a large amount of estimated cost data, the sub-step S21 is further performed: judging whether there is the same online car-hailing order in the database;

[0059] If exists, route to the corresponding data shard to update the estimated cost data;

[0060] If not exists, perform the generation of the estimated cost code corresponding to the estimated cost data.

[0061] The user may switch between multiple online car-hailing selection schemes, or change the start point or the end point multiple times due to selection error and positioning error, if a data shard is occupied after each change, it will seriously affect the reasonable use of the data shard, therefore, this step replaces the re-occupation of a new data shard by judging the use of the estimated cost of the same online car-hailing order and routing to the data shard for data update, so as to make the storage of the data shard more reasonable.

[0062] Step S3: generating the estimated cost code corresponding to the estimated cost data, and calculating the data shard number to be written based on the estimated cost code.

[0063] Specifically, the server generates an estimated cost code corresponding to the estimated cost data after calculating the estimated cost data of the current online car-hailing order. The estimated cost code is specifically the sequential superposition of the current date and a certain number of incremental serial numbers, such as the superposition of 8 digits of the year, month and day, and then the superposition of 10 incremental serial numbers. After each estimated cost code is generated, the incremental serial number is automatically incremented by 1, so that the estimated cost code corresponds to the generation order. Then, the data shard number corresponding to the data shard where the estimated cost data should be written is calculated based on the cost code, so as to be routed to the data shard. Specifically, the calculation of the data shard number is based on the remainder obtained by dividing the estimated cost code by the total number of data shards.

[0064] As another preferred embodiment, after the estimated cost code is generated and the corresponding data shard number is calculated, the estimated cost data is renamed after the sequential superposition of the corresponding estimated cost code and data shard number, so that the estimated cost data is easier to be retrieved, thereby improving the overall retrieval efficiency when a large number of retrievals are performed at the same time.

[0065] Step S4: Based on the data shard number, the estimated cost data is routed to the corresponding data shard and written to the data shard.

[0066] Specifically, after the server obtains the corresponding data shard number, it is routed to the data shard corresponding to the data shard number, and then the estimated cost data is written to the data shard. Then, based on the estimated cost code and the unique code of the online car-hailing order, the two are combined to form a unique corresponding retrieval mark, such as a hexadecimal mark and an encrypted code, etc. after processing, to form a retrieval mark corresponding to the estimated cost data, thereby improving the accuracy of retrieval.

[0067] Step S5: Obtain the online car-hailing cost retrieval instruction, and calculate the corresponding data shard number based on the estimated cost code.

[0068] Step S6: Route to the corresponding data shard, and return the query result after querying the estimated cost data.

[0069] Specifically, when the server needs to retrieve the estimated cost data stored in the database based on the retrieval instruction, the estimated cost code is used for retrieval. Based on the calculation logic of the data shard number, the corresponding data shard number is calculated in reverse, and then the data shard number is routed to the corresponding data shard based on the data shard number. After reading the estimated cost data stored in the data shard, it is returned to the user terminal for display, including the total cost and the specific data display of the charging basis and the final charging of the sub-cost, so that the user can intuitively obtain the information of the estimated cost data.

[0070] In summary, the application creatively stores the estimated cost data of the online car-hailing service in the data shards by slicing the database into multiple data shards, and generates corresponding estimated cost codes for storage and retrieval. The data shard number is associated with the estimated cost code, so that the data shards can efficiently meet the real-time retrieval needs of a large number of users while storing a large amount of estimated cost data. Based on the data shard number and the estimated cost code, the corresponding estimated cost retrieval result can be accurately and efficiently obtained, thereby significantly improving the user experience.

[0071] The other steps of the algorithm for online car-hailing cost estimation based on shard storage to realize real-time retrieval described in the embodiment are known in the art.

[0072] Embodiment 2

[0073] As shown in Figure 2 the second aspect, the application also discloses an apparatus for online car-hailing cost estimation based on shard storage to realize real-time retrieval, which comprises:

[0074] a data shard module M1 for forming a database into a structure of multiple data shards, wherein the data shards have corresponding data shard numbers;

[0075] an estimated cost module M2 for obtaining an online car-hailing cost estimation instruction, estimating the cost based on online car-hailing order data and cost estimation rules to obtain estimated cost data;

[0076] a data encoding module M3 for generating an estimated cost code corresponding to the estimated cost data, and calculating the data shard number to be written based on the estimated cost code;

[0077] a data writing module M4 for routing to the corresponding data shard based on the data shard number, and writing the estimated cost data to the data shard;

[0078] a cost retrieval module M5 for obtaining an online car-hailing cost retrieval instruction, and calculating the corresponding data shard number based on the estimated cost code;

[0079] a data query module M6 for routing to the corresponding data shard, and returning the query result after querying the estimated cost data.

[0080] As a preferred implementation, the estimated cost data in the estimated cost module M2 includes a total cost and a sub-cost, wherein the sub-cost includes a distance cost, a time length cost, a long-distance cost, a car model cost, a peak period cost, a bridge crossing cost, a road crossing cost, and a parking cost; and the cost estimation rules include a sub-cost discrimination rule, a sub-cost unit rule, and a sub-cost base rule.

[0081] The estimated cost module M2 further comprises:

[0082] a sub-fragment setting unit configured to further slice the data fragment based on the sub-fee to divide into corresponding sub-fragments, write the sub-fee into the sub-fragments respectively, and generate a corresponding sub-fragment query code for each sub-fragment.

[0083] an order discrimination unit configured to discriminate whether there is a same online car-hailing order in the database;

[0084] if yes, route to the corresponding data fragment and update the estimated fee data;

[0085] if no, execute the generation of the estimated fee code corresponding to the estimated fee data.

[0086] Specifically, the estimated fee code is specifically the sequential superposition of the current date and a number of self-incrementing serial numbers, and the calculation of the data fragment number is based on the remainder obtained by dividing the estimated fee code by the total number of data fragments.

[0087] The device for online car-hailing fee estimation based on sharding storage for real-time retrieval according to the embodiment can run all steps of the algorithm for online car-hailing fee estimation based on sharding storage for real-time retrieval according to embodiment 1, thereby realizing sharding storage of fee estimation data and a large amount of real-time retrieval support, so that the online car-hailing fee estimation can meet the huge storage capacity and the short-term surge of real-time retrieval demand, thereby improving the user experience.

[0088] Other structures of the device for online car-hailing fee estimation based on sharding storage for real-time retrieval according to the embodiment are referable to the prior art.

[0089] Embodiment 3

[0090] The application further discloses an electronic device, at least one processor, and a memory connected in communication with the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, and the at least one processor executes the following steps when executing the instructions: forming a database into an architecture of a plurality of data fragments, the data fragments having corresponding data fragment numbers; obtaining an online car-hailing fee estimation instruction, estimating a fee based on online car-hailing order data and a fee estimation rule to obtain estimated fee data; generating an estimated fee code corresponding to the estimated fee data, calculating a data fragment number to be written based on the estimated fee code; routing to the corresponding data fragment based on the data fragment number, and writing the estimated fee data to the data fragment; obtaining an online car-hailing fee retrieval instruction, calculating a corresponding data fragment number based on the estimated fee code; routing to the corresponding data fragment, and returning the query result after querying the estimated fee data.

[0091] Example 4

[0092] The application also discloses a storage medium storing a computer program, which, when executed by a processor, implements the following steps: a database forms an architecture of multiple data shards, the data shards having corresponding data shard numbers; a network car fare estimation instruction is obtained, and fare estimation is performed based on network car order data and fare estimation rules to obtain estimated fare data; estimated fare codes corresponding to the estimated fare data are generated, and data shard numbers to be written are calculated based on the estimated fare codes; the data shard numbers are routed to corresponding data shards based on the data shard numbers, and the estimated fare data is written to the data shards; a network car fare retrieval instruction is obtained, and corresponding data shard numbers are calculated based on the estimated fare codes; the corresponding data shards are routed to, and query results are returned after the estimated fare data is queried.

[0093] The present disclosure can be a method, apparatus, system, and / or computer program product. A computer program product can include a computer-readable storage medium having computer-readable program instructions loaded thereon for implementing various aspects of the present disclosure.

[0094] The computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium can be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium include the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or punched tape, a magneto-optical storage device, a ROM, a memory, a cache, a cache core, or any suitable combination of the foregoing. A computer readable storage medium, as used herein, is not to be construed as being transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission media (e.g., light pulses passing through a fiber-optic cable), or electrical signals transmitted through a wire.

[0095] Computer readable program instructions described herein can be downloaded to respective computing / processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and / or a wireless network. The network can comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and / or edge servers. A network adapter card or network interface in each computing / processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing / processing device.

[0096] Computer readable program instructions for carrying out operations of the present disclosure can be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate arrays (FPGA), or programmable logic arrays (PLA) can execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present disclosure.

[0097] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computer, other programmable data processing apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0098] These computer readable program instructions can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks. These computer readable program instructions can also be stored in a computer readable storage medium that can include a non-transitory computer readable storage medium that can be a computer- readable storage medium having no data storage cycles that change state. The instructions can be executed by one or more processors of a computer, other programmable data processing apparatus, or other devices to produce a computer-implemented process such that the instructions which execute via the one or more processors of the computer or other programmable data processing apparatus create means for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks. A computer readable storage medium can be, but is not limited to, a floppy disk, a hard disk, a solid state drive, a DVD, a CD, a tape, a magnetic

[0099] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer implemented process such that the instructions which execute on the computer or other programmable data processing apparatus implement the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0100] The flow diagrams and the block diagrams in the drawings are presented to illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flow diagrams and the block diagrams can represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical functions ("instructions"). In some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may

[0101] The various embodiments of the disclosure have been described in detail above, with examples of the disclosure being illustrative, but not restrictive, of the various embodiments. Many modifications and variations of the disclosed embodiments are possible in light of the above teachings. It is, therefore, to be understood that within the scope of the disclosed embodiments there is room for modification and variation. The specific exemplifications in which the disclosure has been described are intended to be illustrative only and not limiting to the scope of the disclosure. The terms in the claims have their broadest reasonable interpretation, which can be interpreted in the context of the whole patent document in addition to the specific terms used in the claims.

Claims

1. An algorithm for real-time retrieval of ride-hailing fare estimation based on sharded storage, characterized in that, Comprise: The database forms the architecture of multiple data shards, and the data shards have corresponding data shard numbers; Obtain a network car fare estimation instruction, estimate the fare based on the network car order data combined with the fare estimation rules to obtain the estimated fare data; After obtaining the estimated fare data, it further comprises: Determine whether there is a same network car order in the database; If so, route to the corresponding data shard and update the estimated fare data; If not, execute the generation of the estimated fare code corresponding to the estimated fare data; Before performing the fare estimation calculation, determine whether there is a network car order with the same starting point and ending point in the database; If so, route to the corresponding data shard to read the fare of the network car order as a reference for the estimated fare; If not, continue to obtain the estimated fare data; After searching for the starting point and ending point, if there are the same or similar starting points and ending points in the database, the final fare of the network car order data with the same or similar starting points and ending points is used as the reference data for this estimated fare, and based on the reference data for the estimated fare, the specific calculation correction is performed based on the reference data for the estimated fare. The difference in specific sub-fare data is corrected to quickly calculate and obtain the estimated fare data based on the reference data for the estimated fare; Generate the estimated fare code corresponding to the estimated fare data, and calculate the data shard number to be written based on the estimated fare code; The estimated fare code is the sequential superposition of the current date and a certain number of incremental serial numbers, and the calculation of the data shard number is based on the remainder obtained by dividing the estimated fare code by the total number of data shards; Based on the data shard number, route to the corresponding data shard and write the estimated fare data to the data shard; Obtain a network car fare search instruction, calculate the corresponding data shard number based on the estimated fare code; Route to the corresponding data shard and return the query result after querying the estimated fare data; The estimated fare data includes total fare and sub-fare, and the sub-fare includes distance fare, time length fare, long distance fare, vehicle type fare, peak period fare, bridge toll fare, road toll fare and parking fare, as well as other fees; The fare estimation rules include sub-fare discrimination rules, sub-fare unit rules and sub-fare base rules. 2.The algorithm for implementing real-time retrieval of online car-hailing fare estimation based on sharded storage according to claim 1, wherein, After estimating the fare based on the network car order data combined with the fare estimation rules to obtain the estimated fare data, it further comprises: Based on the sub-fare, further slice the data shard to form corresponding sub-shards, and write the sub-fare to the sub-shards respectively, and generate corresponding sub-shard query codes for the sub-shards respectively.

3. An apparatus for implementing real-time retrieval of a ride-hailing fare estimate based on sharded storage, the apparatus comprising: Comprise: A data shard module for the database to form the architecture of multiple data shards, and the data shards have corresponding data shard numbers; An estimated fare module for obtaining a network car fare estimation instruction, estimating the fare based on the network car order data combined with the fare estimation rules to obtain the estimated fare data; A data encoding module for generating an estimated fare code corresponding to the estimated fare data, and calculating the data shard number to be written based on the estimated fare code; a data writing module, configured to write the estimated fare data to the data shard based on the data shard number; a fare retrieving module, configured to obtain a network car fare retrieving instruction, and calculate the corresponding data shard number based on the estimated fare code; a data querying module, configured to route to the corresponding data shard, and return the query result after querying the estimated fare data; the estimated fare data comprises a total fare and a sub-fare, and the sub-fare comprises a distance fare, a time length fare, a long distance fare, a car type fare, a peak time fare, a bridge fare, a road fare and a parking fare; the fare estimation rule comprises a sub-fare distinguishing rule, a sub-fare unit rule and a sub-fare base rule; the estimated fare module further comprises: an order distinguishing unit, configured to distinguish whether there is a same network car order in the database; if yes, route to the corresponding data shard and update the estimated fare data; if no, execute the generation of the estimated fare code corresponding to the estimated fare data. 4.The apparatus for implementing real-time retrieval of online car-hailing fare estimation based on sharded storage according to claim 3, wherein, the estimated fare module further comprises: a sub-shard setting unit, configured to further slice the data shard based on the sub-fare, to divide the data shard into corresponding sub-shards, write the sub-fare into the sub-shards respectively, and generate a corresponding sub-shard query code for each sub-shard.

5. The network car fare estimation device based on the shard storage for realizing real-time retrieval according to claim 3, characterized in that: the estimated fare code is specifically a sequential superposition of the current date and a plurality of self-incrementing serial numbers, and the calculation of the data shard number is based on the remainder obtained by dividing the estimated fare code by the total number of data shards.

Citation Information

Patent Citations

  • Data management method and device, server and storage medium

    CN111666265A