Object extraction method and device, nonvolatile storage medium and computer equipment

By introducing an object extraction method into the system, receiving the extraction request of the target account, determining the target extraction method and object collection, and performing the extraction, the problem of repetition of the lottery step code in the existing technology is solved, and the scalability and maintenance of the system are improved.

CN119831649APending Publication Date: 2025-04-15CHINA TELECOM BESTPAY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411763912.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

In the prior art, activities involving multiple rewards need to repeat the writing of the lottery step code according to different activities, resulting in extremely high coupling and poor expansion and maintenance.

Method used

It provides an object extraction method, which determines the target extraction method and the target object collection by receiving the extraction request from the target account, and extracts it from the target object collection based on the target extraction method to obtain the target object.

Benefits of technology

It realizes direct call of different extraction methods, which improves the scalability of the system, reduces coupling and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119831649A_ABST
    Figure CN119831649A_ABST
Patent Text Reader

Abstract

The invention discloses an object extraction method and device, a nonvolatile storage medium and computer equipment. The method comprises the following steps: receiving an extraction request initiated based on a target account; determining a target extraction method from a plurality of preset extraction methods based on the extraction request; according to the extraction request, a target object set is determined, and the target object set represents an electronic coupon set; and based on a target extraction method, performing extraction from the target object set to obtain a target object. According to the method and the device, the technical problems that the coupling is extremely high and the expansion maintainability is relatively poor due to the fact that the step codes of the extraction objects are repeatedly written according to different activities in the activities related to various extraction rewards at present are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an object extraction method, device, non-volatile storage medium and computer equipment. Background Art

[0002] Currently, in major apps, in order to attract a large number of users and increase traffic, most of them will issue some electronic coupons through different activities. The current activities involving the issuance of electronic coupons will repeatedly write the code for these lottery steps according to different activities, resulting in extremely high coupling and poor expansion and maintenance, and it is a waste of time.

[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0004] The embodiments of the present invention provide an object extraction method, apparatus, non-volatile storage medium and computer device to at least solve the technical problem that current activities involving multiple extraction rewards will repeatedly write the step codes of these extraction objects according to different activities, resulting in extremely high coupling and poor expansion and maintainability.

[0005] According to one aspect of an embodiment of the present invention, there is provided an object extraction method, comprising: receiving an extraction request initiated based on a target account; determining a target extraction method from a plurality of preset extraction methods based on the extraction request; determining a target object set according to the extraction request; and extracting from the target object set based on the target extraction method to obtain a target object.

[0006] Optionally, based on the target extraction method, extracting from the target object set to obtain the target object includes: obtaining multiple extraction methods; setting corresponding identifiers for the multiple extraction methods; based on the identifier corresponding to the target extraction method, calling the target extraction method to extract from the target object set to obtain the target object.

[0007] Optionally, based on a target extraction method, extraction is performed from a target object set to obtain a target object, wherein the target extraction method is as follows: obtaining account information corresponding to a target account; based on the account information, determining an object preference corresponding to the target account; based on the object preference, adjusting an object extraction weight in the target object set to obtain an object target extraction weight in the target object set; based on the object target extraction weight, extraction is performed from the target object set to obtain a target object.

[0008] Optionally, when multiple extraction requests are received, threads corresponding to each of the multiple extraction requests are set; the number of threads that complete object extraction among the multiple threads is recorded; when the number of threads that complete object extraction matches the number of multiple extraction requests, the multiple threads are terminated.

[0009] Optionally, the target account and the target object corresponding to the target account are recorded in a preset database, and the number of objects in the target object set is updated.

[0010] Optionally, a query request is received, wherein the query request is used to query whether the target account is extracted successfully; query whether the target account exists in a preset database; if the target account exists in the preset database, query whether there is a corresponding object for the target account in the preset database; if the corresponding target object exists for the target account in the preset database, determine that the target account is extracted successfully.

[0011] According to another aspect of an embodiment of the present invention, there is also provided an object extraction device, including: a receiving module for receiving an extraction request initiated based on a target account; a method determination module for determining a target extraction method from a plurality of preset extraction methods based on the extraction request; a set determination module for determining a target object set according to the extraction request, wherein the target object set represents an electronic voucher set; and an extraction module for extracting from the target object set based on the target extraction method to obtain a target object.

[0012] According to another aspect of an embodiment of the present invention, a non-volatile storage medium is provided, the non-volatile storage medium including a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute any one of the above-mentioned object extraction methods.

[0013] According to yet another aspect of an embodiment of the present invention, a computer device is provided. The computer device includes a processor, and the processor is used to run a program. When the program is run, any one of the above-mentioned object extraction methods is executed.

[0014] According to yet another aspect of an embodiment of the present invention, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, any one of the above-mentioned object extraction methods is implemented.

[0015] In an embodiment of the present invention, an object extraction method is adopted, by receiving an extraction request initiated based on a target account; based on the extraction request, determining a target extraction method from a plurality of preset extraction methods; according to the extraction request, determining a target object set, wherein the target object set represents an electronic voucher set; based on the target extraction method, extracting from the target object set to obtain a target object, thereby achieving the purpose of directly calling different extraction methods, thereby realizing the technical effect of improving the scalability of the system, and further solving the technical problem that the current activities involving multiple extraction rewards will repeatedly write the step codes of these extraction objects according to different activities, resulting in extremely high coupling and poor scalability and maintainability. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0017] Figure 1 A hardware structure block diagram of a computer terminal for implementing an object extraction method is shown;

[0018] Figure 2 is a flow chart of an object extraction method provided according to an embodiment of the present invention;

[0019] Figure 3 It is a structural block diagram of an object extraction device provided according to an embodiment of the present invention. DETAILED DESCRIPTION

[0020] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0021] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0022] According to an embodiment of the present invention, a method embodiment of an object extraction method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0023] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1FIG. 1 shows a hardware structure block diagram of a computer terminal for implementing an object extraction method. Figure 1 As shown, the computer terminal 10 may include one or more (102a, 102b, ..., 102n are used to illustrate) processors (the processor may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0024] It should be noted that the one or more processors and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10. As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0025] The memory 104 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the object extraction method in the embodiment of the present invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the object extraction method of the above-mentioned application program is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0026] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 .

[0027] Figure 2 is a flow chart of an object extraction method according to an embodiment of the present invention. Figure 2 As shown, the method comprises the following steps:

[0028] Step S202: receiving an extraction request initiated based on a target account.

[0029] In this step, an extraction request initiated based on the target account may be received, wherein the extraction request may include the following information:

[0030] User ID: This is a fundamental component of the request and is used to identify the specific user making the request. The User ID can be a unique user ID, mobile phone number, or account name, etc., to ensure that the system can accurately associate the lottery ticket to the correct user account.

[0031] Pool ID: The pool ID (i.e., target object set) is used to specify the specific pool that the user wants to draw from. Each pool may contain different types of e-vouchers, as well as specific extraction rules and strategies. Therefore, the pool ID is key information to determine which set the user will draw from.

[0032] Drawing mode: The drawing request may also include a drawing mode, such as full release, N out of M, random weight, or adaptive release. This determines how the system will handle the electronic tickets in the prize pool and how many or what type of tickets the user will receive.

[0033] Big Data Tags: In some cases, an extraction request may contain big data tag information about a user, which is used to determine the category to which the user belongs and the type of e-vouchers they may receive. For example, premium users may be eligible for higher value vouchers.

[0034] Step S204: based on the extraction request, determine a target extraction method from a plurality of preset extraction methods.

[0035] In this step, the target extraction method is determined from the preset multiple extraction methods based on the extraction request, and the key parameters in the request can be parsed, which indicate the specific conditions and the expected extraction mode for the user to extract the electronic voucher. Key information can be extracted from the extraction request, including user identification, prize pool identification, and extraction mode. This information is the basis for determining the target extraction method. Check whether the extraction method specified in the extraction request conforms to the preset extraction method set. For example, the request may indicate that the full amount is issued, N chooses M, random weight or adaptive issuance mode is desired. According to the mode in the request, the specific parameters that may be contained in the request can be further parsed. For example, in the N chooses M mode, the specific values ​​of N and M need to be parsed; in the random weight mode, the weight information of each electronic voucher in the prize pool needs to be obtained; in the adaptive issuance mode, the user's big data label or other personal information is required. Select the target extraction method: Based on the parsed extraction mode and parameters, select the target extraction method that matches the request from the preset extraction methods. Each preset extraction method may be a specific algorithm or business logic for processing different types of extraction requests. You can define a series of algorithms and encapsulate each algorithm so that they can be replaced with each other, and the change of the algorithm will not affect the clients who use the algorithm. The strategy pattern belongs to the object behavior pattern. It separates the responsibility of using the algorithm from the implementation of the algorithm by encapsulating the algorithm, and delegates the management of these algorithms to different objects. Each algorithm can be an extraction method. In this way, there is no need to develop the extraction method again, which greatly improves scalability and reduces coupling.

[0036] Step S206: Determine a target object set according to the extraction request.

[0037] In this step, the process of determining the target object set according to the extraction request mainly depends on the parameters of the extraction request and the preset prize pool configuration. The extraction request can be parsed first, and key parameters can be extracted from the request, including but not limited to user ID, prize pool ID (target object set ID), extraction mode (such as full amount, N choose M, random weight, adaptability) and possible big data tag information. The preset prize pool configuration information can be queried according to the prize pool ID to verify whether the prize pool is valid and whether it is associated with the user in the request. According to the prize pool configuration and extraction mode, determine the type of electronic voucher that can be drawn from the prize pool. For example, in the N choose M mode, the prize pool configuration may list all possible electronic voucher types, and the system needs to select M electronic voucher types from them for extraction. The electronic voucher set determined in turn is the target object set.

[0038] Step S208: extracting from the target object set based on the target extraction method to obtain the target object.

[0039] In this step, the target object (in this scenario, a specific electronic voucher) is extracted from the target object set based on the target extraction method. All possible target objects to be extracted are prepared according to the target object set (electronic voucher set) determined in the previous step. Then the target extraction method is executed, among which there are many extraction methods, as follows:

[0040] Full distribution: If the target extraction method is full distribution, no specific extraction steps are required, and all objects (electronic coupons) in the collection will be issued to the user. At this time, the target object is the target object collection itself.

[0041] N-choose-M extraction: Extract M objects from the target object set, where M is less than or equal to the total number of objects in the set, N. This is usually implemented through a random but fair algorithm, for example, a random number can be generated for each object in the set, and then M objects with the smallest random numbers are selected.

[0042] Random weight extraction: Extraction is performed based on the preset weight of each object, and objects with higher weights are more likely to be extracted. This usually involves a cumulative weight calculation, and then a random number generator is used to determine the object to be extracted.

[0043] Adaptive extraction: Based on big data labels such as user behavior and preferences, calculate the user's fitness for each object in the collection, and then extract based on the fitness. This may involve more complex machine learning algorithms to predict the objects that users are most likely to use.

[0044] Through the above steps, the system can effectively extract target objects from the target object set according to different target extraction methods, while ensuring the accuracy and efficiency of the operation.

[0045] Through the above steps, the purpose of directly calling different extraction methods is achieved, thereby realizing the technical effect of improving the scalability of the system, and further solving the technical problem that the current activities involving multiple extraction rewards will repeatedly write the step codes of these extraction objects according to different activities, resulting in extremely high coupling and poor expansion and maintainability.

[0046] As an optional embodiment, based on a target extraction method, extracting from a target object set to obtain a target object includes: obtaining multiple extraction methods; setting corresponding identifiers for the multiple extraction methods; based on the identifier corresponding to the target extraction method, calling the target extraction method to extract from the target object set to obtain the target object.

[0047] Optionally, based on the target extraction method, the process of extracting from the target object set and obtaining the target object can be further refined into the following steps to ensure the accuracy of the extraction and the clarity of the system logic. This process is particularly suitable for situations where there are multiple extraction methods in the system, such as full issuance, N-select-M, random weight issuance, adaptive issuance, etc. A unique identifier (ID) can be set for each extraction method, which is used to identify and call specific extraction methods in the system. The identifier can be a digital ID, a string ID, or an identifier that combines the type and version for easy management and expansion. According to the parsed identifier, the system calls the corresponding target extraction method. The calling process may need to pass in the target object set and the parameters of the extraction request (such as user ID, number of extractions, weight distribution, etc.) as input to the method.

