WO2021120538A1 - Applet code scanning method and apparatus - Google Patents

Applet code scanning method and apparatus Download PDF

Info

Publication number
WO2021120538A1
WO2021120538A1 PCT/CN2020/094680 CN2020094680W WO2021120538A1 WO 2021120538 A1 WO2021120538 A1 WO 2021120538A1 CN 2020094680 W CN2020094680 W CN 2020094680W WO 2021120538 A1 WO2021120538 A1 WO 2021120538A1
Authority
WO
WIPO (PCT)
Prior art keywords
code
scanning
small program
applet
module
Prior art date
Application number
PCT/CN2020/094680
Other languages
French (fr)
Chinese (zh)
Inventor
高诗林
Original Assignee
支付宝(杭州)信息技术有限公司
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 支付宝(杭州)信息技术有限公司 filed Critical 支付宝(杭州)信息技术有限公司
Publication of WO2021120538A1 publication Critical patent/WO2021120538A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3604Software analysis for verifying properties of programs
    • G06F11/3612Software analysis for verifying properties of programs by runtime analysis

Definitions

  • This specification relates to the field of computer technology, and in particular to a method and device for scanning small program codes.
  • the applet manager can open the applet entrance to third-party developers, and third-party developers (for example, enterprise or individual developers) can write applets and access the written applets in the application of the applet manager. program.
  • third-party developers for example, enterprise or individual developers
  • many small programs developed by these third-party developers have white screens and crashes caused by code problems. Therefore, only by managing the quality of the applet code can users better use the applet.
  • this specification provides a small program code scanning method and device to improve the quality of the small program code.
  • a method for scanning code of an applet includes:
  • the respective code modules are respectively detected based on the scanning rule, and the scanning result of the small program code is obtained.
  • a method for scanning code of an applet including:
  • a small program code scanning device includes:
  • the request receiving module is configured to receive a code scan request sent by the client, where the code scan request carries the small program code to be scanned;
  • the code analysis module is used to parse the applet code to obtain each code module;
  • the scanning processing module is used to detect the respective code modules based on the scanning rules to obtain the scanning result of the small program code.
  • a small program code scanning device includes:
  • the code acquisition module is used to acquire the small program code corresponding to the currently edited file
  • the request sending module is configured to send a code scan request to the server, where the code scan request carries the small program code
  • the result receiving module is used to receive the scanning result of the applet code returned by the server.
  • a small program code scanning device in a fifth aspect, includes a memory, a processor, and computer instructions that are stored in the memory and can run on the processor.
  • the processor implements any of the instructions in this specification when executing the instructions.
  • the small program code scanning method described in the embodiment, or the small program code scanning method described in any embodiment of this specification can be implemented.
  • the code scanning method and device of the applet in one or more embodiments of this specification by sending the applet code to the server for scanning by the scanning plug-in, the code writing defects in the applet code can be detected in time, and the code writing defects in the applet code can be detected in time, and timely This defect is displayed to users for improvement, so as to avoid various types of small program application problems such as white screen and flashback caused by small program code defects, and improve the quality of the small program code.
  • FIG. 1 is a process of scanning and detecting applet code provided by one or more embodiments of this specification
  • Figure 2 is a schematic structural diagram of a small program code scanning device provided by one or more embodiments of this specification;
  • FIG. 3 is a schematic structural diagram of a small program code scanning device provided by one or more embodiments of this specification.
  • the embodiment of this specification provides a code scanning method for a small program, which can perform defect detection on the code of the small program developed by the developer, so as to avoid problems such as white screen and flashback caused by the code writing defect of the small program.
  • developers can develop small program software through IDE (Integrated Development Environment, integrated development environment), and a scanning plug-in can be installed in the small program IDE, and the scanning plug-in can be used to initiate a small program edited in the IDE to the server Code scan request for the code.
  • the server can scan and detect the code of the applet according to the code scanning request sent by the scanning plug-in.
  • Figure 1 illustrates the process of scanning and detecting the applet code that is executed interactively between the scanning plug-in and the server.
  • the small program code scanning method may include the following processing:
  • step 100 the scanning plug-in receives a scanning request.
  • a developer of applet software is developing an applet in the IDE.
  • the developer wants to detect whether the applet code he has written has code defects, he can initiate a scan request for the applet code through the scanning plug-in in the IDE.
  • the user can see an option for choosing whether to initiate a code scan, and the user can trigger the initiation of a scan request for the code of the small program being edited by clicking this option.
  • the scan plug-in receives the scan request.
  • step 102 the scanning plug-in encrypts the small program code requested to be scanned.
  • the small program code may be encrypted before being sent to the scanning server.
  • Encryption methods include, but are not limited to, symmetric encryption, asymmetric encryption, and session authentication.
  • the scan plug-in when the scan plug-in receives a scan request initiated by the user, if there is no small program code file currently being opened for editing, it may not respond, that is, not scan.
  • step 104 the scanning plug-in sends a code scanning request to the server, and the code scanning request carries the encrypted applet code.
  • the scanning plug-in can send the encrypted small program code to the server, requesting the server to scan the small program code to detect whether there are code defects.
  • step 106 the server decrypts to obtain the applet code.
  • the server can decrypt the encrypted small program code carried in the code scanning request to obtain the small program code to be scanned.
  • the scanning plug-in is installed in the small program IDE, which is equivalent to the client of the code scanning. Therefore, it can also be called the server of the code scanning to receive the code scanning request sent by the client.
  • step 108 the server parses the applet code to obtain each code module.
  • the server can disassemble the small program code to be scanned.
  • the applet code When the applet code is written, it is written in accordance with the applet API (Application Programming Interface) and specifications.
  • applet API Application Programming Interface
  • the layout of the small program uses flex layout during the development process; the JS statement does not need to end with a semicolon; the callback function is written in the same way as the Promise function, and the parameters for the successful callback are unified as res, and error
  • the parameter is err.
  • the query request can be executed through the API "selectorQuery.exec", etc. The above is only an example.
  • the server can disassemble the applet code according to the applet code writing specification, and disassemble each code module to make it easier to scan and detect the disassembled code modules.
  • each code module of the small program code can be disassembled level by level to obtain each code module in a tree-like hierarchy. Examples are as follows:
  • a small program code can include page1 and page2.
  • page2 includes the definition of variable 1 and variable 2, as well as the definition of function 1 and function 2.
  • the definition of function 2 also includes code block 1 and code block 2, where code block 2 includes logic branch 1 and logic branch 2.
  • the logic branch 2 includes expression 1 and expression 2
  • expression 2 includes variable definition expressions, variable assignment expressions, and error handling expressions.
  • the variable definition expression includes the assigned variable a and the assigned variable b.
  • the above small program code analysis is a level-by-level analysis method.
  • the page is equivalent to the highest level.
  • the next level of the page is the definition of the variables and functions included in the page. Continue to the next level.
  • the function includes , And so on, until it is disassembled to a lower-level fine-grained code block in the applet code, such as a variable in an expression.
  • This level-by-level disassembly method can finally disassemble the small program code to obtain the various code modules of the tree-like hierarchical structure.
  • the highest level is equivalent to the trunk of the big tree
  • the lower level is equivalent to the big tree. branches and leaves.
  • Both high-level and low-level can be called individual code modules.
  • function definitions can be higher-level code modules
  • logical branch blocks can be lower-level code modules.
  • step 110 the server separately detects each code module based on the scanning rules, and obtains the scanning result of the mini program code.
  • the server may store some scanning rules for scanning the applet code. For example, "variables used should be defined in the context" can be used as a scanning rule. If a variable that is not defined in the context is used in the applet code, this usage will not prevent the applet from running, but it does exist Potential white screen risk, code scanning can prompt the user "there are undefined variables".
  • the server can traverse the various scanning rules of the stored applet code, and each scanning rule can correspond to a requirement for writing the applet code. By scanning the applet code according to the scanning rules, the applet code can be detected. Whether there are defects in the coding.
  • the scanning result obtained by the server scanning and detecting each code module can be whether it meets the requirements of each scanning rule.
  • the scanning result in the above example can be "there is an undefined variable", or it can be other undefined variables. Comply with the code writing specifications of the mini program.
  • step 112 the server returns the scanning result to the scanning plug-in.
  • step 114 the scanning plug-in displays the scanning result through the small program IDE.
  • the scanning plug-in can display the scan results on the applet IDE.
  • the scanning plug-in can display "undefined variables exist" on the applet IDE to prompt the developer of the applet to scan As a result, the corresponding code defects were improved.
  • the code scanning plug-in sends the mini program code to the server for scanning, so that the code writing defects in the mini program code can be detected in time, and the defects can be displayed to the user for improvement in time ,
  • the code scanning plug-in sends the mini program code to the server for scanning, so that the code writing defects in the mini program code can be detected in time, and the defects can be displayed to the user for improvement in time ,
  • the scanning rules can be updated on the server side in time, so that the server can scan according to the latest scanning rules and get the latest Scan results.
  • the server of the embodiment of the present specification can scan not only small programs, but also other types of program codes for defects, for example, it can parse and scan program codes written in traditional JS (Javascript) language.
  • Fig. 2 is a schematic structural diagram of a small program code scanning device provided by one or more embodiments of this specification, and the device can be applied to a code scanning server. As shown in FIG. 2, the device may include: a request receiving module 21, a code analysis module 22, and a scanning processing module 23.
  • the request receiving module 21 is configured to receive a code scan request sent by the client, and the code scan request carries the small program code to be scanned.
  • the code analysis module 22 is used to parse the applet code to obtain each code module.
  • the scanning processing module 23 is configured to separately detect the respective code modules based on scanning rules to obtain the scanning result of the small program code.
  • the request receiving module 21 is specifically configured to: receive the code scan request sent by the client, the code scan request carrying the encrypted applet code; and decrypt the encrypted applet code to obtain The code of the small program to be scanned.
  • the code analysis module 22 is specifically used to: according to the applet code specification, disassemble each code module level by level on the applet code to obtain each code module of the tree-like hierarchical structure.
  • FIG. 3 is a schematic structural diagram of a small program code scanning device provided by one or more embodiments of this specification.
  • the device can be applied to a client of code scanning, for example, it can be specifically applied to a scanning plug-in of the client.
  • the device may include: a code acquisition module 31, a request sending module 32, and a result receiving module 33.
  • the code obtaining module 31 is used to obtain the small program code corresponding to the currently edited file
  • the request sending module 32 is configured to send a code scan request to the server, where the code scan request carries the applet code;
  • the result receiving module 33 is configured to receive the scan result of the applet code returned by the server.
  • the devices or modules described in the above embodiments may be implemented by computer chips or entities, or implemented by products with certain functions.
  • a typical implementation device is a computer.
  • the specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email receiving and sending device, and a game control A console, a tablet computer, a wearable device, or a combination of any of these devices.
  • each step in the process shown in the above cash recognition method is not limited to the sequence in the flowchart.
  • the description of each step can be implemented in the form of software, hardware, or a combination thereof.
  • a person skilled in the art can implement it in the form of software code, which can be a computer executable that can implement the logic function corresponding to the step. instruction.
  • the executable instructions can be stored in the memory and executed by the processor in the device.
  • one or more embodiments of this specification also provide a small program code scanning device.
  • the device may include a processor, a memory, and computer instructions stored in the memory and running on the processor.
  • the processor executes the instructions to implement the small program code scanning method described in any embodiment of this specification.
  • one or more embodiments of this specification can be provided as a method, a system, or a computer program product. Therefore, one or more embodiments of this specification may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, one or more embodiments of this specification may adopt computer programs implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The form of the product.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • One or more embodiments of this specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules.
  • program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types.
  • One or more embodiments of this specification can also be practiced in distributed computing environments. In these distributed computing environments, tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Radar Systems Or Details Thereof (AREA)
  • Apparatus For Radiation Diagnosis (AREA)

Abstract

Embodiments of the present description provide an applet code scanning method and apparatus. The method comprises: receiving a code scanning request sent by a client, the code scanning request carrying applet code to be scanned; parsing the applet code to obtain code modules; and separately detecting the code modules on the basis of a scanning rule to obtain a scanning result of the applet code.

Description

一种小程序代码扫描方法和装置Method and device for scanning small program code 技术领域Technical field
本说明书涉及计算机技术领域,特别涉及一种小程序代码扫描方法和装置。This specification relates to the field of computer technology, and in particular to a method and device for scanning small program codes.
背景技术Background technique
小程序管理方可以向第三方开发者开放小程序入口,第三方开发者(例如,可以是企业或者个人开发者)可以编写小程序,并在小程序管理方的应用程序中访问该编写的小程序。但是,由于第三方开发者水平参差不齐,导致这些第三方开发者开发的很多小程序存在由代码问题导致的白屏现象和闪退现象。因此,对小程序代码的质量进行管理才能使用户更好的使用小程序。The applet manager can open the applet entrance to third-party developers, and third-party developers (for example, enterprise or individual developers) can write applets and access the written applets in the application of the applet manager. program. However, due to the uneven level of third-party developers, many small programs developed by these third-party developers have white screens and crashes caused by code problems. Therefore, only by managing the quality of the applet code can users better use the applet.
发明内容Summary of the invention
有鉴于此,本说明书提供一种小程序代码扫描方法和装置,以提高小程序代码的质量。In view of this, this specification provides a small program code scanning method and device to improve the quality of the small program code.
具体地,本说明书一个或多个实施例是通过如下技术方案实现的:Specifically, one or more embodiments of this specification are implemented through the following technical solutions:
第一方面,提供一种小程序代码扫描方法,所述方法包括:In a first aspect, a method for scanning code of an applet is provided. The method includes:
接收客户端发送的代码扫描请求,所述代码扫描请求携带待扫描的小程序代码;Receiving a code scan request sent by the client, where the code scan request carries a small program code to be scanned;
对所述小程序代码进行解析,得到各个代码模块;Parse the applet code to obtain each code module;
基于扫描规则对所述各个代码模块分别进行检测,得到所述小程序代码的扫描结果。The respective code modules are respectively detected based on the scanning rule, and the scanning result of the small program code is obtained.
第二方面,提供一种小程序代码扫描方法,所述方法包括:In a second aspect, a method for scanning code of an applet is provided, the method including:
获取当前编辑文件对应的小程序代码;Obtain the small program code corresponding to the currently edited file;
向服务端发送代码扫描请求,所述代码扫描请求携带所述小程序代码;Sending a code scan request to the server, where the code scan request carries the applet code;
接收所述服务端返回的对所述小程序代码的扫描结果。Receiving the scan result of the applet code returned by the server.
第三方面,提供一种小程序代码扫描装置,所述装置包括:In a third aspect, a small program code scanning device is provided, and the device includes:
请求接收模块,用于接收客户端发送的代码扫描请求,所述代码扫描请求携带待扫描的小程序代码;The request receiving module is configured to receive a code scan request sent by the client, where the code scan request carries the small program code to be scanned;
代码解析模块,用于对所述小程序代码进行解析,得到各个代码模块;The code analysis module is used to parse the applet code to obtain each code module;
扫描处理模块,用于基于扫描规则对所述各个代码模块分别进行检测,得到所述小程序代码的扫描结果。The scanning processing module is used to detect the respective code modules based on the scanning rules to obtain the scanning result of the small program code.
第四方面,提供一种小程序代码扫描装置,所述装置包括:In a fourth aspect, a small program code scanning device is provided, and the device includes:
代码获取模块,用于获取当前编辑文件对应的小程序代码;The code acquisition module is used to acquire the small program code corresponding to the currently edited file;
请求发送模块,用于向服务端发送代码扫描请求,所述代码扫描请求携带所述小程序代码;The request sending module is configured to send a code scan request to the server, where the code scan request carries the small program code;
结果接收模块,用于接收所述服务端返回的对所述小程序代码的扫描结果。The result receiving module is used to receive the scanning result of the applet code returned by the server.
第五方面,提供一种小程序代码扫描设备,所述设备包括存储器、处理器,以及存储在存储器上并可在处理器上运行的计算机指令,所述处理器执行指令时实现本说明书任一实施例所述的小程序代码扫描方法,或者实现本说明书任一实施例所述的小程序代码扫描方法。In a fifth aspect, a small program code scanning device is provided. The device includes a memory, a processor, and computer instructions that are stored in the memory and can run on the processor. The processor implements any of the instructions in this specification when executing the instructions. The small program code scanning method described in the embodiment, or the small program code scanning method described in any embodiment of this specification can be implemented.
本说明书一个或多个实施例的小程序代码扫描方法和装置,通过由扫码插件将小程序代码发送到服务端进行扫描,可以及时检测到小程序代码中存在的代码编写缺陷,并及时将该缺陷展示给用户进行改进,从而避免出现由于小程序代码缺陷导致的白屏和闪退等各种类型的小程序应用问题,提高了小程序代码的质量。The code scanning method and device of the applet in one or more embodiments of this specification, by sending the applet code to the server for scanning by the scanning plug-in, the code writing defects in the applet code can be detected in time, and the code writing defects in the applet code can be detected in time, and timely This defect is displayed to users for improvement, so as to avoid various types of small program application problems such as white screen and flashback caused by small program code defects, and improve the quality of the small program code.
附图说明Description of the drawings
为了更清楚地说明本说明书一个或多个实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书一个或多个实施例中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly explain one or more embodiments of this specification or the technical solutions in the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, in the following description The drawings are only some of the embodiments described in one or more embodiments of this specification. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative labor. .
图1为本说明书一个或多个实施例提供的一种对小程序代码进行扫描检测的流程;FIG. 1 is a process of scanning and detecting applet code provided by one or more embodiments of this specification;
图2为本说明书一个或多个实施例提供的一种小程序代码扫描装置的结构示意图;Figure 2 is a schematic structural diagram of a small program code scanning device provided by one or more embodiments of this specification;
图3为本说明书一个或多个实施例提供的一种小程序代码扫描装置的结构示意图。FIG. 3 is a schematic structural diagram of a small program code scanning device provided by one or more embodiments of this specification.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本说明书一个或多个实施例中的技术方案,下 面将结合本说明书一个或多个实施例中的附图,对本说明书一个或多个实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是一部分实施例,而不是全部的实施例。基于本说明书一个或多个实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本说明书保护的范围。In order to enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the following will be combined with the drawings in one or more embodiments of this specification to compare the technical solutions in one or more embodiments of this specification. The technical solution is described clearly and completely. Obviously, the described embodiments are only a part of the embodiments, rather than all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by a person of ordinary skill in the art without creative work shall fall within the protection scope of this specification.
本说明书实施例提供了一种小程序代码扫描方法,该方法可以对开发者开发的小程序代码进行缺陷检测,以避免出现由于小程序代码编写缺陷导致的白屏、闪退等问题。The embodiment of this specification provides a code scanning method for a small program, which can perform defect detection on the code of the small program developed by the developer, so as to avoid problems such as white screen and flashback caused by the code writing defect of the small program.
例如,开发者可以通过IDE(Integrated Development Environment,集成开发环境)开发小程序软件,并且,该小程序IDE中可以安装扫描插件,该扫描插件可以用于向服务端发起对IDE中编辑的小程序代码的代码扫描请求。服务端可以根据扫描插件发送的代码扫描请求,对小程序代码进行扫描检测。For example, developers can develop small program software through IDE (Integrated Development Environment, integrated development environment), and a scanning plug-in can be installed in the small program IDE, and the scanning plug-in can be used to initiate a small program edited in the IDE to the server Code scan request for the code. The server can scan and detect the code of the applet according to the code scanning request sent by the scanning plug-in.
请参见图1,图1示例了扫描插件和服务端之间交互执行的对小程序代码进行扫描检测的流程。该小程序代码扫描方法可以包括如下处理:Please refer to Figure 1. Figure 1 illustrates the process of scanning and detecting the applet code that is executed interactively between the scanning plug-in and the server. The small program code scanning method may include the following processing:
在步骤100中,扫描插件接收到扫描请求。In step 100, the scanning plug-in receives a scanning request.
例如,小程序软件的开发者正在IDE开发小程序,当开发者想要检测自己编写的小程序代码是否存在代码缺陷时,可以通过IDE中的扫描插件发起对小程序代码的扫描请求。For example, a developer of applet software is developing an applet in the IDE. When the developer wants to detect whether the applet code he has written has code defects, he can initiate a scan request for the applet code through the scanning plug-in in the IDE.
示例性的,当IDE中安装了扫描插件之后,用户可以看到用于选择是否发起代码扫描的选项,用户可以通过点击该选项触发发起对正在编辑的小程序代码的扫描请求。当用户点击扫描选项后,扫描插件就接收到该扫描请求。Exemplarily, after the scanning plug-in is installed in the IDE, the user can see an option for choosing whether to initiate a code scan, and the user can trigger the initiation of a scan request for the code of the small program being edited by clicking this option. When the user clicks the scan option, the scan plug-in receives the scan request.
在步骤102中,扫描插件将请求扫描的小程序代码进行加密处理。In step 102, the scanning plug-in encrypts the small program code requested to be scanned.
例如,为了保证待扫描的小程序代码在向服务端传输过程中的安全性,可以在将小程序代码向扫描服务端发送之前,对小程序代码进行加密处理。加密方式包括但不限于对称加密、非对称加密、Session验证等方式。For example, in order to ensure the security of the small program code to be scanned during transmission to the server, the small program code may be encrypted before being sent to the scanning server. Encryption methods include, but are not limited to, symmetric encryption, asymmetric encryption, and session authentication.
此外,当扫描插件接收到用户发起的扫描请求时,如果当前没有正在打开编辑的小程序代码文件,可以不进行响应,即不进行扫描。In addition, when the scan plug-in receives a scan request initiated by the user, if there is no small program code file currently being opened for editing, it may not respond, that is, not scan.
在步骤104中,扫描插件向服务端发送代码扫描请求,该代码扫描请求中携带加密的小程序代码。In step 104, the scanning plug-in sends a code scanning request to the server, and the code scanning request carries the encrypted applet code.
本步骤中,扫描插件可以将加密后的小程序代码向服务端发送,请求服务端对该小 程序代码进行扫描检测,检测是否存在代码缺陷。In this step, the scanning plug-in can send the encrypted small program code to the server, requesting the server to scan the small program code to detect whether there are code defects.
在步骤106中,服务端解密得到小程序代码。In step 106, the server decrypts to obtain the applet code.
本步骤中,服务端在接收到扫描插件发送的代码扫描请求后,可以对代码扫描请求中携带的加密后的小程序代码进行解密,获得待扫描的该小程序代码。此外,扫描插件安装在小程序IDE,该IDE相当于代码扫描的客户端,因此,也可以称为是代码扫描的服务端接收客户端发送的代码扫描请求。In this step, after receiving the code scanning request sent by the scanning plug-in, the server can decrypt the encrypted small program code carried in the code scanning request to obtain the small program code to be scanned. In addition, the scanning plug-in is installed in the small program IDE, which is equivalent to the client of the code scanning. Therefore, it can also be called the server of the code scanning to receive the code scanning request sent by the client.
在步骤108中,服务端对小程序代码进行解析得到各个代码模块。In step 108, the server parses the applet code to obtain each code module.
具体的,服务端可以对待扫描的小程序代码进行拆解。Specifically, the server can disassemble the small program code to be scanned.
小程序代码在编写时,是按照小程序API(Application Programming Interface,应用程序接口)和规范进行编写的。例如,如下示例一些小程序的代码规范:小程序在开发过程中布局使用flex布局;JS语句无需以分号结束;回调函数统一使用Promise函数的方式进行编写,回调成功的参数统一为res,错误参数为err。可以通过API“selectorQuery.exec”执行查询请求,等,以上仅是示例。When the applet code is written, it is written in accordance with the applet API (Application Programming Interface) and specifications. For example, the following are examples of the code specifications of some small programs: the layout of the small program uses flex layout during the development process; the JS statement does not need to end with a semicolon; the callback function is written in the same way as the Promise function, and the parameters for the successful callback are unified as res, and error The parameter is err. The query request can be executed through the API "selectorQuery.exec", etc. The above is only an example.
服务端可以根据小程序代码编写规范对小程序代码进行拆解,拆解得到各个代码模块,以使得拆解后的各个代码模块更便于进行扫描检测。The server can disassemble the applet code according to the applet code writing specification, and disassemble each code module to make it easier to scan and detect the disassembled code modules.
在一个例子中,可以对小程序代码进行逐层级的各个代码模块的拆解,得到树状层级结构的各个代码模块。示例如下:In an example, each code module of the small program code can be disassembled level by level to obtain each code module in a tree-like hierarchy. Examples are as follows:
例如,可以分析一个小程序代码中有哪些page。对于每个page,该page中包括哪些变量定义和函数定义。对于每个函数定义,包括哪些代码块。其中的每个代码块包括哪些条件分支逻辑块。每个逻辑分支块又包括哪些表达式,以及每个种类的表达式的具体构成。For example, you can analyze which pages are in a small program code. For each page, which variable definitions and function definitions are included in the page. For each function definition, which code blocks are included. Which conditional branch logic blocks are included in each code block. What expressions are included in each logical branch block, and the specific composition of each type of expression.
如下的示例,一个小程序代码中可以包括page1和page2,以page2为例,该page2中包括对于变量1和变量2的定义、以及包括对于函数1和函数2的定义。继续以函数2为例,该函数2的定义中又包括代码块1和代码块2,其中的代码块2包括逻辑分支1和逻辑分支2。进一步的,逻辑分支2中包括表达式1和表达式2,表达式2中又包括变量定义型表达式、变量赋值型表达式和错误处理表达式。其中的变量定义型表达式包括赋值变量a和被赋值变量b。In the following example, a small program code can include page1 and page2. Taking page2 as an example, page2 includes the definition of variable 1 and variable 2, as well as the definition of function 1 and function 2. Continuing to take function 2 as an example, the definition of function 2 also includes code block 1 and code block 2, where code block 2 includes logic branch 1 and logic branch 2. Further, the logic branch 2 includes expression 1 and expression 2, and expression 2 includes variable definition expressions, variable assignment expressions, and error handling expressions. The variable definition expression includes the assigned variable a and the assigned variable b.
Figure PCTCN2020094680-appb-000001
Figure PCTCN2020094680-appb-000001
Figure PCTCN2020094680-appb-000002
Figure PCTCN2020094680-appb-000002
如上的小程序代码解析就是一种逐层级拆解的解析方式,page相当于最高层级,page的下一层级即page中包括的各变量和函数的定义,继续下一层级例如是函数中包括的代码块,以此类推,直至拆解到小程序代码中较低层级的细粒度的代码块,比如某表达式中的变量。The above small program code analysis is a level-by-level analysis method. The page is equivalent to the highest level. The next level of the page is the definition of the variables and functions included in the page. Continue to the next level. For example, the function includes , And so on, until it is disassembled to a lower-level fine-grained code block in the applet code, such as a variable in an expression.
这种逐层级拆解的方式,最终可以将小程序代码拆解得到树状层级结构的各个代码模块,其中,最高层级的相当于大树的树干,而较低层级的相当于大树的枝叶。不论是高层级还是低层级都可以称为各个代码模块,比如,函数定义可以是较高层级的代码模块,逻辑分支块可以是较低层级的代码模块。This level-by-level disassembly method can finally disassemble the small program code to obtain the various code modules of the tree-like hierarchical structure. Among them, the highest level is equivalent to the trunk of the big tree, and the lower level is equivalent to the big tree. branches and leaves. Both high-level and low-level can be called individual code modules. For example, function definitions can be higher-level code modules, and logical branch blocks can be lower-level code modules.
在步骤110中,服务端基于扫描规则对各个代码模块分别进行检测,得到小程序代 码的扫描结果。In step 110, the server separately detects each code module based on the scanning rules, and obtains the scanning result of the mini program code.
本步骤中,服务端可以存储有用于对小程序代码进行扫描的一些扫描规则。例如,“已使用的变量应在上下文中进行了定义”可以作为一种扫描规则,如果小程序代码中使用了上下文中未定义的变量,这种用法,不会阻止小程序的运行,但是存在潜在的白屏风险,代码扫描可以提示用户“存在未定义的变量”。In this step, the server may store some scanning rules for scanning the applet code. For example, "variables used should be defined in the context" can be used as a scanning rule. If a variable that is not defined in the context is used in the applet code, this usage will not prevent the applet from running, but it does exist Potential white screen risk, code scanning can prompt the user "there are undefined variables".
例如,服务端可以遍历存储的小程序代码的各个扫描规则,每种扫描规则可以对应于一种对小程序代码的编写要求,通过根据扫描规则对小程序代码进行扫描,可以检测得到小程序代码是否存在代码编写上的缺陷。For example, the server can traverse the various scanning rules of the stored applet code, and each scanning rule can correspond to a requirement for writing the applet code. By scanning the applet code according to the scanning rules, the applet code can be detected. Whether there are defects in the coding.
例如,服务端对各个代码模块进行扫描检测得到的扫描结果,可以是是否符合各个扫描规则的规定,比如,上述例子中的扫描结果可以是“存在未定义的变量”,或者也可以是其他不符合小程序代码编写规范的情况。For example, the scanning result obtained by the server scanning and detecting each code module can be whether it meets the requirements of each scanning rule. For example, the scanning result in the above example can be "there is an undefined variable", or it can be other undefined variables. Comply with the code writing specifications of the mini program.
在步骤112中,服务端将扫描结果返回给扫描插件。In step 112, the server returns the scanning result to the scanning plug-in.
在步骤114中,扫描插件通过小程序IDE展示扫描结果。In step 114, the scanning plug-in displays the scanning result through the small program IDE.
本步骤中,扫描插件可以在小程序IDE上展示扫描结果,例如,在上面的例子中,扫描插件可以在小程序IDE上显示“存在未定义的变量”,以提示小程序的开发者对扫描结果对应的代码缺陷进行改进。In this step, the scanning plug-in can display the scan results on the applet IDE. For example, in the above example, the scanning plug-in can display "undefined variables exist" on the applet IDE to prompt the developer of the applet to scan As a result, the corresponding code defects were improved.
本实施例的小程序代码扫描方法,通过由扫码插件将小程序代码发送到服务端进行扫描,可以及时检测到小程序代码中存在的代码编写缺陷,并及时将该缺陷展示给用户进行改进,从而避免出现由于小程序代码缺陷导致的白屏和闪退等各种类型的小程序应用问题,提高了小程序代码的质量。In the mini program code scanning method of this embodiment, the code scanning plug-in sends the mini program code to the server for scanning, so that the code writing defects in the mini program code can be detected in time, and the defects can be displayed to the user for improvement in time , Thereby avoiding various types of small program application problems such as white screen and flashback caused by small program code defects, and improving the quality of the small program code.
此外,由于是在服务端对小程序代码进行扫描,当出现新的扫描规则时,可以及时在服务端对扫描规则进行更新,从而也使得服务端能够根据最新的扫描规则进行扫描,得到最新的扫描结果。In addition, because the applet code is scanned on the server side, when new scanning rules appear, the scanning rules can be updated on the server side in time, so that the server can scan according to the latest scanning rules and get the latest Scan results.
本说明书实施例的服务端不仅可以对小程序进行扫描,也可以对其他类型的程序代码进行缺陷扫描,例如可以解析扫描传统的JS(Javascript)语言编写的程序代码。The server of the embodiment of the present specification can scan not only small programs, but also other types of program codes for defects, for example, it can parse and scan program codes written in traditional JS (Javascript) language.
图2为本说明书一个或多个实施例提供的一种小程序代码扫描装置的结构示意图,该装置可以应用于代码扫描的服务端。如图2所示,该装置可以包括:请求接收模块21、代码解析模块22和扫描处理模块23。Fig. 2 is a schematic structural diagram of a small program code scanning device provided by one or more embodiments of this specification, and the device can be applied to a code scanning server. As shown in FIG. 2, the device may include: a request receiving module 21, a code analysis module 22, and a scanning processing module 23.
请求接收模块21,用于接收客户端发送的代码扫描请求,所述代码扫描请求携带待扫描的小程序代码。The request receiving module 21 is configured to receive a code scan request sent by the client, and the code scan request carries the small program code to be scanned.
代码解析模块22,用于对所述小程序代码进行解析,得到各个代码模块。The code analysis module 22 is used to parse the applet code to obtain each code module.
扫描处理模块23,用于基于扫描规则对所述各个代码模块分别进行检测,得到所述小程序代码的扫描结果。The scanning processing module 23 is configured to separately detect the respective code modules based on scanning rules to obtain the scanning result of the small program code.
在一个例子中,请求接收模块21,具体用于:接收客户端发送的所述代码扫描请求,所述代码扫描请求携带加密的小程序代码;并对所述加密的小程序代码进行解密,获得所述待扫描的小程序代码。In an example, the request receiving module 21 is specifically configured to: receive the code scan request sent by the client, the code scan request carrying the encrypted applet code; and decrypt the encrypted applet code to obtain The code of the small program to be scanned.
在一个例子中,代码解析模块22,具体用于:根据小程序代码规范,对所述小程序代码进行逐层级的各个代码模块的拆解,得到树状层级结构的各个代码模块。In an example, the code analysis module 22 is specifically used to: according to the applet code specification, disassemble each code module level by level on the applet code to obtain each code module of the tree-like hierarchical structure.
图3为本说明书一个或多个实施例提供的一种小程序代码扫描装置的结构示意图,该装置可以应用于代码扫描的客户端,例如具体可以应用于客户端的扫描插件。如图3所示,该装置可以包括:代码获取模块31、请求发送模块32和结果接收模块33。FIG. 3 is a schematic structural diagram of a small program code scanning device provided by one or more embodiments of this specification. The device can be applied to a client of code scanning, for example, it can be specifically applied to a scanning plug-in of the client. As shown in FIG. 3, the device may include: a code acquisition module 31, a request sending module 32, and a result receiving module 33.
代码获取模块31,用于获取当前编辑文件对应的小程序代码;The code obtaining module 31 is used to obtain the small program code corresponding to the currently edited file;
请求发送模块32,用于向服务端发送代码扫描请求,所述代码扫描请求携带所述小程序代码;The request sending module 32 is configured to send a code scan request to the server, where the code scan request carries the applet code;
结果接收模块33,用于接收所述服务端返回的对小程序代码的扫描结果。The result receiving module 33 is configured to receive the scan result of the applet code returned by the server.
上述实施例阐明的装置或模块,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。The devices or modules described in the above embodiments may be implemented by computer chips or entities, or implemented by products with certain functions. A typical implementation device is a computer. The specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email receiving and sending device, and a game control A console, a tablet computer, a wearable device, or a combination of any of these devices.
为了描述的方便,描述以上装置时以功能分为各种模块分别描述。当然,在实施本说明书一个或多个实施例时可以把各模块的功能在同一个或多个软件和/或硬件中实现。For the convenience of description, when describing the above device, the functions are divided into various modules and described separately. Of course, when implementing one or more embodiments of this specification, the functions of each module can be implemented in the same one or more software and/or hardware.
上述套现识别方法中所示流程中的各个步骤,其执行顺序不限制于流程图中的顺序。此外,各个步骤的描述,可以实现为软件、硬件或者其结合的形式,例如,本领域技术人员可以将其实现为软件代码的形式,可以为能够实现所述步骤对应的逻辑功能的计算机可执行指令。当其以软件的方式实现时,所述的可执行指令可以存储在存储器中,并 被设备中的处理器执行。The execution sequence of each step in the process shown in the above cash recognition method is not limited to the sequence in the flowchart. In addition, the description of each step can be implemented in the form of software, hardware, or a combination thereof. For example, a person skilled in the art can implement it in the form of software code, which can be a computer executable that can implement the logic function corresponding to the step. instruction. When it is implemented in software, the executable instructions can be stored in the memory and executed by the processor in the device.
例如,对应于上述方法,本说明书一个或多个实施例同时提供一种小程序代码扫描设备,该设备可以包括处理器、存储器、以及存储在存储器上并可在处理器上运行的计算机指令,所述处理器通过执行所述指令,用于实现本说明书任一实施例所述的小程序代码扫描方法。For example, corresponding to the above method, one or more embodiments of this specification also provide a small program code scanning device. The device may include a processor, a memory, and computer instructions stored in the memory and running on the processor. The processor executes the instructions to implement the small program code scanning method described in any embodiment of this specification.
本领域内的技术人员应明白,本说明书一个或多个实施例可提供为方法、系统、或计算机程序产品。因此,本说明书一个或多个实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本说明书一个或多个实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that one or more embodiments of this specification can be provided as a method, a system, or a computer program product. Therefore, one or more embodiments of this specification may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, one or more embodiments of this specification may adopt computer programs implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The form of the product.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device. The device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment. The instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or equipment including a series of elements not only includes those elements, but also includes Other elements that are not explicitly listed, or also include elements inherent to such processes, methods, commodities, or equipment. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, method, commodity, or equipment that includes the element.
本说明书一个或多个实施例可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本说明书一个或多个实施例,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。One or more embodiments of this specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of this specification can also be practiced in distributed computing environments. In these distributed computing environments, tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于服务端设备实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the difference from other embodiments. In particular, as for the server device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for related parts, please refer to the part of the description of the method embodiment.
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。The foregoing describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than in the embodiments and still achieve desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or sequential order shown in order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
以上所述仅为本说明书一个或多个实施例的较佳实施例而已,并不用以限制本说明书,凡在本说明书的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本说明书保护的范围之内。The foregoing descriptions are only preferred embodiments of one or more embodiments of this specification, and are not intended to limit this specification. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification, All should be included in the protection scope of this manual.

Claims (10)

  1. 一种小程序代码扫描方法,所述方法包括:A method for scanning small program codes, the method comprising:
    接收客户端发送的代码扫描请求,所述代码扫描请求携带待扫描的小程序代码;Receiving a code scan request sent by the client, where the code scan request carries a small program code to be scanned;
    对所述小程序代码进行解析,得到各个代码模块;Parse the applet code to obtain each code module;
    基于扫描规则对所述各个代码模块分别进行检测,得到所述小程序代码的扫描结果。The respective code modules are respectively detected based on the scanning rule, and the scanning result of the small program code is obtained.
  2. 根据权利要求1所述的方法,所述接收客户端发送的代码扫描请求,所述代码扫描请求携带待扫描的小程序代码,包括:The method according to claim 1, wherein said receiving a code scanning request sent by a client, said code scanning request carrying a small program code to be scanned, comprises:
    接收客户端发送的所述代码扫描请求,所述代码扫描请求携带加密的小程序代码;Receiving the code scanning request sent by the client, where the code scanning request carries the encrypted applet code;
    对所述加密的小程序代码进行解密,获得所述待扫描的小程序代码。Decrypt the encrypted small program code to obtain the to-be-scanned small program code.
  3. 根据权利要求1所述的方法,所述对所述小程序代码进行解析,得到各个代码模块,包括:The method according to claim 1, wherein the parsing the code of the applet to obtain each code module comprises:
    根据小程序代码规范,对所述小程序代码进行逐层级的各个代码模块的拆解,得到树状层级结构的各个代码模块。According to the code specification of the small program, the code modules of the small program code are disassembled hierarchically to obtain each code module of the tree-like hierarchy.
  4. 根据权利要求1所述的方法,所述基于扫描规则对所述各个代码模块分别进行检测,得到所述小程序代码的扫描结果之后,所述方法还包括:The method according to claim 1, wherein the respective code modules are respectively detected based on scanning rules, and after the scanning result of the applet code is obtained, the method further comprises:
    将所述扫描结果发送至所述客户端,以使得所述客户端显示所述扫描结果。The scan result is sent to the client, so that the client displays the scan result.
  5. 一种小程序代码扫描方法,所述方法包括:A method for scanning small program codes, the method comprising:
    获取当前编辑文件对应的小程序代码;Obtain the small program code corresponding to the currently edited file;
    向服务端发送代码扫描请求,所述代码扫描请求携带所述小程序代码;Sending a code scan request to the server, where the code scan request carries the applet code;
    接收所述服务端返回的对所述小程序代码的扫描结果。Receiving the scan result of the applet code returned by the server.
  6. 一种小程序代码扫描装置,所述装置包括:A small program code scanning device, the device includes:
    请求接收模块,用于接收客户端发送的代码扫描请求,所述代码扫描请求携带待扫描的小程序代码;The request receiving module is configured to receive a code scan request sent by the client, where the code scan request carries the small program code to be scanned;
    代码解析模块,用于对所述小程序代码进行解析,得到各个代码模块;The code analysis module is used to parse the applet code to obtain each code module;
    扫描处理模块,用于基于扫描规则对所述各个代码模块分别进行检测,得到所述小程序代码的扫描结果。The scanning processing module is used to detect the respective code modules based on the scanning rules to obtain the scanning result of the small program code.
  7. 根据权利要求6所述的装置,The device according to claim 6,
    所述请求接收模块,具体用于:接收客户端发送的所述代码扫描请求,所述代码扫描请求携带加密的小程序代码;并对所述加密的小程序代码进行解密,获得所述待扫描的小程序代码。The request receiving module is specifically configured to: receive the code scanning request sent by the client, the code scanning request carrying the encrypted small program code; and decrypt the encrypted small program code to obtain the to-be-scanned code The small program code.
  8. 根据权利要求6所述的装置,The device according to claim 6,
    所述代码解析模块,具体用于:根据小程序代码规范,对所述小程序代码进行逐层级的各个代码模块的拆解,得到树状层级结构的各个代码模块。The code analysis module is specifically used to: according to the applet code specification, disassemble each code module of the applet code level by level to obtain each code module of the tree-like hierarchical structure.
  9. 一种小程序代码扫描装置,所述装置包括:A small program code scanning device, the device includes:
    代码获取模块,用于获取当前编辑文件对应的小程序代码;The code acquisition module is used to acquire the small program code corresponding to the currently edited file;
    请求发送模块,用于向服务端发送代码扫描请求,所述代码扫描请求携带所述小程序代码;The request sending module is configured to send a code scan request to the server, where the code scan request carries the small program code;
    结果接收模块,用于接收所述服务端返回的对所述小程序代码的扫描结果。The result receiving module is used to receive the scanning result of the applet code returned by the server.
  10. 一种小程序代码扫描设备,所述设备包括存储器、处理器,以及存储在存储器上并可在处理器上运行的计算机指令,所述处理器执行指令时实现权利要求1-4任一所述的方法,或者实现权利要求5所述的方法。A small program code scanning device, the device comprising a memory, a processor, and computer instructions stored in the memory and running on the processor, and the processor implements any one of claims 1 to 4 when executing the instructions , Or implement the method described in claim 5.
PCT/CN2020/094680 2019-12-19 2020-06-05 Applet code scanning method and apparatus WO2021120538A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911315920.1 2019-12-19
CN201911315920.1A CN111143204B (en) 2019-12-19 2019-12-19 Applet code scanning method and device

Publications (1)

Publication Number Publication Date
WO2021120538A1 true WO2021120538A1 (en) 2021-06-24

Family

ID=70518826

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/094680 WO2021120538A1 (en) 2019-12-19 2020-06-05 Applet code scanning method and apparatus

Country Status (3)

Country Link
CN (1) CN111143204B (en)
TW (1) TWI768343B (en)
WO (1) WO2021120538A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111143204B (en) * 2019-12-19 2021-06-29 支付宝(杭州)信息技术有限公司 Applet code scanning method and device
CN111783095A (en) * 2020-07-28 2020-10-16 支付宝(杭州)信息技术有限公司 Method and device for identifying malicious code of applet and electronic equipment
CN112148603A (en) * 2020-09-18 2020-12-29 支付宝(杭州)信息技术有限公司 Applet risk identification method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101017458A (en) * 2007-03-02 2007-08-15 北京邮电大学 Software safety code analyzer based on static analysis of source code and testing method therefor
CN102945203A (en) * 2012-10-26 2013-02-27 深圳出入境检验检疫局信息中心 Code security test method applied to mobile Internet application
US20150046753A1 (en) * 2013-08-09 2015-02-12 Freescale Semiconductor, Inc. Embedded software debug system with partial hardware acceleration
CN107885995A (en) * 2017-10-09 2018-04-06 阿里巴巴集团控股有限公司 The security sweep method, apparatus and electronic equipment of small routine
CN109992935A (en) * 2019-03-15 2019-07-09 同盾控股有限公司 A kind of source code guard method and device
CN111143204A (en) * 2019-12-19 2020-05-12 支付宝(杭州)信息技术有限公司 Applet code scanning method and device

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101051600B1 (en) * 2010-03-29 2011-07-22 주식회사 소프트 포 소프트 Systems for performing code inspection on abap source code
TWI464582B (en) * 2012-05-31 2014-12-11 Univ Far East Scan the computer to monitor the program in the program
TW201510767A (en) * 2013-09-11 2015-03-16 Quixant Plc Electronic apparatus with security-approved bios, security-approved booting method and computer-accessible storage
CN106201889A (en) * 2016-07-15 2016-12-07 国云科技股份有限公司 A kind of system and its implementation checking that program code writes specification
CN106294164B (en) * 2016-08-15 2019-02-19 中国银行股份有限公司 A kind of code check method and device
CN108009080B (en) * 2016-10-28 2021-06-15 腾讯科技(深圳)有限公司 Code scanning tool evaluation method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101017458A (en) * 2007-03-02 2007-08-15 北京邮电大学 Software safety code analyzer based on static analysis of source code and testing method therefor
CN102945203A (en) * 2012-10-26 2013-02-27 深圳出入境检验检疫局信息中心 Code security test method applied to mobile Internet application
US20150046753A1 (en) * 2013-08-09 2015-02-12 Freescale Semiconductor, Inc. Embedded software debug system with partial hardware acceleration
CN107885995A (en) * 2017-10-09 2018-04-06 阿里巴巴集团控股有限公司 The security sweep method, apparatus and electronic equipment of small routine
CN109992935A (en) * 2019-03-15 2019-07-09 同盾控股有限公司 A kind of source code guard method and device
CN111143204A (en) * 2019-12-19 2020-05-12 支付宝(杭州)信息技术有限公司 Applet code scanning method and device

Also Published As

Publication number Publication date
TWI768343B (en) 2022-06-21
CN111143204B (en) 2021-06-29
TW202125255A (en) 2021-07-01
CN111143204A (en) 2020-05-12

Similar Documents

Publication Publication Date Title
US11656859B2 (en) Data model API for live applications in a cloud collaboration platform
US11281732B2 (en) Recommending development tool extensions based on media type
US10866791B2 (en) Transforming non-Apex code to Apex code
US20190379650A1 (en) Reactive programming subscription context
WO2021120538A1 (en) Applet code scanning method and apparatus
US20120166177A1 (en) Systems and methods for accessing applications based on user intent modeling
US11797273B2 (en) System and method for enhancing component based development models with auto-wiring
AU2008332701A1 (en) Templating system and method for updating content in real time
US20200050431A1 (en) Recommending development tool extensions based on usage context telemetry
US20230026911A1 (en) Describing changes in a workflow based on changes in structured documents containing workflow metadata
EP3156902B1 (en) Data flow analysis with collapsed contexts
US11900080B2 (en) Software development autocreated suggestion provenance
US8510343B2 (en) Cogeneration of database applications and their databases
US20190310865A1 (en) Virtualizing extension code in an application
CN114816361A (en) Method, device, equipment, medium and program product for generating splicing project
US11119761B2 (en) Identifying implicit dependencies between code artifacts
Shrivastava Learning Salesforce Einstein
CN107357926B (en) Webpage processing method and device and electronic equipment
US11977882B2 (en) System and method implementing a design system review tool
Chandramouli et al. Insider: Towards breaking down mobile app silos
GB2559543A (en) System and method for implementing and testing security protections in computer software
Aly et al. Understanding multilayered applications for building extensions
CN116820565A (en) Source code processing method, device, electronic equipment and medium
List et al. CBCS BCA Programme Structure

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20900833

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20900833

Country of ref document: EP

Kind code of ref document: A1