CN112860566B - Applet detection method, device, electronic equipment and readable medium - Google Patents

Applet detection method, device, electronic equipment and readable medium Download PDF

Info

Publication number
CN112860566B
CN112860566B CN202110232141.6A CN202110232141A CN112860566B CN 112860566 B CN112860566 B CN 112860566B CN 202110232141 A CN202110232141 A CN 202110232141A CN 112860566 B CN112860566 B CN 112860566B
Authority
CN
China
Prior art keywords
applet
detection value
value
host program
page
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
CN202110232141.6A
Other languages
Chinese (zh)
Other versions
CN112860566A (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202110232141.6A priority Critical patent/CN112860566B/en
Publication of CN112860566A publication Critical patent/CN112860566A/en
Application granted granted Critical
Publication of CN112860566B publication Critical patent/CN112860566B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The disclosure provides an applet detection method, an applet detection device, an electronic device and a readable storage medium, and relates to the technical field of computers, in particular to cloud computing and cloud platform technology. The method comprises the following steps: receiving a code packet of an applet; acquiring one or more pages contained in the applet based on the code package; acquiring a loading result value for each page based on the content loading condition of each page in one or more pages in a first preset time period; acquiring a first detection value based on a loading result value of each page; and based on the first detection value, acquiring a final detection value of the applet.

Description

Applet detection method, device, electronic equipment and readable medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a cloud computing and cloud platform technology, and in particular, to an applet detection method, apparatus, electronic device, computer readable storage medium and computer program product.
Background
With the development of internet technology, various application programs are put into daily life. As an application which can be used without downloading and installing, the applet is widely popular with users once being pushed out, and a large number of developers are attracted to realize various business functions on various application program platforms by taking the applet as a carrier.
With the updating and development of technology, new applets are continuously appeared, and online applets are updated and iterated very frequently. Under the background of online and increasingly frequent iteration of a large number of applets, an audit platform is required to rapidly and accurately detect the functions and the quality of the applets, and provide high-quality, abundant and various applet products for end users.
Disclosure of Invention
The present disclosure provides an applet detection method, apparatus, electronic device, computer readable storage medium and computer program product.
According to an aspect of the present disclosure, there is provided an applet detection method including: receiving a code packet of an applet; acquiring one or more pages contained in the applet based on the code package; acquiring a loading result value for each page based on the content loading condition of each page in one or more pages in a first preset time period; acquiring a first detection value based on a loading result value of each page; and based on the first detection value, acquiring a final detection value of the applet.
According to another aspect of the present disclosure, there is provided an applet detection apparatus, comprising: a receiving unit configured to receive a code packet of an applet; a first acquisition unit configured to acquire one or more pages included in the applet based on the code packet; the second acquisition unit is configured to acquire a loading result value for each page based on the content loading condition of each page in one or more pages in a first preset time period; and a third acquisition unit configured to acquire a first detection value based on the loading result value of each page, and acquire a final detection value of the applet based on the first detection value.
According to another aspect of the present disclosure, there is provided an electronic apparatus including: at least one processor; and a memory communicatively coupled to the at least one processor. The memory stores a computer program executable by the at least one processor for causing the electronic device to perform a method according to embodiments of the present disclosure when executed by the at least one processor.
According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is for causing the computer to perform a method according to an embodiment of the present disclosure.
According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program, wherein the computer program, when executed by a processor of a computer, is for causing the computer to perform a method according to an embodiment of the present disclosure.
According to one or more embodiments of the present disclosure, the applet quality detection efficiency may be improved, saving operational labor costs.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The accompanying drawings illustrate exemplary embodiments and, together with the description, serve to explain exemplary implementations of the embodiments. The illustrated embodiments are for exemplary purposes only and do not limit the scope of the claims. Throughout the drawings, identical reference numerals designate similar, but not necessarily identical, elements.
FIG. 1 is a schematic diagram illustrating an exemplary system in which various methods described herein may be implemented, according to an embodiment of the present disclosure;
FIG. 2 is a flowchart illustrating an applet detection method according to some exemplary embodiments of the disclosure;
FIG. 3 is a schematic diagram illustrating the success of page content loading according to some exemplary embodiments of the present disclosure;
FIG. 4 is a schematic diagram illustrating page content loading failure according to some exemplary embodiments of the present disclosure;
FIG. 5 is a flowchart illustrating an applet detection method according to further exemplary embodiments of the present disclosure;
FIG. 6 is a flowchart illustrating an applet detection method according to further exemplary embodiments of the present disclosure;
FIG. 7 is a block diagram illustrating the construction of an applet detection apparatus according to some exemplary embodiments of the disclosure;
Fig. 8 illustrates a block diagram of an exemplary electronic device that can be used to implement embodiments of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In the present disclosure, the use of the terms "first," "second," and the like to describe various elements is not intended to limit the positional relationship, timing relationship, or importance relationship of the elements, unless otherwise indicated, and such terms are merely used to distinguish one element from another. In some examples, a first element and a second element may refer to the same instance of the element, and in some cases, they may also refer to different instances based on the description of the context.
The terminology used in the description of the various illustrated examples in this disclosure is for the purpose of describing particular examples only and is not intended to be limiting. Unless the context clearly indicates otherwise, the elements may be one or more if the number of the elements is not specifically limited. Furthermore, the term "and/or" as used in this disclosure encompasses any and all possible combinations of the listed items.
The applet is a cloud application which can be developed based on a specific programming language and used without downloading or installing the applet. Before the applet is developed to be run on line, the applet mainly comprises the following procedures: the method comprises the steps that an applet developer develops an applet, the applet developer detects the developed applet, after the test is passed, the applet developer submits a code package of the applet to an auditing platform, the auditing platform audits the content and the function of the applet, and after the auditing is passed, the applet developer is informed of issuing the applet on line.
In the related art, the auditing of the auditing platform mainly comprises two modes of manual auditing and online inspection. Manual auditing is generally performed by operators using test mobile phones to scan codes and manually check problems. The online inspection is generally to traverse online applets through inspection or crawler programs according to a certain rule to acquire content information of the applets. However, the manual auditing method is low in efficiency and high in cost, and is difficult to deal with high-frequency and large-batch applet iteration online auditing. In addition, the online inspection is more lagged, and inspection of general product functions and illegal display contents is mainly performed, so that personalized function detection for specific small programs cannot be realized. In this regard, the present disclosure provides an applet detection method that detects submitted code packages before the code packages of the applet are submitted to an audit platform for manual audit. Therefore, the quality detection efficiency of the small program is improved, the operation labor cost is saved, and the influence caused by the functional defects and poor use experience of the small program is reduced.
Embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
Fig. 1 illustrates a schematic diagram of an exemplary system 100 in which various methods and apparatus described herein may be implemented, in accordance with an embodiment of the present disclosure. Referring to fig. 1, the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. Client devices 101, 102, 103, 104, 105, and 106 may be configured to execute one or more applications.
In embodiments of the present disclosure, the server 120 may run one or more services or software applications that enable execution of the applet detection methods of embodiments of the present disclosure.
In some embodiments, server 120 may also provide other services or software applications that may include non-virtual environments and virtual environments. In some embodiments, these services may be provided as web-based services or cloud services, for example, provided to users of client devices 101, 102, 103, 104, 105, and/or 106 under a software as a service (SaaS) model.
In the configuration shown in fig. 1, server 120 may include one or more components that implement the functions performed by server 120. These components may include software components, hardware components, or a combination thereof that are executable by one or more processors. A user operating client devices 101, 102, 103, 104, 105, and/or 106 may in turn utilize one or more client applications to interact with server 120 to utilize the services provided by these components. It should be appreciated that a variety of different system configurations are possible, which may differ from system 100. Accordingly, FIG. 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.
The client device may provide an interface that enables a user of the client device to interact with the client device. The client device may also output information to the user via the interface. Although fig. 1 depicts only six client devices, those skilled in the art will appreciate that the present disclosure may support any number of client devices.
Client devices 101, 102, 103, 104, 105, and/or 106 may include various types of computer devices, such as portable handheld devices, general purpose computers (such as personal computers and laptop computers), workstation computers, wearable devices, gaming systems, thin clients, various messaging devices, sensors or other sensing devices, and the like. These computer devices may run various types and versions of software applications and operating systems, such as Microsoft Windows, apple iOS, UNIX-like operating systems, linux, or Linux-like operating systems (e.g., google Chrome OS); or include various mobile operating systems such as Microsoft Windows Mobile OS, iOS, windows Phone, android. Portable handheld devices may include cellular telephones, smart phones, tablet computers, personal Digital Assistants (PDAs), and the like. Wearable devices may include head mounted displays and other devices. The gaming system may include various handheld gaming devices, internet-enabled gaming devices, and the like. The client device is capable of executing a variety of different applications, such as various Internet-related applications, communication applications (e.g., email applications), short Message Service (SMS) applications, and may use a variety of communication protocols.
Network 110 may be any type of network known to those skilled in the art that may support data communications using any of a number of available protocols, including but not limited to TCP/IP, SNA, IPX, etc. For example only, the one or more networks 110 may be a Local Area Network (LAN), an ethernet-based network, a token ring, a Wide Area Network (WAN), the internet, a virtual network, a Virtual Private Network (VPN), an intranet, an extranet, a Public Switched Telephone Network (PSTN), an infrared network, a wireless network (e.g., bluetooth, WIFI), and/or any combination of these and/or other networks.
The server 120 may include one or more general purpose computers, special purpose server computers (e.g., PC (personal computer) servers, UNIX servers, mid-end servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and/or combination. The server 120 may include one or more virtual machines running a virtual operating system, or other computing architecture that involves virtualization (e.g., one or more flexible pools of logical storage devices that may be virtualized to maintain virtual storage devices of the server). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.
The computing units in server 120 may run one or more operating systems including any of the operating systems described above as well as any commercially available server operating systems. Server 120 may also run any of a variety of additional server applications and/or middle tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.
In some implementations, server 120 may include one or more applications to analyze and consolidate data feeds and/or event updates received from users of client devices 101, 102, 103, 104, 105, and 106. Server 120 may also include one or more applications to display data feeds and/or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and 106.
In some implementations, the server 120 may be a server of a distributed system or a server that incorporates a blockchain. The server 120 may also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. The cloud server is a host product in a cloud computing service system, so as to solve the defects of large management difficulty and weak service expansibility in the traditional physical host and Virtual special server (VPS PRIVATE SERVER) service.
The system 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of databases 130 may be used to store information such as audio files and video files. The data store 130 may reside in a variety of locations. For example, the data store used by the server 120 may be local to the server 120, or may be remote from the server 120 and may communicate with the server 120 via a network-based or dedicated connection. The data store 130 may be of different types. In some embodiments, the data store used by server 120 may be a database, such as a relational database. One or more of these databases may store, update, and retrieve the databases and data from the databases in response to the commands.
In some embodiments, one or more of databases 130 may also be used by applications to store application data. The databases used by the application may be different types of databases, such as key value stores, object stores, or conventional stores supported by the file system.
The system 100 of fig. 1 may be configured and operated in various ways to enable application of the various methods and apparatus described in accordance with the present disclosure.
Fig. 2 is a flowchart illustrating an applet detection method 200 according to some exemplary embodiments of the disclosure. The method 200 may be performed at a client device (e.g., any of the client devices 101-106 shown in fig. 1). In some embodiments, the method 200 may be performed at a server (e.g., the server 120 shown in fig. 1). In other embodiments, method 200 may be performed by a client device (e.g., any of client devices 101-106) in combination with a server (e.g., server 120). The method 200 may be applied in the online phase of a new applet to detect the first submitted applet code package. The method 200 may also be applied in the update phase of an online applet, detecting a submitted code package for updating the applet.
As shown in fig. 2, the method 200 may include: receiving a code packet of an applet (step 201); acquiring one or more pages contained in the applet based on the code package (step 201); acquiring a loading result value for each page based on the content loading condition of each page in the one or more pages within a first preset time period (step 203); acquiring a first detection value based on the loading result value of each page (step 204); and based on the first detection value, obtaining a final detection value of the applet (step 205). Therefore, the quality detection efficiency of the applet can be improved and the operation labor cost can be saved by detecting the page loading condition of the applet before the code package of the applet is submitted to the auditing platform for manual auditing. Meanwhile, by detecting the page loading condition of the applet, whether the applet successfully loads all or part of elements in the page in a preset time is determined, and the problem of poor user experience caused by slow page loading or loading failure after the applet is online can be avoided.
In some embodiments, the first preset time period may be determined according to practical circumstances, such as 4-6 seconds, which is not limited by the present disclosure. Illustratively, the content loading condition may include success or failure of the page content loading. The page content loading failure may be, for example, that the page content is not loaded out within a specified time, or that information such as loading failure or system error is displayed on the page.
In some examples, when detecting the content loading condition of the page, one or more detection lines may be preset, and from the time of clicking the applet icon to trigger the page loading, the positions corresponding to the one or more detection lines respectively are detected. It may be detected whether the page of the applet has loaded all elements or content in the page within a first preset time. In other examples, it may also be detected whether the page of the applet has loaded preset elements or content (e.g., key elements or content) in the page within a first preset time. For example, if the position and the cross characteristic of the preset element (for example, the number of the cross points between the detection line and the preset element when the page loading is successful) are indicated in the code packet of the applet, the page loading condition of the applet can be detected according to the position and the cross characteristic of the preset element.
The loading process of a page may generally include, for example, a page skeleton loading phase, a page rendering phase, a page loading success or a page loading failure. In the skeleton loading stage, the page background is single, and the cross points between the detection lines and the page elements are fewer. In the page element rendering stage, the effective elements are not loaded successfully, and no cross point exists. If the page is loaded successfully, the page elements are rich, the content is more, and the cross points are dense. If the page loading fails, the page may stay in the skeleton loading stage, the page content is simple, the cross point between the detection line and the page element is few or no, or the page displays information such as loading failure or system error.
FIG. 3 is a schematic diagram 300 showing the success of a page content load, according to some exemplary embodiments of the present disclosure, as a cross point 302 occurs between a detection line 301 and a page element, a page element 303 is loaded, then a page element 304 and a page element 305 are also loaded, and the page load is successful. Fig. 4 is a schematic diagram 400 illustrating a page content loading failure according to some exemplary embodiments of the present disclosure, with the loading of a page, a cross point 402 occurs between a detection line 401 and a page element, but no page element is loaded, and finally, a "loading failure" message occurs in the page, and the page loading fails. Fig. 3 and 4 are merely exemplary, showing one detection line, and in other examples, a plurality of detection lines may be provided, which is not limited in this disclosure.
In some embodiments, the first detection value may be expressed as:
Wherein S 1 represents a first detection value, m represents the number of pages contained in the applet, p i represents a loading result value of the ith page, x i represents the number of times the ith page is requested in a second preset time period, and t i represents the average stay time of the ith page in the second preset time period. The second preset period may be set according to actual conditions, for example, the second preset period may be 30 days or the like.
For each page of one or more pages contained in the applet, the page can be detected, and a loading result value of the page can be obtained based on the content loading condition of the page in a first preset time period. Illustratively, the load result value may be set to, for example, 1, -1, or 0. For example, when the page is loaded successfully within the first preset time period, the loading result value may be 1. When the page fails to be loaded within the first preset time period, the loading result value can be-1. When the page is not configured, the load result value may be 0.
The normal operation of the applet depends on some functions of the host program, as well as some external server interfaces of the applet, in addition to the coding quality of the applet itself. A host program refers to a local application, also called a third party application, capable of carrying applet operations. The host program provides the correspondence and components and environment for the execution of the applet. The external server interface refers to an interface for providing dynamic data required by the applet. For example, for an e-commerce applet, it may obtain merchandise data, merchandise price data, etc. from a related server through an external server interface. In some embodiments, the methods of the present disclosure also detect the host program function and/or external server interface of the applet.
Fig. 5 is a flowchart illustrating an applet detection method 500 according to an exemplary embodiment of the disclosure. As shown in fig. 5, method 500 may include the following steps.
In step 501, a code packet for an applet is received.
In step 502, based on the code package, one or more pages included in the applet, one or more host program functions used by the applet, and one or more external server side interfaces included in the applet are obtained.
In some embodiments, one or more pages contained by the applet, one or more host program functions used by the applet, and one or more external server side interfaces contained by the applet may be obtained in a variety of ways. In some examples, after receiving a code package for an applet, it may be pre-determined whether the code package is submitted for the first time. In response to determining that the code package of the applet is the first submission, the code package may be source scanned to obtain one or more pages contained by the applet, one or more host program functions used by the applet, and one or more external server interfaces contained by the applet. For example, the relevant program in the code package may be compared to, for example, a function interface API presented in an official developer document of the host program, so that the host program function used by the applet may be determined. For example, the use of the function interface function_1 in the code package of the applet, which function is used for the payment function in the official developer document of the applet's host program, can determine that the applet uses the payment function of the host program, and that the applet has payment capabilities.
In some examples, in response to determining that the code package of the applet is not first submitted, a log of use of the applet may be obtained, which is analyzed to obtain one or more pages contained by the applet, one or more host program functions used by the applet, and one or more external server interfaces contained by the applet. In the case where the code package of the applet is not submitted for the first time, the applet may be considered to be online. During the user's use of the product functionality of the online applet, a corresponding usage log is generated. For example, by analyzing the usage log, knowing that the user frequently clicks on the order function of the applet, triggering the order and payment capabilities provided by the host program, it can be determined that the applet is using the order and payment functions of the host program. For another example, when the information applet is opened, the applet is frequently forwarded by the host program to request the data interface under a certain external domain name to display the content, so that the data interface can be determined to be an external server interface of the applet. For another example, by analyzing the usage log, pages frequently presented by the applet can also be obtained, thereby determining the pages used by the applet.
In other examples, the applet developer may also directly identify the applet's related functions in the code package (e.g., the applet's included pages and external server side interfaces, or the applet's used host functions), through which the applet's related functions may be directly obtained. The present disclosure is not limited in the manner in which the related functionality of the applet is obtained.
In step 503, the one or more pages are detected, and a first detection value is obtained.
In step 504, the one or more host program functions are detected, and a second detection value is obtained.
In step 505, the one or more external service interfaces are detected, and a third detection value is obtained.
In step 506, a final test value for the applet is obtained based on the first test value, the second test value, and the third test value.
Therefore, before the auditing platform carries out manual auditing on the code package of the applet, the detection efficiency of the applet can be improved, the labor cost can be saved, and the quality of the applet can be improved simultaneously through the multi-aspect detection on the pages of the applet, the host program function and the external server interface.
In some embodiments, each of one or more host program functions used by the applet may be detected to obtain a first determination value for the host program function, and a second detection value may be obtained based on the first determination value for each host program function.
In some embodiments, detecting the host program function, obtaining the first determination value of the host program function may include: acquiring a version of a host program on which the applet depends; and acquiring a first judgment value of the host program function based on the matching condition between the host program function and the version of the host program.
Illustratively, the version of the host program may be the SDK version number of the host program. As technology advances, the version of the host program on which the applet depends will also continually update the iterations, as will the functionality supported by the host program for each version. Typically, higher versions of host programs will support more functions than lower versions of host programs. For example, for applet a, it is necessary to use a payment function that needs to run in a host program (e.g., third party application B) of more than 3.0 versions.
After receiving the code package submitted by the applet developer, it can be determined whether the functions used by the applet match the current version of the host program. By detecting the host program functions, whether the host program functions used by the applet are matched with the versions of the host program on which the current applet depends or not can be determined, and therefore the problem that when the applet is operated in some hosts with unmatched versions, for example, some functions cannot be used can be avoided.
In some embodiments, the second detection value may be expressed as:
Wherein S 2 represents the second detection value, k represents the number of host program functions used by the applet, k is a positive integer, w i represents the weight of the ith host program function, and f i represents the first judgment value of the ith host program function.
The first determination value may be set to, for example, 1 or-1. For each host program function, whether the host program function is matched with the version of the host program on which the applet depends or not can be judged, and a first judgment value of the host program function is obtained according to the matching condition. For example, the first determination value may be 1 when the host program function matches the version of the host program on which the applet depends, and-1 when the host program function does not match the version of the host program on which the applet depends. The weight of the host program function may be set according to the importance level of the host program function. For example, a weight of 1 may be set for a general host program function, and a weight of greater than 1, e.g., 4-5, etc., may be set for an important host program function (e.g., a payment function, etc.).
In some embodiments, for each external server interface of the one or more external server interfaces, an expected return value of the external server interface may be obtained, and the external server interface may be detected, to obtain a detected return value of the external server interface.
In some embodiments, for each external server interface of the one or more external server interfaces, a second determination value of the external server interface may be obtained based on a match between an expected return value and a detected return value of the external server interface, and a third detection value may be obtained based on the second determination value of each external server interface.
Therefore, by detecting the external service end interface, whether the external service end interface is available, whether the return value accords with the expectation, whether the return value changes or not or the like is detected, the problems that content recording fails and the like are caused by the fact that a certain external service end interface is unavailable in the process of using the applet can be avoided, and the quality of the applet is improved.
Usually, the code package of the applet is preconfigured with a test case for each external server interface, and the external server interface can be detected by the test case. For example, upon detection of external server interface a, the external test server address, the request path and request parameters of external server interface a, the expected return value (or expected return value format) of external server interface a may be obtained. And then, detecting the external server interface A according to the external test server address, the request path and the request parameter of the external server interface A and the expected return value of the external server interface A. The request path and request parameters of the external server interface a may be obtained from a code package of the applet or from a log of use of the applet, for example.
In some embodiments, the third detection value may be expressed as:
Wherein S 3 represents a third detection value, n represents the number of external service interfaces included in the applet, d i represents a second determination value of the ith external service interface, and v i represents the number of times the ith external service interface is requested in a third preset time period. The third preset period may be set according to actual conditions, for example, the third preset period may be 30 days or the like.
The second judgment value may be set to 1, -1 or 0, for example. The second judgment value can be obtained according to the matching condition between the expected return value and the detection return value of the external server interface. For example, the second determination value may be 1 when the expected return value of the external server interface matches the detected return value. When the expected return value of the external server interface does not match the detected return value, the second determination value may be-1. When the external server interface is not configured, the second judgment value may be 0.
In some embodiments, the final detection value may be a linear function of the first detection value, the second detection value, and the third detection value. In some examples, the linear function of the first, second, and third detection values may be:
S=α1S12S23S3
Wherein S represents a final detection value, S 1 represents a first detection value, S 2 represents a second detection value, S 3 represents a third detection value, α 1 is a weight of S 1, α 2 is a weight of S 2, and α 3 is a weight of S 3. The value of the weight may be set according to the importance degree of each detection value. For example, α 123 =100 can be generally set.
The corresponding processing can be performed on the code package of the applet according to the final detection value of the applet. In some embodiments, the methods of the present disclosure may further comprise: responding to the fact that the final detection value is not smaller than a preset threshold value, and submitting the code package to a third party auditing platform; and returning the code packet to the code packet submitter in response to determining that the final detection value is less than the preset threshold. Thereby, the quality of the applet can be improved.
Fig. 6 is a flowchart illustrating an applet detection method 600 according to further exemplary embodiments of the present disclosure. As shown in fig. 6, method 600 may include steps 601-611.
In step 601, a code package submitted by an applet developer is received.
In step 602, the host program function used by the applet and the SDK version of the host program on which the applet depends are detected to determine whether the host program function used by the applet and the SDK version of the host program match.
In step 603, it is determined whether the code package of the applet is submitted for the first time, if so, step 604 is performed, otherwise, step 605 is performed.
In step 604, the functionality of the applet in the code package is obtained.
In step 605, the applet in-line existing functionality is obtained.
At step 606, an external server interface is detected.
In step 607, the page load expectation of the applet is detected.
In step 608, the functional quality of the applet is evaluated.
In step 609, it is determined whether the functional quality of the applet meets expectations, if so, step 610 is performed, otherwise, step 611 is performed.
At step 610, the code package is submitted to an audit platform.
In step 611, the code package is returned to the applet developer.
Therefore, the detection efficiency of the applet can be improved, the labor cost can be saved, and the quality of the applet can be improved through the multi-aspect detection of the pages, the host program function and the external server interface of the applet.
The method according to the exemplary embodiments of the present disclosure is described above. Although the operations are depicted in the drawings in a particular order, this should not be understood as requiring that the operations be performed in the particular order shown or in sequential order, nor should it be understood that all illustrated operations must be performed in order to achieve desirable results.
An applet detecting apparatus according to an exemplary embodiment of the present disclosure is described below. Fig. 7 shows a block diagram of the configuration of an applet detection apparatus 700 according to an embodiment of the disclosure. As shown in fig. 7, the apparatus 700 includes a receiving unit 701, a first acquiring unit 702, a second acquiring unit 703, and a third acquiring unit 704.
The receiving unit 701 is configured to receive a code packet of an applet.
The first acquisition unit 702 is configured to acquire one or more pages included in the applet based on the code package.
The second obtaining unit 703 is configured to obtain a loading result value for each page based on the content loading condition of each page in the one or more pages within the first preset period.
The third acquisition unit 704 is configured to acquire a first detection value based on the loading result value of each page, and acquire a final detection value of the applet based on the first detection value.
In some examples, the operations of the receiving unit 701, the first acquisition unit 702, the second acquisition unit 703 and the third acquisition unit 704 correspond to steps 201-205, respectively, of the method 200 described above with respect to fig. 2, and thus are not described in detail herein.
Although specific functions are discussed above with reference to specific modules, it should be noted that the functions of the various modules discussed herein may be divided into multiple modules and/or at least some of the functions of the multiple modules may be combined into a single module. The particular module performing the action discussed herein includes the particular module itself performing the action, or alternatively the particular module invoking or otherwise accessing another component or module performing the action (or performing the action in conjunction with the particular module). Thus, a particular module that performs an action may include that particular module itself that performs the action and/or another module that the particular module invokes or otherwise accesses that performs the action.
The exemplary embodiments of the present disclosure also provide an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor. The memory stores a computer program executable by the at least one processor for causing the electronic device to perform a method according to embodiments of the present disclosure when executed by the at least one processor.
The present disclosure also provides a non-transitory computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is for causing the computer to perform a method according to an embodiment of the present disclosure.
The present disclosure also provides a computer program product comprising a computer program, wherein the computer program, when executed by a processor of a computer, is for causing the computer to perform a method according to embodiments of the disclosure.
Referring to fig. 8, a block diagram of an electronic device 800 that may be a server or a client of the present disclosure, which is an example of a hardware device that may be applied to aspects of the present disclosure, will now be described. Electronic devices are intended to represent various forms of digital electronic computer devices, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 8, the apparatus 800 includes a computing unit 801 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 802 or a computer program loaded from a storage unit 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to the bus 804.
Various components in device 800 are connected to I/O interface 805, including: an input unit 806, an output unit 807, a storage unit 808, and a communication unit 809. The input unit 806 may be any type of device capable of inputting information to the device 800, the input unit 806 may receive input numeric or character information and generate key signal inputs related to user settings and/or function control of the electronic device, and may include, but is not limited to, a mouse, a keyboard, a touch screen, a trackpad, a trackball, a joystick, a microphone, and/or a remote control. The output unit 807 may be any type of device capable of presenting information and may include, but is not limited to, a display, speakers, video/audio output terminals, vibrators, and/or printers. The storage unit 808 may include, but is not limited to, magnetic disks, optical disks. The communication unit 809 allows the device 800 to exchange information/data with other devices over computer networks, such as the internet, and/or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers and/or chipsets, such as bluetooth (TM) devices, 1302.11 devices, wiFi devices, wiMax devices, cellular communication devices, and/or the like.
The computing unit 801 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 801 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as methods 200,500, and 600. For example, in some embodiments, the methods 200,500, and 600 may be implemented as computer software programs tangibly embodied on a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 800 via ROM 802 and/or communication unit 809. One or more of the steps of the methods 200,500, and 600 described above may be performed when a computer program is loaded into RAM 803 and executed by computing unit 801. Alternatively, in other embodiments, computing unit 801 may be configured to perform methods 200,500, and 600 by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel, sequentially or in a different order, provided that the desired results of the disclosed aspects are achieved, and are not limited herein.
Although embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it is to be understood that the foregoing methods, systems, and apparatus are merely exemplary embodiments or examples, and that the scope of the present invention is not limited by these embodiments or examples but only by the claims following the grant and their equivalents. Various elements of the embodiments or examples may be omitted or replaced with equivalent elements thereof. Furthermore, the steps may be performed in a different order than described in the present disclosure. Further, various elements of the embodiments or examples may be combined in various ways. It is important that as technology evolves, many of the elements described herein may be replaced by equivalent elements that appear after the disclosure.

Claims (18)

1. A method of applet detection, comprising:
Receiving a code packet of the applet;
Based on the code package, acquiring one or more pages contained in the applet;
Acquiring a loading result value for each page based on the content loading condition of each page in the one or more pages in a first preset time period;
based on the loading result value of each page, a first detection value is obtained, wherein the first detection value is as follows:
Wherein S 1 represents the first detection value, m represents the number of pages contained in the applet, p i represents the loading result value of the ith page, x i represents the number of times the ith page is requested in a second preset time period, and t i represents the average residence time of the ith page in the second preset time period; and
And acquiring a final detection value of the applet based on the first detection value.
2. The method of claim 1, further comprising:
Based on the code package, acquiring one or more host program functions used by the applet and one or more external server interfaces contained in the applet;
Detecting the one or more host program functions to obtain a second detection value; and
And detecting the one or more external server interfaces to obtain a third detection value.
3. The method of claim 2, wherein obtaining the final detection value of the applet based on the first detection value comprises:
and acquiring a final detection value of the applet based on the first detection value, the second detection value and the third detection value.
4. The method of claim 2, wherein detecting the one or more host program functions, obtaining the second detection value comprises:
Detecting the host program function aiming at each host program function in the one or more host program functions to acquire a first judgment value of the host program function; and
The second detection value is obtained based on the first judgment value of each host program function.
5. The method of claim 4, wherein detecting each of the one or more host program functions for the host program function, obtaining a first determination value for the host program function comprises:
Acquiring the version of the host program on which the applet depends; and
And acquiring a first judgment value of the host program function based on the matching condition between the host program function and the version of the host program.
6. The method of claim 2, wherein detecting the one or more external server interfaces, obtaining the third detection value comprises:
For each external server interface in one or more external server interfaces, acquiring a second judgment value of the external server interface based on the matching condition between the expected return value and the detection return value of the external server interface; and
And acquiring the third detection value based on the second judgment value of each external server interface.
7. The method of claim 6, wherein before obtaining the second determination value of the external server interface based on a match between the expected return value and the detected return value of the external server interface, the method further comprises:
for each external server interface in one or more external server interfaces, acquiring an expected return value of the external server interface; and
And detecting each external server interface to obtain a detection return value of the external server interface.
8. The method of any of claims 1-7, wherein, based on the code package, obtaining one or more pages contained by the applet comprises:
In response to determining that the code package is submitted for the first time, source code scanning is performed on the code package to obtain the one or more pages contained by the applet; and
In response to determining that the code package is not first committed, a usage log of the applet is obtained and the usage log is analyzed to obtain the one or more pages contained by the applet.
9. The method of any of claims 2-7, wherein obtaining the one or more host program functions used by the applet and the one or more external service interfaces included by the applet based on the code packet comprises:
in response to determining that the code package is a first commit, source code scanning the code package to obtain the one or more host program functions used by the applet; and
In response to determining that the code package is not submitted for the first time, a usage log of the applet is obtained and the usage log is analyzed to obtain the one or more host program functions used by the applet.
10. The method of any of claims 2-7, wherein obtaining the one or more host program functions used by the applet and the one or more external service interfaces included by the applet based on the code packet comprises:
In response to determining that the code package is submitted for the first time, performing source code scanning on the code package to acquire the one or more external server interfaces contained in the applet; and
In response to determining that the code package is not submitted for the first time, a usage log of the applet is obtained and the usage log is analyzed to obtain the one or more external server interfaces contained by the applet.
11. The method of any of claims 4-5, wherein the second detection value is expressed as:
Wherein S 2 represents the second detection value, k represents the number of host program functions used by the applet, k is a positive integer, w i represents the weight of the ith host program function, and f i represents the first judgment value of the ith host program function.
12. The method of any of claims 6-7, wherein the third detection value is expressed as:
Wherein S 3 represents the third detection value, n represents the number of external service interfaces included in the applet, d i represents the second determination value of the i-th external service interface, and v i represents the number of times the i-th external service interface is requested in a third preset time period.
13. The method of any of claims 3-7, wherein the final detection value is a linear function of the first detection value, the second detection value, and the third detection value, and wherein,
The linear function is:
Wherein S represents the final detection value, S 1 represents the first detection value, S 2 represents the second detection value, S 3 represents the third detection value, α 1 is the weight of S 1, α 2 is the weight of S 2, and α 3 is the weight of S 3.
14. The method of any of claims 1-7, further comprising:
Submitting the code packet to a third party audit platform in response to determining that the final detection value is not less than a preset threshold; and
And returning the code packet to a code packet submitter in response to determining that the final detection value is less than the preset threshold.
15. An applet detection apparatus comprising:
a receiving unit configured to receive a code packet of the applet;
a first acquiring unit configured to acquire one or more pages included in the applet based on the code packet;
the second acquisition unit is configured to acquire a loading result value for each page based on the content loading condition of each page in the one or more pages in a first preset time period; and
A third obtaining unit configured to obtain a first detection value based on the loading result value of each page, and obtain a final detection value of the applet based on the first detection value, where the first detection value is:
Wherein S 1 represents the first detection value, m represents the number of pages contained in the applet, p i represents the loading result value of the ith page, x i represents the number of times the ith page is requested in a second preset time period, and t i represents the average residence time of the ith page in the second preset time period.
16. An electronic device, comprising:
at least one processor; and
A memory communicatively coupled to the at least one processor; wherein the method comprises the steps of
The memory stores a computer program executable by the at least one processor for causing the electronic device to perform the method according to any one of claims 1-14 when executed by the at least one processor.
17. A non-transitory computer readable storage medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is for causing the computer to perform the method according to any one of claims 1-14.
18. A computer program product comprising a computer program, wherein the computer program, when executed by a processor of a computer, is for causing the computer to perform the method according to any one of claims 1-14.
CN202110232141.6A 2021-03-02 2021-03-02 Applet detection method, device, electronic equipment and readable medium Active CN112860566B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110232141.6A CN112860566B (en) 2021-03-02 2021-03-02 Applet detection method, device, electronic equipment and readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110232141.6A CN112860566B (en) 2021-03-02 2021-03-02 Applet detection method, device, electronic equipment and readable medium

Publications (2)

Publication Number Publication Date
CN112860566A CN112860566A (en) 2021-05-28
CN112860566B true CN112860566B (en) 2024-04-30

Family

ID=75991031

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110232141.6A Active CN112860566B (en) 2021-03-02 2021-03-02 Applet detection method, device, electronic equipment and readable medium

Country Status (1)

Country Link
CN (1) CN112860566B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113326539B (en) * 2021-06-23 2022-05-17 支付宝(杭州)信息技术有限公司 Method, device and system for private data leakage detection aiming at applet
CN114020992B (en) * 2021-11-09 2022-10-14 北京百度网讯科技有限公司 Page blocking method, device, system, client and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110750463A (en) * 2019-10-29 2020-02-04 百度在线网络技术(北京)有限公司 Applet testing method, device, system, equipment and medium
CN110851366A (en) * 2019-11-18 2020-02-28 中国银行股份有限公司 Method and device for realizing regression test
CN111400722A (en) * 2020-03-25 2020-07-10 深圳市腾讯网域计算机网络有限公司 Method, apparatus, computer device and storage medium for scanning small program
CN111400705A (en) * 2020-03-04 2020-07-10 支付宝(杭州)信息技术有限公司 Application program detection method, device and equipment
CN111597114A (en) * 2020-05-18 2020-08-28 北京百度网讯科技有限公司 Method, device and equipment for verifying small program and storage medium
CN111597113A (en) * 2020-05-18 2020-08-28 北京百度网讯科技有限公司 Method, device and equipment for verifying small program and storage medium
CN112052185A (en) * 2020-09-29 2020-12-08 北京百度网讯科技有限公司 Applet exception handling method and device, electronic device and storage medium
CN112269666A (en) * 2020-11-10 2021-01-26 北京百度网讯科技有限公司 Applet dead link detection method and device, computing device and medium
CN112364266A (en) * 2020-11-11 2021-02-12 平安科技(深圳)有限公司 Seamless navigation method, device, electronic equipment and medium for applet and host application

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10621075B2 (en) * 2014-12-30 2020-04-14 Spirent Communications, Inc. Performance testing of a network segment between test appliances

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110750463A (en) * 2019-10-29 2020-02-04 百度在线网络技术(北京)有限公司 Applet testing method, device, system, equipment and medium
CN110851366A (en) * 2019-11-18 2020-02-28 中国银行股份有限公司 Method and device for realizing regression test
CN111400705A (en) * 2020-03-04 2020-07-10 支付宝(杭州)信息技术有限公司 Application program detection method, device and equipment
CN111400722A (en) * 2020-03-25 2020-07-10 深圳市腾讯网域计算机网络有限公司 Method, apparatus, computer device and storage medium for scanning small program
CN111597114A (en) * 2020-05-18 2020-08-28 北京百度网讯科技有限公司 Method, device and equipment for verifying small program and storage medium
CN111597113A (en) * 2020-05-18 2020-08-28 北京百度网讯科技有限公司 Method, device and equipment for verifying small program and storage medium
CN112052185A (en) * 2020-09-29 2020-12-08 北京百度网讯科技有限公司 Applet exception handling method and device, electronic device and storage medium
CN112269666A (en) * 2020-11-10 2021-01-26 北京百度网讯科技有限公司 Applet dead link detection method and device, computing device and medium
CN112364266A (en) * 2020-11-11 2021-02-12 平安科技(深圳)有限公司 Seamless navigation method, device, electronic equipment and medium for applet and host application

Also Published As

Publication number Publication date
CN112860566A (en) 2021-05-28

Similar Documents

Publication Publication Date Title
US9325717B1 (en) Web-store restriction of external libraries
CN112860566B (en) Applet detection method, device, electronic equipment and readable medium
CN113312072A (en) Configuration file updating method and device, electronic equipment and medium
CN116306396A (en) Chip verification method and device, equipment and medium
WO2022271345A1 (en) Triggering dynamic robotic process automation
CN112948018B (en) Dynamic library loading method, device, equipment and medium for applet
CN112732312A (en) Method and device for updating application program, electronic equipment and medium
CN116737928B (en) Text mining method and system for platform user requirements and cloud platform
CN113839944B (en) Method, device, electronic equipment and medium for coping with network attack
CN113366472A (en) Data migration across SAAS applications
CN112491940A (en) Request forwarding method and device of proxy server, storage medium and electronic equipment
CN114676062A (en) Method and device for testing difference data of interface, electronic equipment and medium
CN114861658B (en) Address information analysis method and device, equipment and medium
CN113312050B (en) Content display method, device, equipment and medium
CN114218516B (en) Webpage processing method and device, electronic equipment and storage medium
CN113010383B (en) Error log filtering method, device, electronic equipment and readable medium
CN114996557B (en) Service stability determination method, device, equipment and storage medium
CN113568797B (en) Testing method and device of intelligent interaction system, electronic equipment and medium
CN118069546A (en) Data reading method, data processing system, device and medium
CN117668824A (en) Code data processing method, device, equipment and medium
CN116700791A (en) Method, apparatus, device and medium for caching instructions
CN117609065A (en) Code submitting method and device based on version control tool and electronic equipment
CN114090073A (en) Interface information extraction method and device, electronic equipment and storage medium
CN118195999A (en) Image detection method, device, equipment and medium
CN114329159A (en) Search method, search device, electronic equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant