WO2023071999A1 - 一种用户匹配方法、装置、设备及存储介质 - Google Patents
一种用户匹配方法、装置、设备及存储介质 Download PDFInfo
- Publication number
- WO2023071999A1 WO2023071999A1 PCT/CN2022/127095 CN2022127095W WO2023071999A1 WO 2023071999 A1 WO2023071999 A1 WO 2023071999A1 CN 2022127095 W CN2022127095 W CN 2022127095W WO 2023071999 A1 WO2023071999 A1 WO 2023071999A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- matching
- user
- queue
- users
- dimension
- 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.)
- Ceased
Links
Images
Classifications
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/70—Game security or game management aspects
- A63F13/79—Game security or game management aspects involving player-related data, e.g. identities, accounts, preferences or play histories
- A63F13/795—Game security or game management aspects involving player-related data, e.g. identities, accounts, preferences or play histories for finding other players; for building a team; for providing a buddy list
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/70—Game security or game management aspects
- A63F13/77—Game security or game management aspects involving data related to game devices or game servers, e.g. configuration data, software version or amount of memory
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/70—Game security or game management aspects
- A63F13/79—Game security or game management aspects involving player-related data, e.g. identities, accounts, preferences or play histories
Definitions
- the embodiments of the present application relate to the field of computer technology, and in particular to a user matching method, device, equipment and storage medium.
- Embodiments of the present application provide a user matching method, device, device, and storage medium to solve the technical problem of low user matching efficiency caused by the mutual matching between different users in the related art.
- the user matching can be completed, and the efficiency of user matching can be effectively improved.
- the embodiment of the present application provides a user matching method, including:
- the matching queue matches a preset number of first users, delete the matched first users from the matching pool and all matching queues, and determine a matching result based on the matched first users.
- the embodiment of the present application provides a user matching device, including a request response module, a queue management module and a matching processing module, wherein:
- the request response module is configured to add the first user to a matching pool in response to a user matching request associated with the first user;
- the queue management module is configured to determine a first matching queue corresponding to a queue dimension from a plurality of matching queues according to the user dimension of the first user, and add the first user to the first matching queue, different The matching queues correspond to different queue dimensions;
- the matching processing module is configured to delete the matched first users from the matching pool and all matching queues when the matching queue matches a preset number of first users, and determine the matching based on the matched first users result.
- the embodiment of the present application provides a user matching device, including: a memory and one or more processors;
- the memory configured to store one or more programs
- the one or more processors are made to implement the user matching method as described in the first aspect.
- the embodiment of the present application provides a storage medium containing computer-executable instructions, and the computer-executable instructions are configured to execute the user matching method as described in the first aspect when executed by a computer processor.
- the embodiment of the present application provides a computer program product, the computer program product includes a computer program, the computer program is stored in a computer-readable storage medium, and at least one processor of the device reads the computer program from the computer-readable storage medium Acquiring and executing a computer program, so that the device executes the user matching method as described in the first aspect.
- the first matching queue corresponding to the queue dimension is determined from multiple matching queues according to the user dimension of the first user, and the first user is added to the matching pool.
- the first matching queue when the number of first users matched by the matching queue reaches the preset number, the matched first user will be deleted from the matching pool and all matching queues, reducing the number of first users who have been matched by other matching queues Repeat the matching, and determine the matching result based on the matched first user, realize the matching of the first user in the matching queues of multiple queue dimensions, each matching queue independently performs the matching of the first user, and in one of the matching queues User matching can be completed when the preset number is met, and there is no need to repeatedly traverse and match different users, reducing a large number of cyclic calculation operations in the matching process and effectively improving user matching efficiency.
- FIG. 1 is a flow chart of a user matching method provided in an embodiment of the present application
- FIG. 2 is a schematic diagram of a response flow to a user matching request provided by an embodiment of the present application
- Fig. 3 is a flow chart of another user matching method provided by the embodiment of the present application.
- FIG. 4 is a schematic diagram of a user matching architecture provided by an embodiment of the present application.
- FIG. 5 is a schematic diagram of changes in a matching pool and a matching queue provided by an embodiment of the present application
- FIG. 6 is a schematic diagram of changes in another matching pool and matching queue provided by the embodiment of the present application.
- Fig. 7 is a schematic structural diagram of a user matching device provided by an embodiment of the present application.
- Fig. 8 is a schematic structural diagram of a user matching device provided by an embodiment of the present application.
- Figure 1 shows a flowchart of a user matching method provided by the embodiment of the present application.
- the user matching method provided by the embodiment of the present application can be executed by a user matching device, and the user matching device can use hardware and/or software Realized, and integrated in user matching equipment (such as server).
- the user matching method includes:
- S101 Add the first user to a matching pool in response to a user matching request associated with the first user.
- the user matching request is sent by a client (such as a mobile phone, tablet, computer, etc. logged in by the first user), and the user matching request is associated with the first user logged in on the client.
- a client such as a mobile phone, tablet, computer, etc. logged in by the first user
- the user matching request is associated with the first user logged in on the client.
- the first user needs to connect or interact with game data, he sends a user matching request associated with the first user to the user matching device.
- the user matching request is verified, and the first user associated with the user matching request is added to the matching pool after passing the verification.
- multiple user matching devices are deployed in different regions, and the user matching device can be set with one or more matching pools.
- the user matching device receives a user matching request, it can synchronize the user matching request to the user matching in other regions.
- other user matching devices add the first user associated with the user matching request to its corresponding matching pool.
- a user matching request when a user matching request is received, it may first be determined whether there is a capacity limit in the matching pool to be joined by the first user, and if there is a capacity limit, a capacity check is performed on the matching pool to determine whether to add The first user joins the corresponding matching pool or determines the time to join the matching pool.
- S102 Determine the first matching queue corresponding to the queue dimension from multiple matching queues according to the user dimension of the first user, and add the first user to the first matching queue, and different matching queues correspond to different queue dimensions.
- This embodiment provides multiple matching queues, and different matching queues correspond to different queue dimensions. Different matching queues may be deployed in the same user matching device, or may be deployed in different user matching devices.
- the matching queue corresponding to the matching queue dimension is determined as the first matching queue matching the current user matching request, the first user is taken out from the matching pool, and the first user is added to the first matching queue.
- the matching pool and/or matching queue provided in this embodiment stores the added first user through storage middleware.
- the storage middleware includes one or a combination of kv storage middleware, Vector storage middleware, List storage middleware, and kafka storage middleware.
- the matching pool it needs to save all the first users who currently submit user matching requests in the entire user matching system, for example, use kv storage middleware such as redis, memcache, etcd to store the added first users.
- redis to store the first user
- redis's ttl expiration callback configuration for example, set notify-keyspace-events "Ex" in redis.conf, and listen to the callback event
- the function of the matching pool can be realized by means of lease + monitoring + prefix.
- the matching queue it requires orderly data and easy expansion.
- etcd For using etcd to store the first user, you can use the prefix feature of etcd to build a queue. For example, you can specify the prefix of the matching queue as: mathcQueue-A-B-C-D/, then satisfy the first user of dimensions A, B, C, and D at the same time It can be pushed to this matching queue and become a new key. For example, the key corresponding to the first user uid1 is: mathcQueue-A-B-C-D/uid1. At the same time, etcd uses the Paxos algorithm to ensure data consistency in the cluster, so as to achieve disaster recovery and restart without losing data.
- kafka For using kafka to store the first user, turn on the switch of automatically creating a new topic in kafka (a matching queue can be regarded as a topic), and then calculate the matching queue that the user needs to be assigned to according to the preset dimension calculation script, and the consumption process subscribes A new topic, each topic handles matching requests individually.
- This solution uses storage middleware to store the first user who joined. When the matching process or queue processing process is restarted (may be caused by system downtime, network problems, program problems, system upgrades), through the storage middleware
- the service governance dynamic scheduling function routes the user matching request associated with the first user to other nodes, and the other nodes continue to serve, making the matching process a stateless process and reducing the loss of matching information after the service is restarted.
- Each matching queue has a corresponding preset number. Each matching queue only traverses itself and matches the first users who join it. When the number of first users added reaches the preset number, the matching queue is considered complete. match.
- the matched first user is deleted from all matching pools and matching queues (including the matching queue that has completed matching).
- the matched first user is deleted from all matching pools and matching queues, so as to avoid the situation that other matching queues perform repeated matching on the first user who has completed matching.
- the matching results are determined based on these matched first users.
- the matching result can be fed back to the client corresponding to the first user or the business at the lower layer, and the logic of the lower layer of the business can be continued.
- Fig. 2 provides a schematic diagram of a response process to a user matching request provided by the embodiment of the present application.
- Fig. 2 assuming that there are n matching queues (1-n in the queue in the figure), after receiving the requests sent by different clients
- users match requests add the first users associated with different user matching requests (user 1 and user 2 in the figure) to the matching pool, and add them to the matching queue of the corresponding queue dimension according to the user dimensions of user 1 and user 2 respectively
- user 1 is added to queue 1 and queue n
- user 2 is added to queue 2 and queue 3.
- Each matching queue detects the number of first users added, and the number of users in a certain matching queue reaches the set value. When the number is exceeded, the matched first user will be deleted from all matching pools and matching queues, and the matching result will be fed back to the client based on the matched first user.
- the first matching queue corresponding to the queue dimension is determined from multiple matching queues according to the user dimension of the first user, and the first user is added to the first matching queue.
- the matching queue when the number of first users matched by the matching queue reaches the preset number, the matched first user will be deleted from the matching pool and all matching queues, reducing the repeated matching of other matching queues to the first users who have already been matched , and determine the matching result based on the matched first user, realize the matching of the first user in the matching queues of multiple queue dimensions, each matching queue independently performs the matching of the first user, and one of the matching queues meets the predetermined User matching can be completed when the number is set, and there is no need to repeatedly traverse and match different users, reducing a large number of cyclic calculation operations in the matching process and effectively improving user matching efficiency.
- the first user and related data added to the matching pool and matching queue are saved through the storage middleware to improve the
- FIG. 3 shows a flow chart of another user matching method provided by the embodiment of the present application.
- the user matching method is the embodiment of the above-mentioned user matching method. Referring to Fig. 3, the user matching method includes:
- S201 Add the first user to a matching pool in response to a user matching request associated with the first user.
- S202 Determine the user dimension according to the user index information of the first user through a preset dimension calculation script, and the dimension calculation script is configured based on the queue dimension.
- a corresponding dimension calculation script is set for each matching pool.
- the matching pool receives a newly added first user, it calls the corresponding dimension calculation script, and the dimension calculation script determines the first user according to the user index information of the first user.
- a user dimension for a user is configured based on the queue dimension, that is, the dimension calculation script is compiled according to the queue dimension corresponding to the applicable matching queue.
- the dimension calculation script provided in this embodiment is used to calculate the user dimension of the first user according to the user index information.
- the user index information can be provided by the client, for example, the user index information of the first user is carried in the user matching request, or it can be obtained from obtained from the server.
- the user index information reflects the dimension that the first user expects to match.
- the user index information can be the gender, rating, region, etc.
- the dimension calculation script provided in this embodiment is a Lua script, and the Lua script is applied to the server end (server), so that the dynamic expansion of the matching dimension can be completed without modifying the binary file.
- the dimension calculation script can be updated according to the update of the matching queue.
- the user matching method provided in this embodiment further includes: according to the queue dimension corresponding to the matching queue to be updated, the dimension calculation script Make a script update.
- the dimension calculation script can be modified synchronously to improve the flexibility of the dimension calculation script, allowing different computer rooms, deployments, and instances of the matching pool to use different Matching rules, that is, you only need to modify the corresponding configuration file, specify the instance to load the specified dimension calculation script to change the matching rules, and realize the matching between users in different regions at no cost (for example, adding the first user at the same time In the same city, the same country, and the matching queue under the global dimension), it has good scalability.
- use a character string as the queue name of the matching queue.
- S203 According to the user dimension and the queue dimensions of the multiple matching queues, determine the first matching queue corresponding to the queue dimension from the multiple matching queues, and add the first user to the first matching queue.
- the manner of adding the first user to the matching pool and the matching queue may be to add the identification information of the first user and/or the corresponding user index information as object information to the matching pool and the matching queue.
- each matching queue monitors the first user added to its own queue, and senses changes in its own queue. When the number of matched first users reaches the preset number, it is determined that the users are successfully matched, and the matching queue further detects whether these matched first users are still stored in the matching pool. If the matched first users are all stored in the matching pool, go to step S205, otherwise go to step S206.
- each matching queue monitors the first user according to the queue reading time or queue reading frequency set by itself. Based on this, after adding the first user to the first matching queue, Including: based on the queue reading time or queue reading frequency corresponding to the matching queue, determine the number of first users added to the matching queue, and the queue reading time or queue reading frequency is determined based on the set priority of the corresponding matching queue .
- Each matching queue detects the number of first users added to it according to its set queue reading time or queue reading frequency, and when the number of matched first users reaches the preset number, the user is determined The match was successful.
- the queue reading time or queue reading frequency provided in this embodiment is determined based on the set priority of the corresponding matching queue, and the higher the set priority, the shorter the corresponding queue reading time and the higher the queue reading frequency. It is understandable that for multiple matching queues of the same queue dimension under different servers, setting a matching queue with a higher priority can complete user matching faster, and delete the first user who has been matched in other matching queues in time. Reduce duplicate matches for other matching queues.
- each matching queue is in charge of a separate process (or thread, coroutine), and by setting the queue reading time or queue reading frequency of the matching queue, the mutual matching among multiple first users is reduced. As long as a certain matching queue satisfies the conditions (the number of users reaches the set number), the matching can be completed. By exchanging space for time, a large number of circular matching calculations are reduced, and the time complexity of user matching is reduced from an exponential level to a constant. level, reduce the waiting time for user matching, and greatly improve the user experience.
- the matched first user is deleted from the matching pool and all matching queues, the matching result is determined based on the matched first user, and the matching result is fed back to the client or the next layer service.
- the matching queue When there are first users who have not been saved in the matching pool among the matched first users, it can be determined that these unsaved first users have been matched by other matching processes, and the set number of first users has been matched from the current Delete the above-mentioned first user who does not exist in the matching pool from the matching queue. At this time, the number of matched users in the matching queue is less than the set number, and the matching queue continues to monitor the number of matched users until the next time the preset number of first users are matched, and the matched first user is determined again. Whether a user exists in the matching pool.
- a public matching queue for processing low-priority user matching requests is set, and the public matching queue is used as a timeout matching queue to receive the first user who has not been successfully matched after timeout, and the public matching queue is based on the setting Match users according to the specified matching strategy. If the first user is still not successfully matched after a set period of time, modify the matching strategy for the first user, match the robot for the first user, or notify the client of the matching failure.
- FIG 4 shows a schematic diagram of a user matching architecture provided by the embodiment of the present application.
- the user matching architecture in the user matching device is set as matching process + storage middleware + queue processing process
- the architecture in which the matching process is the producer (producer), the queue processing process is the consumer (consumer), and the number of queue processing processes is in one-to-one correspondence with the matching queues.
- Each matching queue is in charge of a single queue processing process, storing
- the middleware is used to save the corresponding data of the first user added to the matching pool and matching queue.
- the storage middleware can be redis storage middleware, kafka storage middleware or etcd storage middleware.
- the user matching request sent by the client will be processed by the matching process.
- the matching process calls the corresponding dimension calculation script to calculate the user dimension of the first user and deliver the first user to different matching queues.
- the queue processing process can perceive the change of the corresponding matching queue.
- the number of first users added reaches the set number, it is considered that the current matching queue is successfully matched.
- Delete the first user matched by its own matching queue and notify the matching pool and other matching queues to delete the matched first user, and feed back the matching result to the client or related services based on the matched first user.
- Figure 5 shows a schematic diagram of changes in a matching pool and a matching queue provided by the embodiment of the present application.
- the first users A and B are saved, and the first users A and C are saved in the matching queue Q2, and it is assumed that the set numbers of the matching queues Q1 and Q2 are both three.
- a user request associated with the first user D is received at time T2, and the first user is added to the matching pool and matching queue Q1.
- the matching pool holds the first users A, B, C, and D, and the matching queue Q1
- the first users A, B, and D are saved in the matching queue Q2, and the first users A and C are saved in the matching queue Q2.
- the matching queue Q1 succeeds in matching, and the first user A is deleted from the matching pool and all matching queues at time T3 , B, D, and return the corresponding matching results.
- neither the matching pool nor the matching queue Q1 stores the first users A, B, and D, and the matching queue Q2 stores the first user C.
- Figure 6 shows a schematic diagram of changes in another matching pool and matching queue provided by the embodiment of the present application.
- the first users A and B are saved in
- the first users A and C are saved in the matching queue Q2
- the set numbers of matching queues Q1 and Q2 are both three.
- a user request associated with the first user D is received at T2, and the first user D is added to the matching pool and matching queue Q1.
- the matching pool contains the first users A, B, C, and D, and the matching queue
- the first users A, B, and D are saved in Q1, and the first users A and C are saved in the matching queue Q2.
- the matching queue Q1 succeeds in matching, and at T3, the matching pool and all matching queues are notified to delete the first user A, B, D, return the corresponding matching results.
- the first user A has not been deleted by the matching queue Q2 at this time (for example, the deletion failed or the deletion notification was not received)
- the first users A, B, and D in the matching pool and the matching queue Q1 are all cleared at this time, and the first user A in the matching queue Q2
- the first users A and C are stored.
- a user request associated with the first user E is received at time T4, and the first user E is added to the matching pool and matching queue Q2.
- the matching pool contains the first users C and E, but the matching queue Q1 does not save The first user, the first user A, C, and E are saved in the matching queue Q2.
- the matching queue Q2 is successfully matched, and at T5, it is notified to delete the first user A, C, and E.
- the matching queue Q2 deletes the invalid first user A, and continues to monitor the number of added users.
- the first matching queue corresponding to the queue dimension is determined from multiple matching queues according to the user dimension of the first user, and the first user is added to the first matching queue.
- the matching queue when the number of first users matched by the matching queue reaches the preset number, the matched first user will be deleted from the matching pool and all matching queues, reducing the repeated matching of other matching queues to the first users who have already been matched , and determine the matching result based on the matched first user, realize the matching of the first user in the matching queues of multiple queue dimensions, each matching queue independently performs the matching of the first user, and one of the matching queues meets the predetermined User matching can be completed when the number is set, and there is no need to repeatedly traverse and match different users, reducing a large number of cyclic calculation operations in the matching process and effectively improving user matching efficiency.
- the matching queue matches a preset number of first users, first determine whether all the matched first users exist in the matching pool, so as to reduce the matching result caused by the matched first users being matched by other matching queues In the event of an error, the accuracy of user matching is guaranteed.
- the user dimension of the first user is calculated through a dynamically configurable dimension calculation script, which facilitates the dynamic expansion of matching rules for different queue dimensions.
- FIG. 7 shows a schematic structural diagram of a user matching device provided by an embodiment of the present application.
- the user matching device includes a request response module 71 , a queue management module 72 and a matching processing module 73 .
- the request response module 71 is configured to add the first user to the matching pool in response to the user matching request associated with the first user;
- the queue management module 72 is configured to select from multiple matching queues according to the user dimension of the first user. Determine the first matching queue corresponding to the queue dimension, add the first user to the first matching queue, and different matching queues correspond to different queue dimensions;
- the matching processing module 73 is configured to match a preset number of first matching queues in the matching queue. users, delete the matched first user from the matching pool and all matching queues, and determine the matching result based on the matched first user.
- the embodiment of the present application also provides a user matching device, which can integrate the user matching device provided in the embodiment of the present application.
- Fig. 8 is a schematic structural diagram of a user matching device provided by an embodiment of the present application.
- the user matching device includes: an input device 83, an output device 84, a memory 82 and one or more processors 81; a memory 82 configured to store one or more programs; when one or more programs are used by one or more Multiple processors 81 are executed, so that one or more processors 81 implement the user matching method provided in the above-mentioned embodiments.
- the user matching apparatus, equipment and computer provided above can be configured to execute the user matching method provided in any of the above embodiments, and have corresponding functions and beneficial effects.
- the embodiment of the present application also provides a storage medium containing computer-executable instructions.
- the computer-executable instructions When executed by a computer processor, the computer-executable instructions are configured to execute the user matching method provided in the above-mentioned embodiments.
- a storage medium containing computer-executable instructions provided in the embodiments of the present application the computer-executable instructions are not limited to the above-mentioned user matching method, and can also execute the relevant user matching method provided in any embodiment of the present application. operate.
- the user matching device, equipment, and storage medium provided in the above-mentioned embodiments can execute the user matching method provided in any embodiment of the present application.
- the embodiment of the present application also provides a computer program product.
- the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be implemented as a software product embodied in the form, the computer program product is stored in a storage medium, and includes several instructions to enable a computer device, mobile terminal or a processor therein to execute all or part of the user matching method provided by various embodiments of the present application step.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Business, Economics & Management (AREA)
- Computer Security & Cryptography (AREA)
- General Business, Economics & Management (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Information Transfer Between Computers (AREA)
Abstract
一种用户匹配方法、装置、设备及存储介质。该方案通过将用户匹配请求关联的第一用户添加到匹配池中,根据第一用户的用户维度从多个匹配队列中确定对应队列维度的第一匹配队列,并将第一用户加入到第一匹配队列中,在匹配队列匹配的第一用户达到预设数量时,从匹配池和所有的匹配队列中删除匹配到的第一用户,减少其他匹配队列对已完成匹配的第一用户的重复匹配,并基于匹配到的第一用户确定匹配结果,实现第一用户在多个队列维度的匹配队列中的匹配,每个匹配队列之间独立进行第一用户的匹配,减少匹配过程中的大量循环计算操作,有效提高用户匹配效率。
Description
本申请要求在2021年10月27日提交中国专利局,申请号为202111258214.5的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。
本申请实施例涉及计算机技术领域,尤其涉及一种用户匹配方法、装置、设备及存储介质。
在进行用户连线、游戏数据交互等需要进行用户匹配的业务场景中,需要按照一定的逻辑、变量对不同用户进行配对,例如按照性别、评分等维度为用户进行关联用户的匹配。为了平衡用户的使用体验,需要匹配到合适的用户。
一般情况下,在接收到用户发出的匹配请求时,会将用户添加到匹配队列中,通过循环遍历的方式进行用户配对,但是在用户配对请求的高峰期,由于匹配队列需要遍历每一个加入的用户,存在不同用户之间相互匹配的情况,导致用户匹配效率较低。
发明内容
本申请实施例提供一种用户匹配方法、装置、设备及存储介质,以解决相关技术中不同用户之间相互匹配的情况,导致用户匹配效率较低的技术问题,在匹配队列匹配到足够用户时即可完成用户匹配,有效提高用户匹配效率。
在第一方面,本申请实施例提供了一种用户匹配方法,包括:
响应于和第一用户关联的用户匹配请求,将所述第一用户添加到匹配池;
根据所述第一用户的用户维度从多个匹配队列中确定对应队列维度的第一匹配队列,将所述第一用户添加到所述第一匹配队列中,不同的匹配队列对应不同的队列维度;
在匹配队列匹配到预设数量的第一用户时,从所述匹配池和所有匹配队列中删除匹配到的第一用户,并基于匹配到的第一用户确定匹配结果。
在第二方面,本申请实施例提供了一种用户匹配装置,包括请求响应模块、队列管理模块和匹配处理模块,其中:
所述请求响应模块,配置为响应于和第一用户关联的用户匹配请求,将所述第一用户添加到匹配池;
所述队列管理模块,配置为根据所述第一用户的用户维度从多个匹配队列中确定对应队列维度的第一匹配队列,将所述第一用户添加到所述第一匹配队列中,不同的匹配队列对应不同的队列维度;
所述匹配处理模块,配置为在匹配队列匹配到预设数量的第一用户时,从所述匹配池和所有匹配队列中删除匹配到的第一用户,并基于匹配到的第一用户确定匹配结果。
在第三方面,本申请实施例提供了一种用户匹配设备,包括:存储器以及一个或多个处理器;
所述存储器,配置为存储一个或多个程序;
当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如第一方面所述的用户匹配方法。
在第四方面,本申请实施例提供了一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时配置为执行如第一方面所述的用户匹配方法。
在第五方面,本申请实施例提供了一种计算机程序产品,该计算机程序产品包括计算机程序,该计算机程序存储在计算机可读存储介质中,设备的至少一个处理器从计算机可读存储介质读取并执行计算机程序,使得设备执行如第一方面所述的用户匹配方法。
本申请实施例通过将用户匹配请求关联的第一用户添加到匹配池中,根据第一用户的用户维度从多个匹配队列中确定对应队列维度的第一匹配队列,并将第一用户加入到第一匹配队列中,在匹配队列匹配的第一用户达到预设数量时,从匹配池和所有的匹配队列中删除匹配到的第一用户,减少其他匹配队列对已完成匹配的第一用户的重复匹配,并基于匹配到的第一用户确定匹配结果,实现第一用户在多个队列维度的匹配队列中的匹配,每个匹配队列之间独立进行第一用户的匹配,在其中一个匹配队列满足预设数量时即可完成用户匹配,不需要重复对不同用户进行遍历和匹配,减少匹配过程中的大量循环计算操作,有效提高用户匹配效率。
图1是本申请实施例提供的一种用户匹配方法的流程图;
图2是本申请实施例提供的一种对用户匹配请求的响应流程示意图;
图3是本申请实施例提供的另一种用户匹配方法的流程图;
图4是本申请实施例提供的一种用户匹配架构的架构示意图;
图5是本申请实施例提供的一种匹配池和匹配队列的变化示意图;
图6是本申请实施例提供的另一种匹配池和匹配队列的变化示意图;
图7是本申请实施例提供的一种用户匹配装置的结构示意图;
图8是本申请实施例提供的一种用户匹配设备的结构示意图。
为了使本申请的目的、技术方案和优点更加清楚,下面结合附图对本申请具体实施例作进一步的详细描述。可以理解的是,此处所描述的具体实施例仅仅用于解释本申请,而非对本申请的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本申请相关的部分而非全部内容。在更加详细地讨论示例性实施例之前应当提到的是,一些示例性实施例被描述成作为流程图描绘的处理或方法。虽然流程图将各项操作(或步骤)描述成顺序的处理,但是其中的许多操作可以被并行地、并发地或者同时实施。此外,各项操作的顺序可以被重新安排。当其操作完成时所述处理可以被终止,但是还可以具有未包括在附图中的附加步骤。所述处理可以对应于方法、函数、规程、子例程、子程序等等。
图1给出了本申请实施例提供的一种用户匹配方法的流程图,本申请实施例提供的用户匹配方法可以由用户匹配装置来执行,该用户匹配装置可以通过硬件和/或软件的方式实现,并集成在用户匹配设备(例如服务器)中。
下述以用户匹配装置执行用户匹配方法为例进行描述。参考图1,该用户匹配方法包括:
S101:响应于和第一用户关联的用户匹配请求,将第一用户添加到匹配池。
其中,用户匹配请求由客户端(例如第一用户所登录的手机、平板、电脑等)发出,并且用户匹配请求关联有登录在客户端上的第一用户。第一用户在需要进行连线或游戏数据交互时,向用户匹配装置发送与第一用户相关联的用 户匹配请求。
示例性的,在接收到客户端发出的用户匹配请求后,对用户匹配请求进行校验,在通过校验后将用户匹配请求所关联的第一用户添加到匹配池中。本实施例不同的地区部署多个用户匹配装置,并且用户匹配装置可设置有一个或多个匹配池,在用户匹配装置接收到用户匹配请求时,可将用户匹配请求同步到其他地区的用户匹配装置中,由其他用户匹配装置将用户匹配请求关联的第一用户添加到其对应的匹配池中。
在一个可能的实施例中,在接收到用户匹配请求时,可先判断第一用户所要加入的匹配池是否存在容量限制,若存在容量限制,则对匹配池进行容量校验,以确定是否将第一用户加入对应的匹配池中或者确定加入匹配池的时间。
S102:根据第一用户的用户维度从多个匹配队列中确定对应队列维度的第一匹配队列,将第一用户添加到第一匹配队列中,不同的匹配队列对应不同的队列维度。
本实施例提供有多个匹配队列,并且不同的匹配队列对应不同的队列维度,不同的匹配队列可以是部署在相同的用户匹配装置中,也可以是部署在不同的用户匹配装置中。
示例性的,将第一用户添加到匹配池后,确定该第一用户对应的用户维度,并将该用户维度与所有匹配队列的队列维度进行比较,确定与该用户维度相匹配的队列维度,将匹配的队列维度对应的匹配队列确定为与当前用户匹配请求相匹配的第一匹配队列,从匹配池中取出第一用户,并将第一用户添加到第一匹配队列中。
在一个可能的实施例中,本实施例提供的匹配池和/或匹配队列通过存储中间件存储所添加的第一用户。其中,存储中间件包括kv存储中间件、Vector存储中间件、List存储中间件、kafka存储中间件中的一种或多种的组合。
示例性的,对于匹配池,其需要保存整个用户匹配系统当前提交了用户匹配请求的所有第一用户,例如使用redis、memcache、etcd等kv存储中间件来存储所加入的第一用户。对于使用redis来存储第一用户,可使用zset或者是ttl这两种数据结构,在使用zset数据结构时,可利用key作为第一用户的用户标识(uuid或者uid),使用score作为第一用户加入匹配池的时间戳,从而快速从匹配池中取出所有超过设定时间没有匹配到其他用户的第一用户,并将其加入对应的匹配队列中。在使用ttl数据结构时,可利用redis的ttl过期回调配置(例 如设置redis.conf中的notify-keyspace-events"Ex",且监听回调事件)实现在第一用户的用户匹配请求超时的时候进行处理。对于使用etcd来存储第一用户,可以用租约+监听+前缀的方式实现匹配池的功能。利用redis以及etcd的过期自动通知的功能来实现对过期用户的快速检测及处理。
对于匹配队列,其需要数据的有序以及易于扩展,可使用kv存储中间件的队列结构、使用内存结构的Vector存储中间件或List存储中间件、基于消息队列中间件的kafka存储中间件等,例如redis来存储第一用户,可以利用list数据结构,通过lpush、lpop、rpush、rpop工具来构建一个匹配队列,加入匹配队列使用lpush命令进行,取出匹配队列值可以用lrange、lpop命令进行,通过redis自身的高可用发难来做容灾处理,实现服务重启或升级时不丢失数据的特性。对于使用etcd来存储第一用户,可以利用etcd的prefix特性构建队列,例如可以指定匹配队列的前缀为:mathcQueue-A-B-C-D/,则同时满足A,B,C,D这几个维度的第一用户可以push到这个匹配队列下并成为新的key,例如第一用户uid1对应的key为:mathcQueue-A-B-C-D/uid1。同时,etcd使用paxos算法来保证集群内的数据一致性,从而达到容灾并且重启不丢数据的效果。对于使用kafka来存储第一用户,打开kafka中自动新建topic的开关(一个匹配队列可以认为是一个topic),随后按照预先设定的维度计算脚本来计算用户需要分配到的匹配队列,消费进程订阅新的topic,每一个topic单独处理匹配请求。本方案使用了存储中间件来储存所加入的第一用户,当匹配进程或队列处理进程重启(可能是系统宕机、网络问题、程序问题、系统升级导致的重启)时,通过存储中间件的服务治理动态调度功能将第一用户关联的用户匹配请求路由到其他节点,由其他节点继续服务,使得匹配进程变成无状态的进程,减少服务重启后匹配信息丢失的情况。
S103:在匹配队列匹配到预设数量的第一用户时,从匹配池和所有匹配队列中删除匹配到的第一用户,并基于匹配到的第一用户确定匹配结果。
每个匹配队列均设置有对应的预设数量,各个匹配队列只遍历自身,将加入其中的第一用户进行配对,在加入的第一用户的用户数量达到预设数量时,认为该匹配队列完成匹配。
示例性的,在其中一个匹配队列完成匹配(即匹配到预设数量的第一用户)时,从所有匹配池和匹配队列(包括完成匹配的匹配队列)中删除所匹配到的第一用户。本实施例在一个匹配队列完成匹配时,从所有匹配池和匹配队列中 删除匹配到的第一用户,避免其他匹配队列对已完成匹配的第一用户进行重复匹配的情况。
在一个实施例中,成功从所有匹配池和匹配队列删除匹配到的第一用户后,基于这些匹配到的第一用户确定匹配结果。可将匹配结果反馈给第一用户对应的客户端或者是下一层业务,继续进行业务下层的逻辑。
图2给出了本申请实施例提供的一种对用户匹配请求的响应流程示意图,如图2,假设设置有n个匹配队列(图中队里1~n),在接收到不同客户端发出的用户匹配请求时,将不同用户匹配请求关联的第一用户(图中用户1和用户2)添加到匹配池中,分别根据用户1和用户2的用户维度将加入到对应队列维度的匹配队列中,图中将用户1添加到了队列1和队列n,将用户2添加到了队列2和队列3,各个匹配队列对加入的第一用户的用户数量进行检测,在某个匹配队列用户数量达到设定数量时,将匹配到的第一用户从所有匹配池和匹配队列中删除,并基于匹配到的第一用户向客户端反馈匹配结果。
上述,通过将用户匹配请求关联的第一用户添加到匹配池中,根据第一用户的用户维度从多个匹配队列中确定对应队列维度的第一匹配队列,并将第一用户加入到第一匹配队列中,在匹配队列匹配的第一用户达到预设数量时,从匹配池和所有的匹配队列中删除匹配到的第一用户,减少其他匹配队列对已完成匹配的第一用户的重复匹配,并基于匹配到的第一用户确定匹配结果,实现第一用户在多个队列维度的匹配队列中的匹配,每个匹配队列之间独立进行第一用户的匹配,在其中一个匹配队列满足预设数量时即可完成用户匹配,不需要重复对不同用户进行遍历和匹配,减少匹配过程中的大量循环计算操作,有效提高用户匹配效率。同时,通过存储中间件对加入到匹配池和匹配队列的第一用户以及相关数据进行保存,提高数据存储与处理的效率以及安全性,有效解决系统重启时导致数据丢失的问题,保证用户体验。
在上述实施例的基础上,图3给出了本申请实施例提供的另一种用户匹配方法的流程图,该用户匹配方法是对上述用户匹配方法的具体化。参考图3,该用户匹配方法包括:
S201:响应于和第一用户关联的用户匹配请求,将第一用户添加到匹配池。
S202:通过预先设定的维度计算脚本,根据第一用户的用户指标信息确定用户维度,维度计算脚本基于队列维度进行配置得到。
本实施例针对每个匹配池设置对应的维度计算脚本,匹配池在接收到新加入的第一用户时,调用对应的维度计算脚本,通过维度计算脚本根据第一用户的用户指标信息确定该第一用户的用户维度。其中,维度计算脚本基于队列维度进行配置得到,即维度计算脚本根据适用的匹配队列对应的队列维度进行编写得到。
本实施例提供的维度计算脚本用于根据用户指标信息计算第一用户的用户维度,用户指标信息可以由客户端提供,例如在用户匹配请求中携带第一用户的用户指标信息,还可以是从服务器中获取。用户指标信息反映第一用户所期望匹配的维度,用户指标信息可以是第一用户的性别、评分、地区等,并且相同类型的用户指标信息可以设置有多个,例如第一用户所期望匹配的为地区维度包括第一地区和第二地区,那么用户指标信息中反映地区维度的参数有第一地区和第二地区两个,即可将该第一用户分别加入到第一地区对应的匹配队列和第二地区对应的匹配队列(假设忽略其他类型的维度)。其中用户维度可以与用户指标信息一一对应,还可以在用户指标信息的基础上进行用户维度的限制或扩展,更灵活地为第一用户匹配适用的匹配队列。在具体的实施方式中,本实施例提供的维度计算脚本为Lua脚本,将Lua脚本应用到Server端(服务器)中,使得在不修改二进制文件的情况下完成匹配维度的动态拓展。
在一个可能的实施例中,可根据匹配队列的更新对维度计算脚本进行更新,基于此,本实施例提供的用户匹配方法还包括:根据需要更新的匹配队列对应的队列维度,对维度计算脚本进行脚本更新。在新增、删除、修改匹配队列或匹配队列的队列维度时,可同步对维度计算脚本进行修改,提高维度计算脚本的灵活度,从而允许配置匹配池的不同的机房、部署、实例使用不同的匹配规则,即只需要修改对应的配置文件,指定实例加载指定的维度计算脚本就可以实现匹配规则的改变,可以无成本的实现用户间的在不同地区范围的匹配(例如将第一用户同时加入同城、同国家、全球维度下的匹配队列中),具有良好的拓展性。可选的,使用字符串作为匹配队列的队列名,当需要增加新的队列维度的匹配队列时,无需修改用户匹配程序的二进制代码,只要修改维度计算脚本就可以完成队列维度的扩展。
S203:根据用户维度和多个匹配队列的队列维度,从多个匹配队列中确定对应队列维度的第一匹配队列,将第一用户添加到第一匹配队列中。
在确定第一用户的用户维度后,将该用户维度与各个匹配队列的队列维度 进行比较,确定该用户维度所适配的队列维度,将适配的队列维度确认为第一匹配队列,并将第一用户添加到第一匹配队列中。其中,将第一用户添加到匹配池和匹配队列的方式,可以是将第一用户的识别信息和/或是将对应的用户指标信息作为对象信息添加到匹配池和匹配队列中。
S204:在匹配队列匹配到预设数量的第一用户时,确定匹配到的第一用户是否均存在于匹配池。
具体的,各个匹配队列对自身队列中加入的第一用户进行监视,并感知自身队列的变动。在匹配到的第一用户的用户数量达到预设数量时,确定用户匹配成功,匹配队列进一步检测这些匹配到的第一用户是否仍保存在匹配池中。若这些匹配到的第一用户都保存在匹配池中,则跳转至步骤S205,否则跳转至步骤S206。
在一个可能的实施例中,各个匹配队列根据自身设定的队列读取时间或队列读取频率对第一用户进行监视,基于此,在将第一用户添加到第一匹配队列中之后,还包括:基于匹配队列对应的队列读取时间或队列读取频率,确定匹配队列中添加的第一用户的用户数量,队列读取时间或队列读取频率基于对应的匹配队列的设定优先级确定。
各个匹配队列根据其设定的队列读取时间或队列读取频率,对其所添加的第一用户的用户数量进行检测,在匹配到的第一用户的用户数量达到预设数量时,确定用户匹配成功。本实施例提供的队列读取时间或队列读取频率基于对应的匹配队列的设定优先级确定,并且设定优先等级越高,对应的队列读取时间越短,队列读取频率越高。可以理解的是,对于不同服务器下相同队列维度的多个匹配队列,设定优先等级更高的匹配队列可更快地完成用户匹配,及时删除其他匹配队列中已经被匹配走的第一用户,减少其他匹配队列的重复匹配。
可以理解的是,每个匹配队列都由单独的一个进程(或者线程、协程)负责,通过设置匹配队列的队列读取时间或队列读取频率,减少了多个第一用户之间相互匹配的时间,只要某个匹配队列满足条件(用户数量达到设定数量)就可以完成匹配,通过空间换取时间的方式减少了大量的循环匹配计算,将用户匹配的时间复杂度从指数级别降低到常数级别,减少用户匹配的等待时间,极大的提升了用户体验。
S205:在匹配到的第一用户均存在于匹配池时,从匹配池和所有匹配队列中删除匹配到的第一用户,并基于匹配到的第一用户确定匹配结果。
在匹配到的第一用户都保存在匹配池中时,可确认这些第一用户都没有被其他匹配队列匹配走,则需要及时从匹配池和匹配队列中取出这些匹配到的第一用户,以免其他匹配队列重复匹配无效用户(已经完成匹配的第一用户)的情况。
具体的,将匹配到的第一用户从匹配池和所有匹配队列中删除,基于匹配到的第一用户确定匹配结果,并将匹配结果反馈给客户端或下一层业务。
S206:在第一用户不存在于匹配池时,从匹配队列中删除不存在于匹配池的第一用户。
在匹配到的第一用户中有未保存在匹配池的第一用户时,可确定这些未保存的第一用户已经被其他匹配进程匹配走,则从当前已经匹配到设定数量的第一用户的匹配队列中删除上述不存在于匹配池的第一用户。此时,该匹配队列中匹配到的用户数量少于设定数量,该匹配队列继续对匹配到的用户数量进行监视,直至下一次匹配到预设数量的第一用户,再次确定匹配到的第一用户是否均存在于匹配池。
在一个可能的实施例中,设置用于处理低优先级的用户匹配请求的公共匹配队列,并将该公共匹配队列作为超时匹配队列接收超时没有匹配成功的第一用户,由公共匹配队列基于设定的匹配策略进行用户匹配。如果第一用户在设定时间长度后仍未成功匹配,则修改对该第一用户的匹配策略、为该第一用户匹配机器人或者是通知客户端匹配失败。
图4给出了本申请实施例提供的一种用户匹配架构的架构示意图,如图3所示,本实施例将用户匹配装置中的用户匹配架构设置为匹配进程+存储中间件+队列处理进程的架构,其中匹配进程作为生产者(producer),队列处理进程作为消费者(consumer),并且队列处理进程的数量与匹配队列一一对应,每个匹配队列单独由一个队列处理进程来负责,存储中间件用于保存加入到匹配池和匹配队列的第一用户即相应数据,存储中间件可以是redis存储中间件、kafka存储中间件或etcd存储中间件。客户端发出的用户匹配请求将由匹配进程进行响应处理,匹配进程调用对应的维度计算脚本计算第一用户的用户维度,将第一用户投递到不同的匹配队列。队列处理进程可以感知对应匹配队列的变动,在加入的第一用户的用户数量达到设定数量时,认为当前匹配队列匹配成功,进一步匹配到的第一用户是否均存在于匹配池中,若是则删除自身匹配队列所匹配到的第一用户,以及通知匹配池和其他匹配队列删除匹配到的第一用户, 并基于匹配到的第一用户向客户端或相关业务反馈匹配结果。
图5给出了本申请实施例提供的一种匹配池和匹配队列的变化示意图,如图5所示,假设在T1时刻匹配池保存有第一用户A、B、C,在匹配队列Q1中保存有第一用户A、B,在匹配队列Q2中保存有第一用户A、C,并假设匹配队列Q1和Q2的设定数量都是3。假设在T2时刻接收到与第一用户D关联的用户请求,并将第一用户添加到匹配池和匹配队列Q1,此时匹配池保存有第一用户A、B、C、D,匹配队列Q1中保存有第一用户A、B、D,匹配队列Q2中保存有第一用户A、C,此时匹配队列Q1匹配成功,并在T3时刻从匹配池和所有匹配队列中删除第一用户A、B、D,返回对应的匹配结果,此时匹配池和匹配队列Q1均未保存有第一用户A、B、D,匹配队列Q2中保存有第一用户C。
图6给出了本申请实施例提供的另一种匹配池和匹配队列的变化示意图,如图6所示,假设在T1时刻匹配池保存有第一用户A、B、C,在匹配队列Q1中保存有第一用户A、B,在匹配队列Q2中保存有第一用户A、C,并假设匹配队列Q1和Q2的设定数量都是3。假设在T2时刻接收到与第一用户D关联的用户请求,并将第一用户D添加到匹配池和匹配队列Q1,此时匹配池保存有第一用户A、B、C、D,匹配队列Q1中保存有第一用户A、B、D,匹配队列Q2中保存有第一用户A、C,此时匹配队列Q1匹配成功,并在T3时刻通知匹配池和所有匹配队列中删除第一用户A、B、D,返回对应的匹配结果。假设此时匹配队列Q2未删除第一用户A(例如删除失败或未接收到删除通知),此时匹配池和匹配队列Q1中的第一用户A、B、D均被清除,匹配队列Q2中保存有第一用户A、C。假设在T4时刻接收到与第一用户E关联的用户请求,并将第一用户E添加到匹配池和匹配队列Q2,此时匹配池保存有第一用户C、E,匹配队列Q1未保存有第一用户,匹配队列Q2中保存有第一用户A、C、E,此时匹配队列Q2匹配成功,并在T5时刻通知删除第一用户A、C、E时发现匹配池未保存有第一用户A,匹配队列Q2删除失效的第一用户A,继续监测加入的用户数量。
上述,通过将用户匹配请求关联的第一用户添加到匹配池中,根据第一用户的用户维度从多个匹配队列中确定对应队列维度的第一匹配队列,并将第一用户加入到第一匹配队列中,在匹配队列匹配的第一用户达到预设数量时,从匹配池和所有的匹配队列中删除匹配到的第一用户,减少其他匹配队列对已完 成匹配的第一用户的重复匹配,并基于匹配到的第一用户确定匹配结果,实现第一用户在多个队列维度的匹配队列中的匹配,每个匹配队列之间独立进行第一用户的匹配,在其中一个匹配队列满足预设数量时即可完成用户匹配,不需要重复对不同用户进行遍历和匹配,减少匹配过程中的大量循环计算操作,有效提高用户匹配效率。同时,在匹配队列匹配到预设数量的第一用户时,先确定匹配到的第一用户是否均存在于匹配池,以减少匹配到的第一用户已经被其他匹配队列匹配走而导致匹配结果出错的情况,保证用户匹配的准确率。并且通过可动态配置的维度计算脚本计算第一用户的用户维度,方便实现不同队列维度匹配规则上的动态扩展。
图7给出了本申请实施例提供的一种用户匹配装置的结构示意图。参考图7,该用户匹配装置包括请求响应模块71、队列管理模块72和匹配处理模块73。
其中,请求响应模块71,配置为响应于和第一用户关联的用户匹配请求,将第一用户添加到匹配池;队列管理模块72,配置为根据第一用户的用户维度从多个匹配队列中确定对应队列维度的第一匹配队列,将第一用户添加到第一匹配队列中,不同的匹配队列对应不同的队列维度;匹配处理模块73,配置为在匹配队列匹配到预设数量的第一用户时,从匹配池和所有匹配队列中删除匹配到的第一用户,并基于匹配到的第一用户确定匹配结果。
本申请实施例还提供了一种用户匹配设备,该用户匹配设备可集成本申请实施例提供的用户匹配装置。图8是本申请实施例提供的一种用户匹配设备的结构示意图。参考图8,该用户匹配设备包括:输入装置83、输出装置84、存储器82以及一个或多个处理器81;存储器82,配置为存储一个或多个程序;当一个或多个程序被一个或多个处理器81执行,使得一个或多个处理器81实现如上述实施例提供的用户匹配方法。上述提供的用户匹配装置、设备和计算机可配置为执行上述任意实施例提供的用户匹配方法,具备相应的功能和有益效果。
本申请实施例还提供一种包含计算机可执行指令的存储介质,计算机可执行指令在由计算机处理器执行时配置为执行如上述实施例提供的用户匹配方法。当然,本申请实施例所提供的一种包含计算机可执行指令的存储介质,其 计算机可执行指令不限于如上的用户匹配方法,还可以执行本申请任意实施例所提供的用户匹配方法中的相关操作。上述实施例中提供的用户匹配装置、设备及存储介质可执行本申请任意实施例所提供的用户匹配方法,未在上述实施例中详尽描述的技术细节,可参见本申请任意实施例所提供的用户匹配方法。
在上述实施例的基础上,本申请实施例还提供一种计算机程序产品,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机程序产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备、移动终端或其中的处理器执行本申请各个实施例所提供的用户匹配方法的全部或部分步骤。
上述仅为本申请的较佳实施例及所运用的技术原理。本申请不限于这里的特定实施例,对本领域技术人员来说能够进行的各种明显变化、重新调整及替代均不会脱离本申请的保护范围。因此,虽然通过以上实施例对本申请进行了较为详细的说明,但是本申请不仅仅限于以上实施例,在不脱离本申请构思的情况下,还可以包括更多其他等效实施例,而本申请的范围由权利要求的范围决定。
Claims (11)
- 一种用户匹配方法,应用于用户匹配设备,其中,包括:响应于和第一用户关联的用户匹配请求,将所述第一用户添加到匹配池;根据所述第一用户的用户维度从多个匹配队列中确定对应队列维度的第一匹配队列,将所述第一用户添加到所述第一匹配队列中,不同的匹配队列对应不同的队列维度;在匹配队列匹配到预设数量的第一用户时,从所述匹配池和所有匹配队列中删除匹配到的第一用户,并基于匹配到的第一用户确定匹配结果。
- 根据权利要求1所述的用户匹配方法,其中,所述在匹配队列匹配到预设数量的第一用户时,从所述匹配池和所有匹配队列中删除匹配到的第一用户,包括:在匹配队列匹配到预设数量的第一用户时,确定匹配到的第一用户是否均存在于所述匹配池;在匹配到的第一用户均存在于所述匹配池时,从所述匹配池和所有所述匹配队列中删除匹配到的第一用户。
- 根据权利要求2所述的用户匹配方法,其中,所述方法还包括;在第一用户不存在于所述匹配池时,从匹配队列中删除不存在于所述匹配池的第一用户。
- 根据权利要求1-3任一项所述的用户匹配方法,其中,所述根据所述第一用户的用户维度从多个匹配队列中确定对应队列维度的第一匹配队列,将所述第一用户添加到所述第一匹配队列中,包括:通过预先设定的维度计算脚本,根据所述第一用户的用户指标信息确定用户维度,所述维度计算脚本基于所述队列维度进行配置得到;根据所述用户维度和多个匹配队列的队列维度,从多个匹配队列中确定对应队列维度的第一匹配队列,将所述第一用户添加到所述第一匹配队列中。
- 根据权利要求4所述的用户匹配方法,其中,所述方法还包括:根据需要更新的匹配队列对应的队列维度,对所述维度计算脚本进行脚本更新。
- 根据权利要求1-5任一项所述的用户匹配方法,其中,所述将所述第一用户添加到所述第一匹配队列中之后,还包括:基于匹配队列对应的队列读取时间或队列读取频率,确定匹配队列中添加的所述第一用户的用户数量,所述队列读取时间或所述队列读取频率基于对应 的匹配队列的设定优先级确定。
- 根据权利要求1-5任一项所述的用户匹配方法,其中,所述匹配池和/或所述匹配队列通过存储中间件存储所述第一用户,所述存储中间件包括kv存储中间件、Vector存储中间件、List存储中间件、kafka存储中间件中的一种或多种的组合。
- 一种用户匹配装置,其中,包括请求响应模块、队列管理模块和匹配处理模块,其中:所述请求响应模块,配置为响应于和第一用户关联的用户匹配请求,将所述第一用户添加到匹配池;所述队列管理模块,配置为根据所述第一用户的用户维度从多个匹配队列中确定对应队列维度的第一匹配队列,将所述第一用户添加到所述第一匹配队列中,不同的匹配队列对应不同的队列维度;所述匹配处理模块,配置为在匹配队列匹配到预设数量的第一用户时,从所述匹配池和所有匹配队列中删除匹配到的第一用户,并基于匹配到的第一用户确定匹配结果。
- 一种用户匹配设备,其中,包括:存储器以及一个或多个处理器;所述存储器,配置为存储一个或多个程序;当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-7任一项所述的用户匹配方法。
- 一种包含计算机可执行指令的存储介质,其中,所述计算机可执行指令在由计算机处理器执行时配置为执行如权利要求1-7任一项所述的用户匹配方法。
- 一种计算机程序产品,包括计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1-7任一项所述的用户匹配方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111258214.5 | 2021-10-27 | ||
| CN202111258214.5A CN114130035B (zh) | 2021-10-27 | 2021-10-27 | 一种用户匹配方法、装置、设备及存储介质 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2023071999A1 true WO2023071999A1 (zh) | 2023-05-04 |
Family
ID=80394642
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2022/127095 Ceased WO2023071999A1 (zh) | 2021-10-27 | 2022-10-24 | 一种用户匹配方法、装置、设备及存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN114130035B (zh) |
| WO (1) | WO2023071999A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117135074A (zh) * | 2023-08-29 | 2023-11-28 | 铵泰克(北京)科技有限公司 | 基于fpga的tna设备及其通信方法 |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114130035B (zh) * | 2021-10-27 | 2025-09-19 | 百果园技术(新加坡)有限公司 | 一种用户匹配方法、装置、设备及存储介质 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107837532A (zh) * | 2017-11-16 | 2018-03-27 | 腾讯科技(上海)有限公司 | 用户匹配方法、装置、服务器以及存储介质 |
| CN108491453A (zh) * | 2018-03-01 | 2018-09-04 | 北京峰趣互联网信息服务有限公司 | 数据匹配方法及系统、服务器、介质 |
| US20190262719A1 (en) * | 2017-01-24 | 2019-08-29 | Tencent Technology (Shenzhen) Company Limited | Method for implementing user matching and related device |
| CN112675548A (zh) * | 2021-01-05 | 2021-04-20 | 腾讯科技(深圳)有限公司 | 对局匹配方法、装置、设备及可读存储介质 |
| CN114130035A (zh) * | 2021-10-27 | 2022-03-04 | 百果园技术(新加坡)有限公司 | 一种用户匹配方法、装置、设备及存储介质 |
Family Cites Families (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP5280712B2 (ja) * | 2008-03-12 | 2013-09-04 | 株式会社バンダイナムコゲームス | サーバシステム |
| US20110055135A1 (en) * | 2009-08-26 | 2011-03-03 | International Business Machines Corporation | Deferred Teleportation or Relocation in Virtual Worlds |
| JP6162929B2 (ja) * | 2012-06-01 | 2017-07-12 | 任天堂株式会社 | 投稿情報共有システム |
| JP5671501B2 (ja) * | 2012-07-17 | 2015-02-18 | 株式会社コナミデジタルエンタテインメント | マッチング機能を備えたゲームシステム及びそのマッチング制御方法 |
| CN106730850B (zh) * | 2016-12-16 | 2020-10-27 | 网易(杭州)网络有限公司 | 游戏对手匹配方法和装置 |
| CN109745708B (zh) * | 2017-11-02 | 2022-10-14 | 北京金山安全软件有限公司 | 对手匹配方法及装置 |
| JP7296703B2 (ja) * | 2018-09-07 | 2023-06-23 | 株式会社バンダイナムコエンターテインメント | サーバシステム、ゲームシステム及びマッチング処理方法 |
| CN110354504B (zh) * | 2019-08-15 | 2023-10-13 | 广州方硅信息技术有限公司 | 获取匹配组的方法、装置、服务器和存储介质 |
| CN110404268B (zh) * | 2019-08-20 | 2023-04-07 | 网易(杭州)网络有限公司 | 一种游戏中的玩家匹配方法及装置 |
| CN111185014B (zh) * | 2019-11-07 | 2021-02-12 | 腾讯科技(深圳)有限公司 | 对象匹配方法、装置和计算机可读存储介质 |
-
2021
- 2021-10-27 CN CN202111258214.5A patent/CN114130035B/zh active Active
-
2022
- 2022-10-24 WO PCT/CN2022/127095 patent/WO2023071999A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20190262719A1 (en) * | 2017-01-24 | 2019-08-29 | Tencent Technology (Shenzhen) Company Limited | Method for implementing user matching and related device |
| CN107837532A (zh) * | 2017-11-16 | 2018-03-27 | 腾讯科技(上海)有限公司 | 用户匹配方法、装置、服务器以及存储介质 |
| CN108491453A (zh) * | 2018-03-01 | 2018-09-04 | 北京峰趣互联网信息服务有限公司 | 数据匹配方法及系统、服务器、介质 |
| CN112675548A (zh) * | 2021-01-05 | 2021-04-20 | 腾讯科技(深圳)有限公司 | 对局匹配方法、装置、设备及可读存储介质 |
| CN114130035A (zh) * | 2021-10-27 | 2022-03-04 | 百果园技术(新加坡)有限公司 | 一种用户匹配方法、装置、设备及存储介质 |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117135074A (zh) * | 2023-08-29 | 2023-11-28 | 铵泰克(北京)科技有限公司 | 基于fpga的tna设备及其通信方法 |
| CN117135074B (zh) * | 2023-08-29 | 2024-05-28 | 铵泰克(北京)科技有限公司 | 基于fpga的tna设备及其通信方法 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN114130035B (zh) | 2025-09-19 |
| CN114130035A (zh) | 2022-03-04 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN107295080B (zh) | 应用于分布式服务器集群的数据存储方法和服务器 | |
| CN112882738A (zh) | 一种微服务架构下的配置信息更新方法、装置及电子设备 | |
| US20080244552A1 (en) | Upgrading services associated with high availability systems | |
| CN106462612A (zh) | 用于容错通信的系统和方法 | |
| CN107948318B (zh) | 多节点间的缓存同步方法和系统 | |
| CN112231108A (zh) | 任务处理方法、装置、计算机可读存储介质及服务器 | |
| CN107977252A (zh) | 一种云平台业务的缩容方法、装置及云平台 | |
| US20160350350A1 (en) | Ensuring the same completion status for transactions after recovery in a synchronous replication environment | |
| CN108566291B (zh) | 一种事件处理的方法、服务器及系统 | |
| WO2016177130A1 (zh) | 通讯节点的选择方法及装置 | |
| CN114143905B (zh) | 会话建立方法、通信系统、电子设备和存储介质 | |
| EP3312723A1 (en) | Command processing method and server | |
| WO2023071999A1 (zh) | 一种用户匹配方法、装置、设备及存储介质 | |
| CN105069152B (zh) | 数据处理方法及装置 | |
| CN107797849A (zh) | 分布式事务处理的方法、装置与系统 | |
| CN107797850A (zh) | 分布式事务处理的方法、装置与系统 | |
| CN107463390B (zh) | 一种软件升级方法及升级服务器 | |
| US20120166893A1 (en) | Recording and Preventing Crash in an Appliance | |
| CN108108119A (zh) | 一种可扩展的存储集群事物的配置方法及装置 | |
| CN114625566A (zh) | 数据容灾方法、装置、电子设备及存储介质 | |
| CN120301863B (zh) | 基于xxl-job改造服务注册中心实现服务自动发现的方法 | |
| CN104272789A (zh) | 移动通信系统、呼叫处理节点以及通信控制方法 | |
| CN119996366A (zh) | 一种有状态服务动态弹扩方法、装置、设备及存储介质 | |
| CN116347467B (zh) | 5g网络中udr进行用户数据管理方法及系统 | |
| CN115756855A (zh) | 一种集群切换方法、装置、终端及存储介质 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22885876 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 16/08/2024) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 22885876 Country of ref document: EP Kind code of ref document: A1 |