Scan code login method, device, computer equipment and storage medium

By deploying multiple scanning nodes and virtual containers in the scanning code login system to deploy scanning code services, the problem of manual intervention in scanning code login in automated tests is solved, and efficient scanning code login operation of automated test tasks is realized.

CN118862914BActive Publication Date: 2025-02-11SHENZHEN QIANHAI HUANRONG LIANYI INFORMATION TECHNOLOGY SERVICES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411348936.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-02-11
Estimated Expiration
2044-09-26

AI Technical Summary

Technical Problem

In the web page automation testing process, when encountering scanning codes and logging in, manual intervention is required, resulting in low execution efficiency of automated testing tasks.

Method used

Provide a method of scanning code login. By deploying multiple scanning nodes in the scanning code login system, each node deploys scanning code service through a virtual container and connects multiple scanning devices to realize the scanning code login operation of automated test tasks. . The specific steps include receiving the target code scanning task, polling the device information, pushing the QR code picture to the target code scanning device, and controlling the device to scan the code.

Benefits of technology

The code scanning and login operation of automated test tasks is realized without human intervention, and the execution efficiency of automated test tasks is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118862914B_ABST
    Figure CN118862914B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a code scanning login method, device, computer equipment and storage medium. The method is applied to a code scanning login system, which includes multiple code scanning nodes, each of which is connected to multiple code scanning devices, and the method includes: receiving a target code scanning task, the target code scanning task includes target scheduling information and a QR code image; polling the device information of each code scanning node in turn, determining the polled device information corresponding to the target scheduling information as the target device information, and determining the target code scanning node and the target code scanning device; pushing the QR code image to the target code scanning device through the target code scanning service in the target code scanning node; controlling the target code scanning device to scan the QR code image through the target code scanning service to complete the code scanning login operation. By implementing the method of the embodiment of the present application, when executing an automated test task, code scanning login can be automatically performed, thereby improving the execution efficiency of the automated test task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet technology, and in particular to a code scanning login method, device, computer equipment and storage medium. Background Art

[0002] Software automation testing can improve testing efficiency. However, in the existing technology, if a QR code scanning login scenario is encountered in the web page automation testing process, manual intervention is required to open the mobile phone to scan the QR code. Since the code scanning personnel cannot always keep an eye on the automation task and cannot scan the code to log in in time, the execution efficiency of the automation testing task is low. Summary of the invention

[0003] The embodiments of the present application provide a code scanning login method, apparatus, computer equipment and storage medium, which can automatically perform code scanning login when executing automated testing tasks, thereby improving the execution efficiency of automated testing tasks.

[0004] In a first aspect, an embodiment of the present application provides a code scanning login method, which is applied to a code scanning login system, wherein the code scanning login system includes a plurality of code scanning nodes, each of which is deployed with a code scanning service through a virtual container, each of which is connected to a plurality of code scanning devices, and each of which maintains device information of each connected code scanning device, and the method includes:

[0005] Receive a target code scanning task, wherein the target code scanning task includes target scheduling information and a QR code image, wherein the QR code image is a QR code image in a code scanning login page in a target automated test task;

[0006] Polling the device information of each of the scanning nodes in turn, determining the polled device information corresponding to the target scheduling information as the target device information, and determining the scanning node and the scanning device corresponding to the target device information as the target scanning node and the target scanning device, respectively;

[0007] Push the QR code image to the target code scanning device through the target code scanning service in the target code scanning node;

[0008] The target code scanning service controls the target code scanning device to scan the QR code image to complete the code scanning login operation of the target automated test task.

[0009] In a second aspect, an embodiment of the present application further provides a code scanning login device, which is deployed in a code scanning login system. The code scanning login system includes a plurality of code scanning nodes, each of which is deployed with a code scanning service through a virtual container, each of which is connected to a plurality of code scanning devices, and each of which maintains device information of each connected code scanning device. The code scanning login device includes:

[0010] A transceiver unit is used to receive a target code scanning task, wherein the target code scanning task includes target scheduling information and a QR code image, wherein the QR code image is a QR code image in a code scanning login page in a target automated test task;

[0011] A processing unit is used to poll the device information of each of the scanning nodes in turn, determine the polled device information corresponding to the target scheduling information as the target device information, and determine the scanning node and scanning device corresponding to the target device information as the target scanning node and target scanning device respectively; push the QR code image to the target scanning device through the target scanning service in the target scanning node; control the target scanning device to scan the QR code image through the target scanning service to complete the scanning login operation of the target automated testing task.

[0012] In a third aspect, an embodiment of the present application further provides a computer system, comprising a plurality of computer devices, each of which comprises a memory and a processor, a computer program is stored in the memory, and the above method is implemented when the processor executes the computer program.

[0013] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the storage medium stores a computer program, wherein the computer program includes program instructions, and wherein the program instructions can implement the above method when executed by a processor.

[0014] The embodiment of the present application provides a code scanning login method, device, computer equipment and storage medium. The method is applied to a code scanning login system, which includes multiple code scanning nodes, each of which is deployed with a code scanning service through a virtual container, each of which is connected to multiple code scanning devices, and each of which maintains the device information of each connected code scanning device, and the method includes: receiving a target code scanning task, the target code scanning task includes target scheduling information and a two-dimensional code image, and the two-dimensional code image is a two-dimensional code image in a code scanning login page in a target automated test task; polling the device information of each of the code scanning nodes in turn, determining the polled device information corresponding to the target scheduling information as the target device information, and determining the code scanning node and the code scanning device corresponding to the target device information as the target code scanning node and the target code scanning device respectively; pushing the two-dimensional code image to the target code scanning device through the target code scanning service in the target code scanning node; controlling the target code scanning device to scan the two-dimensional code image through the target code scanning service, and completing the code scanning login operation of the target automated test task. Since the embodiment of the present application is provided with a code scanning login system for the automated testing task, when the code scanning login system receives a target code scanning task of the target automated testing task, it can automatically perform a code scanning operation on the QR code image in the code scanning task, thereby completing the code scanning login operation of the automated testing task. The code scanning login does not require manual operation, thereby improving the execution efficiency of the automated testing task. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0016] Figure 1 A schematic diagram of an application scenario of the code scanning login method provided in an embodiment of the present application;

[0017] Figure 2 A flowchart of the code scanning login method provided in the embodiment of the present application;

[0018] Figure 3 A flowchart of a code scanning login method provided in another embodiment of the present application;

[0019] Figure 4 A schematic block diagram of a code scanning login device provided in an embodiment of the present application;

[0020] Figure 5 A schematic block diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0021] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0022] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0023] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0024] It should be further understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0025] The embodiments of the present application provide a code scanning login method, apparatus, computer equipment and storage medium.

[0026] The executor of the code scanning login method may be the code scanning login device provided in the embodiment of the present application, or a computer system integrating the code scanning login device, wherein the computer system includes multiple computer devices, which may be terminals or servers.

[0027] Specifically, Figure 1 As shown, the computer system is a code scanning login system, and the code scanning login system includes multiple code scanning nodes ( Figure 1 The code scanning node includes N code scanning nodes, where N is an integer greater than 1), each of the code scanning nodes is deployed with a code scanning service through a virtual container docker, each of the code scanning nodes is connected to multiple code scanning devices, and each of the code scanning nodes maintains device information of each connected code scanning device.

[0028] The code scanning device in this embodiment is a terminal device with a code scanning function, such as a mobile phone device or a tablet computer.

[0029] Since the scanning node in this embodiment deploys the scanning service through a virtual container, if the node needs to be expanded, it is only necessary to use the virtual container to deploy the scanning service in the node. It can be seen that the scanning node of the scanning login system can be quickly expanded according to needs through the embodiment of the present application.

[0030] Among them, the scanning service in this embodiment includes a polling service and an interactive service. The polling service is used for the polling operation of the scanning task, and the interactive service is used to interact with the connected scanning terminal so that the scanning terminal can realize automatic scanning operation based on the interactive operation.

[0031] In some embodiments, each scanning node is a physical server, and each scanning node is connected to multiple scanning devices through Universal Serial Bus (USB) mounting technology or Wireless Fidelity (WIFI) mounting technology. The scanning node establishes a scheduling channel with each connected scanning device through Android Debug Bridge (ADB) technology.

[0032] Among them, when the code scanning node is connected to the code scanning device through USB mounting technology, the code scanning node has multiple USB interfaces. When it is connected to the code scanning device through WIFI mounting technology, the code scanning node and the connected code scanning device are connected to the same WIFI.

[0033] Specifically, the USB mounting technology can be used to mount the USB interface of the corresponding scanning node into the virtual container, and the WIFI mounting technology can be used to mount the communication interface of the corresponding scanning node into the virtual container. The above methods can enable the containerized application (scanning service) to interact directly with the physical hardware device (scanning device).

