CN112860566A - Applet detection method, device, electronic equipment and readable medium - Google Patents
Applet detection method, device, electronic equipment and readable medium Download PDFInfo
- Publication number
- CN112860566A CN112860566A CN202110232141.6A CN202110232141A CN112860566A CN 112860566 A CN112860566 A CN 112860566A CN 202110232141 A CN202110232141 A CN 202110232141A CN 112860566 A CN112860566 A CN 112860566A
- Authority
- CN
- China
- Prior art keywords
- applet
- value
- detection value
- external server
- host program
- 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.)
- Granted
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 94
- 238000000034 method Methods 0.000 claims abstract description 62
- 230000006870 function Effects 0.000 claims description 77
- 238000004590 computer program Methods 0.000 claims description 28
- 230000004044 response Effects 0.000 claims description 13
- 238000012886 linear function Methods 0.000 claims description 4
- 238000005516 engineering process Methods 0.000 abstract description 9
- 238000004891 communication Methods 0.000 description 13
- 238000010586 diagram Methods 0.000 description 11
- 230000009471 action Effects 0.000 description 8
- 238000012360 testing method Methods 0.000 description 7
- 238000012545 processing Methods 0.000 description 6
- 230000008569 process Effects 0.000 description 5
- 238000007689 inspection Methods 0.000 description 4
- 238000012550 audit Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000013473 artificial intelligence Methods 0.000 description 2
- 230000001413 cellular effect Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000009877 rendering Methods 0.000 description 2
- 238000012552 review Methods 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000010267 cellular communication Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000003111 delayed effect Effects 0.000 description 1
- 230000007849 functional defect Effects 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3692—Test 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, electronic equipment and a readable storage medium, relates to the technical field of computers, and particularly relates to cloud computing and cloud platform technologies. 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 packet; acquiring a loading result value aiming at 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 the loading result value of each page; and acquiring a final detection value of the applet based on the first detection value.
Description
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 detecting method and apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
Background
With the development of internet technology, various application programs have gone into people's daily life. The applet is an application which can be used without downloading and installation, is widely popular with users once being launched, and attracts a large number of developers to realize various business functions on various application program platforms by taking the applet as a carrier.
With the updating and development of the technology, new applets are continuously appeared, and the updating iteration of the applets which are on line is also very frequent. Under the background that a large number of small programs are online and iteration is increasingly frequent, an auditing platform is required to quickly and accurately detect the functions and the quality of the small programs, and high-quality and rich and diverse small program products are provided for terminal users.
Disclosure of Invention
The present disclosure provides an applet detecting 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 detecting method including: receiving a code packet of an applet; acquiring one or more pages contained in the applet based on the code packet; acquiring a loading result value aiming at 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 the loading result value of each page; and acquiring 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 applet detecting apparatus including: 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 an applet based on a code package; 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 within a first preset time period; and a third acquisition unit configured to acquire the first detection value based on the load 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 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, the computer program, when executed by the at least one processor, is for causing the electronic device to perform a method according to an embodiment of the disclosure.
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 operative to cause the computer to perform a method according to an embodiment of the present disclosure.
According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program, when executed by a processor of a computer, is adapted to cause the computer to perform a method according to an embodiment of the present disclosure.
According to one or more embodiments of the disclosure, the quality detection efficiency of the small program can be improved, and the cost of operation manpower can be saved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate exemplary embodiments of the embodiments and, together with the description, serve to explain the exemplary implementations of the embodiments. The illustrated embodiments are for purposes of illustration only and do not limit the scope of the claims. Throughout the drawings, identical reference numbers 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 flow chart illustrating an applet detection method according to some exemplary embodiments of the present disclosure;
FIG. 3 is a schematic diagram illustrating page content loading success in accordance with some demonstrative embodiments of the disclosure;
FIG. 4 is a schematic diagram illustrating a page content load failure according to some demonstrative embodiments of the disclosure;
FIG. 5 is a flow chart illustrating an applet detection method according to further exemplary embodiments of the present disclosure;
FIG. 6 is a flow chart illustrating an applet detection method according to further exemplary embodiments of the present disclosure;
FIG. 7 is a block diagram illustrating the architecture of an applet detecting apparatus according to some exemplary embodiments of the present 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 with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those 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, unless otherwise specified, the use of the terms "first", "second", etc. to describe various elements is not intended to limit the positional relationship, the timing relationship, or the importance relationship of the elements, and such terms are used only 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, based on the context, they may also refer to different instances.
The terminology used in the description of the various described 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, if the number of elements is not specifically limited, the elements may be one or more. Furthermore, the term "and/or" as used in this disclosure is intended to encompass any and all possible combinations of the listed items.
The applet is a cloud application program which is developed and completed based on a specific programming language and can be used without downloading and installing. Before the small program is developed to be operated on line, the method mainly comprises the following processes: and developing the small program by the small program developer, detecting the developed small program by the small program developer, submitting the code packet of the small program to the auditing platform after the test is passed, auditing the content and the function of the small program by the auditing platform, and informing the small program developer to issue the small program to be online after the audit is passed.
In the related technology, the auditing of the auditing platform mainly adopts two modes of manual auditing and online polling. In general, an operator scans codes by using a test mobile phone to manually check problems. In general, the online inspection is to traverse the online applet according to a certain rule through an inspection or crawler program to obtain the content information of the applet. However, the manual review mode is inefficient and costly, and is difficult to cope with high-frequency and large-batch small program iteration online review. Moreover, online inspection is relatively delayed, which is mainly aimed at the inspection of general product functions and illegal display contents, and cannot realize personalized function detection aiming at specific applets. In view of the above, the present disclosure provides an applet detecting method, which detects a submitted code package before the code package of an applet is submitted to an auditing platform for manual auditing. Therefore, the quality detection efficiency of the small program is improved, the labor cost for operation 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 embodiments 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 the applet detection methods of embodiments of the present disclosure to be performed.
In some embodiments, the server 120 may also provide other services or software applications that may include non-virtual environments and virtual environments. In certain 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, which may be executed by one or more processors. A user operating a client device 101, 102, 103, 104, 105, and/or 106 may, in turn, utilize one or more client applications to interact with the server 120 to take advantage of the services provided by these components. It should be understood 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 any number of client devices may be supported by the present disclosure.
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 involving virtualization (e.g., one or more flexible pools of logical storage that may be virtualized to maintain virtual storage for the server). In various embodiments, the 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. The 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, and the like.
In some implementations, the server 120 may include one or more applications to analyze and consolidate data feeds and/or event updates received from users of the 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 embodiments, the server 120 may be a server of a distributed system, or a server incorporating a blockchain. The server 120 may also be a cloud server, or a smart cloud computing server or a smart cloud host with artificial intelligence technology. The cloud Server is a host product in a cloud computing service system, and is used for solving the defects of high management difficulty and weak service expansibility in the traditional physical host and Virtual Private Server (VPS) 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 the databases 130 may be used to store information such as audio files and video files. The data store 130 may reside in various 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 certain embodiments, the data store used by the server 120 may be a database, such as a relational database. One or more of these databases may store, update, and retrieve data to and from the database in response to the command.
In some embodiments, one or more of the 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 regular stores supported by a 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 flow chart illustrating an applet detection method 200 according to some exemplary embodiments of the present 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, method 200 may be performed at a server (e.g., 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 on-line phase of a new applet to detect a first submitted applet code package. The method 200 may also be applied in an update phase of an online applet to detect submitted code packages for updating the applet.
As shown in fig. 2, the method 200 may include: receiving a code package 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 one or more pages in a first preset time period (step 203); acquiring a first detection value based on the loading result value of each page (step 204); and acquiring a final detection value of the applet based on the first detection value (step 205). Therefore, the page loading condition of the small program is detected before the code packet of the small program is submitted to the auditing platform for manual auditing, so that the quality detection efficiency of the small program can be improved, and the operation labor cost is saved. Meanwhile, the page loading condition of the small program is detected to determine whether the small program successfully loads all or part of elements in the page within the preset time, and the problem of poor user experience caused by slow page loading or loading failure after the small program is online can be avoided.
In some embodiments, the first preset time period may be determined according to practical situations, for example, 4-6 seconds, which is not limited by the present disclosure. Illustratively, the content loading condition may include a page content loading success or failure. The page content loading failure may be, for example, that the page content is not loaded within a specified time, or that a loading failure or a system error is displayed on the page.
In some examples, when the content loading condition of the page is detected, one or more detection lines may be set in advance, and positions corresponding to the one or more detection lines are detected from the moment that the applet icon is clicked to trigger the page loading. It may be detected whether a page of the applet has all elements or content in the page loaded within a first preset time. In other examples, it may also be detected whether a page of the applet loads a preset element or content (e.g., a key element or content) in the page within a first preset time. For example, the position and the cross feature 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 may be detected according to the position and the cross feature 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 number of intersection points between the detection lines and the page elements is small. In the page element rendering stage, the effective elements are not loaded successfully, and no intersection point appears. If the page loading is successful, the page is rich in elements, more in content and dense in cross points. If the page loading fails, the page may stay in the skeleton loading stage, the page content is simple, the intersection points between the detection lines and the page elements are few or no, or the page displays information such as loading failure or system errors.
FIG. 3 is a diagram 300 illustrating successful loading of page content, according to some exemplary embodiments of the present disclosure, as a page is loaded, intersections 302 continue to occur between detection lines 301 and page elements, page elements 303 are loaded, and then page elements 304 and 305 are loaded, and page loading is successful. FIG. 4 is a diagram 400 illustrating a page content load failure, according to some exemplary embodiments of the present disclosure, as a page is loaded, an intersection 402 occurs between a detection line 401 and a page element, but no page element is loaded, and finally, a "load failure" information occurs in the page and the page load fails. Fig. 3 and 4 are only exemplary and show one detection line, and in other examples, a plurality of detection lines may be further provided, which is not limited by the present disclosure.
In some embodiments, the first detection value may be expressed as:
wherein S is1Representing a first detection value, m representing the number of pages contained in the applet, piRepresenting the load result value, x, of the ith pageiIndicating the number of times the ith page has been requested within a second predetermined time period, tiAnd the average staying time of the ith page in a second preset time period is represented. For example, the second preset time period may be set according to actual conditions, for example, the second preset time period may be 30 days, and the like.
For each page of one or more pages included in the applet, the page may be detected, and a loading result value of the page is obtained based on a content loading condition of the page within 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 successfully loaded within a first preset time period, the load result value may be 1. When the page fails to load within the first preset time period, the load result value may 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 and some external server interfaces of the applet, in addition to the coding quality of the applet itself. A host refers to a local application, also referred to as a third party application, that is capable of carrying an applet to run. The host program provides the corresponding components and environment for the running of the small program. An external server interface refers to an interface for providing dynamic data required by an applet. For example, for e-commerce applets, it may obtain merchandise data, merchandise price data, etc. from an associated server through an external server interface. In some embodiments, the method of the present disclosure also detects the applet's host function and/or external server interface.
Fig. 5 is a flowchart illustrating an applet detection method 500 according to an exemplary embodiment of the present disclosure. As shown in fig. 5, method 500 may include the following steps.
In step 501, a code package of an applet is received.
In step 502, based on the code package, one or more pages included in the applet, one or more host functions used by the applet, and one or more external server interfaces included in the applet are obtained.
In some embodiments, one or more pages contained by the applet, one or more host functions used by the applet, and one or more external server interfaces contained by the applet may be obtained in a variety of ways. In some examples, upon receiving a code package for an applet, it may be predetermined whether the code package is a first submission. In response to determining that the code package of the applet is first submitted, a source scan of the code package may be performed to obtain one or more pages included with the applet, one or more host functions used by the applet, and one or more external server interfaces included with the applet. For example, the relevant programs in the code package may be compared to, for example, the functional interface API set forth in the host program's official developer documentation, so that the host program functions used by the applet may be determined. For example, the applet has a code package with the use of function interface function _1, which is used for payment functions in the official developer document of the applet's host program, and it can be determined that the applet has used the payment functions of the host program and the applet has payment capabilities.
In some examples, in response to determining that the code package of the applet is a non-first submission, a usage log of the applet may be obtained and analyzed to obtain one or more pages included with the applet, one or more host functions used by the applet, and one or more external server interfaces included with the applet. In the case where the code package of an applet is not first committed, the applet may be considered to have been online. In the process that the user uses the product function of the online small program, a corresponding use log is generated. For example, by analyzing the usage log to know that the user frequently clicks the order placement function of the applet and triggers the order and payment capability provided by the host program, it can be determined that the applet uses the order and payment function of the host program. For another example, for an information applet, when the applet home page is opened, the applet is frequently forwarded through a host program, and a data interface under an external domain name is requested to perform content display, 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 exposed by the applet may also be obtained, thereby determining the pages used by the applet.
In other examples, the applet developer may also directly identify the applet related functions in the code package (e.g., the applet contains pages and external server interfaces, or the applet uses host functions), and the applet related functions may be directly obtained through the identification. The manner in which the functionality associated with the applet is obtained is not limited by this disclosure.
In step 503, the one or more pages are detected to obtain a first detection value.
In step 504, the one or more host program functions are tested to obtain a second test value.
In step 505, the one or more external server interfaces are detected, and a third detection value is obtained.
In step 506, a final detection value of the applet is acquired based on the first, second and third detection values.
Therefore, before the auditing platform manually audits the code packet of the small program, the detection efficiency of the small program can be improved, the labor cost is saved, and the quality of the small program is improved at the same time through the multi-aspect detection of the page of the small program, the host program function and the external server interface.
In some embodiments, each of the 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 the 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, and obtaining the first determination value of the host program function may include: acquiring the 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 develops, the versions of the host program on which the applet depends are continuously updated and the functions supported by the host program of each version are different. Typically, the higher version of the host program will support more functionality than the lower version of the host program. For example, for applet a, it needs to use a payment function that needs to run in a host program (e.g., third party application B) of version 3.0 or more.
Upon receiving a code package submitted by an applet developer, it may be determined whether the functionality used by the applet matches the current version of the host program. Therefore, by detecting the host program function, whether the host program function used by the applet is matched with the version of the host program depended by the current applet can be determined, so that the problems that certain functions cannot be used and the like caused by the fact that the applet runs in hosts with unmatched versions can be avoided.
In some embodiments, the second detection value may be expressed as:
wherein S is2Representing the second detection value, k representing the number of host program functions used by the applet, k being a positive integer, wiWeight representing the ith host program function, fiA first judgment value indicating the function of the ith host program.
Illustratively, the first judgment 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 depended by the applet can be judged, and a first judgment value of the host program function is obtained according to the matching condition. For example, the first judgment value may be 1 when the host program function matches the version of the host program on which the applet depends, and the first judgment value may be-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 degree of importance of the host program function. For example, for general host program functions, the weight may be set to 1, and for important host program functions (e.g., payment functions, etc.), the weight may be set to be greater than 1, e.g., 4-5, etc.
In some embodiments, for each external service interface of the one or more external service interfaces, an expected return value of the external service interface may be obtained, and the external service interface is detected, and a detected return value of the external service interface is obtained.
In some embodiments, for each external server interface of the one or more external server interfaces, the second determination value of the external server interface may be obtained based on a matching condition between an expected return value and a detected return value of the external server interface, and the third detection value may be obtained based on the second determination value of each external server interface.
Therefore, by detecting the external server interface, whether the external server interface is available, whether the return value is in accordance with the expectation, whether the return value is changed or not and the like are detected, the problems that the content recording fails and the like caused by the fact that a certain external server interface is unavailable in the process of using the small program can be avoided, and the quality of the small program is improved.
Generally, a code package of an applet is configured with a test case for each external server interface in advance, and the external server interface can be detected by the test case. For example, when the external server interface a is detected, the address of the external test server, the request path and request parameters of the external server interface a, and the expected return value (or the expected return value format) of the external server interface a may be obtained. And then, detecting the external server interface A according to the address of the external test server, the request path and the request parameters of the external server interface A and the expected return value of the external server interface A. Illustratively, the request path and request parameters of the external server interface a may be obtained from the code package of the applet or from the usage log of the applet.
In some embodiments, the third detection value may be expressed as:
wherein S is3Representing a third detection value, n representing the number of external service interfaces comprised by the applet, diA second decision value, v, representing the ith external server interfaceiIndicating the number of times the ith external server interface was requested within a third preset time period. Illustratively, the third preset time period may be set according to actual conditions, for example, the third preset time period may be 30 days, and the like.
Illustratively, the second determination value may be set to 1, -1, or 0. The second decision value may be obtained based on a match between an expected return value and a detected 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. The second determination value may be-1 when the expected return value of the external server interface does not match the detected return value. The second determination value may be 0 when the external server interface is not configured.
In some embodiments, the final detection value may be a linear function of the first, second, and third detection values. In some examples, the linear function of the first, second, and third detection values may be:
S=α1S1+α2S2+α3S3
wherein S represents the final detection value, S1Indicating a first detected value, S2Indicating a second detected value, S3Indicating a third detected value, alpha1Is S1Weight of (a), a2Is S2Weight of (a), a3Is S3The weight of (c). The value of the weight may be set according to the degree of importance of each detection value. Illustratively, α may be set in general1+α2+α3=100。
The code packet of the applet can be correspondingly processed according to the final detection value of the applet. In some embodiments, the method of the present disclosure may further comprise: in response to determining that the final detection value is not less than the preset threshold value, submitting the code packet to a third-party auditing platform; and returning the code package to the code package 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 flow chart 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.
At 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 checked 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 was first submitted, if so, step 604 is performed, otherwise, step 605 is performed.
At step 604, the functionality of the applet in the code package is obtained.
At step 605, existing functions on the applet line are obtained.
At step 606, an external server interface is detected.
At step 607, page load expectations of the applet are detected.
At 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, and if so, step 610 is performed, otherwise, step 611 is performed.
At step 610, the code package is submitted to the audit platform.
At step 611, the code package is returned to the applet developer.
Therefore, by detecting the page of the small program, the host program function and the external server interface in multiple aspects, the detection efficiency of the small program can be improved, the labor cost is saved, and the quality of the small program is improved.
The method according to the exemplary embodiment of the present disclosure is explained above. Although the operations are depicted in the drawings in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, nor that all illustrated operations be performed, to achieve desirable results.
The applet detecting apparatus according to an exemplary embodiment of the present disclosure is described below. Fig. 7 shows a block diagram of an applet detecting 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 obtaining unit 702 is configured to obtain 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 a content loading condition of each page of the one or more pages within a first preset time period.
The third acquisition unit 704 is configured to acquire a first detection value based on the load 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 obtaining unit 702, the second obtaining unit 703 and the third obtaining unit 704 correspond to the steps 201 and 205 of the method 200 described above with respect to fig. 2, respectively, and thus are not described in detail herein.
Although specific functionality is discussed above with reference to particular modules, it should be noted that the functionality of the various modules discussed herein may be divided into multiple modules and/or at least some of the functionality of multiple modules may be combined into a single module. Performing an action by a particular module discussed herein includes the particular module itself performing the action, or alternatively the particular module invoking or otherwise accessing another component or module that performs the action (or performs the action in conjunction with the particular module). Thus, a particular module that performs an action can include the particular module that performs the action itself and/or another module that the particular module invokes or otherwise accesses that performs the action.
An exemplary embodiment of the present disclosure also provides 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, the computer program, when executed by the at least one processor, is for causing the electronic device to perform a method according to an embodiment of the disclosure.
The disclosed exemplary embodiments also provide a non-transitory computer readable storage medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is adapted to cause the computer to perform a method according to an embodiment of the present disclosure.
The exemplary embodiments of the present disclosure also provide a computer program product comprising a computer program, wherein the computer program, when executed by a processor of a computer, is adapted to cause the computer to perform a method according to an embodiment of the present disclosure.
Referring to fig. 8, a block diagram of a structure of an electronic device 800, which 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 device is 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 phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples 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 calculation 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 bus 804.
A number of components in the device 800 are connected to the 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, and the input unit 806 may receive input numeric or character information and generate key signal inputs related to user settings and/or function controls of the electronic device, and may include, but is not limited to, a mouse, a keyboard, a touch screen, a track pad, a track ball, a joystick, a microphone, and/or a remote control. Output unit 807 can be any type of device capable of presenting information and can include, but is not limited to, a display, speakers, a video/audio output terminal, a vibrator, and/or a printer. The storage unit 808 may include, but is not limited to, a magnetic disk, an optical disk. The communication unit 809 allows the device 800 to exchange information/data with other devices via a computer network, 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.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a 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 that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes 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 codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. 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. A 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 a pointing device (e.g., a mouse or a 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 can 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, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end 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 back-end, 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 clients and servers. A client and server are generally 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 understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be performed in parallel, sequentially or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
Although embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it is to be understood that the above-described 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 as issued and their equivalents. Various elements in the embodiments or examples may be omitted or may be replaced with equivalents thereof. Further, the steps may be performed in an order different from that described in the present disclosure. Further, various elements in 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 with equivalent elements that appear after the present disclosure.
Claims (19)
1. An applet detection method comprising:
receiving a code packet of the applet;
acquiring one or more pages contained in the applet based on the code packet;
acquiring a loading result value aiming at each page based on the content loading condition of each page in the one or more pages in a first preset time period;
acquiring a first detection value based on the loading result value of each page; and
based on the first detection value, a final detection value of the applet is acquired.
2. The method of claim 1, further comprising:
based on the code package, acquiring one or more host program functions used by the small program and one or more external server interfaces contained by the small program;
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 for the applet, based on the first detection value, comprises:
a final detection value of the applet is acquired based on the first, second, and third detection values.
4. The method of claim 2, wherein detecting the one or more host program functions, obtaining the second detection value comprises:
detecting each host program function in the one or more host program functions to obtain 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 for each of the one or more host program functions, detecting the host program function, and obtaining the first determination value for the host program function comprises:
obtaining a version of a 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 a matching condition between an expected return value and a detected 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, obtaining 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 obtaining one or more pages included by the applet, based on the code package, comprises:
in response to determining that the code package is a first submission, performing a source scan on the code package to obtain the one or more pages included in the applet; and
in response to determining that the code package is a non-first submission, a usage log of the applet is obtained and analyzed to obtain the one or more pages included in the applet.
9. The method of any of claims 2-7, wherein obtaining, based on the code package, the one or more host program functions used by the applet and the one or more external server interfaces included by the applet comprises:
in response to determining that the code package is a first submission, source scanning the code package for the one or more host program functions used by the applet; and
in response to determining that the code package is a non-first submission, a usage log of the applet is obtained and 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, based on the code package, the one or more host program functions used by the applet and the one or more external server interfaces included by the applet comprises:
in response to determining that the code package is a first submission, performing a source code scan on the code package to obtain the one or more external server interfaces included in the applet; and
in response to determining that the code package is a non-first submission, a usage log of the applet is obtained and analyzed to obtain the one or more external server interfaces included with the applet.
11. The method of any of claims 1-7, wherein the first detection value is represented as:
wherein S is1Representing said first detection value, m representing the number of pages comprised by said applet, piRepresenting the load result value, x, of the ith pageiIndicating the number of times the ith page has been requested within a second predetermined time period, tiAnd the average staying time of the ith page in the second preset time period is represented.
12. The method of any of claims 4-5, wherein the second detection value is represented as:
wherein S is2Representing the second detection value, k representing the number of host program functions used by the applet, k being a positive integer, wiWeight representing the ith host program function, fiA first judgment value indicating the function of the ith host program.
13. The method of any of claims 6-7, wherein the third detection value is represented as:
wherein S is3Representing the third detection value, n representing the number of external server interfaces comprised by the applet, diA second decision value, v, representing the ith external server interfaceiIndicating the number of times the ith external server interface was requested within a third preset time period.
14. The method of any of claims 3-7, wherein the final detection value is a linear function of the first, second, and third detection values, and wherein,
the linear function is:
S=α1S1+α2S2+α3S3
wherein S represents the final detection value, S1Representing said first detection value, S2Representing said second detection value, S3Representing said third detection value, a1Is S1Weight of (a), a2Is S2Weight of (a), a3Is S3The weight of (c).
15. The method of any of claims 1-7, further comprising:
in response to determining that the final detection value is not less than a preset threshold value, submitting the code package to a third party auditing platform; and
in response to determining that the final detection value is less than the preset threshold, returning the code package to a code package submitter.
16. An applet detecting apparatus comprising:
a receiving unit configured to receive a code packet of the applet;
a first obtaining unit configured to obtain one or more pages included in the applet based on the code package;
the second obtaining unit 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 a first preset time period; and
a third acquisition unit configured to acquire a first detection value based on the load result value of each page, and acquire a final detection value of the applet based on the first detection value.
17. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein
The memory stores a computer program executable by the at least one processor, the computer program, when executed by the at least one processor, is for causing the electronic device to perform the method of any of claims 1-15.
18. A non-transitory computer readable storage medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is operable to cause the computer to perform the method of any of claims 1-15.
19. A computer program product comprising a computer program, wherein the computer program is operative, when executed by a processor of a computer, to cause the computer to perform the method according to any of claims 1-15.
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 true CN112860566A (en) | 2021-05-28 |
CN112860566B 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) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113326539A (en) * | 2021-06-23 | 2021-08-31 | 支付宝(杭州)信息技术有限公司 | Method, device and system for private data leakage detection aiming at applet |
CN114020992A (en) * | 2021-11-09 | 2022-02-08 | 北京百度网讯科技有限公司 | Page blocking method, device, system, client and storage medium |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160188445A1 (en) * | 2014-12-30 | 2016-06-30 | Spirent Communications, Inc. | Conducting performance snapshots during test and using feedback to control test based on customer experience parameters |
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 |
-
2021
- 2021-03-02 CN CN202110232141.6A patent/CN112860566B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160188445A1 (en) * | 2014-12-30 | 2016-06-30 | Spirent Communications, Inc. | Conducting performance snapshots during test and using feedback to control test based on customer experience parameters |
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 |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113326539A (en) * | 2021-06-23 | 2021-08-31 | 支付宝(杭州)信息技术有限公司 | Method, device and system for private data leakage detection aiming at applet |
CN113326539B (en) * | 2021-06-23 | 2022-05-17 | 支付宝(杭州)信息技术有限公司 | Method, device and system for private data leakage detection aiming at applet |
CN114020992A (en) * | 2021-11-09 | 2022-02-08 | 北京百度网讯科技有限公司 | Page blocking method, device, system, client and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN112860566B (en) | 2024-04-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9325717B1 (en) | Web-store restriction of external libraries | |
CN113312072A (en) | Configuration file updating method and device, electronic equipment and medium | |
US11836072B2 (en) | Risk-based root cause identification methods and related autobuild systems | |
CN113411645B (en) | Information recommendation method and device, electronic equipment and medium | |
CN112860566B (en) | Applet detection method, device, electronic equipment and readable medium | |
CN113256583A (en) | Image quality detection method and apparatus, computer device, and medium | |
CN116306396A (en) | Chip verification method and device, equipment and medium | |
US11842726B2 (en) | Method, apparatus, electronic device and storage medium for speech recognition | |
CN112732312A (en) | Method and device for updating application program, electronic equipment and medium | |
CN112948018B (en) | Dynamic library loading method, device, equipment and medium for applet | |
CN116737928A (en) | Text mining method and system for platform user requirements and cloud platform | |
CN113495843B (en) | Method and apparatus for testing play-up performance of video player | |
CN113641929B (en) | Page rendering method, device, electronic equipment and computer readable storage medium | |
CN114676062A (en) | Method and device for testing difference data of interface, electronic equipment and medium | |
CN113839944A (en) | Method, device, electronic equipment and medium for coping with network attack | |
CN114510308A (en) | Method, device, equipment and medium for storing application page by mobile terminal | |
CN114118067A (en) | Term noun error correction method and apparatus, electronic device, and medium | |
US9497253B2 (en) | Authorization review system | |
CN114218516B (en) | Webpage processing method and device, electronic equipment and storage medium | |
CN113010383B (en) | Error log filtering method, device, electronic equipment and readable medium | |
CN113568797B (en) | Testing method and device of intelligent interaction system, electronic equipment and medium | |
CN114861658B (en) | Address information analysis method and device, equipment and medium | |
CN114398653B (en) | Data processing method, device, electronic equipment and medium | |
CN113902313A (en) | Object information processing method and device | |
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 |