Sample extraction method, system, electronic device and computer readable storage medium
By adopting a sample extraction method with a layered sampling and retract mechanism in the online travel industry, the problem of users being repeatedly drawn and sample omission is solved, the full utilization and comprehensive coverage of samples are achieved, and user satisfaction and stickiness are improved.
Patent Information
- Application Number
- CN202411873361.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-04-08
AI Technical Summary
In the online travel industry, traditional sampling methods may cause users to be repeatedly drawn, resulting in increased boredom and it is impossible to ensure that as many users as possible are drawn at least once in a course cycle, resulting in incomplete research on user learning situations.
A sample extraction method is adopted, including the initial extraction process and multiple re-extraction processes. Through a layered sampling and re-extraction mechanism, we ensure full utilization and comprehensive coverage of samples, avoid sample omissions, and reduce the possibility that the same sample will be repeatedly extracted in one extraction cycle.
Through this method, the number of times each sample is drawn can be allocated more evenly, ensuring that the sample coverage is comprehensive, avoiding repeated extraction of users, improving user satisfaction, and improving user stickiness.
Smart Images

Figure CN119784541A_ABST
Abstract
Description
Background Art
[0002] In today's online travel agency (OTA) industry, each OTA platform needs to provide course training for users on the platform on platform basic knowledge, operation content, etc. After the course training, there is a need to select a portion of users to take course exams, so as to investigate the user's learning situation and improve the user stickiness of OTA.
[0003] However, when using traditional sampling methods to select some users for course examinations, there is a possibility that the same user will be repeatedly selected, which will cause users to feel bored due to being selected multiple times, resulting in a decrease in user satisfaction. In addition, the traditional sampling method cannot ensure that as many users as possible can be selected at least once in a course cycle, which easily leads to users being missed in the selection process, making it impossible to investigate the learning situation of most users.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute prior art known to ordinary technicians in the field. Summary of the invention
[0005] Based on this, the embodiments of the present application provide a sample extraction method, system, electronic device and computer-readable storage medium, which are conducive to the full utilization and comprehensive coverage of samples, avoid the occurrence of sample omissions, and at the same time improve the problem of the same sample being repeatedly extracted within an extraction cycle.
[0006] In a first aspect, the present application provides a sample extraction method, including an initial extraction process and multiple re-extraction processes;
[0007] The initial sampling process includes: obtaining an initial sample volume A1, and performing stratified sampling on the initial sample volume A1;
[0008] The re-drawing process includes: determining the number of samples that have not been drawn before the i-th drawing Where i includes an integer greater than or equal to 2; obtaining the probability of replacement before the i-th drawing, and randomly selecting whether to replace part of the drawn samples before the i-th drawing according to the probability of replacement before the i-th drawing; in the number of drawings in which part of the drawn samples are replaced before the i-th drawing, replacing part of the drawn samples to the number of samples that have not been drawn before the i-th drawing To form the total sample A for the i-th time i ; For the total sample size A of the i-th time i Conduct stratified sampling;
[0009] The re-extraction process is repeatedly performed, and each time the re-extraction process is completed, i is increased by one until the extraction cycle ends.
[0010] In some embodiments, the re-extraction process further includes:
[0011] Obtain the estimated sample net growth α and the number of draws n in the draw cycle, and calculate the total initial sample size A 1、 The sample net growth estimate α and the number of draws n are used to calculate the number of samples that should be drawn for each draw.
[0012] Set the replacement probability P before each sampling, and calculate the replacement probability P(1-P) before the i-th sampling of the sample that has been drawn according to the replacement probability P i-1 ;
[0013] According to the probability of replacement before the i-th draw P(1-P) i-1 Randomly choose whether to replace some of the samples that have been drawn in the i-th draw. If some of the samples that have been drawn are replaced before the i-th draw, then according to the number of samples that should be drawn in each sampling (A1+α) / n and the number of samples that have not been drawn before the i-th draw Calculate the number of replacement samples before obtaining the i-th draw
[0014] Replace the number of samples before the i-th draw with replacement β i Put it back into the original sample size extracted for the i-th time to form the total sample size A for the i-th time i , and the total sample size A for the i-th time i Conduct stratified sampling.
[0015] In some embodiments, according to the replacement probability P(1-P) i-1 Randomly choose whether to put back some of the samples that have been drawn in the i-th draw. If some of the samples that have been drawn are not put back before the i-th draw, then When , the number of samples that have not been drawn before the i-th draw The number of samples drawn The original sample quantity is supplemented to form the total sample quantity A for the i-th time i .
[0016] In some embodiments, the sample net growth estimate α is determined based on the net growth of the number of samples in the last sample extraction compared to the number of samples in the first extraction in the previous sample extraction cycle.
[0017] In some embodiments, the number of draws n is determined based on the net increase in the number of samples in the last draw compared to the number of samples in the first draw in the previous sample draw cycle.
[0018] In some embodiments, the stratified sampling comprises:
[0019] Determine the total sample size A before the i-th draw i According to the preset rules, the total sample volume A i Divide into j groups of sample components;
[0020] According to the number of extractions n in the extraction cycle, determine the i-th extraction ratio And according to the i-th extraction ratio Calculate the number of samples drawn for the i-th time
[0021] The number of samples randomly selected for the i-th time is sequentially selected from the j groups of sample components. samples.
[0022] In some embodiments, the stratified sampling further comprises:
[0023] Get the number of samples a in each group of the sample components in the j groups of sample components i,j ;
[0024] According to the number of samples a i,j Randomly extract the number of samples for the i-th extraction from the corresponding sample components in order from small to large samples.
[0025] In a second aspect, the present application further provides a sample extraction system for implementing the sample extraction method provided in the aforementioned embodiment, the sample extraction system comprising:
[0026] A primary sampling module is configured to obtain an initial sample volume A1 and perform stratified sampling on the initial sample volume A1;
[0027] A re-extraction module is configured to repeatedly perform a re-extraction process, wherein the re-extraction process includes: determining the number of samples that have not been extracted before the i-th extraction Where i includes an integer greater than or equal to 2; obtaining the probability of replacement before the i-th drawing, and randomly selecting whether to replace part of the drawn samples before the i-th drawing according to the probability of replacement before the i-th drawing; in the number of drawings in which part of the drawn samples are replaced before the i-th drawing, replacing part of the drawn samples to the number of samples that have not been drawn before the i-th drawing To form the total sample A for the i-th time i , for the total sample size A of the i-th time iPerform stratified sampling; each time the re-sampling process is completed, i is increased by one until the sampling cycle ends.
[0028] In a third aspect, the present application further provides an electronic device, including:
[0029] processor;
[0030] a memory storing executable instructions of the processor;
[0031] The processor is configured to execute the steps of the sample extraction method provided in the above embodiment by executing the executable instructions.
[0032] In a fourth aspect, the present application further provides a computer-readable storage medium for storing a program, which, when executed by a processor, implements the steps of the sample extraction method provided in the aforementioned embodiment.
[0033] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application.
[0034] The embodiments of the present application may or at least have the following advantages:
[0035] The embodiment of the present application includes, during the initial extraction process, stratified sampling of the total initial sample volume A1, which can ensure the rationality and balance of the distribution of the sample population and lay a good foundation for subsequent multiple re-extraction processes.
[0036] The embodiment of the present application introduces a replacement mechanism in multiple re-drawing processes, and randomly replaces some of the samples that have been drawn and the number of samples that have not been drawn before the i-th drawing. Merging effectively increases the total number of samples A for the i-th time i The number of samples that have not been drawn Adding them to the sample pool of the i-th extraction ensures full utilization and comprehensive coverage of the samples, making the expected number of times each sample is extracted more balanced and avoiding sample omissions. In addition, compared with replacing all the extracted samples, randomly replacing some of the extracted samples helps avoid the possibility of the same sample being repeatedly extracted in one extraction cycle.
[0037] Other advantages, objectives and features of the present application will be described in the following description to some extent, and will be apparent to those skilled in the art based on the following examination and study, or can be taught from the practice of the present application to some extent. The objectives and other advantages of the present application can be achieved and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings.
[0039] Figure 1 is a flow chart of a sample extraction method according to an embodiment of the present application;
[0040] Figure 2 It is a schematic diagram of the process of stratified sampling in the sample extraction method of one embodiment of the present application;
[0041] Figure 3 is a flow chart of a re-extraction process in a sample extraction method according to an embodiment of the present application;
[0042] Figure 4 It is a flow chart of the sample extraction method according to one embodiment of the present application applied to extracting users for course examinations;
[0043] Figure 5 It is a structural diagram of a sample extraction method according to an embodiment of the present application applied to extracting users for course examinations;
[0044] Figure 6 is a schematic diagram of the structure of a sample extraction system according to an embodiment of the present application;
[0045] Figure 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
[0046] Figure 8 It is a schematic diagram of the structure of a computer-readable storage medium according to an embodiment of the present application.
[0047] Description of reference numerals:
[0048] 10. Extract the module for the first time; 20. Extract the module again. DETAILED DESCRIPTION
[0049] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0050] In addition, the accompanying drawings are only schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0051] See also Figure 1 According to some embodiments, the present application provides a sample extraction method, which includes an initial extraction process S100 and multiple secondary extraction processes S200.
[0052] The initial sampling process S100 includes: obtaining the total initial sample volume A1, and performing stratified sampling on the total initial sample volume A1.
[0053] The re-drawing process S200 includes: determining the number of samples that have not been drawn before the i-th drawing Where i includes an integer greater than or equal to 2; obtain the probability of replacement before the i-th drawing, and randomly select whether to replace part of the drawn samples before the i-th drawing according to the probability of replacement before the i-th drawing; in the number of drawings in which part of the drawn samples are replaced before the i-th drawing, replace part of the drawn samples to the number of samples that have not been drawn before the i-th drawing To form the total sample A for the i-th time i , for the total sample size A of the i-th time i Conduct stratified sampling.
[0054] The sample extraction method further includes step S300: repeatedly executing the re-extraction process S200, and each time the re-extraction process is completed, i is increased by one until the extraction cycle ends.
[0055] The sampling method includes stratified sampling of the initial sample amount A1 during the initial sampling process, which can ensure the rationality and balance of the sample population distribution and lay a good foundation for subsequent multiple re-sampling processes.
[0056] This sampling method introduces a replacement mechanism in multiple re-sampling processes, and randomly replaces some of the samples that have been drawn and the number of samples that have not been drawn before the i-th drawing. Merging effectively increases the total number of samples A for the i-th time i The number of samples that have not been drawn Adding them to the sample pool of the i-th extraction ensures full utilization and comprehensive coverage of the samples, making the expected number of times each sample is extracted more balanced and avoiding sample omissions. In addition, compared with replacing all the extracted samples, randomly replacing some of the extracted samples helps avoid the possibility of the same sample being repeatedly extracted in one extraction cycle.
[0057] First, please refer to the stratified sampling involved in this sample extraction method. Figure 2 It is understood that, in some embodiments, the stratified sampling may be specifically performed as the following steps S101 to S103.
[0058] In step S101, the total sample volume A before the i-th extraction is determined i According to the preset rules, the total sample size A i Divide into j groups of sample components.
[0059] It should be noted that, in this embodiment, i may include an integer that is 1 or greater than or equal to 2. Wherein, A1 is the number of samples before the first sampling, that is, the total number of samples.
[0060] In step S102, the i-th extraction ratio is determined according to the number of extractions n in the extraction cycle. And according to the i-th extraction ratio Calculate the number of samples drawn for the i-th time That is, the total sample volume A before the i-th extraction i Multiply by the i-th extraction ratio Then round up.
[0061] In step S103, randomly extract the i-th sample number from the j groups of sample components. samples.
[0062] In some embodiments, the number of samples a in each group of sample components in j groups of sample components is obtained. i,j ; Then, according to the sample number a i,j Randomly extract the number of samples for the i-th time from the corresponding sample components in order from small to large samples.
[0063] In some embodiments, please combine Figure 3 It is understood that the re-extraction process S200 may specifically include the following steps S210 to S240.
[0064] In step S210, the estimated net sample growth α and the number of draws n in the draw cycle are obtained, and the initial sample size A is used as the starting point. 1、 The sample net growth estimate α and the number of draws n are used to calculate the number of samples that should be drawn for each draw.
[0065] In step S220, the replacement probability P before each sampling is set, and the replacement probability P(1-P) before the i-th sampling of the sample that has been drawn is calculated according to the replacement probability P. i-1 .
[0066] In step S230, according to the probability of replacement before the i-th draw P(1-P) i-1 Randomly choose whether to replace some of the samples that have been drawn in the i-th draw. If some of the samples that have been drawn are replaced before the i-th draw, then according to the number of samples that should be drawn in each sampling (A1+α) / n and the number of samples that have not been drawn before the i-th draw Calculate the number of replacement samples before obtaining the i-th draw
[0067] In step S240, replace the number of samples before the i-th extraction β i Put it back into the original sample size extracted for the i-th time to form the total sample size A for the i-th time i , and the total sample size A for the i-th time i Conduct stratified sampling.
[0068] As an example, if the random selection in step S230 is to not replace some of the samples that have been drawn before the i-th draw, then When , the number of samples that have not been drawn before the i-th draw The number of samples drawn Supplement the original sample size to form the total sample size A for the i-th time i .
[0069] In some embodiments, the sample net growth estimate α is determined based on the net growth of the number of samples in the last sample extraction compared to the number of samples in the first sample extraction in the previous sample extraction cycle.
[0070] In some embodiments, the number of draws n is determined based on the net increase in the number of samples in the last draw compared to the number of samples in the first draw in the previous sample draw cycle.
[0071] See below Figure 4 , the sample extraction method is further described by taking the scenario of applying it to extracting users to take course examinations as an example.
[0072] First, regarding the stratified sampling involved in this sample extraction method, the total sample volume A before the i-th extraction can be defined as i is the number of users that need to be sampled before the i-th sampling. For example, the user group that has not been sampled, that is, the user group that needs to be sampled for the first time is A1.
[0073] According to the user's business situation, for example, according to the user attributes and course attributes, the number of users A that need to be extracted before the i-th extraction i Divide into j groups of sample components, and the number of users in each group after grouping is a i,j , a i,j Here, j represents the jth group after grouping.
[0074] In addition, the number of users A that need to be drawn from each group before the i-th draw can be calculated i The proportion in the data can be used to determine the number of users to be extracted from each group.
[0075] Based on the historical experience of previous courses, it is determined that a course cycle contains n exams, and the number of draws n is defined. In this way, under the premise of evenly allocating the draw ratio, the draw ratio each time is Then the number of users extracted for the i-th time is
[0076] It can be understood that for the jth group, the number of users extracted for the i-th time is Considering In order to ensure that each group can extract corresponding relevant users, when extracting users, it is possible to start from the group with a smaller number of users, and randomly extract users from each group according to the number of users extracted from each group.
[0077] Stratified sampling according to the aforementioned steps can improve the stability of the sampling process while ensuring that all business types are covered during stratified sampling. For each group of business types, relevant users can be given post-course exams to ensure that all aspects are covered.
[0078] In the aforementioned steps, the extracted users and the unextracted users will be added to two different sample pools respectively, wherein the unextracted users can be used as the main user group in the subsequent extraction process, and the extracted users can be used as the user group that may be put back in the subsequent extraction process.
[0079] Next, an example is given of introducing a replacement mechanism in multiple re-extraction processes of the sample extraction method.
[0080] Before the i-th extraction, the number of users who have not been extracted is The sampled user group can be recorded as B i , where i is an integer greater than or equal to 2.
[0081] Since the number of users usually changes during the training course, there will be certain problems if the initial number of users is used as the total sample. Considering this problem, in order to ensure that the number of users not drawn each time is basically the same, the net increase α of the number of users in the last draw compared to the number of users in the first draw in the previous course cycle is obtained.
[0082] After determining the net increase in the number of users α, according to the number of draws n in a course cycle, the number of users that should be drawn for each draw can be calculated as That is, the number of users who have not been extracted is The number of users that should be extracted.
[0083] Since the sampling method introduces a replacement mechanism in multiple re-sampling processes, it can be determined whether the i-th sampling needs to put some of the extracted users back into the user group to be extracted this time based on the binomial distribution with probability P. The replacement probability P before each sampling is set, and the probability of replacing the extracted users before the i-th sampling is P(1-P). i-1 .
[0084] If some of the users that have been drawn need to be randomly replaced before the i-th draw, then the number of users replaced before the i-th draw β i satisfy:
[0085] Optionally, the extracted user groups may be grouped according to course attributes, with random selection being prioritized from relevant user group groups that are relatively close to the attributes of this course.
[0086] In contrast, if there is no need to replace some of the users that have been drawn before the i-th draw, then When , the number of users who have not been drawn before the i-th extraction Extract to make up the number of users.
[0087] The aforementioned re-drawing process is repeated, and each time a re-drawing process is completed, i is increased by one until the course cycle ends.
[0088] The above sample extraction method adjusts the population for each sampling, and performs random replacement of some people to reduce the psychological tendency of users to stop studying related courses because they are unlikely to be selected, thereby improving user stickiness; at the same time, only some people are replaced. This can prevent a user from being repeatedly selected. In this way, user stickiness is improved to the greatest extent while ensuring user satisfaction. At the same time, by combining the number of samples for each course exam with the number of sampling and replacement times, the balance of the number of samples each time is ensured to avoid too many or too few people in a single sample.
[0089] The following combination Figure 5 Some possible embodiments of the present application are further described.
[0090] Figure 5 Four groups of sample components a are shown in i,1 、a i,2 、a i,3 and a i,4 . Based on the number of users to be extracted after the i-th course The proportion of each group was counted separately.
[0091] Before conducting stratified sampling, the number of users to be selected in this stratified sampling is set, and a random operator is set, that is, a random sequence number is set for the users in each group.
[0092] Based on this, random sampling is performed according to the set number of users to be drawn this time and the set random sequence number.
[0093] After random sampling, the selected users and the unselected users will be added to two different sample pools respectively.
[0094] Set the random operator again, that is, generate any natural number between [0-100], and then replace it with the preset probability P(1-P) before extraction. i-1 Decide whether to replace the sample and re-sample, so that the total sample size A can be generated based on the result i , and the total sample size A for the i-th time i Stratified sampling is performed. After that, the above steps are repeated until the sampling cycle is completed.
[0095] Based on the same inventive concept, the embodiment of the present application also provides a sample extraction system for implementing the sample extraction method involved above. The implementation solution provided by the sample extraction system to solve the problem is similar to the implementation solution recorded in the above sample extraction method, so the technical effects that can be achieved by the above sample extraction method can also be achieved by the sample extraction system, which will not be repeated here.
[0096] Specifically, please combine Figure 6 It is understood that the sample extraction system includes a primary extraction module 10 and a secondary extraction module 20.
[0097] The initial sampling module 10 is configured to obtain an initial sample volume A1 and perform stratified sampling on the initial sample volume A1.
[0098] The re-extraction module 20 is configured to repeatedly perform the re-extraction process, which includes: determining the number of samples that have not been extracted before the i-th extraction Where i is an integer greater than or equal to 2; obtain the probability of replacement before the i-th draw, and randomly choose whether to replace part of the drawn samples before the i-th draw according to the probability of replacement before the i-th draw; in the number of draws in which part of the drawn samples are replaced before the i-th draw, replace part of the drawn samples to the number of samples that have not been drawn before the i-th draw To form the total sample A for the i-th time i , for the total sample size A of the i-th time i Perform stratified sampling; after each re-sampling process is completed, i is increased by one until the sampling cycle ends.
[0099] It should be noted that each module in the above sample extraction system can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0100] Furthermore, the sample extraction system of the present application also includes other existing functional modules that support the operation of the sample extraction system. Figure 6 The sample extraction system shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0101] An embodiment of the present application also provides an electronic device, comprising a processor; a memory, in which executable instructions of the processor are stored; wherein the processor is configured to perform the steps of the sample extraction method described in the above embodiment by executing the executable instructions.
[0102] Those skilled in the art will appreciate that various aspects of the present application may be implemented as a system, method or program product. Therefore, various aspects of the present application may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to as "circuit", "module" or "platform" herein.
[0103] Refer to the following Figure 7 The electronic device 600 according to this embodiment of the present application is described. Figure 7 The electronic device 600 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0104] like Figure 7As shown, the electronic device 600 is in the form of a general computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different system components (including the storage unit 620 and the processing unit 610), a display unit 640, etc.
[0105] The storage unit stores a program code, which can be executed by the processing unit 610, so that the processing unit 610 performs the steps according to various exemplary embodiments of the present application described in the above sample extraction method section of this specification. For example, the processing unit 610 can perform the following steps: Figure 1 Follow the steps shown in .
[0106] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 6201 and / or a cache memory unit 6202 , and may further include a read-only memory unit (ROM) 6203 .
[0107] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include the implementation of a network environment.
[0108] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0109] The electronic device 600 may also communicate with one or more external devices 700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 650. Furthermore, the electronic device 600 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 660. The network adapter 660 may communicate with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0110] In the electronic device, when the program in the memory is executed by the processor, the steps of the sample extraction method described in the aforementioned embodiment are implemented. Therefore, the electronic device can also obtain the technical effects of the aforementioned sample extraction method.
[0111] Those skilled in the art will understand that Figure 7 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0112] The present application also provides a computer-readable storage medium for storing a program, which, when executed by a processor, implements the steps of the sample extraction method described in the foregoing embodiments. In some possible implementations, various aspects of the present application may also be implemented in the form of a program product, which includes a program code, and when the program product is executed on a terminal device, the program code is used to cause the terminal device to perform the steps according to various exemplary embodiments of the present application described in the above sample extraction method section of this specification.
[0113] refer to Figure 8 As shown, a program product 800 for implementing the above method according to an embodiment of the present application is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be executed on a terminal device, such as a personal computer. However, the program product of the present application is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0114] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0115] The computer readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by an instruction execution system, an apparatus, or a device or used in combination with it. The program code contained on the readable storage medium may be transmitted with any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
[0116] Program code for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0117] When the program in the computer storage medium is executed by the processor, the steps of the sample extraction method are implemented. Therefore, the computer storage medium can also obtain the technical effect of the above-mentioned sample extraction method.
[0118] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features of the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0119] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the patent application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent application shall be subject to the attached claims.
Claims
1. A sample extraction method, characterized in that: Including the initial extraction process, and multiple re-extraction processes; The initial sampling process includes: obtaining an initial sample volume A1, and performing stratified sampling on the initial sample volume A1; The re-drawing process includes: determining the number of samples that have not been drawn before the i-th drawing Where i includes an integer greater than or equal to 2; obtaining the probability of replacement before the i-th drawing, and randomly selecting whether to replace part of the drawn samples before the i-th drawing according to the probability of replacement before the i-th drawing; in the number of drawings in which part of the drawn samples are replaced before the i-th drawing, replacing part of the drawn samples to the number of samples that have not been drawn before the i-th drawing To form the total sample A for the i-th time i ; For the total sample size A of the i-th time i Conduct stratified sampling; The re-extraction process is repeatedly performed, and each time the re-extraction process is completed, i is increased by one until the extraction cycle ends.
2. The sample extraction method according to claim 1, characterized in that: The re-extraction process also includes: Obtain the sample net growth estimate α and the number of draws n in the draw cycle, and calculate the number of samples to be drawn for each sampling based on the initial sample total A1, the sample net growth estimate α and the number of draws n Set the replacement probability P before each sampling, and calculate the replacement probability P(1-P) before the i-th sampling of the sample that has been drawn according to the replacement probability P i-1 ; According to the probability of replacement before the i-th draw P(1-P) i-1 Randomly choose whether to replace some of the samples that have been drawn in the i-th draw. If some of the samples that have been drawn are replaced before the i-th draw, then according to the number of samples that should be drawn in each sampling (A1+α) / n and the number of samples that have not been drawn before the i-th draw Calculate the number of replacement samples before obtaining the i-th draw Replace the number of samples before the i-th draw with replacement β i Put it back into the original sample size extracted for the i-th time to form the total sample size A for the i-th time i , and the total sample size A for the i-th time i Conduct stratified sampling.
3. The sample extraction method according to claim 2, characterized in that: According to the replacement probability P(1-P) i-1 Randomly choose whether to put back some of the samples that have been drawn in the i-th draw. If some of the samples that have been drawn are not put back before the i-th draw, then When , the number of samples that have not been drawn before the i-th draw The number of samples drawn The original sample quantity is supplemented to form the total sample quantity A for the i-th time i .
4. The sample extraction method according to claim 2, characterized in that: The sample net growth estimate α is determined based on the net growth of the number of samples at the last sampling compared to the number of samples at the first sampling in the previous sample sampling cycle.
5. The sample extraction method according to claim 2, characterized in that: The number of draws n is determined based on the net increase in the number of samples at the last draw compared to the number of samples at the first draw in the previous sample draw cycle.
6. The sample extraction method according to claim 1, characterized in that: The stratified sampling includes: Determine the total sample size A before the i-th draw i According to the preset rules, the total sample volume A i Divide into j groups of sample components; According to the number of extractions n in the extraction cycle, determine the i-th extraction ratio And according to the i-th extraction ratio Calculate the number of samples drawn for the i-th time The number of samples randomly selected for the i-th time is sequentially selected from the j groups of sample components. samples.
7. The sample extraction method according to claim 6, characterized in that: The stratified sampling also includes: Get the number of samples a in each group of the sample components in the j groups of sample components i,j ; According to the number of samples a i,j Randomly extract the number of samples for the i-th extraction from the corresponding sample components in order from small to large samples.
8. A sample extraction system, characterized in that: Used to implement the sample extraction method according to any one of claims 1 to 7, the sample extraction system comprises: A primary sampling module is configured to obtain an initial sample volume A1 and perform stratified sampling on the initial sample volume A1; A re-extraction module is configured to repeatedly perform a re-extraction process, wherein the re-extraction process includes: determining the number of samples that have not been extracted before the i-th extraction Where i includes an integer greater than or equal to 2; obtaining the probability of replacement before the i-th drawing, and randomly selecting whether to replace part of the drawn samples before the i-th drawing according to the probability of replacement before the i-th drawing; in the number of drawings in which part of the drawn samples are replaced before the i-th drawing, replacing part of the drawn samples to the number of samples that have not been drawn before the i-th drawing To form the total sample A for the i-th time i , for the total sample size A of the i-th time i Perform stratified sampling; each time the re-sampling process is completed, i is increased by one until the sampling cycle ends.
9. An electronic device, characterized in that: include: processor; a memory storing executable instructions of the processor; The processor is configured to perform the steps of the sample extraction method according to any one of claims 1 to 7 by executing the executable instructions.
10. A computer-readable storage medium for storing a program, characterized in that: When the program is executed by a processor, the steps of the sample extraction method according to any one of claims 1 to 7 are implemented.