[0034] ADB technology is a command line tool used by Android developers to help develop and debug Android applications. Through ADB, the virtual container in the scanning node can establish a scheduling channel with each connected scanning device. Through the scheduling channel, the scanning service can communicate with the corresponding scanning device, including installing and uninstalling applications, transferring files, accessing device logs, executing Shell commands, etc.

[0035] Specifically, the code scanning service in this embodiment is based on the scheduling channel, and interacts with the corresponding code scanning device through the uiautomator automation tool to perform automation tasks.

[0036] Among them, the uiautomator automation tool is a UI automation testing framework provided by Android. Through the uiautomator automation tool, the code scanning service can automatically perform user operations on different Android devices and versions.

[0037] For further information, see Figure 1 In some embodiments, the code scanning login system further includes a management center master, which is connected to each code scanning node, wherein the management center has the following functions:

[0038] Collect node information of each scanning node, wherein the node information includes node identification, node online status information and node scheduling status information; wherein the node identification includes the node name and / or node IP address, the node online status information indicates whether the corresponding scanning node is online, and the node scheduling status information indicates whether the corresponding scanning node is in a state where it can execute automated tasks.

[0039] The device information of each code scanning device is collected, and the device information includes node information, device identification, application identification list, scheduling label, working status information and device online status information; wherein, the node information indicates the code scanning node to which the code scanning device is connected, and the device identification is the unique device identity document (ID) recognized by the code scanning service when the code scanning device is connected to the code scanning node through ADB technology. The scanning identification will not change even if the code scanning device is connected to different code scanning nodes; the application identification list includes the APP identification of the application (Application, APP) installed in the corresponding code scanning device that can be used for task scheduling, and the APP identification can be the APP name, such as WeChat, QQ, etc.; the scheduling label includes at least one of the device model label and the application account label, and the device model label can specifically be the mobile phone model, and the application account label is the user login name of the code scanning application in the corresponding code scanning device, for example, the login user of WeChat is user a, and the scheduling label is used for task scheduling; the working status information indicates whether the corresponding code scanning device is executing an automated task.

[0040] Among them, the code scanning service also includes a heartbeat sending service, which is used to periodically send heartbeat information containing node information and device information to the management center.

[0041] After the management center collects the node information of each scanning node and the device information of each scanning device, the tester can view the node information and device information through the management center to understand the operation status of each scanning node and scanning device in the scanning login system, thereby realizing unified management of scanning nodes and scanning devices.

[0042] Figure 2 : is a flowchart of the code scanning login method provided in the embodiment of the present application. Figure 2 As shown, the method includes the following steps S110-S140.

[0043] S110, receiving a target code scanning task, wherein the target code scanning task includes target scheduling information and a QR code image, and the QR code image is a QR code image in a code scanning login page in a target automated testing task.

[0044] The target scheduling information includes a target scanning application identifier and a target scheduling tag. The target scheduling tag includes at least one of a device model tag and an application account tag. The target scanning application identifier indicates the type of application that needs to be called, such as WeChat or QQ, etc. The device model tag indicates that when executing the target scanning task, a scanning device of a specified device model needs to be used for scanning. The application account tag indicates that when executing the target scanning task, a scanning device logged in to a specified user account needs to be used for scanning.

[0045] Among them, the target code scanning task is a subtask in the target automated testing task.

[0046] S120, polling the device information of each scanning node in turn, determining the polled device information corresponding to the target scheduling information as the target device information, and determining the scanning node and scanning device corresponding to the target device information as the target scanning node and target scanning device, respectively.

[0047] In this embodiment, a scanning service is deployed in each scanning node through a virtual container. The deployed scanning service includes a polling service. Each scanning node can poll the target scanning task in sequence based on the polling order set in the polling service.

[0048] Specifically, in some embodiments, step S120 includes:

[0049] Determine the current polling node of the multiple code scanning nodes; determine whether there is device information containing the target code scanning application identifier and the target scheduling tag in the multiple device information maintained through the polling service in the current polling node; if there is device information containing the target code scanning application identifier and the target scheduling tag, determine the corresponding device information as the target device information; if there is no device information containing the target code scanning application identifier and the target scheduling tag, update the current polling node from the multiple code scanning nodes, and return to execute the step of determining whether there is device information containing the target code scanning application identifier and the target scheduling tag in the multiple device information maintained through the polling service in the current polling node.

[0050] If all the scanning nodes have completed polling and no scanning device suitable for processing the target scanning task is found, at this time, the target scanning task is stored in the scanning task queue, and the scanning tasks in the scanning task queue continue to be polled through each scanning node, wherein the maximum storage time of the scanning task in the scanning task queue is a preset storage time threshold (such as 2 minutes), and when the scanning task in the scanning task queue exceeds the preset storage time threshold and has not been processed, the overdue scanning task is deleted. If the target scanning task is overdue, the target scanning task is deleted. When the target scanning task is deleted, it is necessary to trigger the target automated test task to be re-executed, update the QR code image through the target automated test task, and generate a scanning task again based on the updated QR code image and the target scheduling information, wherein, if the number of re-executions of the target automated test task exceeds the preset number of executions (such as 10 times), at this time, the target automated test task is stopped, and an abnormal alarm for the execution of the target automated test task is generated.

[0051] The code scanning login system provided in this embodiment supports multiple code scanning tasks concurrently and supports the simultaneous execution of multiple code scanning devices. Furthermore, there are multiple target code scanning tasks, that is, the code scanning login system obtains multiple target code scanning tasks at the same time. At this time, it is necessary to first store the multiple code scanning tasks in the code scanning task pool, and then, for each of the target code scanning tasks in the code scanning task pool, determine through the polling service in the current polling node whether there is device information containing the target code scanning application identifier and the target scheduling tag in the multiple device information maintained.

[0052] Specifically, each polling node polls the target scanning task in the scanning task pool in turn. When a scanning node polls a suitable scanning task, it receives the scanning task and deletes the scanning task from the task pool, or marks it with a received label. When subsequent scanning nodes poll the scanning tasks, they will not poll the scanning tasks marked with the received label.

[0053] S130: Push the QR code image to the target code scanning device through the target code scanning service in the target code scanning node.

[0054] In this embodiment, the target code scanning task is also given to the target interaction service. After the target code scanning node and the target code scanning device connected to the target code scanning node are determined, the target interaction service deployed in the virtual container of the target code scanning node pushes the QR code image to the target code scanning device.

[0055] Specifically, the QR code image is pushed to the device album of the target code scanning device through the target interactive service in the target code scanning service and the corresponding scheduling channel. For example, when the target code scanning device is a mobile phone, the QR code image is pushed to the mobile phone album of the mobile phone.

[0056] S140: Control the target code scanning device to scan the QR code image through the target code scanning service to complete the code scanning login operation of the target automated test task.

[0057] In this embodiment, when the QR code image is stored in the device album of the target scanning device, at this time, the target application corresponding to the target scanning application identifier is first opened in the target scanning device through the target interactive service and the corresponding scheduling channel; then the scanning function of the target application is turned on, and the QR code image is selected from the device album as the current scanning image of the scanning function to complete the scanning login operation of the target automated testing task.

[0058] Among them, after completing the scan code login operation, the target automated test task automatically completes the login operation of the scan code login page and continues to perform subsequent automated test operations.

[0059] To sum up, since the embodiment of the present application is provided with a code scanning login system for the automated testing task, when the code scanning login system receives the target code scanning task of the target automated testing task, it can automatically perform a code scanning operation on the QR code image in the code scanning task, thereby completing the code scanning login operation of the automated testing task. The code scanning login does not require manual operation, thereby improving the execution efficiency of the automated testing task.

[0060] In addition, the scanning node in this application deploys the scanning service through a virtual container, and deploys the service through containerization technology, which can achieve rapid expansion of the scanning node.

[0061] Figure 3 FIG. 1 is a flowchart of a code scanning login method provided by another embodiment of the present application. Figure 3 As shown, the code scanning login method of this embodiment includes steps S210-S280.

[0062] S210: Determine the target scheduling information from a preset scheduling information pool, and generate the target automated testing task according to the target scheduling information.

[0063] Among them, the target scheduling information indicates that when executing the target automated testing task, a code scanning device corresponding to the target scheduling information is used to perform a code scanning login operation in the target automated testing task.

[0064] In this embodiment, a plurality of scheduling information are pre-set in the scheduling information pool. The scheduling information is manually set in advance. When an automated test is required for the target website, the target website is provided with a code scanning login interface. In this embodiment, different automated testing tasks need to be generated for different scheduling information to perform code scanning login verification tests on different models of code scanning devices and / or different application accounts. For example, a code scanning operation is performed using a model A mobile phone and a code scanning application whose application login account is a.

[0065] When generating an automated test task, it is first necessary to select target scheduling information from a scheduling information pool according to a preset algorithm, and the preset algorithm is a random algorithm or a sequential algorithm.

