A method, apparatus, device, and storage medium for querying verification codes.

By equipping the server with a verification code query device, and using cache queue storage and monitoring methods to automatically obtain virtual mobile phone numbers and verification codes, the problem of low verification code query efficiency during the business acceptance phase is solved, enabling a convenient testing process and reducing the waste of human resources.

CN117131086BActive Publication Date: 2025-11-14CHINA UNITED NETWORK COMM GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311090917.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-28
Publication Date
2025-11-14
Estimated Expiration
2043-08-28

AI Technical Summary

Technical Problem

During application testing, in the business acceptance phase, business personnel cannot log in to the server to view application logs, which requires developers to assist in querying verification codes, wasting human resources and resulting in low efficiency.

Method used

By equipping the server with a verification code query device, virtual mobile phone numbers and corresponding verification codes can be automatically obtained through cache queue storage and monitoring. Any business personnel can easily obtain them, reducing the waste of human resources.

Benefits of technology

It enables automatic CAPTCHA retrieval for testing without the need for developer assistance, improving query efficiency and reducing development costs and deployment risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117131086B_ABST
    Figure CN117131086B_ABST
Patent Text Reader

Abstract

This application provides a verification code query method, apparatus, device, and storage medium, relating to the field of computer technology. The method automatically queries virtual phone numbers used for testing and their corresponding verification codes, improving query efficiency. The method includes: obtaining a query instruction, which instructs the query to retrieve virtual phone numbers used for testing and their corresponding verification codes from a target application; responding to the query instruction, sequentially retrieving and displaying query results from a cache queue, whereby the cache queue stores virtual phone numbers and their corresponding verification codes retrieved by the server from the target application in a monitoring manner. This application can be used during target application testing to retrieve virtual phone numbers and their corresponding verification codes from the target application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, device and storage medium for CAPTCHA query. Background Technology

[0002] With the rapid development of electronic and computer technologies, various applications are widely used in various electronic devices. With the popularization of mobile terminals, various mobile applications are widely used in all walks of life, and a mobile terminal may need to have a dozen or even dozens of mobile applications installed. However, as the application environment and required functions of these applications become increasingly complex, testing them to ensure their stability and reliability has become increasingly important.

[0003] In daily testing, testers typically begin testing application business processes with user login, usually via mobile phone verification codes. However, in test environments, because the test phone numbers are often fake, the verification codes cannot be sent to users. Therefore, testers must log into the application's deployment server to view application logs and find the verification codes there. While testers can access the logs themselves during system testing, during business acceptance testing, business personnel often lack the skills and permissions to do so, requiring testers or developers to assist in retrieving the verification codes. This method of querying verification codes not only consumes developer time and wastes human resources but is also inefficient. Summary of the Invention

[0004] This application provides a verification code query method, apparatus, device, and storage medium, which realizes automatic query of virtual mobile phone numbers used for testing and corresponding verification codes, thereby improving query efficiency.

[0005] In a first aspect, this application provides a verification code query method applied to a server, the server having a target application for generating verification codes, the method comprising: obtaining a query instruction; the query instruction being used to instruct the query of a virtual mobile phone number used for testing and the corresponding verification code in the target application; in response to the query instruction, sequentially retrieving query results from a cache queue and displaying them; the cache queue being used to store the virtual mobile phone number and the corresponding verification code obtained by the server from the target application in a monitoring manner.

[0006] The verification code query method provided in this application obtains a query instruction indicating the virtual phone number and corresponding verification code used for testing in the target application. In response to the query instruction, it sequentially retrieves and displays the virtual phone number and corresponding verification code from a cache queue. This verification code query method uses a cache queue to store the virtual phone number and corresponding verification code obtained from the target application in a monitored manner. This achieves automatic retrieval of the virtual phone number and corresponding verification code used for testing from the target application, without the assistance of developers. Any business personnel can conveniently obtain verification codes for testing, reducing the waste of human resources and improving testing efficiency.

[0007] One possible implementation is that, when the query command carries a specified virtual phone number, the query result includes the specified virtual phone number and multiple corresponding verification codes.

[0008] Another possible implementation method includes building a cache queue.

[0009] Another possible implementation involves constructing a cache queue, which includes: determining whether the target application is under monitoring; the monitored state indicates that the server can obtain the virtual phone number and corresponding verification code generated by the target application; if the target application is under monitoring, and the target function is called, obtaining the virtual phone number and corresponding verification code generated by the target function, and constructing a cache queue; the target function is the function in the target application used to generate the virtual phone number and corresponding verification code.

[0010] Another possible implementation method includes: configuring the target application to be monitored based on the monitoring logic package when the target application is in an unmonitored state; the monitoring logic package is used to dynamically track the target function.

[0011] Another possible implementation involves retrieving and displaying query results sequentially from the cache queue in response to a query command, including: periodically sending query requests to the cache queue in response to a query command; and periodically retrieving and displaying the query results returned by the cache queue in response to a query request.

[0012] Another possible implementation method includes: deleting the cache queue and configuring the target application to be in an unmonitored state if no query request is sent within a preset time period.

[0013] Secondly, this application provides a verification code query device, which includes: an acquisition module and a response module; the acquisition module is used to acquire a query instruction; the query instruction is used to instruct the query of a virtual mobile phone number used for testing in a target application and the corresponding verification code; the response module is used to, in response to the query instruction, sequentially acquire query results from a cache queue and display them; the cache queue is used to store the virtual mobile phone number and the corresponding verification code acquired by the server from the target application in a monitoring manner.

[0014] One possible implementation is that, when the query command carries a specified virtual phone number, the query result includes the specified virtual phone number and multiple corresponding verification codes.

[0015] Another possible implementation includes a building module; the building module is used to build a cache queue.

[0016] Another possible implementation involves a module specifically designed to determine whether the target application is under monitoring. The monitored state indicates that the server can obtain the virtual phone number and corresponding verification code generated by the target application. If the target application is under monitoring, and the target function is called, the module obtains the virtual phone number and corresponding verification code generated by the target function and constructs a cache queue. The target function is the functional function in the target application used to generate the virtual phone number and corresponding verification code.

[0017] Another possible implementation includes: a configuration module; the configuration module is used to configure the target application to be in a monitored state based on the monitoring logic package when the target application is in an unmonitored state; the monitoring logic package is used to dynamically track the target function.

[0018] Another possible implementation is that the response module is specifically used to periodically send query requests to the cache queue in response to query commands; and to periodically retrieve and display the query results returned by the cache queue in response to query requests.

[0019] Another possible implementation includes a deletion module; the deletion module is used to delete the cache queue and configure the target application to be in an unmonitored state if no query request is sent within a preset time period.

[0020] Thirdly, this application provides an electronic device comprising: a processor and a memory; the memory storing processor-executable instructions; when the processor is configured to execute the instructions, causing the electronic device to implement the method of the first aspect described above.

[0021] Fourthly, this application provides a computer-readable storage medium comprising: computer software instructions; which, when executed in an electronic device, cause the electronic device to implement the method described in the first aspect.

[0022] Fifthly, this application provides a computer program product that, when run on a computer, causes the computer to perform the steps of the relevant method described in the first aspect above, so as to implement the method of the first aspect above.

[0023] The beneficial effects of the second to fifth aspects mentioned above are described in the corresponding description of the first aspect and will not be repeated here. Attached Figure Description

[0024] Figure 1 A schematic diagram illustrating the application environment of the verification code query method provided in this application;

[0025] Figure 2 This application provides a flowchart illustrating a verification code query method.

[0026] Figure 3 A flowchart illustrating another verification code query method provided in this application;

[0027] Figure 4 A flowchart illustrating another verification code query method provided in this application;

[0028] Figure 5 A schematic diagram of the front-end interface of a verification code query method provided in this application;

[0029] Figure 6 A schematic diagram of the front-end interface for another verification code query method provided in this application;

[0030] Figure 7 A schematic diagram of the composition of a verification code query device provided in this application;

[0031] Figure 8 This is a schematic diagram of the composition of an electronic device provided in this application. Detailed Implementation

[0032] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0033] It should be noted that in the embodiments of this application, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design scheme described as "exemplarily" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the words "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.

[0034] To facilitate a clear description of the technical solutions of the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish the same or similar items with essentially the same function and effect. Those skilled in the art can understand that the terms "first" and "second" are not intended to limit the quantity or execution order.

[0035] With the rapid development of electronic and computer technologies, various applications are widely used in various electronic devices. With the popularization of mobile terminals, various mobile applications are widely used in all walks of life, and a mobile terminal may need to have a dozen or even dozens of mobile applications installed. However, as the application environment and required functions of these applications become increasingly complex, testing them to ensure their stability and reliability has become increasingly important.

[0036] In daily testing, when testers operate the client (such as a browser) to test the application's business processes, the first step is usually user login testing. User login is mostly via mobile phone verification codes, so users need to view the received verification code upon login. However, in the testing environment, the mobile phone numbers used for user login are often fake, i.e., virtual phone numbers. Therefore, unlike in the production environment, verification codes cannot be sent to users' phones for viewing. Testers can only log in to the application's deployment server and view the application logs to find the verification code (usually printed out as a log entry). During system testing, testers can log in to the server themselves to view the logs. However, during business acceptance testing, business users lack the skills and permissions to log in to the server and view application logs. Therefore, testers or developers need to assist in viewing the verification code. When there are many scenarios requiring verification codes during business acceptance testing (not only during login testing but also when testing business processing functions, requiring secondary confirmation and verification code viewing), testers or developers need to continuously cooperate with business users to view the verification code. This method of querying verification codes not only takes up the time of testers or developers and wastes human resources, but also has low query efficiency.

[0037] In summary, there is an urgent need for a convenient way to obtain virtual phone numbers and corresponding verification codes for testing. Based on this, this application provides a verification code query method. In this method, the query device obtains a query instruction indicating the virtual phone number and corresponding verification code used for testing in the target application. Responding to the query instruction, the device sequentially retrieves the virtual phone number and corresponding verification code from a cache queue and displays them. In this application embodiment, the query device uses a cache queue to store the virtual phone number and corresponding verification code obtained from the target application in a monitored manner. This achieves automatic retrieval of the virtual phone number and corresponding verification code for testing from the target application, without the assistance of developers. Any business personnel can conveniently obtain verification codes for testing, reducing the waste of human resources and improving testing efficiency.

[0038] The verification code query method provided in this application can be applied to, for example... Figure 1 The application environment shown. For example... Figure 1 As shown, the application environment includes a verification code query device 101 (which can be simply referred to as the query device) and a front-end device 102, wherein the query device 101 and the front-end device 102 are interconnected.

[0039] In some embodiments, the query device 101 may be a server cluster consisting of multiple servers, a single server, a computer, or a processor or processing chip in a server or computer, etc. This application embodiment does not limit the specific device form of the query device 101. Figure 1 The example shown is a query device 101 serving as a single server.

[0040] In some embodiments, the front-end device 102 may be a device with transceiver capabilities connected via a wired network, such as a desktop computer, personal computer, or computer. The query device 101 is connected to the front-end device 102 via a wired network. Figure 1 The example shown is a personal computer.

[0041] In other embodiments, the front-end device 102 can also be a device with wireless transceiver capabilities, such as a mobile phone, tablet computer, wearable device, in-vehicle device, augmented reality (AR) / virtual reality (VR) device, laptop computer, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), etc. The query device 101 is connected to the front-end device 102 via a wireless network.

[0042] In some embodiments, when it is necessary to query the verification code of a virtual mobile number used for testing, the query device 101 retrieves the query results sequentially from the cache queue according to the query instruction, and displays the virtual mobile number and the corresponding verification code on the front-end interface through the front-end device 102 for use by business personnel.

[0043] Figure 2 This is a schematic flowchart illustrating a verification code query method provided in an embodiment of this application. Figure 2 As shown, the verification code query method provided in this application can be implemented using the aforementioned query device, and specifically includes the following steps:

[0044] S201, The query device obtains the query command.

[0045] The query command is used to instruct users to query the virtual phone number and corresponding verification code used for testing in the target application.

[0046] In some embodiments, the query device can obtain query instructions from business personnel, and then query the virtual mobile phone number used for testing and the corresponding verification code in the target application according to the query instructions.

[0047] For example, a business user sends a query command by clicking the "Start Receiving" button on the front-end interface (which can be a query device or a front-end device). The query device receives the query command to retrieve the virtual phone number and corresponding verification code required by the business user to test the target application. The target application is the application that generates the verification code.

[0048] S202. The query device responds to the query command by sequentially retrieving the query results from the cache queue and displaying them.

[0049] The cache queue is used to store virtual phone numbers and corresponding verification codes that the server obtains from the target application in a monitoring manner.

[0050] In some embodiments, after receiving a query instruction, the query device, in response to the query instruction, can sequentially retrieve the virtual mobile phone number and the corresponding verification code from the cache queue and display them on the front-end interface. The cache queue is stored in the query device's database.

[0051] For example, the query device attaches monitoring to the target application through a monitoring logic package to dynamically track the target function that generates the verification code in the target application. When the target function is called, the query device obtains the output result of the target function (i.e., the virtual mobile phone number and the corresponding verification code) and stores it in the cache queue.

[0052] It should be understood that the database used by the query device may be Redis, but the embodiments of this application are not limited to this, and the query device may also use any other database for storage. Redis is an open-source in-memory data storage system that supports various data structures, such as strings, hashes, lists, sets, and sorted sets. One of the characteristics of Redis is that data is stored in memory, thus having extremely fast read and write speeds.

[0053] In one possible implementation, if the query device's database does not contain a cache queue, the query device can pre-build a cache queue in the database for direct use when a verification code is needed. Alternatively, it can build the cache queue based on the query command after receiving the command. Specifically, for example... Figure 3 As shown, the query device can construct a cache queue in the following ways: S301-S303.

[0054] S301, The query device determines whether the target application is under monitoring.

[0055] The monitored status indicates that the server is able to obtain the virtual phone number and corresponding verification code generated by the target application.

[0056] In some embodiments, the querying device can determine whether a target application is under monitoring based on the mounting identifier information of the target application in the database. The mounting identifier information indicates the monitoring status of the target application, including both monitored and unmonitored states.

[0057] S302. When the target application is under monitoring, the query device obtains the virtual mobile phone number and corresponding verification code generated by the target function when the target function is called, and builds a cache queue.

[0058] The objective function is the function in the target application used to generate a virtual phone number and the corresponding verification code.

[0059] In some embodiments, when the target application is under monitoring, the query device can monitor the state of the target function, and when the target function is called, obtain the virtual mobile phone number generated by the target function and the corresponding verification code, and construct a cache queue based on the obtained virtual mobile phone number and the corresponding verification code.

[0060] For example, when the target application is under monitoring, the query device can monitor the function corresponding to the verification code sending interface under the target application. When this function is called, that is, when the function's code logic is executed, the query device can monitor whether the function's sub-functions are called. If the sub-function is called, the query device determines whether the sub-function is the function that generates the verification code. If the sub-function is the function that generates the verification code, the query device determines that the sub-function is the target function, obtains the verification code generated by the target function and the corresponding virtual mobile phone number, and then pushes the verification code into a cache queue with the virtual mobile phone number as the key. If the sub-function is not the function that generates the verification code, the query device does not perform any additional intervention.

[0061] It should be understood that when the target application is under monitoring, the query device can obtain the virtual phone number and the corresponding verification code in the called target function. When the target application is not under monitoring, the query device can configure the target application to be under monitoring based on the monitoring logic package, and then obtain the virtual phone number and the corresponding verification code from the target function. Therefore, after S302, the verification code query method provided in this application embodiment further includes the following S303:

[0062] S303. When the target application is in an unmonitored state, the query device configures the target application to be in a monitored state based on the monitoring logic package.

