CN111078554B - Applet debugging method, device, equipment and storage medium - Google Patents

Applet debugging method, device, equipment and storage medium Download PDF

Info

Publication number
CN111078554B
CN111078554B CN201911293232.XA CN201911293232A CN111078554B CN 111078554 B CN111078554 B CN 111078554B CN 201911293232 A CN201911293232 A CN 201911293232A CN 111078554 B CN111078554 B CN 111078554B
Authority
CN
China
Prior art keywords
applet
debugging
account
virtual test
test account
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911293232.XA
Other languages
Chinese (zh)
Other versions
CN111078554A (en
Inventor
黄灿辉
彭宇洋
孙锦辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201911293232.XA priority Critical patent/CN111078554B/en
Publication of CN111078554A publication Critical patent/CN111078554A/en
Application granted granted Critical
Publication of CN111078554B publication Critical patent/CN111078554B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3644Software debugging by instrumenting at runtime

Abstract

The invention provides a method and a device for debugging an applet, an electronic device and a storage medium; the method comprises the following steps: the method comprises the steps that an applet debugging tool obtains a virtual test account for logging in an applet server, and the virtual test account is displayed in a human-computer interaction interface of the applet debugging tool; responding to the selection operation aiming at the virtual test account, logging in the applet server based on each selected virtual test account, and displaying the applet window in a logging state in the human-computer interaction interface; and responding to a debugging request for the small program, running the code of the item to be debugged in each small program window, and displaying debugging information output when the code is executed in the small program window. By the method and the device, the virtual test account can replace a real account to debug the applet, so that the development cost is reduced, and the development efficiency of the applet is improved.

Description

Applet debugging method, device, equipment and storage medium
Technical Field
The present invention relates to computer technologies, and in particular, to a method and an apparatus for debugging an applet, an electronic device, and a storage medium.
Background
A Mini Program (Mini Program) is an application that can be used without download and installation, and can run on a cross-platform client. The small program has the greatest characteristic of convenient use, and a user can open the application through code scanning or searching without manually installing the small program in an operating system of the terminal, so that the problem that too many application programs are installed on the terminal is solved.
As with a typical application program, the applet also needs to debug the applet before it is released in order to correct syntax errors and logic errors present in the applet in a timely manner.
However, when a developer debugs an applet by using multiple accounts, the applet debugging tool provided by the related art can only support the developer to debug the applet through a real account (e.g., a real WeChat account), which affects development efficiency of the applet.
Disclosure of Invention
The embodiment of the invention provides an applet debugging method, an applet debugging device, electronic equipment and a storage medium, which can be used for debugging an applet by replacing a real account with a virtual test account, so that the development cost is reduced, and the development efficiency of the applet is improved.
The technical scheme of the embodiment of the invention is realized as follows:
the embodiment of the invention provides a small program debugging method, which comprises the following steps:
the applet debugging tool obtains a virtual test account number for logging in the applet server, and
presenting the virtual test account in a human-computer interaction interface of the applet debugging tool;
in response to the selection operation aiming at the virtual test account, logging in the applet server based on each selected virtual test account, and
displaying an applet window in a login state in the human-computer interaction interface;
responding to the debugging request of the small program, running the code of the item to be debugged in each small program window, and
displaying debugging information output when the code is executed in the applet window.
The embodiment of the invention provides an applet debugging device, which comprises:
the system comprises a first processing module, a second processing module and a third processing module, wherein the first processing module is used for acquiring a virtual test account for logging in an applet server by an applet debugging tool and presenting the virtual test account in a human-computer interaction interface of the applet debugging tool;
the second processing module is used for responding to the selection operation aiming at the virtual test account, logging in the applet server based on each selected virtual test account, and displaying the applet window in a logging state in the human-computer interaction interface;
and the debugging module is used for responding to a debugging request aiming at the small program, running the codes of the items to be debugged in each small program window and displaying debugging information output when the codes are executed in the small program window.
In the above technical solution, the first processing module is further configured to determine, according to the running mode of the applet, the number of virtual test accounts used for logging in the applet server, and determine the number of virtual test accounts used for logging in the applet server
Randomly extracting the number of virtual test account numbers in the virtual test account number data set;
the operation mode comprises a single account online mode and a multi-account online mode, and the number of the virtual test accounts in the multi-account online mode is larger than that in the single account online mode.
In the above technical solution, the first processing module is further configured to obtain a virtual test account preset in the applet debugging tool and used for logging in the applet server; alternatively, the first and second electrodes may be,
obtaining historical debugging data of the applet from an applet server, an
And determining a virtual test account for logging in the applet server according to the historical debugging data of the applet.
In the above technical solution, the first processing module is further configured to include at least one of:
traversing historical debugging data of the applet to obtain the debugging failure frequency of a historical virtual test account, and determining the historical virtual test account as a virtual test account for logging in the applet server when the debugging failure frequency is greater than a debugging failure threshold value;
traversing historical debugging data of the applet to obtain a first historical virtual testing account number which fails to debug and a second historical virtual testing account number which succeeds in debugging, and determining at least one first historical virtual testing account number and at least one second historical virtual testing account number as virtual testing account numbers for logging in the applet server;
and traversing the historical debugging data of the applet to obtain the times of selecting the historical virtual test account by a developer, and determining the historical virtual test account as the virtual test account for logging in the applet server when the selected times are greater than a selection threshold.
In the above technical solution, the types of the applet windows include a debugging main window and a debugging sub-window, and the first processing module is further configured to determine a virtual test account randomly extracted from the selected virtual test accounts as a target virtual test account, and determine the applet window corresponding to the target virtual test account as the debugging main window;
determining small program windows corresponding to virtual test account numbers except the target virtual test account number in the selected virtual test account numbers as debugging sub-windows;
displaying a debugging main window and a debugging sub-window in a login state in the human-computer interaction interface;
the debugging main window is used for receiving codes of the project to be debugged submitted by a developer, and sharing the codes of the project to be debugged to the debugging sub-window through the occupied memory of the debugging main window.
In the above technical solution, the applet debugging apparatus further includes:
the third processing module is used for presenting a login interface in a human-computer interaction interface of the applet debugging tool;
in response to a login operation of logging in the applet server based on a real account in the login interface, logging in the applet server based on login information of the real account, and
displaying a debugging main window of the real account in a login state in the human-computer interaction interface when the login is successful;
the second processing module is further configured to determine an applet window corresponding to the selected virtual test account as a debugging child window;
and displaying the debugging sub-window in the login state in the human-computer interaction interface.
In the above technical solution, the applet debugging apparatus further includes:
the detection module is used for detecting the state of the real account based on the login information of the real account;
the third processing module is further configured to log in the applet server based on the login information of the real account when it is determined that the state of the real account is an unregistered state.
In the above technical solution, the applet debugging apparatus further includes:
the fourth processing module is used for responding to the adding operation of a real test account in the human-computer interaction interface, verifying the real test account, presenting the real test account in the human-computer interaction interface of the applet debugging tool when the verification is passed, and logging in the applet server based on the real test account;
and in response to the deletion operation of the real test account in the human-computer interaction interface, deleting the applet window in the login state, which displays the real test account in the human-computer interaction interface.
In the above technical solution, the debugging module is further configured to divide the code of the item to be debugged into N code segments according to a plurality of breakpoints set in the code of the item to be debugged;
running the [ (1+ N// M) × (i-1) +1] code segment to the ith (1+ N// M) code segment in the ith applet window;
wherein, 0< i ≦ M ≦ N, i, M, N are positive integers, M is the total number of the small program windows, and N// M represents the integer part of N/M.
In the above technical solution, the applet debugging apparatus further includes:
a recording module, configured to send, after the applet debugging tool successfully logs in the applet server based on a real account, debugging error information obtained by debugging based on the real account to a block chain network, so that the debugging tool can enable the applet debugging tool to obtain debugging error information
The consensus node in the block chain network verifies the debugging error information through a deployed intelligent contract;
and when the verification is passed, recording the debugging error information and the points generated corresponding to the real account number into an account book of the block chain network.
In the foregoing technical solution, the first processing module is further configured to send a virtual test account request to the applet server after the applet debugging tool logs in the applet server based on a real account, so that the applet debugging tool logs in the applet server based on the real account, so that the applet server can perform virtual test on the virtual test account request
The small program server determines the points required to be consumed in response to the virtual test account request, deducts the points required to be consumed from the account book of the block chain network, and generates a virtual test account which can be used for logging in the small program server and meets the virtual test account request;
and receiving the virtual test account generated by the applet server.
In the above technical solution, the first processing module is further configured to generate a virtual test account with the authority and the function according to the authority and the function included in the virtual test account request;
and recording the generated virtual test account as a logged account of the applet server.
An embodiment of the present invention provides an applet debugging apparatus, where the apparatus includes:
a memory for storing executable instructions;
and the processor is used for realizing the small program debugging method provided by the embodiment of the invention when executing the executable instructions stored in the memory.
The embodiment of the invention provides a storage medium, which stores executable instructions and is used for causing a processor to execute so as to realize the small program debugging method provided by the embodiment of the invention.
The embodiment of the invention has the following beneficial effects:
the applet debugging tool supports selection of a virtual test account and creation of an applet window corresponding to a login state, so that debugging of project codes of the applet is performed, developers can flexibly select the test account according to specific test requirements to debug the applet, and debugging efficiency is improved.
Drawings
Fig. 1 is a schematic application scenario diagram of an applet debugging system 10 provided in an embodiment of the present invention;
FIG. 2 is a diagram illustrating an alternative application mode 100 of the applet debugging method provided in the embodiment of the present invention;
fig. 3 is a schematic structural diagram of an applet debugging apparatus provided in an embodiment of the present invention;
FIGS. 4A-4D are schematic flow diagrams of a method for debugging an applet according to an embodiment of the present invention;
FIG. 5 is a diagram of a debug sub-window provided by an embodiment of the present invention;
FIG. 6 is a diagram of a debug main window provided by an embodiment of the present invention;
fig. 7 is a schematic diagram of a real account logged in by a user name according to an embodiment of the present invention;
fig. 8 is a schematic diagram illustrating a real account logged in through a two-dimensional code according to an embodiment of the present invention;
fig. 9 is a schematic view illustrating a virtual test account and a real account according to an embodiment of the present invention;
fig. 10 is a schematic diagram of a virtual test account simulating multi-account online debugging according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail with reference to the accompanying drawings, the described embodiments should not be construed as limiting the present invention, and all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
In the following description, references to the terms "first \ second \ third \ fourth" are only to distinguish similar objects and do not denote a particular order or importance to the objects, and it is to be understood that "first \ second \ third \ fourth" may be interchanged with a particular order or sequence as appropriate to enable the embodiments of the invention described herein to be practiced in an order other than that shown or described herein.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to be limiting of the invention.
Before further detailed description of the embodiments of the present invention, terms and expressions mentioned in the embodiments of the present invention are explained, and the terms and expressions mentioned in the embodiments of the present invention are applied to the following explanations.
1) Applet (Mini Program): a program developed based on a front-end-oriented Language (e.g., JavaScript) and implementing services in a Hypertext Markup Language (HTML) page, software downloaded by a client (e.g., a browser or any client embedded with a browser core) via a network (e.g., the Internet) and interpreted and executed in the browser environment of the client, saves steps installed in the client. For example, an applet for implementing various services such as ticket purchase, a ride code, and the like may be downloaded and run in the social network client.
2) Integrated Development Environment (IDE): one type of application software that assists in the development of computer programs generally includes tools such as code editors, compilers, debuggers, and graphical user interfaces. The integrated development software service integrating the code compiling function, the analyzing function, the compiling function, the debugging function and the like is integrated, and all software or software sets (groups) with the characteristic can be called as an integrated development environment. For example, Microsoft Visual Studio series, Borland C + + Builder, Delphi series, etc. all belong to the IDE. The IDE program can run independently or in combination with other programs. The embodiment of the invention mainly relates to an applet debugging tool.
3) Operating time (runtime): software/instructions that are executed while a program is running, in particular instructions that are not explicitly written out, but are critical to the proper functioning of the program. The applet runtime Software Development Kit (SDK) specifies the environment and libraries that the applet runs on.
4) Application Programming Interface (API): some predefined functions, or conventions that refer to the joining of different components of a software system. The goal is to provide the ability for applications and developers to access a set of routines based on some software or hardware, so that the developers do not need to access the source code, or understand the details of the internal work mechanisms.
5) The small program debugging tool comprises: a browser environment is provided that is needed for the applet to run in the client (e.g. the WeChat) (the code of the applet needs an interpreter/executor in the browser to interpret/execute). The small program debugging tool can be an IDE development tool and is provided with a visual human-computer interaction interface.
6) Virtual test account/real test account: the virtual test account is maintained by an operation and maintenance party of the applet server, namely, the account which is opened in the applet background and is specially used for testing, and the real test account is an account which is owned by a natural person and can be used for logging in a client of the applet background (namely, after the applet is online, the applet is downloaded and the applet is run on the client, such as WeChat). The virtual test account may have the same attributes and permissions as the real test account, and of course, some restrictions may be imposed for some needs (e.g., security), for example, the virtual test account cannot log in the wechat client, but the real test account can log in the wechat client.
7) And (4) small program window: also called a debugging window, can be a window running an instance of the applet, and can also be a code running an item to be debugged of the applet (debugging, such as breakpoint debugging, is implanted in the code), so that debugging information can be output in the process of running the code by the applet window.
8) Blockchain (Blockchain): an encrypted, chained transactional memory structure formed of blocks (blocks).
9) Block chain Network (Blockchain Network): the new block is included in a consensus manner to a set of a series of nodes of the block chain.
The embodiment of the invention provides a method and a device for debugging an applet, an electronic device and a storage medium, which can debug the applet by replacing a real account with a virtual test account, reduce the development cost and improve the development efficiency of the applet. The following describes an exemplary application of the applet debugging device provided in the embodiment of the present invention, where the applet debugging device provided in the embodiment of the present invention may be a server, for example, a server deployed in a cloud, and performs a series of processing on a virtual test account according to a virtual test account provided by another device or a user to obtain applet windows in a login state, run a code of an item to be debugged in each applet window, and display debugging information output when the code is executed in the applet window; the method includes the steps that a local virtual test account is obtained according to the handheld terminal, a series of processing is conducted on the virtual test account to obtain applet windows in a login state, codes of items to be debugged are operated in each applet window, and debugging information output when the codes are executed is displayed in the applet windows.
By way of example, referring to fig. 1, fig. 1 is a schematic view of an application scenario of the applet debugging system 10 provided in an embodiment of the present invention, a terminal 200 is connected to a server 100 through a network 300, and the network 300 may be a wide area network or a local area network, or a combination of the two.
The terminal 200 may be used to obtain the virtual test account, for example, the terminal automatically obtains a local virtual test account.
In some embodiments, the terminal 200 locally executes the applet debugging method provided in the embodiments of the present invention to display debugging information output when the code is executed in an applet window in which the virtual test account is in a login state according to the local virtual test account, for example, an applet debugging tool is installed on the terminal 200, after a user starts the applet debugging tool, the local virtual test account is acquired, and the terminal 200 presents the virtual test account in a human-computer interaction interface of the applet debugging tool according to the local virtual test account; responding to selection operation aiming at the virtual test account, logging in an applet server based on each selected virtual test account, and displaying an applet window in a logging state in a human-computer interaction interface; in response to a debugging request for an applet, the code of an item to be debugged is run in each applet window, and debugging information output when the code is executed is displayed in the applet window, that is, the debugging information is displayed on the display interface 210 of the terminal 200.
In some embodiments, the terminal 200 may also send a requirement of the virtual test account to the server 100 through the network 300, and invoke an applet debugging function provided by the server 100, where the server 100 obtains the virtual test account for logging in the applet server according to the requirement of the virtual test account by using the applet debugging method provided in the embodiments of the present invention, and presents the virtual test account in a human-computer interaction interface of an applet debugging tool in the server 100; responding to selection operation aiming at the virtual test account, logging in the applet server based on each selected virtual test account, and displaying the applet window in a logging state in a human-computer interaction interface; in response to a debugging request for the applet, running the code of the item to be debugged in each applet window, displaying debugging information output when the code is executed in the applet window, and also sending the output debugging information to the terminal 200 to display the debugging information on a display interface of the terminal 200.
Referring to fig. 2, fig. 2 is a schematic diagram of an optional application mode 100 of the applet debugging method according to an embodiment of the present invention, including a blockchain network 400 (exemplarily showing a consensus node 410-1 to a consensus node 410-3), an authentication center 500, a client node 600, and a client node 700, which are described below.
The type of blockchain network 400 is flexible and may be, for example, any of a public chain, a private chain, or a federation chain. Taking a public chain as an example, electronic devices of any service subject, such as the terminal 200 and the server 300, can access the blockchain network 400 without authorization; taking a federation chain as an example, an electronic device (e.g., terminal 200/server 300) hosted by a service entity after obtaining authorization may access the blockchain network 400, and at this time become a client node in the blockchain network 400.
In some embodiments, the client node may act as a mere observer of the blockchain network 400, i.e., provide functionality to support the business entity to initiate transactions (e.g., for uplink storage of data or querying of data on the chain), and may be implemented by default or selectively (e.g., depending on the specific business requirements of the business entity) with respect to the functions of the consensus nodes 410 (e.g., the consensus node 410-1 to the consensus node 410-3) of the blockchain network 400, such as the ranking function, the consensus service, and the ledger function, etc. Therefore, the data and the service processing logic of the service subject can be migrated to the blockchain network 400 to the maximum extent, and the credibility and traceability of the data and service processing process are realized through the blockchain network 400.
Consensus nodes in blockchain network 400 receive transactions submitted from different client nodes (e.g., client node 600 and client node 700 shown in fig. 2), perform the transactions to update the ledger or query the ledger, and various intermediate or final results of performing the transactions may be returned for display in the client nodes of the business entity.
For example, the client node 600/700 may subscribe to events of interest in the blockchain network 400, such as transactions occurring in a particular organization/channel in the blockchain network 400, push corresponding transaction notifications by the consensus node 410 to the client node 600/700, thereby triggering corresponding business logic in the client node 600/700.
An exemplary application of a blockchain network is described below, taking as an example the case where multiple client endpoints access the blockchain network to enable management of applet debugging.
Referring to fig. 2, a plurality of client nodes involved in the management link, for example, the client node 600 may be a client node corresponding to an applet debugging tool, the client node 700 may be a client node corresponding to an applet server, the client node 600 registers from the certificate authority 500 to obtain respective digital certificates, each digital certificate includes a public key of the client node 600 and a digital signature signed by the certificate authority 500 for the public key and identity information of the client node 600, and is used to attach to a transaction together with the digital signature of the client node 600 for the transaction and is sent to the blockchain network, for the blockchain network to take the digital certificate and signature from the transaction, verify the authenticity of the message (i.e., whether it has not been tampered with) and the identity information of the client node 600 that sent the message, and the blockchain network will verify based on the identity, e.g., whether it has the right to initiate the transaction. Clients running on electronic devices (e.g., terminals or servers) hosted by the business entity may request access from blockchain network 400 to become client nodes.
The client node 600 is configured to send debug error information obtained by debugging based on the real account to the blockchain network 400. The client node 600 generates a transaction corresponding to the update operation according to the debug error information, specifies an intelligent contract that needs to be invoked to implement the update operation and parameters transferred to the intelligent contract in the transaction, and the transaction also carries a digital certificate of the client node 600 and a signed digital signature (for example, a digest of the transaction is encrypted using a private key in the digital certificate of the client node 600), and broadcasts the transaction to the consensus node 410 in the blockchain network 400.
When the transaction is received in the consensus node 410 in the blockchain network 400, the digital certificate and the digital signature carried by the transaction are verified, after the verification is successful, whether the client node 600 has the transaction right is determined according to the identity carried in the transaction, and the transaction failure is caused by any verification judgment of the digital signature and the right verification. After the verification is successful, the digital signature of the node itself is signed (for example, the private key of the consensus node 410-1 encrypts the summary of the transaction), and the debugging error information and the points generated corresponding to the real account number are recorded in the ledger of the blockchain network.
After the client node 600 logs in the client node 700 based on the real account, a virtual test account request is sent to the client node 700, the client node 700 responds to the virtual test account request, customizes a virtual test account according to the virtual test account request, determines points to be consumed according to the customized virtual test account, sends the points to be consumed to the blockchain network 400, the blockchain network 400 inquires the points of the real account in the account book and verifies that the points are enough, deducts the points to be consumed from the account book of the blockchain network 400, and the client node 700 sends the customized virtual test account to the client node.
An exemplary structure of an applet debugging apparatus implementing an embodiment of the present invention is described below, where the applet debugging apparatus may be various terminals, such as a mobile phone, a computer, and the like, and may also be a server.
Referring to fig. 3, fig. 3 is a schematic structural diagram of an applet debugging apparatus 500 according to an embodiment of the present invention, where the applet debugging apparatus shown in fig. 3 includes: at least one processor 510, memory 550, at least one network interface 520, and a user interface 530. The various components in applet debugging device 500 are coupled together by a bus system 540. It is understood that the bus system 540 is used to enable communications among the components. The bus system 540 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 540 in fig. 3.
The Processor 510 may be an integrated circuit chip having Signal processing capabilities, such as a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like, wherein the general purpose Processor may be a microprocessor or any conventional Processor, or the like.
The user interface 530 includes one or more output devices 531 enabling presentation of media content, including one or more speakers and/or one or more visual display screens. The user interface 530 also includes one or more input devices 532, including user interface components to facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
The memory 550 may comprise volatile memory or nonvolatile memory, and may also comprise both volatile and nonvolatile memory. The non-volatile Memory may be a Read Only Memory (ROM), and the volatile Memory may be a Random Access Memory (RAM). The memory 550 described in connection with embodiments of the invention is intended to comprise any suitable type of memory. Memory 550 optionally includes one or more storage devices physically located remote from processor 510.
In some embodiments, memory 550 can store data to support various operations, examples of which include programs, modules, and data structures, or subsets or supersets thereof, as exemplified below.
An operating system 551 including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
a network communication module 552 for communicating to other computing devices via one or more (wired or wireless) network interfaces 520, exemplary network interfaces 520 including: bluetooth, wireless compatibility authentication (WiFi), and Universal Serial Bus (USB), etc.;
a display module 553 for enabling presentation of information (e.g., a user interface for operating peripherals and displaying content and information) via one or more output devices 531 (e.g., a display screen, speakers, etc.) associated with the user interface 530;
an input processing module 554 to detect one or more user inputs or interactions from one of the one or more input devices 532 and to translate the detected inputs or interactions.
In some embodiments, the image processing apparatus provided by the embodiments of the present invention may be implemented by combining hardware and software, and by way of example, the image processing apparatus provided by the embodiments of the present invention may be a processor in the form of a hardware decoding processor, which is programmed to execute the image processing method provided by the embodiments of the present invention, for example, the processor in the form of the hardware decoding processor may be one or more Application Specific Integrated Circuits (ASICs), DSPs, Programmable Logic Devices (PLDs), Complex Programmable Logic Devices (CPLDs), Field Programmable Gate Arrays (FPGAs), or other electronic components.
In other embodiments, the applet debugging apparatus provided in the embodiments of the present invention may be implemented in software, and fig. 3 illustrates an applet debugging apparatus 555 stored in a memory 550, which may be software in the form of programs, plug-ins, and the like, and includes a series of modules, including a first processing module 5551, a second processing module 5552, a debugging module 5553, a third processing module 5554, a detection module 5555, a fourth processing module 5556, and a recording module 5557; the first processing module 5551, the second processing module 5552, the debugging module 5553, the third processing module 5554, the detection module 5555, the fourth processing module 5556, and the recording module 5557 are used to implement the applet debugging method provided in the embodiment of the present invention.
The applet debugging method provided by the embodiment of the present invention is described below with reference to an exemplary application and implementation of the terminal provided by the embodiment of the present invention. Referring to fig. 4A, fig. 4A is a flowchart illustrating a method for debugging an applet according to an embodiment of the present invention, which is described with reference to the steps shown in fig. 4A.
In step 101, the applet debug tool obtains a virtual test account for logging in to the applet server.
After a developer starts an applet debugging tool on a terminal, the applet debugging tool can acquire a virtual test account for logging in an applet server, so that the applet debugging can be performed through the virtual test account in the following process.
In some embodiments, the applet debugging tool obtains a virtual test account number for logging into the applet server, including: determining the number of virtual test account numbers for logging in an applet server according to the running mode of the applet, and randomly extracting the number of virtual test account numbers in a virtual test account number data set; the operation mode comprises a single account online mode and a multi-account online mode, and the number of the virtual test accounts in the multi-account online mode is larger than that in the single account online mode.
After a developer starts an applet debugging tool, determining the running mode of an applet to be debugged, determining the number of virtual test account numbers according to the running mode of the applet, and randomly extracting the number of virtual test data in a virtual test account number data set. For example, when the operation mode of the applet to be debugged (ticket purchasing applet) is determined to be the single account online mode, the number of the virtual test accounts may be determined to be 3; when the running mode of the applet to be debugged (the multiplayer mini game) is determined to be the multi-account online mode, the number of the virtual test accounts can be determined to be 8, that is, the number of the virtual test accounts in the multi-account online mode is larger than that in the single-account online mode.
In some embodiments, the applet debugging tool obtaining a virtual test account for logging in to the applet server, comprising: and acquiring a virtual test account number which is preset in the applet debugging tool and used for logging in the applet server.
The developer can preset a virtual test account in the applet debugging tool so as to directly call the virtual test account in the following process. After a developer starts the applet debugging tool, the applet debugging tool can directly acquire a virtual test account preset in the applet debugging tool and used for logging in an applet server.
Referring to fig. 4B, fig. 4B is an optional flowchart provided in an embodiment of the present invention, and in some embodiments, fig. 4B shows that step 101 in fig. 4A may be implemented by steps 1011 to 1012 shown in fig. 4B.
In step 1011, historical debug data for the applet is obtained from the applet server.
After a developer starts the applet debugging tool, the applet debugging tool can send a request to the applet server, and after the applet server receives the request, the applet debugging tool inquires the historical debugging data corresponding to the applet according to the request and sends the historical debugging data of the applet to the applet debugging tool, so that the applet debugging tool obtains the historical debugging data of the applet from the applet server.
In step 1012, a virtual test account number for logging into the applet server is determined based on historical debug data for the applet.
After the applet debugging tool obtains the historical debugging data of the applet from the applet server, the virtual test account for logging in the applet server can be determined according to the historical debugging data of the applet, so that a proper virtual test account can be obtained according to the historical debugging data.
In some embodiments, determining a virtual test account for logging in to the applet server from historical debug data of the applet comprises: traversing historical debugging data of the small program to obtain the frequency of debugging failure of the historical virtual test account; and when the frequency of debugging failures is greater than a debugging failure threshold value, determining the historical virtual test account as the virtual test account for logging in the applet server.
After the applet debugging tool obtains the historical debugging data of the applet from the applet server, traversal processing can be carried out on the historical debugging data of the applet, the frequency of debugging failures of the historical virtual test account is counted, and when the frequency of debugging failures is determined to be larger than a debugging failure threshold value, the historical virtual test account is determined to be the virtual test account used for logging in the applet server. Since the frequency of debugging failures of the historical virtual test account is greater than the debugging failure threshold, it is indicated that problems often occur when the historical virtual test account is used for debugging the applet, and in order to improve the development efficiency, the applet can be debugged for the historical virtual test account.
In some embodiments, determining a virtual test account for logging in to the applet server from historical debug data of the applet comprises: traversing historical debugging data of the applet to obtain a first historical virtual testing account number which fails to debug and a second historical virtual testing account number which succeeds in debugging; and determining at least one first historical virtual test account number and at least one second historical virtual test account number as virtual test account numbers for logging in the applet server.
After the applet debugging tool obtains the historical debugging data of the applet from the applet server, traversal processing may be performed on the historical debugging data of the applet, statistics is performed on a first historical virtual test account which fails to debug and a second historical virtual test account which succeeds in debugging, and at least one first historical virtual test account and at least one second historical virtual test account are determined as virtual test accounts for logging in the applet server, for example, 5 first historical virtual test accounts and 3 second historical virtual test accounts are determined as virtual test accounts for logging in the applet server. In order to improve the development accuracy, the small program can be debugged aiming at different types of historical virtual test account numbers, so that the small program covers all the virtual test account numbers, special virtual test account numbers cannot appear, and the compatibility of the small program is improved. The number of the first historical virtual test account numbers can be larger than that of the second historical virtual test account numbers, so that the debugging of the applet is more focused on the virtual test account numbers which fail in debugging.
In some embodiments, determining a virtual test account for logging in to the applet server from historical debug data of the applet comprises: traversing historical debugging data of the small program to obtain the times of the historical virtual test account selected by a developer; and when the selected times are larger than the selected threshold value, determining the historical virtual test account as the virtual test account for logging in the applet server.
After the applet debugging tool obtains the historical debugging data of the applet from the applet server, traversal processing can be performed on the historical debugging data of the applet, the times of selection of the historical virtual test account by a developer are counted, and when the selected times are larger than a selection threshold value, the historical virtual test account is determined to be the virtual test account for logging in the applet server. In order to improve the experience of the developer, the small program debugging can be performed on the historical virtual test account which is frequently selected by the developer, so that the virtual test account is more in line with the preference of the developer.
In step 102, a virtual test account is presented in a human-computer interaction interface of an applet debugging tool.
After the virtual test account is obtained by the applet debugging tool, the virtual test account can be presented in a human-computer interaction interface so that a subsequent developer can select the virtual test account.
In step 103, in response to the selection operation for the virtual test account, logging in the applet server based on each selected virtual test account, and displaying the applet window in the logged-in state in the human-computer interaction interface.
After the virtual test account is presented by the applet debugging tool, a developer can select the virtual test account according to a virtual test account list displayed on the human-computer interaction interface so as to confirm the virtual test account for debugging. And the applet debugging tool responds to the selection operation of the developer for the virtual test account, logs in the applet server based on each selected virtual test account, and displays the applet window in a login state in the human-computer interaction interface. After the selected virtual test account is confirmed, a virtual test account login request can be sent to the applet server, after the applet server receives the virtual test account login request, connection between the virtual test account and the applet server is established, debugging work of the applet is conducted on the basis of the virtual test account, and the applet window in a login state is displayed in a human-computer interaction interface.
In some embodiments, the types of the applet windows include a debugging main window and a debugging sub-window, and the displaying of the applet windows in a login state in the human-computer interaction interface includes: determining a virtual test account randomly extracted from the selected virtual test accounts as a target virtual test account, and determining an applet window corresponding to the target virtual test account as a debugging main window; determining small program windows corresponding to virtual test account numbers except for a target virtual test account number in the selected virtual test account numbers as debugging sub-windows; displaying a debugging main window and a debugging sub-window in a login state in a human-computer interaction interface; the debugging main window is used for receiving codes of the project to be debugged submitted by a developer, and sharing the codes of the project to be debugged to the debugging sub-window through the occupied memory of the debugging main window.
When no real account logs in the small program debugging tool, or no real account carries out debugging and debugging tools in the small program debugging tool, one virtual test account can be randomly extracted from the selected virtual test accounts and determined as a target virtual test account, and small program windows corresponding to the virtual test accounts except the target virtual test account in the selected virtual test accounts are determined as debugging sub-windows. As shown in fig. 5, fig. 5 is a schematic diagram of a debugging sub-window provided in the embodiment of the present invention, where the debugging sub-window only includes a simulator 501 and a debugger 502, where the simulator is used for simulating a display interface of a terminal, and the debugger is used for debugging a style of the display interface; as shown in fig. 6, fig. 6 is a schematic diagram of a debugging main window provided in the embodiment of the present invention, where the debugging main window has an encoder 601, which can edit a project code, and after the project code is saved, each debugging sub-window can synchronously execute the saved project code.
Referring to fig. 4C, fig. 4C is an optional schematic flow chart provided by the embodiment of the present invention, and in some embodiments, before step 103 in fig. 4A, step 105 is further included in fig. 4C.
In step 105, presenting a login interface in a human-computer interaction interface of the applet debugging tool; and responding to a login operation of logging in the applet server based on the real account in the login interface, logging in the applet server based on the login information of the real account, and displaying a debugging main window in a login state of the real account in the human-computer interaction interface when the login is successful.
Before the applet debugging tool obtains the virtual test account for logging in the applet server, namely after a developer starts the applet debugging tool, a login interface can be presented in a human-computer interaction interface of the applet debugging tool, the developer can log in a real account based on the login interface, log in the applet server based on login information of the real account, and display a debugging main window in a login state of the real account in the human-computer interaction interface when the login is successful. Wherein, the displaying of the applet window in the login state in the human-computer interaction interface comprises: determining an applet window corresponding to the selected virtual test account as a debugging child window; and displaying the debugging sub-window in the login state in the man-machine interaction interface. For example, after a developer opens an applet debugging tool, a login interface is presented in the applet debugging tool, as shown in fig. 7-8, fig. 7 is a schematic diagram of login of a real account by a user name provided in an embodiment of the present invention, the developer may input the user name and the user password of the real account on the login interface, log in an applet server based on the user name and the user password of the real account, and display a debugging main window of the real account in a login state in a human-computer interaction interface when the login is successful; fig. 8 is a schematic diagram of a real account logged in through a two-dimensional code according to an embodiment of the present invention, where a developer may scan a two-dimensional code on a login interface based on the real account, log in to an applet server based on the two-dimensional code scanned by the real account, and display a debugging main window of the real account in a login state in a human-computer interaction interface when the login is successful. Of course, the real account can be logged in through voice, short message and other modes.
Before responding to the selection operation aiming at the virtual test account, a login interface can be presented in a human-computer interaction interface of the applet debugging tool, a developer can log in a real account based on the login interface, log in the applet server based on the login information of the real account, and display a debugging main window in a login state of the real account in the human-computer interaction interface when the login is successful. Wherein, the displaying of the applet window in the login state in the human-computer interaction interface comprises: determining an applet window corresponding to the selected virtual test account as a debugging child window; and displaying the debugging sub-window in the login state in the man-machine interaction interface.
In some embodiments, before logging in to the applet server based on the login information of the real account number, the method further comprises: detecting the state of the real account based on the login information of the real account;
the login information login applet server based on the real account number comprises the following steps: and logging in the applet server based on the login information of the real account when the state of the real account is determined to be the unregistered state.
Before logging information of a real account number logs in the applet server, whether the real account number logs in other debugging equipment or not needs to be detected, namely, the logging state of the real account number is detected, when the fact that the real account number does not log in other equipment is determined, it is indicated that the real account number is not occupied, and the applet server can be logged in based on the logging information of the real account number.
In some embodiments, before displaying the applet window in the login state in the human-computer interaction interface, the method further comprises: responding to the adding operation aiming at the real test account number in the human-computer interaction interface, verifying the real test account number, presenting the real test account number in the human-computer interaction interface of the small program debugging tool when the verification is passed, and logging in the small program server based on the real test account number; and in response to the deletion operation aiming at the real test account in the human-computer interaction interface, deleting the applet window in the login state, which displays the real test account in the human-computer interaction interface.
Before displaying the applet window in the login state in the man-machine interaction interface, a real test account number adding button can be displayed in the man-machine interaction interface of the applet debugging tool, a developer can click the real test account number adding button and display a login interface so as to add a real test account number, and login information of the applet server is logged in based on the real test account number. For example, as shown in fig. 9, fig. 9 is a schematic view illustrating a virtual test account and a real test account provided in the embodiment of the present invention, and a developer may click an "add" button in the real test account interface in fig. 9, so as to present a login interface in an applet debugging tool, and integrate the login interface to log in the real test account, so as to add the real test account.
Before the applet window in the login state is displayed in the man-machine interaction interface, a button for deleting the real test account can be displayed in the man-machine interaction interface of the applet debugging tool, and a developer can click the button for deleting the real test account, so that the applet window in the login state, in which the real test account is displayed in the man-machine interaction interface, is deleted, or the applet debugging tool is directly quitted.
In step 104, in response to a debugging request for an applet, code of an item to be debugged is run in each applet window, and debugging information output when the code is executed is displayed in the applet window.
After the applet windows in the login state are displayed in the man-machine interaction interface, a developer can click a debugging button to start debugging work, the applet debugging tool responds to a debugging request aiming at the applet, runs codes of the same item to be debugged in each applet window, and displays debugging information output when the codes are executed in the applet window, so that the developer determines the debugging information of the applet and carries out subsequent operation.
In some embodiments, running code for an item to be debugged in each applet window comprises: dividing the code of the project to be debugged into N code segments according to a plurality of breakpoints set in the code of the project to be debugged; running the [ (1+ N// M) × (i-1) +1] code segment to the ith (1+ N// M) code segment in the ith applet window; wherein, 0< i ≦ M ≦ N, i, M, N are positive integers, M is the total number of small program windows, and N// M represents the integer part of N/M.
In order to improve the debugging efficiency, the applet window can debug part of the code of the item to be debugged, the code of the item to be debugged can be divided into N code segments according to a plurality of breakpoints set in the code of the item to be debugged, so that the ith code segment from the [ (1+ N// M) × (i-1) +1] to the ith (1+ N// M) code segment is run in the ith applet window, for example, the code of the item to be debugged is divided into 6 code segments, so that the 1 st code segment from the 1 st to the 2 nd code segment is run in the 1 st applet window, the 3 rd code segment from the 4 th code segment from the 2 nd applet window, and the 5 th code segment from the 3 rd to the 6 th code segment from the 3 rd applet window.
Referring to fig. 4D, fig. 4D is an alternative flow chart provided by the embodiment of the present invention, and in some embodiments, fig. 4D shows that fig. 4A further includes step 106.
In step 106, after the applet debugging tool successfully logs in the applet server based on the real account, debugging error information obtained by debugging based on the real account is sent to the block chain network, so that a consensus node in the block chain network verifies the debugging error information through a deployed intelligent contract; and when the verification is passed, recording debugging error information and points generated corresponding to the real account number into an account book of the block chain network.
When the small program debugging tool successfully logs in the small program server based on the real account number of the developer, the developer can submit debugging error information output when a display code is executed in a small program window, the small program debugging tool sends the transaction of the debugging error information to a block chain network, the block chain network calls an intelligent contract arranged in the block chain network according to the transaction of the debugging error information, a common identification node in the block chain network verifies the debugging error information through the arranged intelligent contract, when the verification is passed, the integral generated corresponding to the real account number is determined according to the debugging error information, and the debugging error information and the integral generated corresponding to the real account number are recorded in an account book of the block chain network, so that a follow-up developer needs to customize a virtual test account number to consume the integral.
In some embodiments, the applet debugging tool obtaining a virtual test account for logging in to the applet server, comprising: after logging in an applet server based on a real account by an applet debugging tool, sending a virtual test account request to the applet server so that the applet server determines the points to be consumed for responding to the virtual test account request, deducting the points to be consumed from an account book of a block chain network, and generating a virtual test account which can be used for logging in the applet server and meets the virtual test account request; and receiving the virtual test account generated by the applet server.
The virtual test account may be generated for the development requirements of each developer's applet. For example, after logging in the applet server by using the real account, the applet developer may submit development requirements, such as quantity, attributes, and permissions, and the operation and maintenance party of the applet server may customize a virtual test account meeting the requirements for the developer in the applet server according to the requirements of the developer, and send the virtual test account to the applet debugging tool of the developer. For example, the applet debugging tool may receive a request for a virtual test account submitted by a developer, and the developer needs to log in to the applet debugging tool using a real account before submitting the request. The applet background can authenticate the real account of the developer (for example, whether the authority of customizing the virtual test account exists).
The authentication of the real account number can be deducting the credit of the real account number (the deduction amount is determined according to customization conditions such as the account number, the type of the attribute and the authority level), and the credit can be distributed according to the contribution of a developer to the applet debugging tool, for example, the credit can be obtained by submitting debugging error information to a blockchain network.
After logging in an applet server based on a real account, an applet debugging tool can send a virtual test account request (the requirement of a virtual test account, such as the number of accounts, the type of attributes and the level of authority) submitted by the real account to the applet server, after receiving the virtual test account request, the applet server determines the points to be consumed according to the virtual test account request, and sends a point query transaction based on the real account to a blockchain network, wherein the point query transaction comprises the points to be consumed, the blockchain network responds to the point query transaction, the points of the real account in an account book are queried through a deployed intelligent contract by a common identification node in the blockchain network, when the points of the real account are determined to be greater than or equal to the points to be consumed, the points to be consumed corresponding to the real account are deducted from the account book, and after the points are deducted successfully, and the applet server sends the virtual test account customized according to the virtual test account request to the applet debugging tool.
In some embodiments, generating a virtual test account usable to log on to the applet server and satisfy the virtual test account request comprises: generating a virtual test account with authority and function according to the authority and function included in the virtual test account request; and recording the generated virtual test account as a logged account of the applet server.
After the block link deduction is successful, it is indicated that the integral of the real account is enough, the real account has the authority for customizing the virtual test account, the applet server can generate the virtual test account with the authority and the function according to the authority and the function included in the virtual test account request, and record the generated virtual test account as the logged-in account of the applet server. For example, if the virtual test account request includes the authority of the user information of any real user and the function of debugging any breakpoint, the applet server generates a virtual test account corresponding to the authority and the function.
In some embodiments, after logging in the applet server based on the real account number, the applet debugging tool sends a virtual test account number request to the applet server, the applet server determines the cost of the virtual test account number according to the requirement of the virtual test account number, and when it is determined that the payment method associated with the real account number pays the fee, the applet server sends the virtual test account number to the applet debugging tool.
The applet debugging method provided in the embodiment of the present invention has been described with reference to the exemplary application and implementation of the terminal provided in the embodiment of the present invention, and a scheme for implementing the applet debugging by matching each module in the applet debugging apparatus 555 provided in the embodiment of the present invention is continuously described below.
The first processing module 5551 is configured to acquire a virtual test account for logging in an applet server by an applet debugging tool, and present the virtual test account in a human-computer interaction interface of the applet debugging tool;
the second processing module 5552 is configured to, in response to a selection operation for the virtual test account, log in the applet server based on each selected virtual test account, and display an applet window in a log-in state in the human-computer interaction interface;
a debugging module 5553, configured to run, in response to a debugging request for the applet, code of an item to be debugged in each applet window, and display, in the applet window, debugging information output when the code is executed.
In some embodiments, the first processing module 5551 is further configured to determine, according to the running mode of the applet, the number of virtual test accounts used for logging in the applet server, and randomly extract the number of virtual test accounts in the virtual test account data set; the operation mode comprises a single account online mode and a multi-account online mode, and the number of the virtual test accounts in the multi-account online mode is larger than that in the single account online mode.
In some embodiments, the first processing module 5551 is further configured to obtain a virtual test account preset in the applet debugging tool for logging in the applet server; or obtaining historical debugging data of the applet from the applet server, and determining a virtual test account for logging in the applet server according to the historical debugging data of the applet.
In some embodiments, the first processing module 5551 is further configured to include at least one of:
traversing historical debugging data of the applet to obtain the debugging failure frequency of a historical virtual test account, and determining the historical virtual test account as a virtual test account for logging in the applet server when the debugging failure frequency is greater than a debugging failure threshold value;
traversing historical debugging data of the applet to obtain a first historical virtual testing account number which fails to debug and a second historical virtual testing account number which succeeds in debugging, and determining at least one first historical virtual testing account number and at least one second historical virtual testing account number as virtual testing account numbers for logging in the applet server;
and traversing the historical debugging data of the applet to obtain the times of selecting the historical virtual test account by a developer, and determining the historical virtual test account as the virtual test account for logging in the applet server when the selected times are greater than a selection threshold.
In some embodiments, the types of the applet windows include a debugging main window and a debugging sub-window, and the first processing module 5551 is further configured to determine one virtual test account randomly extracted from the selected virtual test accounts as a target virtual test account, and determine the applet window corresponding to the target virtual test account as the debugging main window; determining small program windows corresponding to virtual test account numbers except the target virtual test account number in the selected virtual test account number as debugging sub-windows; displaying a debugging main window and a debugging sub-window in a login state in the human-computer interaction interface; the debugging main window is used for receiving codes of the project to be debugged submitted by a developer, and sharing the codes of the project to be debugged to the debugging sub-window through the occupied memory of the debugging main window.
In some embodiments, the applet debugging device 555 further comprises:
a third processing module 5554, configured to present a login interface in a human-computer interaction interface of the applet debugging tool; responding to a login operation of logging in the applet server based on a real account in the login interface, logging in the applet server based on login information of the real account, and displaying a debugging main window of the real account in a login state in the human-computer interaction interface when the login is successful;
the second processing module 5552 is further configured to determine an applet window corresponding to the selected virtual test account as a debugging sub-window; and displaying the debugging sub-window in the login state in the human-computer interaction interface.
In some embodiments, the applet debugging device 555 further comprises:
a detection module 5555, configured to detect a status of the real account based on login information of the real account;
the third processing module 5554 is further configured to log in the applet server based on the login information of the real account when it is determined that the status of the real account is an unregistered status.
In some embodiments, the applet debugging device 555 further comprises:
a fourth processing module 5556, configured to verify a real test account in response to an add operation on the real test account in the human-computer interaction interface, and when the verification passes, present the real test account in the human-computer interaction interface of the applet debugging tool, and log in the applet server based on the real test account; and in response to the deletion operation of the real test account in the human-computer interaction interface, deleting the applet window in the login state, which displays the real test account in the human-computer interaction interface.
In some embodiments, the debugging module 5553 is further configured to divide the code of the item to be debugged into N code segments according to a plurality of breakpoints set in the code of the item to be debugged; running the [ (1+ N// M) × (i-1) +1] code segment to the ith (1+ N// M) code segment in the ith applet window; wherein, 0< i ≦ M ≦ N, i, M, N are positive integers, M is the total number of the small program windows, and N// M represents the integer part of N/M.
In some embodiments, the applet debugging device 555 further comprises:
a recording module 5557, configured to send, after the applet debugging tool successfully logs in the applet server based on a real account, debugging error information obtained by debugging based on the real account to a block chain network, so that a consensus node in the block chain network verifies the debugging error information through a deployed intelligent contract; and when the verification is passed, recording the debugging error information and the points generated corresponding to the real account number into an account book of the block chain network.
In some embodiments, the first processing module 5551 is further configured to, after the applet debugging tool logs in the applet server based on a real account number, send a virtual test account number request to the applet server, so that the applet server determines a credit required to be consumed in response to the virtual test account number request, deduct the credit required to be consumed in a book of the block chain network, and generate a virtual test account number capable of being used for logging in the applet server and satisfying the virtual test account number request; and receiving the virtual test account generated by the applet server.
In some embodiments, the first processing module 5551 is further configured to generate a virtual test account with the authority and the function according to the authority and the function included in the virtual test account request; and recording the generated virtual test account as a logged account of the applet server.
Embodiments of the present invention further provide a storage medium storing executable instructions, where the executable instructions are stored, and when executed by a processor, will cause the processor to execute an applet debugging method provided in embodiments of the present invention, for example, the applet debugging method shown in fig. 4A-4D.
In some embodiments, the storage medium may be memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
In some embodiments, executable instructions may be written in any form of programming language (including compiled or interpreted languages), in the form of programs, software modules, scripts or code, and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
By way of example, executable instructions may correspond, but do not necessarily have to correspond, to files in a file system, and may be stored in a portion of a file that holds other programs or data, such as in one or more scripts in a hypertext Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code).
By way of example, executable instructions may be deployed to be executed on one computing device or on multiple computing devices at one site or distributed across multiple sites and interconnected by a communication network.
In the following, an exemplary application of the embodiments of the present invention in a practical application scenario will be described.
Applets, as a new product and technology modality, can run in mobile clients (iOS, android), and applet developers can use the IDE to develop and debug applets.
An applet debugging tool (IDE) can log in by adopting a real account (real micro signal) and takes the account as a primary account of all opened debugging projects, and when the logged account is changed, the logging state is synchronized to all opened project windows (applet windows); when an applet (such as a mini game) needs a plurality of real accounts (a plurality of micro signals) to finish a debugging work together, the applet debugging tool provides a multi-account debugging function. Scanning the two-dimensional code by using a real account different from the primary account can add a real test account, and if the real test account logs in other debugging tool clients, the login state of the real test account fails.
The small program debugging tool can support a developer to check a plurality of account numbers simultaneously and open a plurality of debugging sub-windows (the account numbers correspond to the sub-windows one by one) to debug the same debugging project; the debugging sub-window is different from the debugging main window, as shown in fig. 5, fig. 5 is a schematic diagram of the debugging sub-window provided in the embodiment of the present invention, and the debugging sub-window only includes a simulator 501 and a debugger 502, where the simulator is used for simulating a display interface of a terminal, and the debugger is used for debugging a style of the display interface; as shown in fig. 6, fig. 6 is a schematic diagram of a debugging main window provided in the embodiment of the present invention, where the debugging main window has an encoder 601, which can edit a project code, and after the project code is saved, each debugging sub-window can synchronously execute the saved project code.
Currently, multi-account debugging only supports adding real accounts (such as micro-signals) for debugging. The embodiment of the invention provides a virtual test account (such as a virtual WeChat account), a debugging system can automatically add the virtual test account to each applet, and a developer only needs to select the virtual test account and then click to determine, so that the function debugging of the same debugging project can be carried out through the selected virtual test account.
When a developer uses multiple account numbers for debugging, only real micro signals can be added for debugging, the development cost is very high, the experience of a small program developer is poor, the developer is difficult to obtain enough micro signals to assist in debugging, the development efficiency is low, and resources are wasted. The virtual test account is added to the applet to simulate the online debugging of multiple micro signals, so that the development efficiency of an applet developer in the debugging of multiple accounts is improved.
When the small program developer conducts multi-account debugging, the debugging system automatically distributes the virtual test account for each small program, and online debugging of multiple micro signals is simulated. The virtual test account can be shared by all the applet accounts, and multiple virtual test accounts can be provided simultaneously in consideration of the mode that the mini-game has multi-player battle. The virtual test account is only used for debugging multiple accounts by an applet debugging tool and cannot be logged in and used by a client. And the virtual test account can be added to an account list of multi-account debugging of the applet debugging tool by default without code scanning. Because all the applets can share the virtual test account number, the virtual test account number can support login in a plurality of applet debugging tools, and the login state cannot fail for a long time.
The small program debugging method provided by the embodiment of the invention comprises three parts, namely: 1) generating and using a virtual test account; 2) the principle of multi-account debugging is realized by using the virtual test account; 3) and maintaining the state of the virtual test account. These three sections are specifically explained below:
1) generation and use of virtual test account numbers: the virtual test account number is automatically assigned to each applet by the debug system. Virtual test account information can be added to the applet debugging tool, and the virtual test account simulates all user information contained in the real account. When the applet debugging tool reads the virtual test account and the real WeChat account, the two accounts can be distinguished, but because the attributes of the information of the two accounts are the same, the virtual test account can realize the simulation of all functions and permissions of the real account. However, the virtual test account cannot be used for wechat login and the like, based on development considerations.
2) The principle of using virtual test accounts to realize multi-account debugging is as follows: the applet debugging tool can obtain the virtual test account information from the local, and the debugging system can provide a plurality of virtual test accounts. When the test account is displayed, the test account can be displayed in a differentiated manner according to the virtual test account and the real account, as shown in fig. 9, fig. 9 is a schematic view of displaying the virtual test account and the real account provided by the embodiment of the present invention, and entries are not added or deleted in the virtual test account, so that user interaction can be limited, development confusion is avoided, and information cannot be modified. The real account number can keep the functions of adding and deleting, and a user can modify the real account number according to needs so that a developer can debug the small program according to the condition of the real account number.
3) Maintaining the state of the virtual test account: the state of the virtual test account can be defaulted to login success, maintenance of an applet debugging tool is facilitated, and the login state of the virtual test account cannot be modified by a user. The real account needs other tools to detect the login status.
As shown in fig. 10, fig. 10 is a schematic view of a virtual test account simulating multi-account online debugging provided in the embodiment of the present invention. Firstly, detecting a real account by an applet debugging tool, adding the real account into an account list after the real account is determined to be logged in, and directly adding a virtual test account into a multi-account debugging list without detecting a login state; then, performing multi-account debugging on the real account and the virtual test account in the account list, and generating a debugging window corresponding to the real account and a debugging window corresponding to the virtual test account (e.g., a debugging window of test account 1, a debugging window of test account 2, a debugging window of test account 3, and a debugging window of test account 4).
1. The virtual test account number is obtained, and the virtual test account number may be common to all developers, for example, the applet debugging tool obtains a preset (i.e., preset in an installation package of the applet debugging tool when the applet debugging tool is issued) common virtual test account number from local, or obtains a common virtual test account number from the applet server when the applet debugging tool is started.
It should be noted that the virtual test account may also be generated according to the development requirement of each developer's applet. For example, after logging in the applet server by using a real account (i.e., the social account of the developer), the developer of the applet can submit development requirements, such as the number, attributes, and permissions of virtual test accounts, and the operation and maintenance party of the applet server can open a virtual test account meeting the requirements for the developer in the applet server according to the requirements of the developer and send the virtual test account to the applet debugging tool of the developer.
For example, the applet debugging tool may receive a request for a virtual test account submitted by a developer, and the developer needs to log in to the applet debugging tool using a real account before submitting the request. The applet server may authenticate the developer's real account (e.g., whether there is authority to customize the virtual test account (which may be a charged service)).
The authentication of the real account number may be to deduct points of the real account number (the deduction number is determined according to a customization situation, such as the account number, the type of the attribute, and the level of the authority), and the points may be distributed according to the contribution of a developer to the applet debugging tool, for example, the points may be obtained by submitting debugging error information (bug) to the applet server.
The embodiment of the invention can realize a real account authentication scheme by combining the block chain: each developer can submit a transaction including a bug, common identification nodes in the blockchain network check the bug, and after confirmation, the bug information and the points generated by the bug information are recorded into an account book in the blockchain network, so that the developers obtain the points.
When a developer submits the requirement of a virtual test account number to the applet server, the applet server determines points required to be consumed by customizing the virtual test account number according to the requirement of the virtual test account number, inquires the score of the developer in an account book of the block chain network, if the points are enough, the applet server can initiate a transaction to the block chain network, the transaction comprises the points required to be consumed and the customized virtual test account number information, after a common identification node in the block chain network is confirmed, the transaction is recorded in the account book, deduction of the score of the developer is completed, and the applet server sends the customized virtual test account number information to an applet debugging tool.
In addition, the authentication of the real account can be realized by the way that the applet server collects the cost for customizing the virtual test account for the developer, and the developer can pass the authentication by paying the cost in a payment mode related to the real account.
It should be noted that, when the developer starts the applet debugging tool, the following parallel scheme is provided:
1) the applet debugging tool can directly present the candidate virtual test account;
2) and providing a login interface for a developer to log in by using a real account (a held client account) of the developer, wherein the login interface can be a login mode such as a code scanning mode, a voice/short message verification code, a user name + password and the like.
2. Selecting a virtual test account; the virtual test account numbers can have the same attributes and permissions (in the applet server) or can be differentiated, so that developers can flexibly select the virtual test account numbers according to the requirements of debugging projects.
3. If the real account is not used for logging in, the small program debugging tool randomly sets a main window and shares the memory with other testing windows, and the code of the item to be tested, which is submitted by the developer in the main window, is shared to other windows through the memory, so that the program can be debugged together.
4. And if the real account is used for logging in, the small program window for logging in the real account is the main window.
5. And the developer submits the applet codes to be debugged through a human-computer interaction interface of the applet debugging tool.
6. Each window outputs debugging information by interpreting and executing the code of the item to be debugged of the applet in its own browser environment (e.g., browser core, including interpreter and executor).
In summary, the embodiment of the present invention performs applet debugging through the virtual test account, and has the following beneficial effects:
the small program debugging tool can automatically acquire the virtual test account and debug the small program according to the small program window logged by the virtual test account, so that the development cost of debugging by adopting a real account is reduced, and the development efficiency is improved; by responding to the selection operation aiming at the virtual test account, selecting the virtual test account to log in the applet server, and debugging the applet according to the selected virtual test account, debugging of the applet can be carried out according to the preference of a developer to the virtual test account, and the experience of the developer is improved.
The above description is only an example of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, and improvement made within the spirit and scope of the present invention shall fall within the protection scope of the present invention.