[0066] S220. Start the target browser through the Selenium automation tool, and open the scan code login page corresponding to the target automated test task through the target browser.

[0067] In this embodiment, after the target automated test task is generated, the target browser is automatically started through the Selenium automation tool to open the scan code login page of the target website that requires scanning code login.

[0068] S230, taking a screenshot of the QR code in the scan code login page to obtain the QR code image.

[0069] In some embodiments, after opening the scan code login page, the position of the target QR code in the scan code login page is determined based on a preset QR code recognition algorithm and a target scan code application identifier, and then a screenshot is taken based on the identified QR code position to obtain a QR code image; wherein, the scan code login page may include multiple QR codes, for example, a QR code for logging in via QQ scan code and a QR code for logging in via WeChat scan code, and may also include other non-login QR codes, and the target QR code is the QR code corresponding to the target scan code application identifier in the scan code login page, such as a QR code that requires logging in via WeChat scan code.

[0070] S240: Generate the target code scanning task according to the QR code image and the target scheduling information.

[0071] In this embodiment, after obtaining the QR code image required for scanning and logging in the current target automated test task, the target scanning task is generated according to the QR code image and the target scheduling information.

[0072] Among them, the present application can generate multiple automated test tasks simultaneously through multi-threading, and generate a code scanning task corresponding to each automated test task, that is, generate multiple code scanning tasks simultaneously.

[0073] S250, receiving a target code scanning task, wherein the target code scanning task includes target scheduling information and a QR code image, and the QR code image is a QR code image in a code scanning login page in a target automated testing task.

[0074] S260, polling the device information of each scanning node in turn, determining the polled device information corresponding to the target scheduling information as the target device information, and determining the scanning node and scanning device corresponding to the target device information as the target scanning node and target scanning device, respectively.

[0075] S270: Push the QR code image to the target code scanning device through the target code scanning service in the target code scanning node.

[0076] S280: Control the target code scanning device to scan the QR code image through the target code scanning service to complete the code scanning login operation of the target automated test task.

[0077] In this embodiment, steps S250-S280 and Figure 2 Steps S110-S140 in the embodiment are similar and will not be described in detail here.

[0078] To sum up, since the embodiment of the present application is provided with a code scanning login system for the automated testing task, when the code scanning login system receives the target code scanning task of the target automated testing task, it can automatically perform a code scanning operation on the QR code image in the code scanning task, thereby completing the code scanning login operation of the automated testing task. The code scanning login does not require manual operation, thereby improving the execution efficiency of the automated testing task.

[0079] Figure 4 is a schematic block diagram of a code scanning login device provided in an embodiment of the present application. Figure 4 As shown, corresponding to the above code scanning login method, the present application also provides a code scanning login device 400. The code scanning login device 400 includes a unit for executing the above code scanning login method. The code scanning login device 400 is configured in a code scanning login system. The code scanning login system includes multiple code scanning nodes. Each of the code scanning nodes is deployed with a code scanning service through a virtual container. Each of the code scanning nodes is connected to multiple code scanning devices, and each of the code scanning nodes maintains the device information of each connected code scanning device. Specifically, please refer to Figure 4 The scanning code login device 400 includes a transceiver unit 401 and a processing unit 402, wherein:

[0080] The transceiver unit 401 is used to receive a target code scanning task, wherein the target code scanning task includes target scheduling information and a QR code image, wherein the QR code image is a QR code image in a code scanning login page in a target automated test task;

[0081] The processing unit 402 is used to poll the device information of each of the scanning nodes in turn, determine the polled device information corresponding to the target scheduling information as the target device information, and determine the scanning node and scanning device corresponding to the target device information as the target scanning node and the target scanning device, respectively; push the QR code image to the target scanning device through the target scanning service in the target scanning node; control the target scanning device to scan the QR code image through the target scanning service, and complete the scanning login operation of the target automated testing task.

[0082] In some embodiments, the target scheduling information includes a target code scanning application identifier and a target scheduling tag, and the target scheduling tag includes at least one of a device model tag and an application account tag.

[0083] In some embodiments, the code scanning service includes a polling service; when the processing unit 402 performs the step of sequentially polling the device information of each code scanning node and determining the polled device information corresponding to the target scheduling information as the target device information, it is specifically used to:

[0084] Determine the current polling node of the multiple code scanning nodes; determine whether there is device information containing the target code scanning application identifier and the target scheduling tag in the multiple device information maintained through the polling service in the current polling node; if there is device information containing the target code scanning application identifier and the target scheduling tag, determine the corresponding device information as the target device information; if there is no device information containing the target code scanning application identifier and the target scheduling tag, update the current polling node from the multiple code scanning nodes, and return to execute the step of determining whether there is device information containing the target code scanning application identifier and the target scheduling tag in the multiple device information maintained through the polling service in the current polling node.

[0085] In some embodiments, there are multiple target code scanning tasks; after the transceiver unit 401 executes the step of receiving the target code scanning task, the processing unit 402 is further used to:

[0086] Storing the plurality of target code scanning tasks in a code scanning task pool;

[0087] At this time, when the processing unit 402 executes the step of determining whether there is device information including the target code scanning application identifier and the target scheduling tag in the maintained multiple device information through the polling service in the current polling node, it is specifically used to:

[0088] For each of the target scanning tasks in the scanning task pool, the polling service in the current polling node is used to determine whether there is device information including the target scanning application identifier and the target scheduling tag in the maintained multiple device information.

[0089] In some embodiments, before the transceiver unit 401 executes the step of receiving the target code scanning task, the processing unit 402 is further used to:

[0090] The target scheduling information is determined from a preset scheduling information pool, and the target automated test task is generated according to the target scheduling information, wherein the target scheduling information indicates that when executing the target automated test task, a code scanning device corresponding to the target scheduling information is used to perform a code scanning login operation in the target automated test task; a target browser is started through a Selenium automation tool, and a code scanning login page corresponding to the target automated test task is opened through the target browser; a screenshot of the QR code in the code scanning login page is taken to obtain the QR code image; and the target code scanning task is generated according to the QR code image and the target scheduling information.

[0091] In some embodiments, the code scanning node is connected to multiple code scanning devices through USB mounting technology or WIFI mounting technology, and a scheduling channel is established between the code scanning node and each connected code scanning device through Android debugging bridge technology; when the processing unit 402 executes the step of pushing the QR code image to the target code scanning device through the target code scanning service in the target code scanning node, it is specifically used to:

[0092] Push the QR code image to the device album of the target code scanning device through the target interaction service in the target code scanning service and the corresponding scheduling channel;

[0093] At this time, when the processing unit 402 executes the scanning and logging operation step of controlling the target scanning device to scan the QR code image through the target scanning service to complete the target automated test task, it is specifically used to:

[0094] Through the target interactive service and the corresponding scheduling channel, the target application corresponding to the target scanning application identifier is opened in the target scanning device; the scanning function of the target application is turned on, and the QR code image is selected from the device album as the current scanning image of the scanning function to complete the scanning login operation of the target automated testing task.

[0095] In some embodiments, the code scanning login system further includes a management center, the management center is connected to each code scanning node, and the transceiver unit 401 is also used for:

[0096] The node information of each scanning node is collected through the management center, and the node information includes node identification, node online status information and node scheduling status information; the device information of each scanning device is collected through the management center, and the device information includes node information, device identification, application identification list, scheduling label, working status information and device online status information.

[0097] To sum up, since the embodiment of the present application sets up a scanning code login system with a scanning code login device 400 for the automated testing task, when the scanning code login system receives a target scanning code task of a target automated testing task, it can automatically perform a scanning operation on the QR code image in the scanning code task, thereby completing the scanning code login operation of the automated testing task. The scanning code login does not require manual operation, thereby improving the execution efficiency of the automated testing task.

[0098] It should be noted that technicians in the relevant field can clearly understand that the specific implementation process of the above-mentioned code scanning login device 400 and each unit can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and brevity of description, it will not be repeated here.

[0099] The above-mentioned code scanning login device 400 can be implemented in the form of a computer program, which can be run on a computer system. The computer system includes multiple computer devices, and the code scanning login system provided in the embodiment of the present application is constituted by the computer system.

[0100] See also Figure 5 , Figure 5 1 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 500 may be a code scanning node in a code scanning login system, and may specifically be a terminal or a server.

[0101] See also Figure 5 The computer device 500 includes a processor 502 , a memory and a network interface 505 connected via a system bus 501 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 504 .

[0102] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions, and when the program instructions are executed, the processor 502 can execute a code scanning login method.

[0103] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .

[0104] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a code scanning login method.

[0105] The network interface 505 is used to communicate with other devices over the network. Figure 5 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0106] The processor 502 of each computer device 500 in the computer system is used to run the computer program 5032 stored in the memory to jointly implement the following steps:

[0107] Receive a target code scanning task, wherein the target code scanning task includes target scheduling information and a QR code image, wherein the QR code image is a QR code image in a code scanning login page in a target automated test task;

[0108] Polling the device information of each of the scanning nodes in turn, determining the polled device information corresponding to the target scheduling information as the target device information, and determining the scanning node and the scanning device corresponding to the target device information as the target scanning node and the target scanning device, respectively;

[0109] Push the QR code image to the target code scanning device through the target code scanning service in the target code scanning node;

[0110] The target code scanning service controls the target code scanning device to scan the QR code image to complete the code scanning login operation of the target automated test task.

[0111] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0112] It can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.

[0113] Therefore, the present application also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor, the processor executes the following steps:

[0114] Receive a target code scanning task, wherein the target code scanning task includes target scheduling information and a QR code image, wherein the QR code image is a QR code image in a code scanning login page in a target automated test task;

[0115] Polling the device information of each of the scanning nodes in turn, determining the polled device information corresponding to the target scheduling information as the target device information, and determining the scanning node and the scanning device corresponding to the target device information as the target scanning node and the target scanning device, respectively;

[0116] Push the QR code image to the target code scanning device through the target code scanning service in the target code scanning node;

[0117] The target code scanning service controls the target code scanning device to scan the QR code image to complete the code scanning login operation of the target automated test task.

[0118] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.

[0119] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0120] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0121] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present application can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0122] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application.

[0123] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A code scanning login method, characterized in that: The method is applied to a code scanning login system, which includes multiple code scanning nodes, each of which is deployed with a code scanning service through a virtual container, each of which is connected to multiple code scanning devices, and each of which maintains device information of each connected code scanning device, wherein the device information includes node information, device identification, application identification list, scheduling label, working status information and device online status information. The method includes: Receive a target code scanning task, the target code scanning task including target scheduling information and a QR code image, the QR code image being the QR code image in the code scanning login page in the target automated testing task, wherein the target scheduling information includes a target code scanning application identifier and a target scheduling tag, the target scheduling tag includes at least one of a device model tag and an application account tag, the target code scanning application identifier indicates the type of application to be called, the device model tag indicates that a code scanning device of a specified device model needs to be used for code scanning when executing the target code scanning task, and the application account tag indicates that a code scanning device logged in to a specified user account needs to be used for code scanning when executing the target code scanning task; Polling the device information of each of the scanning nodes in turn, determining the polled device information corresponding to the target scheduling information as the target device information, and determining the scanning node and the scanning device corresponding to the target device information as the target scanning node and the target scanning device, respectively; Push the QR code image to the target code scanning device through the target code scanning service in the target code scanning node; Control the target code scanning device to scan the QR code image through the target code scanning service to complete the code scanning login operation of the target automated test task; Before receiving the target code scanning task, the method further includes: Determine the target scheduling information from a preset scheduling information pool according to a random algorithm or a sequential algorithm, and generate the target automated test task according to the target scheduling information, wherein the target scheduling information indicates that when executing the target automated test task, a code scanning device corresponding to the target scheduling information is used to perform a code scanning login operation in the target automated test task, wherein a plurality of scheduling information are pre-set in the scheduling information pool, and different scheduling information is used to generate different automated test tasks, so as to perform code scanning login verification tests on code scanning devices of different models and / or different application accounts; Start the target browser through the Selenium automation tool, and open the scan code login page corresponding to the target automated test task through the target browser; Taking a screenshot of the QR code in the scan code login page to obtain the QR code image; The target code scanning task is generated according to the two-dimensional code image and the target scheduling information.

2. The method according to claim 1, characterized in that The code scanning service includes a polling service; the device information of each code scanning node is polled in sequence, and the polled device information corresponding to the target scheduling information is determined as the target device information, including: Determine a current polling node of the plurality of code scanning nodes; Determine, through the polling service in the current polling node, whether there is device information including the target code scanning application identifier and the target scheduling tag in the maintained multiple device information; If there is device information including the target code scanning application identifier and the target scheduling tag, the corresponding device information is determined as the target device information; If there is no device information containing the target code scanning application identifier and the target scheduling tag, update the current polling node from the multiple code scanning nodes, and return to execute the step of determining whether there is device information containing the target code scanning application identifier and the target scheduling tag in the multiple device information maintained through the polling service in the current polling node.

3. The method according to claim 2, characterized in that There are multiple target code scanning tasks; after receiving the target code scanning task, the method further includes: Storing the plurality of target code scanning tasks in a code scanning task pool; The determining, through the polling service in the current polling node, whether there is device information including the target code scanning application identifier and the target scheduling tag in the maintained multiple device information includes: For each of the target scanning tasks in the scanning task pool, the polling service in the current polling node is used to determine whether there is device information including the target scanning application identifier and the target scheduling tag in the maintained multiple device information.

4. The method according to claim 1, characterized in that: The code scanning node is connected to multiple code scanning devices through USB mounting technology or WIFI mounting technology, and a scheduling channel is established between the code scanning node and each connected code scanning device through Android debugging bridge technology; The pushing of the two-dimensional code image to the target code scanning device through the target code scanning service in the target code scanning node includes: Push the QR code image to the device album of the target code scanning device through the target interaction service in the target code scanning service and the corresponding scheduling channel; The target code scanning service is used to control the target code scanning device to scan the QR code image to complete the code scanning login operation of the target automated test task, including: Opening a target application corresponding to the target code scanning application identifier in the target code scanning device through the target interactive service and the corresponding scheduling channel; Open the code scanning function of the target application, and select the QR code image from the device album as the current code scanning image of the code scanning function to complete the code scanning login operation of the target automated test task.

5. The method according to any one of claims 1 to 4, characterized in that The code scanning login system also includes a management center, and the management center is connected to each code scanning node. The method also includes: The management center collects node information of each scanned node, wherein the node information includes node identification, node online status information, and node scheduling status information; The management center collects device information of each code scanning device, and the device information includes node information, device identification, application identification list, scheduling label, working status information and device online status information.

6. A code scanning login device, characterized in that: The code scanning login device is deployed in the code scanning login system, and the code scanning login system includes multiple code scanning nodes, each of which is deployed with a code scanning service through a virtual container, each of which is connected to multiple code scanning devices, and each of which maintains the device information of each connected code scanning device, and the device information includes the node information, device identification, application identification list, scheduling label, working status information and device online status information. The code scanning login device includes: a transceiver unit, configured to receive a target code scanning task, wherein the target code scanning task includes target scheduling information and a QR code image, wherein the QR code image is a QR code image in a code scanning login page in a target automated test task, wherein the target scheduling information includes a target code scanning application identifier and a target scheduling tag, wherein the target scheduling tag includes at least one of a device model tag and an application account tag, wherein the target code scanning application identifier indicates an application type to be called, wherein the device model tag indicates that a code scanning device of a specified device model needs to be used for code scanning when executing the target code scanning task, and wherein the application account tag indicates that a code scanning device logged in to a specified user account needs to be used for code scanning when executing the target code scanning task; A processing unit is used to poll the device information of each of the scanning nodes in sequence, determine the polled device information corresponding to the target scheduling information as the target device information, and determine the scanning node and the scanning device corresponding to the target device information as the target scanning node and the target scanning device respectively; push the two-dimensional code image to the target scanning device through the target scanning service in the target scanning node; control the target scanning device to scan the two-dimensional code image through the target scanning service, and complete the scanning login operation of the target automated test task; Before the step of receiving the target code scanning task is performed by the transceiver unit, the processing unit is further used to: The target scheduling information is determined from a preset scheduling information pool according to a random algorithm or a sequential algorithm, and the target automated test task is generated according to the target scheduling information, wherein the target scheduling information indicates that when executing the target automated test task, a code scanning device corresponding to the target scheduling information is used to perform a code scanning login operation in the target automated test task, wherein a plurality of scheduling information are pre-set in the scheduling information pool, and different scheduling information is used to generate different automated test tasks, so as to perform code scanning login verification tests on code scanning devices of different models and / or different application accounts; the target browser is started through the Selenium automation tool, and the code scanning login page corresponding to the target automated test task is opened through the target browser; a screenshot of the QR code in the code scanning login page is taken to obtain the QR code image; and the target code scanning task is generated according to the QR code image and the target scheduling information.

7. A computer system, comprising multiple computer devices, each of which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processors in the multiple computer devices jointly implement the code scanning login method as described in any one of claims 1 to 5 when executing the corresponding computer programs.

8. A storage medium, characterized in that: The storage medium stores a computer program, which includes program instructions. When the program instructions are executed by a processor, the processor executes the code scanning login method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Distributed test method, device, apparatus and system and readable storage medium

    CN111913884A

  • Automatic login method, device and equipment for application test of in-vehicle infotainment device, and in-vehicle infotainment device

    CN117714206A