[0048] In a specific implementation, a dictionary (often represented as Map or Dictionary in programming languages) is usually used to store the correspondence between such identifiers and lottery methods, so as to achieve flexible and efficient lottery method selection and calling.

[0049] Each lottery method is assigned a unique identifier, which can be an integer, string, or enumeration value, and is used to reference a specific lottery algorithm in system configuration or requests. For example, full distribution can be identified as 1, N-choose-M extraction as 2, random weight extraction as 3, and adaptive extraction as 4. Key-value pair relationship (Map or Dictionary): Inside the system, a Map or Dictionary structure is created, where the key (Key) is the above lottery method identifier and the value (Value) is the implementation class object or function reference of the corresponding lottery method. This design allows the system to quickly find and call the corresponding lottery logic based on the identifier. In the strategy mode, the system defines a series of algorithms and encapsulates them in different classes, each class representing a specific strategy. Using Map or Dictionary to store the relationship between the strategy identifier and its corresponding class can avoid hard coding when calling specific strategies, improving the scalability and flexibility of the system. When the system starts or the configuration changes, the corresponding strategy implementation class will be dynamically loaded according to the preset lottery method identifier, and then these identifiers and class instances will be constructed into key-value pairs and put into the Map. In the actual operation process, after receiving the lottery request, the system parses the lottery method identifier specified in the request, and then locates the specific strategy implementation through the key-value pair relationship in the Map and calls its lottery method. Using Map or Dictionary as a key-value pair storage, you can easily call different lottery strategies through the lottery method identifier without changing the core code of the system. When you need to add a new lottery method or replace the old lottery algorithm, you only need to modify the key-value pair in the Map and add or update the corresponding strategy implementation. There is no need to make large-scale modifications to the original logic of the system, which greatly reduces the coupling of the code and improves the maintainability and scalability of the system.

[0050] Through the above steps, not only the flexibility of the system is improved, but also the workload of developers when connecting new extraction logic is simplified, so that the system can easily cope with new extraction requirements and scenarios that may arise in the future.

[0051] As an optional embodiment, based on a target extraction method, extraction is performed from a target object set to obtain a target object, wherein the target extraction method is as follows: obtaining account information corresponding to a target account; based on the account information, determining an object preference corresponding to the target account; based on the object preference, adjusting an object extraction weight in the target object set to obtain an object target extraction weight in the target object set; based on the object target extraction weight, extracting from the target object set to obtain a target object.

[0052] Optionally, the process of extracting from the target object set based on the target extraction method to obtain the target object, especially when the extraction method involves adjusting the extraction weight of the object according to the preference of the target account, can be refined into the following steps. This method is particularly suitable for personalized recommendation scenarios, such as adaptive electronic voucher issuance: the account information corresponding to the target account can be obtained first, such as the account's historical transaction records, electronic voucher cancellation status, browsing history, search history, etc. Using the account information, through data analysis and machine learning algorithms (such as collaborative filtering, content-based recommendation algorithms, etc.), determine which types of objects (in this scenario, electronic voucher types) the target account prefers. User preferences can be specific product categories, brand preferences, electronic voucher type preferences, etc., which need to be defined according to the specific business scenarios of the application. For each object in the target object set, its extraction weight is adjusted according to the calculated preference degree. The weight adjustment mechanism can be linear or nonlinear to reflect the preference degree. For example, if the user has a high preference for a certain type of electronic voucher, the extraction weight of this type of electronic voucher can be increased accordingly, otherwise the weight can be reduced. In this way, the system can ensure that when extracting, it is more likely to extract the object preferred by the user, thereby improving the user experience and the overall efficiency of the system. Use the adjusted weights for weighted random extraction, or extract objects from the target object set according to a specific algorithm (such as the roulette algorithm). In the specific extraction process, the system will calculate the probability of each object being selected based on its target extraction weight, and then determine the final object to be extracted through a random number generator.

[0053] For example, the method can calculate the weight of a category that the user prefers based on a certain algorithm based on many factors such as the user's browsing history, browsing time of a certain page, app consumption history, search history, etc., and calculate the electronic coupons in the prize pool issued to the user through the weight ratio. For example: the prize pool is an e-commerce coupon for a variety of commodities. If a user often browses electrical appliances or searches for a certain appliance, when the user receives the prize pool, he or she is more likely to get an electronic coupon for the relevant appliance.

[0054] The specific process is as follows:

[0055] a. Another system will record the user's searches and browsing history in the app and organize them regularly.

[0056] b. When distributing the prize pool, if the distribution method is adaptive, another system will be called for calculation. The other system will analyze and calculate according to the user's habits (the specific calculation is not expanded in detail and is not the focus of this patent method) to obtain the best electronic coupon belonging to the user.

[0057] Through the above steps, the system can extract the object that best meets the user's needs from the target object set based on the preferences of the target account using an adaptive extraction method, thereby improving user satisfaction and the system's write-off rate. This process not only reflects the concept of personalized service, but also demonstrates the important role of algorithms in improving user experience and business results.

[0058] As an optional embodiment, when multiple extraction requests are received, threads corresponding to each of the multiple extraction requests are set; the number of threads that complete object extraction among the multiple threads is recorded; and when the number of threads that complete object extraction matches the number of multiple extraction requests, the multiple threads are terminated.

[0059] Optionally, in the case of receiving multiple extraction requests, a multi-threaded processing strategy can be used to ensure that all requests are properly processed and completed. First, create a thread pool based on the system's concurrent processing capabilities and the expected request load. The thread pool can pre-create and manage a certain number of worker threads to avoid the overhead of creating new threads for each request, while controlling the system's concurrency level to prevent excessive resource consumption. For each extraction request received, the system will assign a thread (or obtain a thread from the thread pool) to process the request. Each thread is responsible for executing specific extraction logic, including obtaining account information, determining object preferences, adjusting extraction weights, and performing extraction operations. In the main thread, the system needs to maintain a counter (such as AtomicInteger type) to record the number of threads that have completed object extraction tasks. Whenever a thread completes its assigned extraction task, it updates the value of this counter, indicating that another extraction request has been processed. In order to ensure that the main thread continues to execute only after all threads have completed their tasks, an inter-thread communication mechanism can be used, such as using CyclicBarrier, CountDownLatch, and other classes. These classes allow the main thread to wait for all child threads to complete specific operations. For example, after each child thread completes the extraction task, it will reduce the count through the countDown method of CountDownLatch. Only when the count returns to zero, indicating that all threads have completed their tasks, can the main thread continue to execute. In a multi-threaded environment, ensuring data consistency is key. Using thread-safe data structures and atomic operations to update thread counters and record extraction results in the database can avoid data inconsistencies or race conditions caused by concurrent modifications. The main thread will continue to check the value of the thread counter. Once the value of the counter is equal to the number of extraction requests received, it means that all threads have completed their tasks. At this point, the main thread can continue with subsequent operations, such as recording extraction results, feeding back to users, and cleaning up thread resources.

[0060] Through the above steps, the system can effectively handle multiple concurrent extraction requests while ensuring that all requests are fully processed, improving the system's processing capacity and response speed. This strategy is particularly suitable for high-concurrency, low-latency application scenarios, and can significantly improve user experience and system efficiency. At the same time, by reasonably designing the thread pool and using the inter-thread communication mechanism, the amount of requests that the system can handle can be dynamically adjusted, providing flexible support for businesses of different sizes.

[0061] As an optional embodiment, the target account and the target object corresponding to the target account are recorded in a preset database, and the number of objects in the target object set is updated.

[0062] Optionally, recording the target account and the target object corresponding to the target account into a preset database and updating the number of objects in the target object set are important steps in the electronic voucher issuance system to ensure data consistency and track the user reward status. Once the electronic voucher or other reward is successfully extracted and allocated to the target account, the system needs to record this allocation event into the preset database. This usually includes creating a new record containing the unique identifier of the target account (such as user ID), the type of electronic voucher allocated, the electronic voucher ID (if any), the allocation time, the allocation status (success / failure), and other information. This information is not only used for auditing and management, but also the basis for subsequent queries and user reward status updates. While recording the extraction event, the system should also update the number of corresponding electronic vouchers in the target object set. This is to ensure that the inventory of electronic vouchers is accurate and avoid over-issuance or insufficient inventory. Update operations usually require locking related database rows or using transaction processing to ensure data consistency in a concurrent environment. In order to ensure the atomicity of data recording and inventory update operations, that is, either success or failure at the same time, the database transaction processing mechanism can be used. Transaction processing ensures that no other operations occur between data recording and inventory update, so that data consistency is maintained. In the event of an exception or error, the transaction can be rolled back, undoing all changes and preventing incomplete data.

[0063] Through the above steps, the system can accurately record the reward distribution of each target account and update the inventory status in real time to ensure the consistency and integrity of the data. This not only improves the reliability and stability of the system, but also facilitates subsequent audits, analysis, and user services. When designing and implementing this process, full consideration should be given to data security and transaction processing efficiency in a concurrent environment to ensure system performance while maintaining data accuracy.

[0064] As an optional embodiment, a query request is received, wherein the query request is used to query whether the target account is extracted successfully; query whether the target account exists in a preset database; if the target account exists in the preset database, query whether there is a corresponding object for the target account in the preset database; if the corresponding target object exists for the target account in the preset database, determine that the target account is extracted successfully.

[0065] Optionally, the process of processing received query requests to determine whether the target account successfully extracts an object (such as an electronic voucher) can be divided into the following clear steps to ensure the accuracy of the query and the response efficiency of the system: The system receives a query request from the front end or the user, and the request contains a unique identifier of the target account, such as a user ID. This request is usually initiated after the user participates in an activity and requests to extract a reward, and is used to confirm the extraction result. The system parses the account identifier in the query request, and then queries the preset database to see if there is an account record matching the identifier. The preset database stores all account information that participates in the activity and attempts to extract rewards and their corresponding extraction records. If the record of the target account is found in the database, the system will further check whether the account has a corresponding object extraction record. If the account does not exist, an error message is directly returned or the user account is prompted that the account has not participated in the relevant activity. After confirming that the target account exists, the system queries whether the account has an object record related to the extraction request. This usually involves checking the electronic voucher type, extraction time, extraction status, and other information under the account record. If the object record corresponding to the target account with a successful status is found in the database, the system can determine that the account has been successfully extracted. If the status in the record is failed or waiting for issuance, the system returns the corresponding status according to the current business rules. The user may need to wait for a while before querying again, or the user may be prompted with the reason for the failure of the extraction. The system returns the query results (success, failure, waiting for issuance, etc.) to the initiator of the query request through the corresponding interface. This may include specific object details (such as the type of electronic voucher, validity period, etc.), extraction time, extraction status and other information, so that the user or the system front end can display it to the user.

[0066] For asynchronous processing of third-party interfaces, the system needs to provide an asynchronous query interface to allow users to query the final extraction results within a period of time after initiating the extraction request. The system should design a status tracking mechanism to ensure that users get the final extraction status even when the third-party response time is uncertain. When implementing this process, the efficiency and accuracy of database queries should be ensured, while taking into account possible data competition issues in a concurrent environment. The use of database optimization methods such as indexing, partitioning, and caching, as well as the reasonable design of query logic, can improve the response speed and processing power of queries. In addition, for asynchronous queries, the system should design a reasonable retry mechanism and timeout handling strategy to deal with the instability and delay issues of third-party interfaces and ensure a smooth user experience.

[0067] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0068] Through the description of the above implementation methods, those skilled in the art can clearly understand that the object extraction method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), including a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0069] According to an embodiment of the present invention, there is also provided an object extraction device for implementing the above object extraction method. Figure 3 is a structural block diagram of an object extraction device provided according to an embodiment of the present invention. Figure 3 As shown, the object extraction device includes: a receiving module 32, a method determination module 34, a set determination module 36 and an extraction module 38. The object extraction device is described below.

[0070] The receiving module 32 is used to receive an extraction request initiated based on a target account.

[0071] The method determination module 34 is connected to the receiving module 32 and is used to determine a target extraction method from a plurality of preset extraction methods based on the extraction request.

[0072] The set determination module 36 is connected to the method determination module 34 and is used to determine a target object set according to the extraction request, wherein the target object set represents an electronic voucher set.

[0073] The extraction module 38 is connected to the set determination module 36 and is used to extract the target object from the target object set based on the target extraction method to obtain the target object.

[0074] It should be noted that the receiving module 32, the method determination module 34, the set determination module 36 and the extraction module 38 correspond to steps S202 to S208 in the embodiment, and the examples and application scenarios implemented by the multiple modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above embodiment. It should be noted that the above modules, as part of the device, can be run in the computer terminal 10 provided in the embodiment.

[0075] Optionally, the extraction module is used to extract from the target object set based on a target extraction method to obtain a target object, including: obtaining multiple extraction methods; setting corresponding identifiers for the multiple extraction methods; based on the identifier corresponding to the target extraction method, calling the target extraction method to extract from the target object set to obtain the target object.

[0076] Optionally, the extraction module is used to extract from the target object set based on a target extraction method to obtain a target object, wherein the target extraction method is as follows: obtain account information corresponding to the target account; based on the account information, determine the object preference corresponding to the target account; based on the object preference, adjust the object extraction weight in the target object set to obtain the object target extraction weight in the target object set; based on the object target extraction weight, extract from the target object set to obtain the target object.

[0077] Optionally, a setting module is used to set threads corresponding to each of the multiple extraction requests when multiple extraction requests are received; a recording module is used to record the number of threads that complete object extraction among the multiple threads; and an ending module is used to end the multiple threads when the number of threads that complete object extraction matches the number of multiple extraction requests.

[0078] Optionally, the updating module is used to record the target account and the target object corresponding to the target account into a preset database, and update the number of objects in the target object set.

[0079] Optionally, a query receiving module is used to receive a query request, wherein the query request is used to query whether the target account is extracted successfully; a first query module is used to query whether the target account exists in a preset database; a second query module is used to query whether there is a corresponding object for the target account in the preset database if the target account exists in the preset database; and a determination module is used to determine that the target account is extracted successfully if there is a corresponding target object for the target account in the preset database.

[0080] An embodiment of the present invention may provide a computer device. Optionally, in this embodiment, the computer device may be located in at least one network device among multiple network devices of a computer network. The computer device includes a memory and a processor.

[0081] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the object extraction method and device in the embodiment of the present invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned object extraction method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0082] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: receive an extraction request initiated based on a target account; based on the extraction request, determine a target extraction method from multiple preset extraction methods; according to the extraction request, determine a target object set, wherein the target object set represents an electronic voucher set; based on the target extraction method, extract from the target object set to obtain a target object.

[0083] Optionally, the processor may also execute program code of the following steps: based on a target extraction method, extracting from a target object set to obtain a target object, including: obtaining multiple extraction methods; setting corresponding identifiers for the multiple extraction methods; based on the identifier corresponding to the target extraction method, calling the target extraction method to extract from the target object set to obtain the target object.

[0084] Optionally, the processor may also execute the program code of the following steps: based on a target extraction method, extracting from a target object set to obtain a target object, wherein the target extraction method is as follows: obtaining account information corresponding to a target account; based on the account information, determining an object preference corresponding to the target account; based on the object preference, adjusting an object extraction weight in the target object set to obtain an object target extraction weight in the target object set; based on the object target extraction weight, extracting from the target object set to obtain a target object.

[0085] Optionally, the processor may also execute the program code of the following steps: upon receiving multiple extraction requests, setting threads corresponding to each of the multiple extraction requests; recording the number of threads that complete object extraction among the multiple threads; and terminating the multiple threads when the number of threads that complete object extraction matches the number of multiple extraction requests.

[0086] Optionally, the processor may further execute program code of the following steps: recording the target account and the target object corresponding to the target account into a preset database, and updating the number of objects in the target object set.

[0087] Optionally, the processor may also execute the program code of the following steps: receiving a query request, wherein the query request is used to query whether the target account is extracted successfully; querying whether the target account exists in a preset database; if the target account exists in the preset database, querying whether there is a corresponding object for the target account in the preset database; if the target account has a corresponding target object in the preset database, determining that the target account is extracted successfully.

[0088] By adopting the embodiment of the present invention, a method for object extraction is provided, which receives an extraction request initiated based on a target account; determines a target extraction method from a plurality of preset extraction methods based on the extraction request; determines a target object set according to the extraction request, wherein the target object set represents an electronic voucher set; extracts from the target object set based on the target extraction method to obtain the target object, thereby achieving the purpose of directly calling different extraction methods, thereby realizing the technical effect of improving the scalability of the system, and further solving the technical problem that the current activities involving multiple extraction rewards will repeatedly write the step codes of these extraction objects according to different activities, resulting in extremely high coupling and poor scalability and maintainability.

[0089] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a non-volatile storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0090] The embodiment of the present invention further provides a non-volatile storage medium. Optionally, in this embodiment, the non-volatile storage medium can be used to store the program code executed by the object extraction method provided in the embodiment.

[0091] Optionally, in this embodiment, the non-volatile storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.

[0092] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: receiving an extraction request initiated based on a target account; based on the extraction request, determining a target extraction method from a plurality of preset extraction methods; according to the extraction request, determining a target object set, wherein the target object set represents a set of electronic vouchers; based on the target extraction method, extracting from the target object set to obtain a target object.

[0093] An embodiment of the present invention also provides a computer program product, including a computer program. Optionally, in this embodiment, when the computer program is executed by a processor, it can achieve: receiving an extraction request initiated based on a target account; based on the extraction request, determining a target extraction method from a plurality of preset extraction methods; according to the extraction request, determining a target object set, wherein the target object set represents an electronic voucher set; based on the target extraction method, extracting from the target object set to obtain a target object.

[0094] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0095] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0096] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

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

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

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

[0100] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. An object extraction method, characterized in that: include: Receive extraction requests based on target accounts; Based on the extraction request, determining a target extraction method from a plurality of preset extraction methods; Determine a target object set according to the extraction request; Based on the target extraction method, extraction is performed from the target object set to obtain a target object.

2. The method according to claim 1, characterized in that The step of extracting a target object from the target object set based on the target extraction method comprises: Obtaining the multiple extraction methods; Setting respective corresponding identifiers for the multiple extraction methods; Based on the identifier corresponding to the target extraction method, the target extraction method is called to extract from the target object set to obtain the target object.

3. The method according to claim 1, characterized in that Based on the target extraction method, extracting from the target object set to obtain the target object, wherein the target extraction method is as follows: Obtaining account information corresponding to the target account; Based on the account information, determining an object preference corresponding to the target account; Based on the object preference, adjusting the object extraction weights in the target object set to obtain the object target extraction weights in the target object set; Based on the object target extraction weight, extraction is performed from the target object set to obtain the target object.

4. The method according to claim 1, characterized in that: Also includes: In the case of receiving multiple extraction requests, setting threads corresponding to the multiple extraction requests respectively; Record the number of threads that have completed object extraction among multiple threads; When the number of threads that have completed object extraction matches the number of the plurality of extraction requests, the plurality of threads are terminated.

5. The method according to any one of claims 1 to 4, characterized in that: Also includes: The target account and the target object corresponding to the target account are recorded in a preset database, and the number of objects in the target object set is updated.

6. The method according to claim 5, characterized in that Also includes: Receiving a query request, wherein the query request is used to query whether the target account is extracted successfully; Querying whether the target account exists in the preset database; If the target account exists in the preset database, query whether there is a corresponding object in the preset database; In the case that the target account in the preset database has the corresponding target object, it is determined that the target account is extracted successfully.

7. An object extraction device, characterized in that: include: A receiving module, used to receive an extraction request initiated based on a target account; A method determination module, used to determine a target extraction method from a plurality of preset extraction methods based on the extraction request; A set determination module, used to determine a target object set according to the extraction request; The extraction module is used to extract the target object from the target object set based on the target extraction method to obtain the target object.

8. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored program, wherein when the program is executed, the device where the non-volatile storage medium is located is controlled to execute the object extraction method according to any one of claims 1 to 6.

9. A computer device, characterized in that: include: Memory and processor, The memory stores a computer program; The processor is used to execute the computer program stored in the memory, and when the computer program is run, the processor executes the object extraction method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the object extraction method described in any one of claims 1 to 6 is implemented.