[0063] The monitoring logic package is used to dynamically track the target function.

[0064] In some embodiments, when the target application is in an unmonitored state, the query can be configured to be in a monitored state based on the monitoring logic package, so that when the target function is called, the virtual mobile phone number generated by the target function and the corresponding verification code can be obtained and a cache queue can be built.

[0065] For example, when the target application is in an unmonitored state, the query device configures the target application to be monitored based on the monitoring logic package. For instance, it can use the command `. / sandbox.sh -p 6499 -d 'service-monitor / startMonit'` to configure the target application to be monitored. Here, 6499 is the process of the target application, obtained by the query device using the command `ps -ef | grep -i xxx | awk '{print $2}'`, where xxx is the application name; `sandbox.sh` is the mount monitoring startup command for JVM-Sandbox pre-installed on the server where the target application resides; and `service-monitor / startMonit` indicates the name of the monitoring logic package executed by the query device after mount monitoring of the target application is implemented. After successfully configuring the target application to be monitored, the query device can modify the mount identifier information of the target application in the cache to "monitored".

[0066] Specifically, the server hosting the target application has dynamic tracing and monitoring tools for the Java Virtual Machine (JVM) installed, such as JVM-Sandbox or BTrace. After the query device mounts monitoring on the target application, it can use JVM-Sandbox or BTrace to dynamically trace the target functions of the target application. However, this embodiment is not limited to this; the query device can also use other tools that can provide dynamic tracing capabilities to dynamically trace the target functions of the target application.

[0067] JVM-Sandbox is a JVM-based sandbox environment used to restrict permissions and resource access for Java applications. It provides a secure execution environment to prevent malicious code from harming the system. JVM-Sandbox implements permission restrictions using the Java Security Manager and security policy files, allowing developers to define custom security policies to control application behavior, such as restricting file system access, network access, and reflection operations. BTrace is an open-source project designed to provide secure and reliable dynamic tracing and analysis tools for Java, based on dynamic bytecode modification technology (Hotswap) to trace and replace runtime Java programs. It allows developers to perform code injection and tracing during application runtime to collect detailed information about application behavior. BTrace can help developers diagnose and debug application problems such as performance bottlenecks, memory leaks, and concurrency issues. It provides a simple scripting language that allows developers to define tracing logic executed at different stages of the application.

[0068] In another possible implementation, if a cache queue already exists in the query device's database, the query device can directly retrieve the virtual phone number and corresponding verification code sequentially from the cache queue. Specifically, for example... Figure 4 As shown, the above S202 can be specifically implemented as S2021-S2022.

[0069] S2021. In response to a query command, the query device periodically sends query requests to the cache queue.

[0070] In some embodiments, the query device may periodically send query requests to the cache queue in response to a query instruction.

[0071] For example, the query device can send a query request to the cache queue every second according to the query instruction in order to obtain the virtual mobile phone number of the target application and the corresponding verification code in the cache queue.

[0072] S2022. The query device responds to the query request by periodically obtaining and displaying the query results returned by the cache queue.

[0073] In some embodiments, in response to a query request, the query device may periodically retrieve a virtual mobile phone number and the corresponding verification code from a cache queue and display them on the front-end interface.

[0074] For example, if the query command includes a specified virtual phone number, the query results will include the specified virtual phone number and multiple corresponding verification codes.

[0075] Specifically, when a query command includes a specified virtual phone number—that is, when a business user enters a specified virtual phone number in the "Show only this number" input box on the front-end interface—the query device periodically sends query requests to the cache queue, also carrying the specified virtual phone number, to retrieve a verification code matching the specified virtual phone number. In response to the query request, the query device periodically retrieves the verification code corresponding to the specified virtual phone number from the cache queue and displays the results sequentially on the front-end interface.

[0076] For example, if the query command does not include a specified virtual phone number—that is, when the business personnel do not enter a virtual phone number in the "Show only this number" input box on the front-end interface—the query device periodically sends query requests to the cache queue based on the query command to retrieve all virtual phone numbers and their corresponding verification codes from the cache queue. In response to the query request, the query device periodically retrieves all virtual phone numbers and their corresponding verification codes from the cache queue and displays them sequentially on the front-end interface.