Claims (14)

1. An applet debugging method, comprising:
the applet debugging tool obtains a virtual test account for logging in the applet server, and
presenting the virtual test account in a human-computer interaction interface of the applet debugging tool;
logging in the applet server based on each selected virtual test account in response to a selection operation for the virtual test account;
responding to an adding operation aiming at a real test account in the human-computer interaction interface, verifying the real test account, presenting the real test account in the human-computer interaction interface of the applet debugging tool when the verification is passed, and logging in the applet server based on the real test account;
displaying an applet window in a login state in the human-computer interaction interface;
responding to the debugging request aiming at the small program, running the code of the item to be debugged in each small program window, and
displaying debugging information output when the code is executed in the applet window;
and in response to the deletion operation of the real test account in the human-computer interaction interface, deleting the applet window in the login state, which displays the real test account in the human-computer interaction interface.
2. The method of claim 1, wherein the applet debugging tool obtaining a virtual test account number for logging in an applet server, comprises:
determining the number of virtual test accounts for logging in the applet server according to the running mode of the applet, and
randomly extracting the number of virtual test account numbers in the virtual test account number data set;
the operation mode comprises a single account online mode and a multi-account online mode, and the number of the virtual test accounts in the multi-account online mode is larger than that in the single account online mode.
3. The method of claim 1, wherein the applet debugging tool obtaining a virtual test account number for logging in an applet server, comprises:
acquiring a virtual test account preset in the applet debugging tool and used for logging in the applet server; alternatively, the first and second electrodes may be,
obtaining historical debugging data of the applet from an applet server, an
And determining a virtual test account for logging in the applet server according to the historical debugging data of the applet.
4. The method of claim 3, wherein determining a virtual test account number for logging into the applet server based on historical debugging data of the applet comprises at least one of:
traversing historical debugging data of the applet to obtain the debugging failure frequency of a historical virtual test account, and determining the historical virtual test account as a virtual test account for logging in the applet server when the debugging failure frequency is greater than a debugging failure threshold value;
traversing historical debugging data of the applet to obtain a first historical virtual testing account number which fails to debug and a second historical virtual testing account number which succeeds in debugging, and determining at least one first historical virtual testing account number and at least one second historical virtual testing account number as virtual testing account numbers for logging in the applet server;
and traversing the historical debugging data of the applet to obtain the times of selection of the historical virtual test account by a developer, and determining the historical virtual test account as the virtual test account for logging in the applet server when the selected times are greater than a selection threshold.
5. The method of claim 1, wherein the types of the applet windows comprise a debugging main window and a debugging sub window, and the displaying the applet window in the login state in the human-computer interaction interface comprises:
determining one randomly extracted virtual test account number in the selected virtual test account numbers as a target virtual test account number, and determining an applet window corresponding to the target virtual test account number as a debugging main window;
determining small program windows corresponding to virtual test account numbers except the target virtual test account number in the selected virtual test account numbers as debugging sub-windows;
displaying a debugging main window and a debugging sub-window in a login state in the human-computer interaction interface;
the debugging main window is used for receiving codes of the project to be debugged submitted by a developer, and sharing the codes of the project to be debugged to the debugging sub-window through the occupied memory of the debugging main window.
6. The method of any of claims 1-4, wherein prior to responding to the opt-in operation for the virtual test account, the method further comprises:
presenting a login interface in a human-computer interaction interface of the applet debugging tool;
in response to a login operation of logging in the applet server based on a real account in the login interface, logging in the applet server based on login information of the real account, and
displaying a debugging main window of the real account in a login state in the human-computer interaction interface when the login is successful;
the displaying of the applet window in the login state in the human-computer interaction interface comprises:
determining the small program window corresponding to the selected virtual test account as a debugging sub-window;
and displaying the debugging sub-window in the login state in the human-computer interaction interface.
7. The method of claim 6, wherein before logging in to the applet server based on the login information of the real account number, the method further comprises:
detecting the state of the real account based on the login information of the real account;
the logging in the applet server based on the logging in information of the real account number comprises the following steps:
and logging in the applet server based on the login information of the real account when the state of the real account is determined to be the unregistered state.
8. The method of claim 1, wherein the running code of the item to be debugged in each applet window comprises:
dividing the code of the project to be debugged into N code segments according to a plurality of breakpoints set in the code of the project to be debugged;
running the [ (1+ N// M) × (i-1) +1] code segment to the ith (1+ N// M) code segment in the ith applet window;
wherein, 0< i ≦ M ≦ N, i, M, N are positive integers, M is the total number of the small program windows, and N// M represents the integer part of N/M.
9. The method of claim 1, further comprising:
after the small program debugging tool successfully logs in the small program server based on a real account, debugging error information acquired by debugging based on the real account is sent to a block chain network so as to enable the small program debugging tool to debug and acquire
The consensus node in the block chain network verifies the debugging error information through a deployed intelligent contract;
and when the verification is passed, recording the debugging error information and the points generated corresponding to the real account number into an account book of the block chain network.
10. The method of claim 9, wherein the applet debugging tool obtaining a virtual test account number for logging in to an applet server, comprises:
after the applet debugging tool logs in the applet server based on a real account, a virtual test account request is sent to the applet server so that the applet debugging tool can log in the applet server based on the real account so as to enable the applet debugging tool to send a virtual test account request to the applet server
The small program server determines the points required to be consumed in response to the virtual test account request, deducts the points required to be consumed from the account book of the block chain network, and generates a virtual test account which can be used for logging in the small program server and meets the virtual test account request;
and receiving the virtual test account generated by the applet server.
11. The method of claim 10, wherein generating the virtual test account usable to log into the applet server and satisfy the virtual test account request comprises:
generating a virtual test account with the authority and the function according to the authority and the function included in the virtual test account request;
and recording the generated virtual test account as a logged account of the applet server.
12. An applet debugging apparatus, comprising:
the system comprises a first processing module, a second processing module and a third processing module, wherein the first processing module is used for acquiring a virtual test account for logging in an applet server by an applet debugging tool and presenting the virtual test account in a human-computer interaction interface of the applet debugging tool;
the second processing module is used for responding to the selection operation aiming at the virtual test account, logging in the applet server based on each selected virtual test account, and displaying the applet window in a logging state in the human-computer interaction interface;
the fourth processing module is used for responding to the adding operation of a real test account in the human-computer interaction interface, verifying the real test account, presenting the real test account in the human-computer interaction interface of the applet debugging tool when the verification is passed, and logging in the applet server based on the real test account;
the debugging module is used for responding to a debugging request aiming at the small program, running codes of items to be debugged in each small program window and displaying debugging information output when the codes are executed in the small program window;
the fourth processing module is further configured to delete the applet window in the login state, which displays the real test account in the human-computer interaction interface, in response to a deletion operation for the real test account in the human-computer interaction interface.
13. An applet debugging apparatus, characterized in that the apparatus comprises:
a memory for storing executable instructions;
a processor for implementing the applet debugging method of any one of claims 1 to 11 when executing the executable instructions stored in the memory.
14. A computer-readable storage medium having stored thereon executable instructions for causing a processor, when executing the computer-readable storage medium, to implement the applet debugging method as claimed in any one of claims 1 to 11.
CN201911293232.XA 2019-12-16 2019-12-16 Applet debugging method, device, equipment and storage medium Active CN111078554B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911293232.XA CN111078554B (en) 2019-12-16 2019-12-16 Applet debugging method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911293232.XA CN111078554B (en) 2019-12-16 2019-12-16 Applet debugging method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111078554A CN111078554A (en) 2020-04-28
CN111078554B true CN111078554B (en) 2022-05-27

Family

ID=70314739

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911293232.XA Active CN111078554B (en) 2019-12-16 2019-12-16 Applet debugging method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111078554B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527252B (en) * 2020-11-30 2024-01-09 北京百度网讯科技有限公司 Applet management method and device, applet platform, electronic equipment and medium
CN112528257B (en) * 2020-12-04 2023-08-01 百度在线网络技术(北京)有限公司 Secure debugging method and device, electronic equipment and storage medium
CN112799970B (en) * 2021-04-08 2021-07-06 腾讯科技(深圳)有限公司 Test data processing method, device, electronic equipment and medium
CN113505081B (en) * 2021-08-13 2024-02-23 广州博冠信息科技有限公司 Lottery program testing method and device, computer storage medium and electronic equipment
US11748236B2 (en) * 2021-09-07 2023-09-05 International Business Machines Corporation Multi-user debugging with user data isolation
CN114362966A (en) * 2022-02-28 2022-04-15 携程商旅信息服务(上海)有限公司 Pseudo test login method, system, electronic device and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102015109945A1 (en) * 2015-06-22 2016-12-22 Deutsche Telekom Ag Method and system for driving and driver data acquisition
CN108563584A (en) * 2018-05-09 2018-09-21 平安普惠企业管理有限公司 Test data generating method, device, computer equipment and storage medium
CN109117361A (en) * 2018-06-21 2019-01-01 腾讯科技(深圳)有限公司 A kind of remote debugging method of small routine, relevant device and system
CN109739770A (en) * 2019-01-04 2019-05-10 百度在线网络技术(北京)有限公司 The adjustment method and device of small routine

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102015109945A1 (en) * 2015-06-22 2016-12-22 Deutsche Telekom Ag Method and system for driving and driver data acquisition
CN108563584A (en) * 2018-05-09 2018-09-21 平安普惠企业管理有限公司 Test data generating method, device, computer equipment and storage medium
CN109117361A (en) * 2018-06-21 2019-01-01 腾讯科技(深圳)有限公司 A kind of remote debugging method of small routine, relevant device and system
CN109739770A (en) * 2019-01-04 2019-05-10 百度在线网络技术(北京)有限公司 The adjustment method and device of small routine

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
小程序开发工具如何多账号调试;趣职场;《https://jingyan.baidu.com/article/14bd256ee081d2fb6c261261.html》;20190907;第1-4页 *

Also Published As

Publication number Publication date
CN111078554A (en) 2020-04-28

Similar Documents

Publication Publication Date Title
CN111078554B (en) Applet debugging method, device, equipment and storage medium
CN105849691B (en) The method and apparatus generated for code virtualization and remote process call
CN104363264B (en) The SDK access systems by all kinds of means of mobile terminal software
US8515876B2 (en) Dry-run design time environment
US20180276111A1 (en) Mock services for software infrastructures
US20220050769A1 (en) Program testing method and apparatus, computer device, and storage medium
Lou A comparison of Android native app architecture MVC, MVP and MVVM
CN106326113B (en) A kind of game data monitoring method and device
Amalfitano et al. Testing android mobile applications: Challenges, strategies, and approaches
US20200201689A1 (en) System and method for determining a process flow of a software application and for automatically generating application testing code
CN105765527A (en) Method and apparatus for custom software development kit (SDK) generation
US11200155B2 (en) System and method for automated application testing
US11726897B2 (en) System and method for testing applications
CN109348472A (en) A kind of OTA upgrade method and system based on single-point push
CN116521509A (en) Intelligent contract testing method, device, equipment, storage medium and product
CN116212398B (en) Game management method, device, equipment and medium based on data center
CN109634865A (en) A kind of code turns to survey method, apparatus and turns to survey terminal
Mahmood An evolutionary approach for system testing of android applications
Tilley et al. Testing IOS Apps with HadoopUnit: Rapid Distributed GUI Testing
CA3077762C (en) System and method for automated application testing
CN114816970A (en) Applet testing method and device, electronic equipment and storage medium
Ascate et al. Mobile App Testing: Tools, Frameworks, and Challenges
CN115237793A (en) Application development system and method and application development response method
de Andrade Freitas et al. Mobile App Testing
Sengelmann An Overview of Reverse Engineering and A Security Analysis of TikTok

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40022536

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant