[go: up one dir, main page]

CN113849409B - Script detection method, device and electronic device - Google Patents

Script detection method, device and electronic device Download PDF

Info

Publication number
CN113849409B
CN113849409B CN202111148009.3A CN202111148009A CN113849409B CN 113849409 B CN113849409 B CN 113849409B CN 202111148009 A CN202111148009 A CN 202111148009A CN 113849409 B CN113849409 B CN 113849409B
Authority
CN
China
Prior art keywords
metadata
scope
integrated
application data
data item
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111148009.3A
Other languages
Chinese (zh)
Other versions
CN113849409A (en
Inventor
黄文楷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to CN202111148009.3A priority Critical patent/CN113849409B/en
Publication of CN113849409A publication Critical patent/CN113849409A/en
Application granted granted Critical
Publication of CN113849409B publication Critical patent/CN113849409B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3604Analysis of software for verifying properties of programs
    • G06F11/3612Analysis of software for verifying properties of programs by runtime analysis
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing

Landscapes

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

Abstract

The embodiment of the invention discloses a script detection method, a script detection device and electronic equipment. The method comprises the steps of obtaining an integrated stream configuration script to be detected, wherein the integrated stream configuration script is used for converting a first integrated application data item into a second integrated application data item, determining metadata describing the second integrated application data item aiming at the second integrated application data item obtained through conversion of the integrated stream configuration script, and displaying the metadata of the second integrated application data item. Thus, a new script detection mode is provided.

Description

Script detection method and device and electronic equipment
Technical Field
The disclosure relates to the technical field of computers, and in particular relates to a script detection method, a script detection device and electronic equipment.
Background
The iPaS (Integration Platform AS A SERVICE, integrated platform is service) is used as an integrated service providing platform, which can support enterprises to quickly construct a system integration model, reasonably manage data and easily provide an aggregated platform for any user needing integration, and the integrated system integration requirements of light weight, full scene and dynamic expansion among various business systems of the enterprises are realized through UI integration, application integration and data integration.
The iPaaS is used as an integrated service providing platform, and a user can configure an integrated stream on the platform to complete an integrated task. When a user configures an integrated stream, data conversion between different integrated applications is typically involved.
Disclosure of Invention
This disclosure is provided in part to introduce concepts in a simplified form that are further described below in the detailed description. This disclosure is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
In a first aspect, an embodiment of the present disclosure provides a script detection method, where the method includes obtaining an integrated flow configuration script to be detected, where the integrated flow configuration script is configured to convert a first integrated application data item into a second integrated application data item, determining metadata describing the second integrated application data item for the second integrated application data item obtained by converting the integrated flow configuration script, and displaying metadata of the second integrated application data item.
In a second aspect, an embodiment of the present disclosure provides a script detection device, which includes an obtaining unit configured to obtain an integrated flow configuration script to be detected, where the integrated flow configuration script is configured to convert a first integrated application data item into a second integrated application data item, a determining unit configured to determine metadata describing the second integrated application data item for the second integrated application data item obtained by converting the integrated flow configuration script, and a displaying unit configured to display the metadata of the second integrated application data item.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including one or more processors, and a storage device configured to store one or more programs, where the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the script detection method as described in the first aspect.
In a fourth aspect, embodiments of the present disclosure provide a computer readable medium having stored thereon a computer program which, when executed by a processor, implements the steps of the script detection method as described in the first aspect.
According to the script detection method, the script detection device and the electronic equipment, through detecting the integrated stream configuration script, the integrated stream configuration script is used for converting the first integrated application data item into the second integrated application data item, determining metadata of data (namely the second integrated application data item) obtained through conversion according to the integrated stream configuration script, and then displaying the metadata of the second integrated application data item. Therefore, a user (i.e. a staff) can know whether the output data is correct or not, and the speed and accuracy of writing the integrated stream configuration script are improved. In other words, if the user finds that the metadata of the data converted by the integrated stream configuration script already written is inconsistent with the expected data, the integrated stream configuration script can be modified as soon as possible, and the accuracy of the integrated stream configuration script is improved.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
FIG. 1 is a flow chart of one embodiment of a script detection method according to the present disclosure;
FIG. 2 is a schematic diagram of one application scenario of a script detection method according to the present disclosure;
FIG. 3 is a flow chart of an alternative implementation of a script detection method according to the present disclosure;
FIG. 4A is a flow chart of an alternative implementation of a script detection method according to the present disclosure;
FIG. 4B is a schematic diagram of one application scenario of the script detection method according to the present disclosure;
FIG. 5 is a flow chart of an alternative implementation of a script detection method according to the present disclosure;
FIG. 6 is a flow chart of an alternative implementation of a script detection method according to the present disclosure;
FIG. 7 is a schematic diagram of a structure of one embodiment of a script detection device according to the present disclosure;
FIG. 8 is an exemplary system architecture in which a script detection method of one embodiment of the present disclosure may be applied;
Fig. 9 is a schematic diagram of a basic structure of an electronic device provided according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment," another embodiment "means" at least one additional embodiment, "and" some embodiments "means" at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
Referring to FIG. 1, a flow of one embodiment of a script detection method according to the present disclosure is shown. The script detection method as shown in fig. 1 comprises the following steps:
step 101, acquiring an integrated flow configuration script to be detected.
In this embodiment, an execution body (e.g., a server and/or a terminal device) of the script detection method may acquire an integrated flow configuration script to be detected.
Here, the integrated stream configuration script is configured to convert the first integrated application data item into the second integrated application data item. The first integrated application data item belongs to a first integrated application and the second integrated application data item belongs to a second application, in other words the first and second are used to distinguish between integrated applications.
Here, application integration can organically integrate different application software and systems built by different schemes based on various different platforms into a single system which is seamless, parallel and easy to access, and make them perform business processing and information sharing just like a whole. The application integration consists of three layers of database, business logic and user interface. The various applications that are integrated may be referred to as integrated applications.
As an example, the a-integration application can be used to manage recruitment transactions and the job candidate c can enter contact details at the client of the a-integration application. The second integration application may be used for communication between members within the enterprise. And when the first integration application confirms that the position candidate C passes the interview, the second integration application can be notified by the to-be-recorded enterprise staff, and the second integration application can be the account number of the position candidate C and generates account related information based on the contact mode of the position candidate C. The account related information may include an account name, an account initial password, and an account contact.
In the example of setting up an account for a job candidate, data entered in an a integration application is converted into data in an b integration application, requiring personnel to perform integration flow configuration. Writing an integrated flow configuration script (which may also be referred to as a data conversion script in some cases) may be included in the integrated flow configuration. The integrated flow configuration script may be used to convert data of an a integrated application to data of an b integrated application.
Here, the integrated stream configuration script may be in text form. The integrated flow configuration script entered by the worker may then be detected.
Step 102, determining metadata describing the second integrated application data item according to the second integrated application data item obtained by converting the integrated stream configuration script.
Here, metadata (meta data) may be understood as data about data, typically structured data (e.g., data stored in a database, specifying a length, type, etc. of a field). With reference to the metadata, the user can reverse whether the written integrated stream configuration script is correct. For example, if the script makes an error, metadata of the output data may also make an error. The user may expect the metadata of the output data, and the user may consider that the script is wrong when the metadata presumed by the invention according to the script does not match the expected metadata.
Step 103, displaying the metadata of the second integrated application data item.
Here, the second integrated application data and metadata of the second integrated application data may be presented correspondingly.
It should be noted that, in the script detection method provided in this embodiment, by detecting the integrated flow configuration script, the integrated flow configuration script is configured to convert the first integrated application data item into the second integrated application data item, determine metadata of data obtained by converting according to the integrated flow configuration script (i.e., the second integrated application data item), and then display the metadata of the second integrated application data item. Therefore, a user (i.e. a staff) can know whether the output data is correct or not, and the speed and accuracy of writing the integrated stream configuration script are improved. In other words, if the user finds that the metadata of the data converted by the integrated stream configuration script already written is inconsistent with the expected data, the integrated stream configuration script can be modified as soon as possible, and the accuracy of the integrated stream configuration script is improved.
In some embodiments, the method may further include displaying the first integrated application data item and the second integrated application data item with a conversion relationship, and displaying metadata of the first integrated application data item.
Here, the conversion relation indicates that the second integrated application data item is converted based on the first integrated application data item.
The specific manner of the conversion relationship may be set according to the actual application scenario, and is not limited herein. In some application scenarios, the transformation relationship may include at least one of, but is not limited to, direct mapping, intermediate variable-based transformation, function-based transformation.
Here, the direct mapping may include the output field directly referencing the input field. By way of example, the output field is named "mobile phone number", the input field is named "contact", and the direct mapping is completed by directly mapping the value in the input field to the output field.
Here, the conversion based on intermediate variables may include that the conversion between the input field and the output field needs to be completed by means of intermediate variables.
Here, function-based conversion may include the need to complete conversion between an input field and an output field by means of a function.
Referring to fig. 2, fig. 2 shows a schematic diagram of metadata corresponding to the first integrated application data item and the second integrated application data item.
In fig. 2, a first presentation area 201 is used to present an integrated flow configuration script. The second presentation area 202 is used for presenting the detection result of the integrated stream configuration script. Specifically, metadata of the second integrated application data item may be shown in the second showing area 202, for example, metadata number of the second integrated application data item aaa may be shown, and for another example, metadata string of the second integrated application data item bbb may be shown.
As an example, a connection between the second integrated application data item aaa and the first integrated application data item ddd may indicate that the connection between the second integrated application data item aaa and the first integrated application data item ddd has a conversion relationship, and this connection may indicate that the second integrated application data item aaa is presented in correspondence with the first integrated application data item ddd.
Thus, the metadata of the first integrated application data item and the first integrated application data item are correspondingly displayed, the first integrated application data item and the second integrated application data item with conversion relation are correspondingly displayed, and the metadata of the second integrated application data item and the second integrated application data item are correspondingly displayed. The user can check the metadata of the second integrated application data item obtained through conversion along the corresponding relation according to the metadata of the first integrated application data item, so that the user can conveniently compare the metadata of the first integrated application data item with the metadata of the second integrated application data item, and whether the metadata of the second integrated application data item is correct or not can be quickly determined. And further, the user can conveniently and quickly adjust the device.
In some embodiments, the step 102 may include the steps 301, 302, 303, and 304 shown in fig. 3.
Step 301, parsing the integrated stream configuration script to obtain an abstract syntax tree of the integrated stream configuration script.
It is understood that in computer science, an abstract Syntax tree (Abstract Syntax Tree, AST), or simply Syntax tree (syncax tree), is an abstract representation of the source code Syntax structure. It represents the syntax structure of a programming language in the form of a tree, each node on the tree representing a structure in the source code. The grammar is said to be "abstract" in that the grammar herein does not represent every detail that appears in the real grammar. For example, nested brackets are implicit in the tree structure and are not presented in the form of nodes, etc.
Step 302, establishing a scope linked list for the integrated flow configuration script.
A scope is the accessibility of functions and variables in different parts of the runtime code. In other words, the scope can prevent the variables belonging to the scope from easily leaking out, that is, the scope can isolate the variables, and the variables with the same name under different scopes can not conflict.
A Scope Chain (Scope Chain) can be understood as a linked list of variable objects of multiple execution contexts. In other words, when searching the variable, the variable object of the current context is searched first, and if not found, the variable object of the global context, that is, the global object, is searched all the time from the variable object of the execution context of the parent level (the parent level on the lexical level).
Step 303, determining metadata of data returned by the nodes in the abstract syntax tree based on the established scope linked list.
A scope linked list is understood here to be a path that provides a tracking basis for determining metadata of data returned by a node.
Alternatively, metadata for the return data of each node in the abstract syntax tree may be determined for that node. Metadata for data returned by the node may be determined for a portion of the nodes in the abstract syntax tree.
Step 304, determining metadata of the second integrated application data according to metadata of data returned by nodes in the abstract syntax tree.
It is understood that the second integrated application data has corresponding nodes in the abstract syntax tree. In other words, the second integrated application data may be data returned by some nodes in the abstract syntax tree. Typically, the data returned by the end node of the abstract syntax tree may comprise second integrated application data.
It should be noted that, through the flow shown in fig. 3, the integrated stream configuration script may be first parsed into an abstract syntax tree, and then the behavior of the runtime script parser is simulated for dynamic analysis, so as to traverse the abstract syntax tree. During traversal, metadata of data returned by the nodes is tracked through the scope linked list. Thus, metadata of the second integrated application data output by the integrated stream configuration script can be determined by analyzing a syntax in the integrated stream configuration script without actually inputting the usage data in the process of writing the integrated stream configuration script. Therefore, the metadata of the output data can be automatically and quickly determined, the convenience of checking the integrated stream configuration script by a user is improved, and the accuracy of writing the integrated stream configuration script is improved.
It should be noted that, because the integration scenario is complex, the data conversion steps are more, and the input field may not be a direct mapping of the input field, but a complex intermediate step such as a function call, an intermediate variable, etc. needs to be introduced to perform calculation, so as to form the final output data. The manner provided in fig. 3, in which the abstract syntax tree and the scope chain are utilized to perform variable tracking, can track a complete variable conversion chain, so that in the scene of indirect conversion of function calls, intermediate variables and the like, accurate metadata can be determined.
In some embodiments, referring to fig. 4A, fig. 4A illustrates an exemplary implementation of step 303 described above. The flow shown in fig. 4A may include steps 401 and 402.
Step 401, adding metadata and script built-in functions of the first integrated application data item to the header of the established scope linked list.
Here, the first integrated application data item may be an integrated flow configuration script input data item. The metadata of this data is known.
Here, the script built-in function may be used to characterize a correspondence between a function type and metadata. In other words, the script built-in function may include a correspondence relationship between a function name and metadata to represent the function indicated by the function name, and metadata of the output data.
And step 402, for the node in the abstract syntax tree, updating the end scope of the scope linked list based on the node, and determining the metadata of the data returned by the node according to the updated end scope and the upstream scope of the end scope.
Optionally, updating the end scope of the scope linked list may include adding a new node at the end of the scope linked list, as well as adding a new variable in the end scope of the scope linked list.
For example, referring to FIG. 4B, FIG. 4B shows a schematic diagram of a scope linked list. Each circle in fig. 4B may visually represent a scope. Arrows between the scope may identify the direction from downstream to upstream. The most upstream scope may be referred to as the head of the scope linked list, as indicated by the "head" word in the figure, and the most downstream scope may be referred to as the tail of the scope linked list, as indicated by the "tail" word in the figure.
In some application scenarios, the updated end scope may include a variable name (e.g., aaa) of the variable to be looked up, which may now be looked up in the present scope, and if found in the present scope, may be looked up in an upstream scope in turn along the scope linked list. Before the lookup, the metadata corresponding to the variable name may or may not exist in the present scope or the upstream scope. Therefore, if the variable name is not found in the most table head, a null value is returned, and if the variable name (for example, aaa) is found in the present scope or the upstream scope, the metadata corresponding to the variable name (for example, aaa) can be used as the metadata corresponding to the variable name (for example, aaa) in the end scope.
It should be noted that, based on the node in the abstract syntax tree, the end of the scope linked list is updated, so that in the process of executing the program, the scope and the upstream scope can be accurately determined for the node in the function execution environment corresponding to the currently executed node, thereby accurately determining the metadata of the data returned by the node.
In some embodiments, referring to fig. 5, fig. 5 shows an alternative implementation of step 402 described above. In the flow shown in fig. 5, steps 501, 502 and 503 may be included.
Step 501, if the currently executing node indicates a variable, adding the variable name of the variable to the end scope of the scope linked list.
When a variable is declared, the corresponding variable may be added in the end scope of the scope linked list.
Step 502, starting with the end scope, searching the variable name along the direction from the end to the head of the scope linked list.
Step 503, according to the search result, determining the metadata of the variables indicated by the nodes.
In the actual use process, corresponding push-in (push) and pop-out (pop) operations can be performed in the variable scope linked list according to the execution process.
It should be noted that, by using the data structure of the scope linked list to perform variable management, accurate tracking of variable metadata can be achieved, and in the scenario of indirect conversion of variables (for example, introducing intermediate variables to perform profile conversion), the above-mentioned variable tracking mode can find accurate metadata along the conversion path, so as to improve the application range and accuracy of the script verification mode.
In some embodiments, the step 503 may include, if a read instruction is received, responding to finding the variable name, using metadata corresponding to the variable name as metadata of the data returned by the node, and responding to not finding the variable name, returning a predefined null value.
In some application scenarios, metadata corresponding to a second integrated application data item in the script may need to be exposed during or after the user writes the integrated stream configuration script, at which time the computer may generate a read instruction to read the scenario. In the read scenario, if the corresponding metadata is found, the found metadata may be used as metadata for the returned data. If the corresponding metadata is not found, it is appropriate to return a null value, which means that the metadata corresponding to the node is determined based on the integrated stream configuration script which has been written.
In some embodiments, the step 503 may include modifying metadata corresponding to the searched variable name into metadata written by the user if metadata corresponding to the variable name written by the user is detected, and adding metadata written by the user to the variable name in the end scope when the variable name is not found.
In some application scenarios, the staff may actively write metadata during the user writing of the elementary stream configuration script, which may be referred to as a writing scenario. In a writing scene, metadata written by a user can be accurately written into corresponding positions through a scope chain, and quick writing and displaying of the metadata are realized.
In some embodiments, referring to fig. 6, fig. 6 shows an alternative implementation of step 402. The flow shown in fig. 6 may include step 601, step 602, and step 603.
In step 601, if the currently executed node indicates a function, a variable scope corresponding to the function is added at the tail of the scope linked list.
When encountering function call, a new variable scope can be constructed, namely, a new variable scope is added at the tail part of the scope linked list, and the newly added variable scope corresponds to the function.
Step 602, adding metadata of parameters of the function into a variable action domain corresponding to the function by taking the parameter name as a variable name.
In practical application, the parameter metadata of the functions can be added into the variable action domain one by one. When the variable scope is added, the parameter name is used as the variable name.
Step 603, parsing the statement in the function to obtain the return value of the function.
Here, some preset rules may be used to parse the statement of the function to obtain metadata of the return value of the function. These preset rules may be set according to the actual application scenario, and are not limited herein.
In general, the return value of a function may be understood as the data returned by the currently executing node. Accordingly, metadata of the return value of the function may also be used as metadata of the data returned by the node.
In some application scenarios, statements in a function may be analyzed statement by statement along an abstract syntax tree corresponding to the function. When a return (return) statement is encountered or the current statement is the last statement (i.e., there is no more last statement), metadata for the return value of the return statement may be calculated from the expression in the return statement. After the completion of the computation of the metadata, the scope corresponding to the function may be removed from the scope linked list.
If the currently executed node indicates the function, metadata of the return value of the function can be determined by combining the parameter entering during the execution of the function and the visible variable during the execution of the function, and the definition of the function (which can be connected with the built-in function of the script). Therefore, the second integrated application data item can be obtained after the first integrated application data item is subjected to function processing, and the metadata of the second integrated application data item can be accurately obtained.
With further reference to fig. 7, as an implementation of the method shown in the foregoing figures, the present disclosure provides an embodiment of a script detecting apparatus, where an embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 1, and the apparatus is particularly applicable to various electronic devices.
As shown in fig. 7, the script detecting apparatus of the present embodiment includes an acquisition unit 701, a determination unit 702, and a presentation unit 703. The system comprises an acquisition unit, a determination unit and a display unit, wherein the acquisition unit is used for acquiring an integrated stream configuration script to be detected, the integrated stream configuration script is used for converting a first integrated application data item into a second integrated application data item, the determination unit is used for determining metadata describing the second integrated application data item aiming at the second integrated application data item obtained by converting the integrated stream configuration script, and the display unit is used for displaying the metadata of the second integrated application data item.
In this embodiment, the specific processes of the acquiring unit 701, the determining unit 702, and the displaying unit 703 of the script detecting device and the technical effects thereof may refer to the descriptions related to the steps 101, 102, and 103 in the corresponding embodiment of fig. 1, and are not repeated here.
In some embodiments, the device is further configured to correspondingly display the first integrated application data item and the second integrated application data item with a conversion relationship, and display metadata of the first integrated application data item, where the conversion relationship indicates that the second integrated application data item is converted based on the first integrated application data item.
In some embodiments, the determining metadata describing the second integrated application data item according to the second integrated application data item obtained by converting the integrated flow configuration script includes parsing the integrated flow configuration script to obtain an abstract syntax tree of the integrated flow configuration script, establishing a scope linked list according to the integrated flow configuration script, determining metadata of data returned by nodes in the abstract syntax tree based on the established scope linked list, and determining metadata of the second integrated application data according to the metadata of the data returned by the nodes in the abstract syntax tree.
In some embodiments, determining metadata of data returned by a node in the abstract syntax tree based on the established scope linked list includes adding metadata and script built-in functions of a first integrated application data item to a header of the established scope linked list, updating an end node of the scope linked list for a node in the abstract syntax tree based on the node, and determining metadata of data returned by the node based on the updated end scope and an upstream scope of the end scope.
In some embodiments, the method comprises updating the end node of the scope linked list for the node in the abstract syntax tree based on the node, determining metadata of data returned by the node according to the updated end scope and an upstream scope of the end scope, wherein the metadata comprises adding a variable name of the variable to the end scope of the scope linked list if the currently executed node indicates the variable, searching the variable name along the direction from the end to the head of the scope linked list with the end scope as a starting point, and determining the metadata of the variable indicated by the node according to the searching result.
In some embodiments, the determining the metadata of the variable indicated by the node according to the searching result includes responding to searching the variable name if a reading instruction is received, using the metadata corresponding to the variable name as the metadata of the data returned by the node, and responding to not searching the variable name, returning a predefined null value.
In some embodiments, the determining the metadata of the variables indicated by the nodes according to the searching result includes modifying the metadata corresponding to the searched variable names into metadata written by the user if the metadata corresponding to the variable names written by the user is detected, and adding the metadata written by the user to the variable names in the end scope if the variable names are not searched.
In some embodiments, the method comprises updating the end node of the scope linked list for the node in the abstract syntax tree based on the node, determining metadata of data returned by the node according to the updated end scope and the upstream scope of the end scope, wherein the metadata comprises adding a variable scope corresponding to the function at the tail of the scope linked list if the currently executed node indicates the function, adding parameters of the function into the variable scope corresponding to the function by taking the parameter name as the variable name, and analyzing sentences in the function to obtain the metadata of the return value of the function.
Referring to fig. 8, fig. 8 illustrates an exemplary system architecture in which a script detection method of one embodiment of the present disclosure may be applied.
As shown in fig. 8, the system architecture may include terminal devices 801, 802, 803, a network 804, and a server 805. The network 804 serves as a medium for providing communication links between the terminal devices 801, 802, 803 and the server 805. The network 804 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
Terminal devices 801, 802, 803 may interact with server 805 through network 804 to receive or send messages, etc. Various client applications, such as a web browser application, a search class application, a news information class application, may be installed on the terminal devices 801, 802, 803. The client applications in the terminal devices 801, 802, 803 may receive the instruction of the user and perform the corresponding functions according to the instruction of the user, for example, adding the corresponding information to the information according to the instruction of the user.
The terminal devices 801, 802, 803 may be hardware or software. When the terminal devices 801, 802, 803 are hardware, they may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, electronic book readers, MP3 players (Moving Picture Experts Group Audio Layer III, dynamic video expert compression standard audio plane 3), MP4 (Moving Picture Experts Group Audio Layer IV, dynamic video expert compression standard audio plane 4) players, laptop and desktop computers, and the like. When the terminal devices 801, 802, 803 are software, they can be installed in the above-listed electronic devices. Which may be implemented as multiple software or software modules (e.g., software or software modules for providing distributed services) or as a single software or software module. The present invention is not particularly limited herein.
The server 805 may be a server that provides various services, for example, receives information acquisition requests sent by the terminal devices 801, 802, 803, and acquires presentation information corresponding to the information acquisition requests in various ways according to the information acquisition requests. And related data showing the information is sent to the terminal devices 801, 802, 803.
It should be noted that, the script detection method provided by the embodiment of the present disclosure may be executed by the terminal device, and accordingly, the script detection apparatus may be set in the terminal devices 801, 802, 803. In addition, the script detection method provided by the embodiment of the present disclosure may also be executed by the server 805, and accordingly, the script detection device may be disposed in the server 805.
It should be understood that the number of terminal devices, networks and servers in fig. 8 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to fig. 9, a schematic diagram of an electronic device (e.g., a terminal device or server in fig. 8) suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 9 is merely an example, and should not impose any limitations on the functionality and scope of use of embodiments of the present disclosure.
As shown in fig. 9, the electronic device may include a processing means (e.g., a central processor, a graphics processor, etc.) 901, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 902 or a program loaded from a storage means 908 into a Random Access Memory (RAM) 903. In the RAM 903, various programs and data necessary for the operation of the electronic device 900 are also stored. The processing device 901, the ROM 902, and the RAM 903 are connected to each other through a bus 904. An input/output (I/O) interface 905 is also connected to the bus 904.
In general, devices including input devices 906 such as a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc., output devices 907 including a Liquid Crystal Display (LCD), speaker, vibrator, etc., storage devices 908 including magnetic tape, hard disk, etc., and communication devices 909 may be connected to the I/O interface 905. Communication means 909 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. While fig. 9 shows an electronic device having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication device 909, or installed from the storage device 908, or installed from the ROM 902. When executed by the processing device 901, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of a computer-readable storage medium may include, but are not limited to, an electrical connection having 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. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to electrical wiring, fiber optic cable, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperTextTransfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be included in the electronic device or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to obtain an integrated stream configuration script to be detected, wherein the integrated stream configuration script is used for converting a first integrated application data item into a second integrated application data item, determining metadata describing the second integrated application data item for the second integrated application data item obtained by converting the integrated stream configuration script, and displaying the metadata of the second integrated application data item.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. Wherein the name of the unit does not constitute a limitation of the unit itself in some cases, for example, the presentation unit may also be described as "unit presenting metadata of the above-mentioned second integrated application data item".
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic that may be used include Field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems-on-a-chip (SOCs), complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted 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. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.

Claims (9)

1. A script detection method, comprising:
Acquiring an integrated stream configuration script to be detected, wherein the integrated stream configuration script is used for converting a first integrated application data item into a second integrated application data item;
determining metadata describing a second integrated application data item according to the second integrated application data item obtained by converting the integrated stream configuration script;
presenting metadata of the second integrated application data item;
The method comprises the steps of converting an integrated flow configuration script into a second integrated application data item, determining metadata describing the second integrated application data item, analyzing the integrated flow configuration script to obtain an abstract syntax tree of the integrated flow configuration script, establishing a scope linked list for the integrated flow configuration script, determining metadata of data returned by nodes in the abstract syntax tree based on the established scope linked list, and determining the metadata of the second integrated application data according to the metadata of the data returned by the nodes in the abstract syntax tree;
the method comprises the steps of determining metadata of data returned by nodes in an abstract syntax tree based on an established scope linked list, wherein the metadata comprises metadata of a first integrated application data item and a script built-in function, adding the metadata and the script built-in function to a table head of the established scope linked list, updating an end node of the scope linked list for the nodes in the abstract syntax tree based on the nodes, and determining the metadata of the data returned by the nodes according to the updated end scope and an upstream scope of the end scope.
2. The method according to claim 1, wherein the method further comprises:
And correspondingly displaying the first integrated application data item and the second integrated application data item with the conversion relation, and displaying the metadata of the first integrated application data item, wherein the conversion relation indicates that the second integrated application data item is converted based on the first integrated application data item.
3. The method of claim 1, wherein for a node in the abstract syntax tree, updating an end node of the scope linked list based on the node, determining metadata for data returned by the node based on the updated end scope and an upstream scope of the end scope, comprising:
If the currently executed node indicates a variable, adding the variable name of the variable to the end scope of the scope linked list;
searching the variable names along the direction from the tail end to the head of the action domain linked list by taking the tail end action domain as a starting point;
and determining the metadata of the variables indicated by the nodes according to the search result.
4. A method according to claim 3, wherein said determining metadata of variables indicated by said nodes based on the search results comprises:
If a reading instruction is received, responding to the searched variable name, and taking metadata corresponding to the variable name as metadata of data returned by the node; in response to not finding the variable name, a predefined null value is returned.
5. A method according to claim 3, wherein said determining metadata of variables indicated by said nodes based on the search results comprises:
if the metadata corresponding to the variable names written by the user are detected, when the variable names are found, the metadata corresponding to the found variable names are modified into the metadata written by the user, and when the variable names are not found, the metadata written by the user are added to the variable names in the end acting domain.
6. The method of claim 1, wherein for a node in the abstract syntax tree, updating an end node of the scope linked list based on the node, determining metadata for data returned by the node based on the updated end scope and an upstream scope of the end scope, comprising:
If the currently executed node indicates a function, adding a variable scope corresponding to the function at the tail part of the scope linked list;
The parameters of the function are added into a variable action domain corresponding to the function by taking the parameter name as a variable name;
Analyzing the statement in the function to obtain the metadata of the return value of the function.
7. A script detecting apparatus, comprising:
The system comprises an acquisition unit, a detection unit and a control unit, wherein the acquisition unit is used for acquiring an integrated stream configuration script to be detected, and the integrated stream configuration script is used for converting a first integrated application data item into a second integrated application data item;
The determining unit is used for determining metadata describing the second integrated application data item aiming at the second integrated application data item obtained by converting the integrated stream configuration script;
the display unit is used for displaying the metadata of the second integrated application data item;
The method comprises the steps of converting an integrated flow configuration script into a second integrated application data item, determining metadata describing the second integrated application data item, analyzing the integrated flow configuration script to obtain an abstract syntax tree of the integrated flow configuration script, establishing a scope linked list for the integrated flow configuration script, determining metadata of data returned by nodes in the abstract syntax tree based on the established scope linked list, and determining the metadata of the second integrated application data according to the metadata of the data returned by the nodes in the abstract syntax tree;
the method comprises the steps of determining metadata of data returned by nodes in an abstract syntax tree based on an established scope linked list, wherein the metadata comprises metadata of a first integrated application data item and a script built-in function, adding the metadata and the script built-in function to a table head of the established scope linked list, updating an end node of the scope linked list for the nodes in the abstract syntax tree based on the nodes, and determining the metadata of the data returned by the nodes according to the updated end scope and an upstream scope of the end scope.
8. An electronic device, comprising:
one or more processors;
Storage means for storing one or more programs,
When executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-6.
9. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-6.
CN202111148009.3A 2021-09-28 2021-09-28 Script detection method, device and electronic device Active CN113849409B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111148009.3A CN113849409B (en) 2021-09-28 2021-09-28 Script detection method, device and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111148009.3A CN113849409B (en) 2021-09-28 2021-09-28 Script detection method, device and electronic device

Publications (2)

Publication Number Publication Date
CN113849409A CN113849409A (en) 2021-12-28
CN113849409B true CN113849409B (en) 2025-02-14

Family

ID=78976887

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111148009.3A Active CN113849409B (en) 2021-09-28 2021-09-28 Script detection method, device and electronic device

Country Status (1)

Country Link
CN (1) CN113849409B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113420531A (en) * 2021-06-24 2021-09-21 北京达佳互联信息技术有限公司 Code text conversion method and device and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8365147B2 (en) * 2008-02-27 2013-01-29 Accenture Global Services Limited Test script transformation architecture
CN111797009B (en) * 2020-06-22 2024-10-29 北京字节跳动网络技术有限公司 Method and device for detecting code compatibility and electronic equipment

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113420531A (en) * 2021-06-24 2021-09-21 北京达佳互联信息技术有限公司 Code text conversion method and device and storage medium

Also Published As

Publication number Publication date
CN113849409A (en) 2021-12-28

Similar Documents

Publication Publication Date Title
CN114035805B (en) Transcoding method, device, medium and equipment for precompiled device
US10650048B2 (en) Managing complex service dependencies in a data integration system
CN111324342B (en) Method, device, medium and electronic equipment for generating interface layer code
CN111338944B (en) Remote Procedure Call (RPC) interface testing method, device, medium and equipment
CN109726217B (en) Database operation method, device, equipment and storage medium
CN111309304B (en) Method, device, medium and electronic equipment for generating IDL file
CN113419740B (en) Program data stream analysis method and device, electronic equipment and readable storage medium
CN111400625B (en) Page processing method and device, electronic equipment and computer readable storage medium
CN112395253B (en) Index file generation method, terminal device, electronic device and medium
CN111539200B (en) Method, device, medium and electronic equipment for generating rich text
CN111813685B (en) Automatic test method and device
CN114780107B (en) Grammar analysis method and device of rule running file and decision engine
CN111506904B (en) Method and device for online bug repair
US20210200806A1 (en) Method and apparatus for parallel processing of information
CN110780874A (en) Method and apparatus for generating information
CN111797009B (en) Method and device for detecting code compatibility and electronic equipment
CN113849409B (en) Script detection method, device and electronic device
CN113176989B (en) Log file analysis method, device, equipment and storage medium
CN116860286A (en) Page dynamic update method, device, electronic equipment and computer readable medium
CN110929209B (en) Method and device for transmitting information
CN112068814B (en) Method, device, system and medium for generating executable file
US9218165B2 (en) System and method for an object instance acquirer
CN114116517B (en) Front-end item analysis method and device, medium and electronic equipment
CN116467178B (en) Database detection method, apparatus, electronic device and computer readable medium
CN109740100B (en) Webpage node sniffing method, device, equipment and storage 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