CN111507493B - Object and span matching method, device and system - Google Patents

Object and span matching method, device and system Download PDF

Info

Publication number
CN111507493B
CN111507493B CN202010284935.2A CN202010284935A CN111507493B CN 111507493 B CN111507493 B CN 111507493B CN 202010284935 A CN202010284935 A CN 202010284935A CN 111507493 B CN111507493 B CN 111507493B
Authority
CN
China
Prior art keywords
matrix
matching
passenger
weights
driver
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010284935.2A
Other languages
Chinese (zh)
Other versions
CN111507493A (en
Inventor
于志杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Bailong Mayun Technology Co ltd
Original Assignee
Beijing Bailong Mayun Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Bailong Mayun Technology Co ltd filed Critical Beijing Bailong Mayun Technology Co ltd
Priority to CN202010284935.2A priority Critical patent/CN111507493B/en
Publication of CN111507493A publication Critical patent/CN111507493A/en
Application granted granted Critical
Publication of CN111507493B publication Critical patent/CN111507493B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/02Reservations, e.g. for tickets, services or events
    • G06Q10/025Coordination of plural reservations, e.g. plural trip segments, transportation combined with accommodation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0631Resource planning, allocation, distributing or scheduling for enterprises or organisations
    • G06Q10/06311Scheduling, planning or task assignment for a person or group
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/40Business processes related to the transportation industry

Landscapes

  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Engineering & Computer Science (AREA)
  • Tourism & Hospitality (AREA)
  • Economics (AREA)
  • Strategic Management (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • General Business, Economics & Management (AREA)
  • Marketing (AREA)
  • Physics & Mathematics (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Development Economics (AREA)
  • Game Theory and Decision Science (AREA)
  • Educational Administration (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Primary Health Care (AREA)
  • Traffic Control Systems (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

An object, in particular, a span matching method, apparatus and system are disclosed. The object matching method comprises the following steps: calculating cross-object weights between a first object set and a second object set, wherein the first object set comprises m first objects, and the second object set comprises n second objects in combination; storing the cross-object weight by using a first matrix, wherein the number of rows and the number of columns of the first matrix are not smaller than larger values in m and n; mapping the first matrix to a second matrix in a physical memory, wherein at least one of the number of rows and the number of columns of the second matrix is smaller than the first matrix; and performing matching calculation on the first object element and the second object element based on the cross-object weight data physically stored in the second matrix. According to the scheme, the high efficiency of the object matching algorithm is met by using a large matrix (for example, a square matrix), and meanwhile, unnecessary memory application is avoided by using a virtual matrix to replace the square matrix in memory allocation, so that smooth performance of matching calculation is ensured.

Description

Object and span matching method, device and system
Technical Field
The present disclosure relates to information technology, and in particular, to a method, apparatus, and system for matching an object and a span.
Background
In order assignment scenarios, matching operations involving assignment of user orders to appropriate acquirers are involved. For example, in a network taxi-taking scenario, the matching operation described above is more a critical process that the system needs to implement efficiently, namely ride matching, matching an appropriate driver for each order sent by a passenger. In a specific matching process, the adopted matching strategy can be simply divided into local optimum and global optimum.
The local optimization strategy is typically based on 1 order, finding n candidate drivers. The most appropriate driver is then selected by calculation. The global optimum strategy then typically involves n orders simultaneously and finds m candidate drivers. The q pairs (q taking the smaller of n and m) of order driver combinations can then be selected by comprehensive calculations. These combinations may not be globally optimal if viewed from a single combination. However, the matching effect achieved by these combinations is best from an overall point of view.
Because the existing global matching scheme cannot meet the characteristics of high real-time performance and burstiness of scenes such as network taxi taking and the like, an improved object matching scheme is needed.
Disclosure of Invention
One technical problem to be solved by the present disclosure is to provide an improved object matching, such as a space-time matching scheme, which satisfies the high efficiency of an object matching algorithm by using a large matrix (e.g., a square matrix), while avoiding unnecessary memory applications by using a virtual matrix instead of a square matrix at the time of memory allocation, thereby ensuring smooth progress of matching calculation.
According to a first aspect of the present disclosure, there is provided an object matching method, including: calculating cross-object weights between a first object set and a second object set, wherein the first object set comprises m first objects, and the second object set comprises n second objects in combination; storing the cross-object weight by using a first matrix, wherein the number of rows and the number of columns of the first matrix are not smaller than larger values in m and n; mapping the first matrix to a second matrix in a physical memory, wherein at least one of the number of rows and the number of columns of the second matrix is smaller than the first matrix; and performing matching calculation on the first object element and the second object element based on the cross-object weight data physically stored in the second matrix.
Preferably, the first matrix is a square matrix, and the number of rows and columns of the square matrix is equal to the larger value of m and n, and the second matrix is a matrix of mxn.
Preferably, mapping the first matrix to a second matrix in the physical memory includes: mapping the elements stored with the cross-object weights in the first matrix to physical memory addresses.
Preferably, mapping the first matrix to a second matrix in the physical memory includes: and returning a default value for the memory query of the element which does not store the cross-object weight in the first matrix.
Preferably, the first object set and the second object set include m order passengers and n order drivers, respectively, within a predetermined range, and calculating the cross-object weight between the first object set and the second object set includes: the weights of the mxn passenger driver combinations are calculated.
Preferably, calculating the weights for each of the mxn passenger driver combinations comprises: a weight for each combination of the passenger and the driver is calculated based on at least one of the driver passenger distance, the driver rating, and the passenger rating.
Preferably, performing a matching calculation on the first object element and the second object element based on the cross-object weight data physically stored in the second matrix includes: based on the KM algorithm, q pairs of passenger driver combinations are selected, where q is the smaller of n and m.
Preferably, the method may further comprise: mapping the first matrix to a second matrix in a physical memory if at least one of: the difference between m and n is greater than a first threshold; and the greater of m and n is greater than the second threshold.
According to a second aspect of the present disclosure, there is provided a span matching method, including: calculating the weight of each combination of m x n passengers and drivers for m passengers and n order receiving drivers in a preset range; storing mxn of the weights using a first square of pxp, the number of rows and columns p of the first square being the larger of m and n; mapping the first matrix to a second matrix in a physical memory, wherein the second matrix is a mxn matrix; and selecting q pairs of passenger driver combinations based on mxn of the weights physically stored in the second matrix, where q is the smaller of n and m.
Preferably, the method may further comprise: mapping the first matrix to a second matrix in a physical memory if at least one of: for a predetermined period of time; within a predetermined geographic range; the difference between m and n is greater than a first threshold; and the greater of m and n is greater than the second threshold.
According to a third aspect of the present disclosure, there is provided an object matching apparatus comprising: a weight calculation unit for calculating a cross-object weight between a first object set and a second object set, the first object set including m first objects, the second object set including n second objects in combination, and m being not equal to n; a matrix storage unit, configured to store the cross-object weight by using a first matrix, where both a number of rows and a number of columns of the first matrix are not smaller than a larger value of m and n; a memory mapping unit, configured to map the first matrix to a second matrix in a physical memory, where at least one of a number of rows and a number of columns of the second matrix is smaller than the first matrix; and an element matching unit for performing matching calculation on the first object element and the second object element based on the cross-object weight data physically stored in the second matrix.
According to a fourth aspect of the present disclosure, there is provided a ride matching device including: the weight calculation unit is used for calculating the weights of the mxn passenger driver combinations for m order passengers and n order receiving drivers in a preset range; a square matrix storage unit, configured to store mxn weights by using a first square matrix of pxp, where the number of rows and the number of columns p of the first square matrix are larger values of m and n; a memory mapping unit, configured to map the first matrix to a second matrix in a physical memory, where the second matrix is a mxn matrix; and a ride matching unit for selecting q pairs of passenger driver combinations based on mxn of the weights physically stored in the second matrix, where q is a smaller value of n and m.
According to a fifth aspect of the present disclosure, there is provided a ride matching system comprising a plurality of passenger clients, a plurality of driver clients, and a server, wherein the passenger clients are configured to: reporting riding requirements, boarding places and boarding time; the driver client is used for: reporting the current position and the operation state; the server is used for: extracting m order passengers and n order receiving drivers in a certain geographic range and time range; calculating the weights of mxn passenger driver combinations for the m order passengers and the n order receiving drivers; storing mxn of the weights using a first square of pxp, the number of rows and columns p of the first square being the larger of m and n; mapping the first matrix to a second matrix in a physical memory, wherein the second matrix is a mxn matrix; and selecting q pairs of passenger driver combinations based on mxn of said weights physically stored in the second matrix, where q is the smaller of n and m; and transmitting the matching information to the selected q passenger clients and q driver clients.
According to a sixth aspect of the present disclosure, there is provided a computing device comprising: a processor; and a memory having executable code stored thereon which, when executed by the processor, causes the processor to perform the method as described in the first and second aspects above.
According to a seventh aspect of the present disclosure there is provided a non-transitory machine-readable storage medium having stored thereon executable code which, when executed by a processor of an electronic device, causes the processor to perform the method as described in the first and second aspects above.
Therefore, the invention uses the virtual matrix to replace the square matrix, thereby avoiding the application of unnecessary memory. Under the scene of a network bus, the invention can use a mode of using a virtual matrix to proxy a real matrix in the engineering process, reduce the memory waste and ensure the service stability because of the condition that the quantity difference between orders and drivers is large.
Drawings
The foregoing and other objects, features and advantages of the disclosure will be apparent from the following more particular descriptions of exemplary embodiments of the disclosure as illustrated in the accompanying drawings wherein like reference numbers generally represent like parts throughout exemplary embodiments of the disclosure.
FIG. 1 shows a bipartite graph and its matching examples.
Fig. 2 shows a schematic flow chart of an object matching method according to an embodiment of the invention.
Fig. 3 shows a schematic flow chart of a span matching method according to an embodiment of the invention.
Fig. 4 shows a schematic composition diagram of an object matching apparatus according to an embodiment of the present invention.
Fig. 5 shows a schematic composition of a ride matching device according to an embodiment of the present invention.
Fig. 6 shows a schematic composition of a ride matching system according to one embodiment of the invention.
Fig. 7 shows a schematic diagram of a computing device that may be used to implement the above-described object, particularly the span matching method, according to an embodiment of the invention.
Fig. 8A-B show a span matching example according to the invention.
Detailed Description
Preferred embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While the preferred embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As described above, in the application scenario of the user order system assignment, the matching operation of assigning the user order to the proper acquirer is involved. For example, in a network taxi-taking scenario, the above-described matching operation is more a critical process that the system needs to implement efficiently, namely, a ride-on matching process that matches an appropriate driver for each order that the passenger sends. In a specific matching process, a global optimal strategy is preferably adopted. The global optimum strategy typically involves n orders at the same time and finds m candidate drivers. The q pairs (q taking the smaller of n and m) of order driver combinations can then be selected by comprehensive calculations. These combinations may not be globally optimal from a single combination perspective. However, the matching effect achieved by these combinations is best from an overall point of view.
The span matching typically requires the use of a global optimization strategy as described above. Aiming at the global optimal strategy, the invention can preferably adopt a KM algorithm to convert the span matching into the weighted bipartite graph matching problem.
Herein, a bipartite graph may refer to a special model in graph theory. Let g= (V, E) be an undirected graph, if the vertex V can be divided into two mutually disjoint subsets (a, B), and the two vertices i and j associated with each edge (i, j) in the graph belong to the two different vertex sets (iin a, iin B), respectively, then the graph G is referred to as a bipartite graph.
In other words, if points in the graph can be divided into two groups, and all edges are made to cross the group boundaries, then this is a bipartite graph. That is, the vertices of a graph are divided into two non-intersecting sets XX and YY, such that each edge connects vertices in XX, YY, respectively. If such a division exists, the graph is a bipartite graph.
FIG. 1 shows a bipartite graph and its matching examples. As shown on the left side of FIG. 1, if the points to the left (points 1-4) are contracted to belong to the XX set and the points to the right (points 5-8) to belong to the YY set, then the two end points on each side of the graph belong to different sets, and such a graph is a bipartite graph. In graph theory, a match is a collection of edges, where any two edges have no common vertex. For example, the middle and right side of FIG. 1 show two matching schemes for the left side graph, match 1 and match 2, where gray links represent matching links selected from existing links. In the matching scheme 2, since all 8 points are matched, it can be regarded as a matching scheme superior to the left matching scheme 1.
Fig. 1 gives an example where the matches between different points have the same utility (i.e. the matching weights are the same). When the connecting lines between the points have different weights, namely when facing the weighted bipartite graph, a group of matches needs to be found, so that the sum of the weights is the maximum, namely the best match of the weighted bipartite graph. The solution of the optimal matching pair may be performed using a KM (Kuhn-Munkres) algorithm. The KM algorithm is a greedy algorithm involving iterative operations, and in particular implementations, a square matrix structure is typically required to hold the weight data. Due to the iterative operation characteristic of the KM algorithm, the accuracy and the calculation efficiency of the algorithm can be ensured by using a square matrix. When the XX set and the YY set each have the same number of points (i.e., the number of objects), as shown in fig. 1, each of the four points to be matched, a 4x4 square matrix (i.e., a square matrix) may be used to hold the weight data. This presents a significant memory problem when the XX and YY sets each have points that differ significantly. Assuming one match during peak hours of departure, 10000 passengers get off a car at the same time in a certain business center area, but only 10 drivers are available for matching. If the square matrix is constructed according to the conventional implementation of the KM algorithm, 10000x10000 spaces are required, but the space in which data is actually stored is a 10000x10 matrix, and only one thousandth of the space in which memory is applied is used. That is, the space of the applied memory depends on the number of orders and drivers, and if the difference between the orders and the drivers is large, the space of the applied memory is wasted, and even the matching cannot be realized in engineering.
Because the existing global matching scheme cannot meet the characteristics of high real-time performance and burstiness of scenes such as network taxi taking and the like, an improved object matching scheme is needed.
Fig. 2 shows an exemplary flow chart of an object matching method according to one embodiment of the invention. The matching method involves matching a first object of a first set of objects with a second object of a second set of objects, in particular weighted matching, for example, especially suitable for driver-to-passenger matching (i.e. matching of driver and passengers) in a network-bound car scene.
In step S210, cross-object weights between the first set of objects and the second set of objects are calculated. Here, the cross-object weight refers to a weight between objects belonging to different sets. If the first set of objects comprises m first objects and the second set of objects comprises n second objects, there may be mxn combinations of the first objects and the second objects, for which the weights of each of the mxn combinations may be calculated based on a predetermined rule.
In step S220, the cross-object weight is stored using a first matrix, where neither the number of rows nor the number of columns of the first matrix is smaller than the larger value of m and n. In a preferred embodiment, for example when weighted bipartite graph matching calculation is performed using KM algorithm, the first matrix may be a square matrix, and the number of rows and columns of the square matrix are equal to the larger value of m and n.
In step S230, the first matrix is mapped to a second matrix in the physical memory, where at least one of the number of rows and columns of the second matrix is smaller than the first matrix. In other words, compared to a large matrix (e.g., square matrix) provided for engineering implementation of, for example, KM algorithm, the memory application may be performed according to the amount of memory required for actual use, e.g., applying for a second matrix with size mxn, and storing the actually calculated weight in the corresponding address of the memory. Here, it should be understood that the second matrix in the physical memory may refer to a memory space capable of storing the second matrix size, and the memory space may implement storage of the corresponding weight value through memory address mapping. In a preferred embodiment, a section of continuous memory address may be applied for the second matrix for weight value storage, and in other embodiments, the actual memory address may be discontinuous, which is not limited to this invention.
Subsequently, in step S240, a matching calculation may be performed on the first object element and the second object element based on the cross-object weight data physically stored in the second matrix.
Therefore, the scheme meets the high efficiency of the object matching algorithm by using a large matrix (for example, a square matrix), and avoids unnecessary memory application by using a virtual matrix to replace the square matrix in memory allocation, thereby ensuring the smooth performance of matching calculation.
Specifically, in order to implement efficient operations such as KM algorithm, iterative computation involved in the algorithm may be implemented in a matching algorithm using a square matrix (i.e., a first matrix), but when compiling a programming language into a machine language and requesting a physical memory space, only elements of the first matrix in which the cross-object weights are stored may be mapped to physical memory addresses. Further, a default value may be returned for the memory query in the first matrix without the element storing the cross-object weight, so as to avoid performance problems and risks caused by an excessive memory application.
The object matching scheme provided by the invention is especially suitable for application scenes of network about car driver multiplication matching. In the ride matching scenario, the number of order pick-up drivers in adjacent physical ranges is limited due to the high timeliness of user orders (the order pick-up feedback needs to be given as soon as possible), so that the efficient real-time (or near real-time) matching scheme of the present invention is particularly needed.
Thus, the first set of objects and the second set of objects may include m order passengers and n order drivers, respectively, within a predetermined range. To this end, calculating cross-object weights between the first set of objects and the second set of objects includes: the weights of the mxn passenger driver combinations are calculated. The above-mentioned weights may characterize the degree of matching between a certain passenger and a certain driver without taking other passengers or drivers into account. For example, the closer the passenger and driver are, or the shorter the required traffic time, the lower the boarding time and other costs, the higher the match, and the greater the weight. Specifically, the weight of each passenger-driver combination may be calculated based on at least one of the driver-passenger distance, the driver rating, and the passenger rating. The distance between the driver and the passengers can be physical distance or traffic distance. For example, the need to turn around opposite roads may mean a closer physical distance but a greater traffic distance.
Here, the predetermined range may be a predetermined business center area, a scenic spot range, or a gridded range. The above range may be predefined by the system or may be dynamically adjusted based on predetermined rules, as the invention is not limited in this regard.
Subsequently, a matching calculation can be performed based on the KM algorithm using the square matrix and its corresponding virtual matrix (i.e., the algorithm appears to be a square matrix, but is a smaller matrix with weights actually stored in memory), and q pairs of passenger driver combinations are selected, where q is the smaller of n and m.
Aiming at the problem of memory waste in the KM conventional engineering method, the object matching scheme can apply for the memory according to the memory demand of actual use on the premise of ensuring the correctness of the algorithm, and avoids performance problems and risks caused by overlarge memory application.
Specifically, the invention designs a virtual matrix, the outside of the structure keeps consistent with the square matrix required in the algorithm, but the inside only needs to apply for the memory space actually required, so that the memory waste is avoided. In the network taxi scene, the order quantity and the driver quantity may have a great gap in a certain period or a certain area, for example, in the scenes of the morning and evening peaks, the airport taxi taking scene and the like, and by adopting the scheme, the memory can be effectively and reasonably utilized, and the stability of the service is ensured.
The virtual matrix adopts a proxy mode to disguise itself as a normal matrix. And applying for the internal memory according to the actual internal memory requirement. The externally provided function is the same as that of a normal matrix, intermediate conversion is performed inside, data inquiry in a reasonable range is directed to an actual memory, and data inquiry outside the reasonable range can return to a default value.
As described above, the above-mentioned "virtual matrix" of the present invention is particularly suitable for application scenarios where the first and second objects are widely separated. Because the matrix requires a certain overhead for virtualization, the above-mentioned "virtual matrix" replacement scheme of the present invention may be adopted only when the difference between m and n is greater than the first threshold value and/or the larger value of m and n is greater than the second threshold value. In other cases, the storage space of the square matrix size may be applied directly in the memory.
In one embodiment, the invention may also be implemented as a span matching method. Fig. 3 shows a schematic flow chart of a span matching method according to an embodiment of the invention.
In step S310, the weights of mxn passenger driver combinations may be calculated for m order passengers and n order taker within a predetermined range. For example, during peak hours of departure 500 passengers and 50 order takers at a business center (i.e., where m=500, n=50). In one embodiment, an identical predetermined range may be defined for m order takers and n order taker drivers. In other embodiments, different predetermined ranges may be defined for the m order passengers and the n order takers due to the higher degrees of freedom of the vehicle. For example, all of the order passengers within 500m of a landmark building square may be considered m order passengers within a predetermined range, while the passenger-loadable drivers within 3km of the landmark building square may be considered n order drivers within the predetermined range. Further, the m order passengers may be passengers who order at the same time or at approximately the same time (e.g., adjacent one minute, etc.) within a predetermined range, and the n order drivers may be assignable drivers who are idle for the above-described period of time.
In step S320, mxn of the weights are stored with a first square of pxp, the number of rows and columns p of the first square being the larger of m and n. For example, in the case of the matching example in the peak hours of the departure, if p is equal to the number m of passengers, the first square matrix is 500×500.
In step S330, the first matrix is mapped to a second matrix in the physical memory, where the second matrix is a matrix of mxn. For example, in the matching example in the peak hours of the next shift, the second matrix is 500×50.
In step S340, q pairs of passenger driver combinations are selected based on mxn of the weights physically stored in the second matrix, where q is the smaller of n and m. For example, in the matching example described above during rush hour, q is determined by the smaller number of order taker n, i.e., 50 orders and drivers can be matched based on the number of order taker.
Because the matrix requires a certain overhead for virtualization, the virtual memory scheme can be started in a specific scene. To this end, the method further comprises mapping said first matrix to a second matrix in the physical memory if at least one of: for a predetermined period of time; within a predetermined geographic range; the difference between m and n is greater than a first threshold; and the greater of m and n is greater than the second threshold.
In one embodiment, the present invention may also be implemented as an object matching apparatus. Fig. 4 shows a schematic composition diagram of an object matching apparatus according to an embodiment of the present invention.
As shown in fig. 4, the object matching apparatus 400 includes a weight calculating unit 410, a matrix storing unit 420, a memory mapping unit 430, and an element matching unit 440.
The weight calculation unit 410 may be configured to calculate a cross-object weight between a first set of objects including m first objects and a second set of objects including n second objects in combination.
The matrix storage unit 420 may be configured to store the cross-object weight using a first matrix, where neither the number of rows nor the number of columns of the first matrix is smaller than the larger value of m and n.
The memory mapping unit 430 may be configured to map the first matrix to a second matrix in the physical memory, where at least one of a number of rows and a number of columns of the second matrix is smaller than the first matrix.
The element matching unit 440 may be configured to perform a matching calculation on the first object element and the second object element based on the cross-object weight data physically stored in the second matrix.
Further, the invention can also be realized as a ride matching device. Fig. 5 shows a schematic composition of a ride matching device according to an embodiment of the present invention.
As shown in fig. 5, the span matching device 500 includes a weight calculating unit 510, a square matrix storing unit 520, a memory mapping unit 530, and a span matching unit 540.
The weight calculation unit 510 may be configured to calculate weights of mxn passenger driver combinations for m getting-on passengers and n getting-on drivers within a predetermined range.
The matrix storage unit 520 may be configured to store mxn of the weights using a first matrix of px, where the number of rows and columns p of the first matrix are larger values of m and n.
The memory mapping unit 530 may be configured to map the first matrix to a second matrix in the physical memory, where the second matrix is a matrix of mxn.
The ride matching unit 540 may be adapted to select q pairs of passenger driver combinations based on mxn of said weights physically stored in the second matrix, where q is the smaller value of n and m.
The above-described span matching calculation of the present invention is particularly suitable for implementation on a server. The server can collect the current position and the ordering condition of the passengers in real time, collect the idle conditions of drivers at nearby positions and give corresponding matching.
For this purpose, the invention can also be implemented as a ride matching system. Fig. 6 shows a schematic composition of a ride matching system according to one embodiment of the invention. As shown, the system 600 may include a plurality of passenger clients 610, a plurality of driver clients 620, and a server 630.
Each passenger client 610 may send a ride request and report when a ride is needed, and the reported information may include ride requirements, boarding locations, and boarding periods. The driver client 620 may report the current status, including the current location and the status information of whether the passenger is loaded or whether the service can be provided, periodically or in real time. As shown in fig. 6, the passenger client 610 may be a ride APP installed in a user's cell phone. Accordingly, the driver client 620 may also be a ride APP (e.g., driver mode) installed in the driver user's handset. In other embodiments, the driver client 620 may also be in-vehicle order software or the like.
Server 630 may then aggregate the current information of the passenger client 610 and driver client 620 in real time. In particular, server 630 may be configured to: extracting m order passengers and n order receiving drivers in a certain geographic range and time range; calculating the weights of mxn passenger driver combinations for the m order passengers and the n order receiving drivers; storing mxn of the weights using a first square of pxp, the number of rows and columns p of the first square being the larger of m and n; the first matrix is mapped to a second matrix in the physical memory, and the second matrix is a matrix of mxn; and selecting q pairs of passenger driver combinations based on mxn of said weights physically stored in the second matrix, where q is the smaller of n and m; and transmitting the matching information to the selected q passenger clients and q driver clients.
Fig. 7 shows a schematic diagram of a computing device that may be used to implement the above-described object, particularly the span matching method, according to an embodiment of the invention.
Referring to fig. 7, a computing device 700 includes a memory 710 and a processor 720.
Processor 720 may be a multi-core processor or may include multiple processors. In some embodiments, processor 920 may include a general-purpose host processor and one or more special coprocessors such as, for example, a Graphics Processor (GPU), a Digital Signal Processor (DSP), etc. In some embodiments, processor 720 may be implemented using custom circuitry, for example, an application specific integrated circuit (ASIC, application Specific Integrated Circuit) or a field programmable gate array (FPGA, field Programmable Gate Arrays).
Memory 710 may include various types of storage units, such as system memory, read Only Memory (ROM), and persistent storage. Where the ROM may store static data or instructions that are required by the processor 720 or other modules of the computer. The persistent storage may be a readable and writable storage. The persistent storage may be a non-volatile memory device that does not lose stored instructions and data even after the computer is powered down. In some embodiments, the persistent storage device employs a mass storage device (e.g., magnetic or optical disk, flash memory) as the persistent storage device. In other embodiments, the persistent storage may be a removable storage device (e.g., diskette, optical drive). The system memory may be a read-write memory device or a volatile read-write memory device, such as dynamic random access memory. The system memory may store instructions and data that are required by some or all of the processors at runtime. Furthermore, memory 710 may include any combination of computer-readable storage media including various types of semiconductor memory chips (DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), magnetic disks, and/or optical disks may also be employed. In some embodiments, memory 710 may include readable and/or writable removable storage devices such as Compact Discs (CDs), digital versatile discs (e.g., DVD-ROMs, dual layer DVD-ROMs), blu-ray discs read only, super-density discs, flash memory cards (e.g., SD cards, min SD cards, micro-SD cards, etc.), magnetic floppy disks, and the like. The computer readable storage medium does not contain a carrier wave or an instantaneous electronic signal transmitted by wireless or wired transmission.
The memory 710 has stored thereon executable code that, when processed by the processor 720, causes the processor 720 to perform the above-described object, particularly the span matching method.
Application example
The object matching scheme of the invention can use a virtual matrix to replace a square matrix in the process of performing bipartite graph matching in the KM algorithm engineering process, and the algorithm flow is embedded, so that the algorithm accuracy is ensured, and the memory use is reduced.
The principle of the invention will be further described in connection with application examples. Fig. 8A-B show a span matching example according to the invention.
As shown, where specific memory usage is involved, for ease of illustration, the scenario is reduced to 5 orders (passenger issued ride requests) matching 2 candidate drivers as shown in fig. 8A.
If the conventional scheme is adopted, since the square matrix structure needs to be satisfied when the KM algorithm is completed, the number of rows and columns of the square matrix is a larger value of the first and second object numbers, and for this purpose, a memory space of application 5x5 is required as shown in the left side of fig. 8B. If double (IEEE 754) type data is used to hold the weight values, a total of 100 bytes of memory space is required. If the virtual matrix scheme of the present invention on the right side of fig. 8B is adopted, only the storage space required by the actual 5x2 weights themselves, i.e., the 5x2 memory space, is required, and the total 40byte memory space is required.
It follows that the greater the order differs from the driver's amount, the more space is saved. Therefore, the invention is especially suitable for network taxi taking scenes, especially peak taxi calling scenes such as commuting and the like.
The object matching, in particular the span matching scheme, according to the present invention has been described in detail above with reference to the accompanying drawings. The invention uses the virtual matrix to replace the square matrix, thereby avoiding the application of unnecessary memory. Under the network taxi scene, the invention can use a mode of using a virtual matrix to proxy a real matrix in the KM engineering process, reduce memory waste and ensure service stability because of the condition that the quantity difference between orders and drivers is large.
It should be appreciated that while the object matching scheme of the present invention is described above in connection with a span matching scenario, the object matching scheme of the present invention may also be applicable to other matching scenarios other than span matching, for example, other scenarios that require conversion to weighted bipartite graph matching, such as other order scenarios that require matching by the system (such as a meal delivery scenario for a system dispatch, etc.).
Furthermore, the method according to the invention may also be implemented as a computer program or computer program product comprising computer program code instructions for performing the steps defined in the above-mentioned method of the invention.
Alternatively, the invention may also be embodied as a non-transitory machine-readable storage medium (or computer-readable storage medium, or machine-readable storage medium) having stored thereon executable code (or a computer program, or computer instruction code) which, when executed by a processor of an electronic device (or computing device, server, etc.), causes the processor to perform the steps of the above-described method according to the invention.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems and methods according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block may 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 sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The foregoing description of embodiments of the invention has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the various embodiments described. The terminology used herein was chosen in order to best explain the principles of the embodiments, the practical application, or the improvement of technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (13)

1. An object matching method, comprising:
calculating cross-object weights between a first object set and a second object set, wherein the first object set comprises m first objects, and the second object set comprises n second objects;
storing the cross-object weight using a first matrix, the first matrix being a square matrix, and the number of rows and columns of the square matrix being equal to the greater of m and n;
mapping the first matrix to a second matrix in a physical memory, wherein the second matrix is an m x n matrix; and
based on the cross-object weight data physically stored in the second matrix, performing a matching calculation on the first object element and the second object element,
wherein the first object set and the second object set respectively comprise m order passengers and n order drivers within a preset range,
calculating cross-object weights between the first set of objects and the second set of objects includes:
the weights of each of the m x n passenger driver combinations are calculated.
2. The method of claim 1, wherein mapping the first matrix to a second matrix in physical memory comprises:
mapping the elements stored with the cross-object weights in the first matrix to physical memory addresses.
3. The method of claim 2, wherein mapping the first matrix to a second matrix in physical memory comprises:
and returning a default value for the memory query of the element which does not store the cross-object weight in the first matrix.
4. The method of claim 1, wherein calculating weights for each of the m x n passenger driver combinations comprises:
a weight for each combination of the passenger and the driver is calculated based on at least one of the driver passenger distance, the driver rating, and the passenger rating.
5. The method of claim 1, wherein performing a matching calculation on the first object element and the second object element based on the cross-object weight data physically stored in the second matrix comprises:
based on the KM algorithm, q pairs of passenger driver combinations are selected, where q is the smaller of n and m.
6. The method of claim 1, further comprising:
mapping the first matrix to a second matrix in a physical memory if at least one of:
the difference between m and n is greater than a first threshold; and
the larger of m and n is greater than the second threshold.
7. A ride matching method comprising:
for m order passengers and n order receiving drivers in a preset range, calculating the weight of each combination of m x n passenger drivers;
storing mx n of the weights using a first square of p, the number of rows and columns p of the first square being the larger of m and n;
mapping the first matrix to a second matrix in a physical memory, wherein the second matrix is an m x n matrix; and
based on the m x n of said weights physically stored in the second matrix, q pairs of passenger driver combinations are selected, where q is the smaller of n and m.
8. The method of claim 7, further comprising:
mapping the first matrix to a second matrix in a physical memory if at least one of:
for a predetermined period of time;
within a predetermined geographic range;
the difference between m and n is greater than a first threshold; and
the larger of m and n is greater than the second threshold.
9. An object matching apparatus comprising:
a weight calculation unit configured to calculate a cross-object weight between a first object set including m first objects and a second object set including n second objects, and m is not equal to n;
a matrix storage unit for storing the cross-object weight using a first matrix, the first matrix being a square matrix, and the number of rows and columns of the square matrix being equal to a larger value of m and n;
a memory mapping unit, configured to map the first matrix to a second matrix in a physical memory, where the second matrix is a mx n matrix; and
an element matching unit for performing a matching calculation on the first object element and the second object element based on the cross-object weight data physically stored in the second matrix,
wherein the first object set and the second object set respectively comprise m order passengers and n order drivers within a preset range,
calculating cross-object weights between the first set of objects and the second set of objects includes:
the weights of each of the m x n passenger driver combinations are calculated.
10. A ride matching device comprising:
the weight calculating unit is used for calculating the weight of each combination of m x n passenger drivers for m order passengers and n order receiving drivers in a preset range;
a square matrix storage unit, configured to store m x n weights by using a first square matrix of p x p, where the number of rows and the number of columns p of the first square matrix are larger values of m and n;
a memory mapping unit, configured to map the first matrix to a second matrix in a physical memory, where the second matrix is a mx n matrix; and
and a ride matching unit for selecting q pairs of passenger driver combinations based on the m x n weights physically stored in the second matrix, wherein q is a smaller value of n and m.
11. A driver-passenger matching system comprises a plurality of passenger clients, a plurality of driver clients and a server, wherein
The passenger client is used for:
reporting riding requirements, boarding places and boarding time;
the driver client is used for:
reporting the current position and the operation state;
the server is used for:
extracting m order passengers and n order receiving drivers in a certain geographic range and time range;
calculating the weight of each combination of m x n passenger drivers for the m order passengers and n order receiving drivers;
storing m x n weights by using a first square matrix of p x p, wherein the number of rows and the number of columns p of the first square matrix are larger values of m and n;
mapping the first matrix to a second matrix in a physical memory, wherein the second matrix is a mx n matrix; and
selecting q pairs of passenger driver combinations based on the m x n of said weights physically stored in the second matrix, where q is the smaller of n and m; and
and sending the matching information to the q passenger clients and the q driver clients which are selected.
12. A computing device, comprising:
a processor; and
a memory having executable code stored thereon, which when executed by the processor, causes the processor to perform the method of any of claims 1-8.
13. A non-transitory machine-readable storage medium having stored thereon executable code, which when executed by a processor of an electronic device, causes the processor to perform the method of any of claims 1-8.
CN202010284935.2A 2020-04-13 2020-04-13 Object and span matching method, device and system Active CN111507493B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010284935.2A CN111507493B (en) 2020-04-13 2020-04-13 Object and span matching method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010284935.2A CN111507493B (en) 2020-04-13 2020-04-13 Object and span matching method, device and system

Publications (2)

Publication Number Publication Date
CN111507493A CN111507493A (en) 2020-08-07
CN111507493B true CN111507493B (en) 2023-04-18

Family

ID=71875977

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010284935.2A Active CN111507493B (en) 2020-04-13 2020-04-13 Object and span matching method, device and system

Country Status (1)

Country Link
CN (1) CN111507493B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112232700B (en) * 2020-11-04 2024-01-09 广州宸祺出行科技有限公司 Optimized method and system for assigning special vehicles

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2562681A1 (en) * 2011-08-25 2013-02-27 Delphi Technologies, Inc. Object tracking method for a camera-based driver assistance system
CN106897801A (en) * 2017-02-28 2017-06-27 百度在线网络技术(北京)有限公司 Method, device, equipment and storage medium that driver classifies
CN109155100A (en) * 2016-06-06 2019-01-04 北京嘀嘀无限科技发展有限公司 System and method for distributing reservation order
CN110580575A (en) * 2019-08-27 2019-12-17 南京领行科技股份有限公司 Order distribution method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019109199A1 (en) * 2017-12-04 2019-06-13 Beijing Didi Infinity Technology And Development Co., Ltd. Systems and methods for allocating orders in an online on-demand service

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2562681A1 (en) * 2011-08-25 2013-02-27 Delphi Technologies, Inc. Object tracking method for a camera-based driver assistance system
CN109155100A (en) * 2016-06-06 2019-01-04 北京嘀嘀无限科技发展有限公司 System and method for distributing reservation order
CN106897801A (en) * 2017-02-28 2017-06-27 百度在线网络技术(北京)有限公司 Method, device, equipment and storage medium that driver classifies
CN110580575A (en) * 2019-08-27 2019-12-17 南京领行科技股份有限公司 Order distribution method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
谭卫民,等."考虑用户体验的动态共乘系统设计".《系统工程理论与实践》.2020,第40卷(第40期),第210-218页. *

Also Published As

Publication number Publication date
CN111507493A (en) 2020-08-07

Similar Documents

Publication Publication Date Title
US9665428B2 (en) Distributing erasure-coded fragments in a geo-distributed storage system
CN109154917A (en) Storage system and solid state hard disk
US7839840B2 (en) Method and system for routing traffic in a communication network
US9398053B2 (en) Efficient data transmission between computing devices
WO2015078238A1 (en) Dispatching map matching tasks by cluster server in internet of vehicles
CN105159610B (en) Large-scale data processing system and method
US20100312749A1 (en) Scalable lookup service for distributed database
WO2019037367A1 (en) Delivery task processing method and apparatus, and electronic device
CN105426245A (en) Dynamically composed compute nodes comprising disaggregated components
US20210256646A1 (en) Diversified and connected freight allocation system and method
CN110321225B (en) Load balancing method, metadata server and computer readable storage medium
US11922059B2 (en) Method and device for distributed data storage
CN103312624A (en) Message queue service system and method
CN108596723B (en) Order pushing method, system, server and storage medium
CN111507493B (en) Object and span matching method, device and system
CN106156062A (en) Determine the personalized labels of user and the method and apparatus of pushed information
CN101778050A (en) Load balancing method, device and system
CN117931447A (en) End-edge cloud cooperative distributed computing method, device, equipment and medium
CN113014408A (en) Distributed system and management method thereof
CN113163421B (en) Method, device, terminal and medium for establishing hierarchical network
CN113807555B (en) Address selection method and device for distribution center, electronic equipment and storage medium
CN103780426A (en) Consistency maintenance methods for cloud storage data and cloud storage system
CN102546549B (en) Method, system and device for data transmission
CN111177478A (en) Query method, device and system
CN111598458A (en) Task processing method and device, electronic equipment and storage medium

Legal Events

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