[0077] It should be understood that when the query device retrieves the virtual phone number and the corresponding verification code from the cache queue according to the query request, the virtual phone number and the corresponding verification code retrieved by the query device are deleted from the cache queue based on the first-in-first-out characteristic. Therefore, each time the query device retrieves the virtual phone number and the corresponding verification code, it can obtain a new verification code corresponding to the virtual phone number.

[0078] As an example, the response message returned by the query device to the front-end interface after obtaining the virtual mobile phone number and the corresponding verification code can be in JavaScript object notation (JSON) format. Therefore, the response message identifies the virtual mobile phone number and the corresponding verification code, for example: {"1863333XXXX": "259684", "1862222XXXX": "2358"}; if the cache queue is empty (i.e., all virtual mobile phone numbers and corresponding verification codes have been retrieved), the query device returns an empty JSON response message.

[0079] It should be understood that the query device will not perform the action of querying the virtual mobile phone number and the corresponding verification code if it does not receive a query request. Therefore, after the query device responds to the query request, periodically obtains and displays the query results returned by the cache queue, the verification code query method of this application embodiment further includes: if no query request is sent within a preset time period, the query device deletes the cache queue and configures the target application to be in an unmonitored state.

[0080] In some embodiments, after each query device responds to a query request, retrieves and displays the query result from the cache queue, it can reconfigure the cache identifier on the cache queue. The cache identifier indicates that the query device can retrieve the query result from the request cache queue within a preset time period. If the query device does not send a query request to the cache queue within the preset time period, it deletes the cache identifier. After detecting that the cache identifier has been deleted, the query device deletes the cache queue and configures the target application to be in an unmonitored state. For example, it can use the command `. / sandbox.sh -p 6499 -d'service-monitor / startMonit' –S` to cancel monitoring of the target application and saves the mounting identifier information of the target application as "unmonitored" in the database. The preset time period is set by the business personnel according to the actual situation, for example, 1 minute, and this embodiment does not limit it.

[0081] Specifically, since the query device updates the cache identifier after processing each query request, the cache identifier will persist as long as the query device continuously sends query requests to the cache queue periodically. The query device will then continuously retrieve and display query results from the cache queue periodically. However, when a user clicks the "Stop Receiving" button on the front-end interface to send a stop query command to the query device, the query device will stop periodically sending query requests to the cache queue. That is, the query device will no longer query the virtual phone number and its corresponding verification code, will delete the cache queue, and will configure the target application to be in an unmonitored state.

[0082] The technical solutions provided by the above embodiments bring at least the following beneficial effects. The verification code query method provided in this application involves a query device obtaining a query instruction indicating the virtual phone number and corresponding verification code used for testing in the target application. In response to the query instruction, the device sequentially retrieves and displays the virtual phone number and corresponding verification code from a cache queue. In this application embodiment, the query device uses a cache queue to store the virtual phone number and corresponding verification code obtained from the target application in a monitored manner. This achieves automatic retrieval of the virtual phone number and corresponding verification code used for testing from the target application, without the assistance of developers. Any business personnel can conveniently obtain the verification code for testing, reducing the waste of human resources and improving testing efficiency.

[0083] Furthermore, the query device can also mount monitoring on the target application through a monitoring logic package, thereby obtaining the virtual mobile phone number and corresponding verification code from the target function when the target function is called. Compared with the prior art, the embodiments of this application do not require building a verification code query interface on the target application, which reduces development costs and the risk of going online.

[0084] Figure 5 This is a schematic diagram of the front-end interface of a verification code query method provided in an embodiment of this application, such as... Figure 5The front-end interface of the query device in this embodiment includes a "Start Receiving" button, a "Stop Receiving" button, a "Show Only This Number:" input box, and a verification code display box. When a business user does not enter a mobile phone number in the "Show Only This Number:" input box and directly clicks the "Start Receiving" button to initiate a query command, the query device retrieves all virtual mobile phone numbers and corresponding verification codes from the cache queue according to the query command and displays them scrolling in the verification code display box. For example: Number: 1863333XXXX, Verification Code: 259684; Number: 1862222XXXX, Verification Code: 2358; Number: 1865656XXXX, Verification Code: 698523; Number: 1863333XXXX, Verification Code: 666345. When a business user clicks the "Stop Receiving" button to initiate a stop query command, the query device stops retrieving virtual mobile phone numbers and corresponding verification codes from the cache queue, and the verification code display box only scrolls to display the query results for this instance.

[0085] Figure 6 A front-end interface diagram of another verification code query method provided in this application embodiment is shown below. Figure 6 As described above, when a salesperson enters the virtual phone number 1863333XXXX in the "Show only this number:" input box and then clicks the "Start Receiving" button to initiate a query, the query device retrieves the virtual phone number matching the virtual phone number 1863333XXXX and the corresponding verification code from the cache queue according to the query command, and displays them scrolling in the verification code display box. For example: Number: 1863333XXXX, Verification Code: 259684; Number: 1863333XXXX, Verification Code: 666345. When the salesperson clicks the "Stop Receiving" button to initiate a stop query command, the query device stops retrieving the virtual phone number and corresponding verification code from the cache queue, and the verification code display box only scrolls to display the query results for this instance.

[0086] In an exemplary embodiment, this application also provides a verification code query device. This verification code query device may include one or more functional modules for implementing the verification code query method of the above method embodiments.

[0087] For example, Figure 7 This is a schematic diagram illustrating the composition of a verification code query device provided in an embodiment of this application. Figure 7 As shown, the query device includes an acquisition module 701 and a response module 702.

[0088] The acquisition module 701 is used to acquire a query command; the query command is used to instruct the queryer to retrieve the virtual phone number and corresponding verification code used for testing in the target application. The response module 702 is used to, in response to the query command, sequentially retrieve the query results from the cache queue and display them; the cache queue is used to store the virtual phone number and corresponding verification code obtained by the server from the target application in a monitoring manner.

[0089] In some embodiments, when a query instruction carries a specified virtual phone number, the query result includes the specified virtual phone number and multiple corresponding verification codes.

[0090] In other embodiments, the apparatus further includes a construction module 703; the construction module 703 is used to construct a cache queue.

[0091] In some other embodiments, the construction module 703 is specifically used to determine whether the target application is in a monitored state; the monitored state is used to indicate that the server can obtain the virtual mobile phone number and the corresponding verification code generated by the target application; when the target application is in a monitored state, when the target function is called, the virtual mobile phone number and the corresponding verification code generated by the target function are obtained, and a cache queue is constructed; the target function is the function in the target application used to generate the virtual mobile phone number and the corresponding verification code.

[0092] In some other embodiments, the apparatus further includes: a configuration module 704; the configuration module 704 is configured to configure the target application to be in a monitored state based on a monitoring logic package when the target application is in an unmonitored state; the monitoring logic package is used to dynamically track the target function.

[0093] In some other embodiments, the response module 702 is specifically configured to periodically send a query request to the cache queue in response to a query instruction; and periodically obtain and display the query results returned by the cache queue in response to the query request.

[0094] In some other embodiments, the apparatus further includes a deletion module 705; the deletion module 705 is configured to delete the cache queue and configure the target application to be in an unmonitored state if no query request is sent within a preset time period.

[0095] In an exemplary embodiment, this application also provides an electronic device, which may be the verification code query device in the above method embodiment. Figure 8 This is a schematic diagram illustrating the composition of an electronic device provided in an embodiment of this application. For example... Figure 8 As shown, the electronic device may include: a processor 801 and a memory 802; the memory 802 stores instructions executable by the processor 801; when the processor 801 is configured to execute the instructions, it causes the electronic device, network device, or manager to implement the methods described in the foregoing method embodiments.

[0096] In an exemplary embodiment, this application also provides a computer-readable storage medium storing computer program instructions thereon; when the computer program instructions are executed by a computer, the computer causes the computer to implement the method described in the foregoing embodiments. The computer-readable storage medium may be a non-transitory computer-readable storage medium, such as a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device.

[0097] In an exemplary embodiment, this application also provides a computer program product that, when run on a computer, causes the computer to execute the aforementioned related method steps to implement the verification code query method in the above embodiments.

[0098] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for querying verification codes, characterized in that, The method is applied to a server, wherein the server carries a target application for generating verification codes; the method includes: Obtain a query instruction; the query instruction is used to instruct the user to query the virtual phone number used for testing and the corresponding verification code in the target application; In response to the query command, query results are sequentially retrieved from the cache queue and displayed; the cache queue is used to store the virtual mobile phone number and the corresponding verification code obtained by the server from the target application in a monitoring manner; The method further includes: Determine whether the target application is under monitoring; the monitored state indicates that the server can obtain the virtual phone number and the corresponding verification code generated by the target application; when the target application is under monitoring, and the target function is called, obtain the virtual phone number and the corresponding verification code generated by the target function, and construct the cache queue; the target function is the function in the target application used to generate the virtual phone number and the corresponding verification code.

2. The method according to claim 1, characterized in that, If the query instruction includes a specified virtual phone number, the query result includes the specified virtual phone number and multiple corresponding verification codes.

3. The method according to claim 1, characterized in that, The method further includes: When the target application is in an unmonitored state, it is configured to be in a monitored state based on the monitoring logic package; the monitoring logic package is used to dynamically track the target function.

4. The method according to claim 1, characterized in that, The step of responding to the query instruction by sequentially retrieving and displaying query results from the cache queue includes: In response to the query command, query requests are periodically sent to the cache queue; In response to the query request, the query results returned by the cache queue are periodically retrieved and displayed.

5. The method according to claim 4, characterized in that, The method further includes: If no query request is sent within a preset time period, the cache queue is deleted, and the target application is configured to be in an unmonitored state.

6. A verification code query device, characterized in that, The device includes: an acquisition module, a response module, and a construction module; The acquisition module is used to acquire a query instruction; the query instruction is used to instruct the user to query the virtual mobile phone number used for testing and the corresponding verification code in the target application. The response module is used to, in response to the query instruction, sequentially retrieve query results from the cache queue and display them; the cache queue is used to store the virtual mobile phone number and the corresponding verification code obtained by the server from the target application in a monitoring manner, and the server is equipped with the target application for generating verification codes; The construction module is used to determine whether the target application is under monitoring; the monitored state indicates that the server can obtain the virtual phone number and the corresponding verification code generated by the target application; when the target application is under monitoring, and the target function is called, the virtual phone number and the corresponding verification code generated by the target function are obtained, and the cache queue is constructed; the target function is a function in the target application used to generate the virtual phone number and the corresponding verification code.

7. The apparatus according to claim 6, characterized in that, If the query instruction includes a specified virtual phone number, the query result includes the specified virtual phone number and multiple corresponding verification codes.

8. The apparatus according to claim 6, characterized in that, The device further includes: a configuration module; the configuration module is used to configure the target application to be in a monitored state based on a monitoring logic package when the target application is in an unmonitored state; the monitoring logic package is used to dynamically track the target function.

9. The apparatus according to claim 6, characterized in that, The response module is specifically used to periodically send query requests to the cache queue in response to the query instruction; and to periodically obtain and display the query results returned by the cache queue in response to the query request.

10. The apparatus according to claim 9, characterized in that, The device further includes a deletion module; the deletion module is used to delete the cache queue and configure the target application to be in an unmonitored state if no query request is sent within a preset time period.

11. An electronic device, characterized in that, The electronic device includes: a processor and a memory; The memory stores instructions that the processor can execute; When the processor is configured to execute the instructions, the electronic device performs the method as described in any one of claims 1-5.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes: computer software instructions; When the computer software instructions are executed in an electronic device, the electronic device causes the electronic device to perform the method as described in any one of claims 1-5.