CN113849409A - Script detection method and device and electronic equipment - Google Patents

Script detection method and device and electronic equipment Download PDF

Info

Publication number
CN113849409A
CN113849409A CN202111148009.3A CN202111148009A CN113849409A CN 113849409 A CN113849409 A CN 113849409A CN 202111148009 A CN202111148009 A CN 202111148009A CN 113849409 A CN113849409 A CN 113849409A
Authority
CN
China
Prior art keywords
metadata
scope
application data
integrated
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.)
Pending
Application number
CN202111148009.3A
Other languages
Chinese (zh)
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/CN113849409A/en
Publication of CN113849409A publication Critical patent/CN113849409A/en
Pending legal-status Critical Current

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing

Abstract

The embodiment of the disclosure discloses a script detection method and device and electronic equipment. One embodiment of the method comprises: acquiring an integrated flow configuration script to be detected, wherein the integrated flow 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 obtained by script conversion aiming at the integrated stream configuration; metadata of the second integrated application data item is exposed. Therefore, a new script detection mode is provided.

Description

Script detection method and device and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a script detection method and apparatus, and an electronic device.
Background
An iPaaS (Integration Platform as a Service) is used as an Integration Service providing Platform, can support an enterprise to quickly construct a system Integration model, reasonably manage data and easily provide a converged Platform for any user needing Integration, and realizes Integration requirements of lightweight, full scene and dynamic expansion among all business systems of the enterprise through UI Integration, application Integration and data Integration.
The iPaaS is used as an integrated service providing platform, and can be configured into an integrated flow by a user on the platform to complete an integrated task. When configuring an integrated stream, user configuration typically involves data conversion between different integrated applications.
Disclosure of Invention
This disclosure is provided 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: acquiring an integrated flow configuration script to be detected, wherein the integrated flow 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; and showing the metadata of the second integrated application data item.
In a second aspect, an embodiment of the present disclosure provides a script detection apparatus, including: the system comprises an acquisition unit, a processing unit and a processing 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; a determining unit, configured to determine, for a second integrated application data item obtained by the script conversion for the integrated stream, metadata describing the second integrated application data item; and the display unit is used for displaying 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; a storage device, configured to store one or more programs, which when executed by the one or more processors, cause the one or more processors to implement the script detection method according to the first aspect.
In a fourth aspect, the disclosed embodiments provide a computer readable medium, on which a computer program is stored, which when executed by a processor, implements the steps of the script detection method as described above in the first aspect.
According to the script detection method, the script detection device and the electronic equipment provided by the embodiment of the disclosure, the integrated flow configuration script is detected, the integrated flow configuration script is used for converting a first integrated application data item into a second integrated application data item, determining metadata of data (namely the second integrated application data item) obtained by conversion according to the integrated flow configuration script, and then displaying the metadata of the second integrated application data item. Therefore, a user (namely a worker) can know whether the output data is correct or not, and the speed and the accuracy of compiling the integrated stream configuration script are improved. In other words, if the user finds that the metadata of the data converted by the already written integrated stream configuration script does not conform to the desired data, the user can modify the integrated stream configuration script as soon as possible to improve the accuracy of the integrated stream configuration script.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
FIG. 1 is a flow diagram for 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 diagram of an alternative implementation of a script detection method according to the present disclosure;
FIG. 4A is a flow diagram 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 a script detection method according to the present disclosure;
FIG. 5 is a flow diagram of an alternative implementation of a script detection method according to the present disclosure;
FIG. 6 is a flow diagram of an alternative implementation of a script detection method according to the present disclosure;
FIG. 7 is a schematic block diagram illustrating one embodiment of a script detection apparatus according to the present disclosure;
FIG. 8 is an exemplary system architecture to which the 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 are shown in the 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 rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the 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. Moreover, 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 "include" and variations thereof as used herein are 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"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Referring to FIG. 1, a flow diagram of one embodiment of a script detection method according to the present disclosure is shown. The script detection method as shown in fig. 1 includes the following steps:
step 101, acquiring an integrated stream configuration script to be detected.
In this embodiment, an executing agent (e.g., a server and/or a terminal device) of the script detection method may obtain the integrated stream configuration script to be detected.
Here, the integrated stream configuration script is used 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 the integrated applications.
Here, application integration can organically integrate different application software and systems built with different schemes based on various platforms into a single system which is seamless, parallel and easy to access, and make them perform business processing and information sharing as a whole. The application integration is composed of three levels of database, business logic and user interface. The various applications that are integrated may be referred to as integrated applications.
As an example, the first integrated application may be used to manage a recruitment transaction and the candidate for the position may enter a contact address at a client of the first integrated application. The second integration application may be used for communication between members within the enterprise. When the candidate person C in the position in the integrated application A is confirmed to pass the interview and is planned to be registered as an enterprise employee, the integrated application B can be notified; the integrated application B can be the account number of the candidate person C and generates account number related information based on the contact information of the candidate person C. The account related information may include an account name, an account initial password, and an account contact address.
In the example of establishing accounts for job candidates, converting data entered in the integrated application a to data in the integrated application b requires an integrated flow configuration by a worker. The integrated stream configuration may include a compiled integrated stream configuration script (which may also be referred to as a data conversion script in some cases). The integrated stream configuration script may be used to convert data of the first integrated application to data of the second integrated application.
Here, the integrated stream configuration script may be in text form. The integrated flow configuration script entered by the staff member may then be detected.
Step 102, aiming at the second integrated application data item obtained by the conversion of the integrated flow configuration script, determining metadata describing the second integrated application data item.
Here, metadata (meta data) is understood to be data about data, and is generally structured data (e.g., data stored in a database, specifying the length, type, etc. of a field). With reference to the metadata, the user can reverse whether the compiled integrated stream configuration script is correct. For example, if the script is in error, it is possible that metadata of the output data will also be in error. For metadata of the output data, the user may be expected; when the metadata presumed by the invention according to the script does not accord with the expected metadata, the user can think that the script has errors.
And 103, displaying the metadata of the second integrated application data item.
Here, the second integrated application data and the metadata of the second integrated application data may be correspondingly presented.
It should be noted that, in the script detection method provided in this embodiment, by detecting the integrated stream configuration script, the integrated stream configuration script is used to convert the first integrated application data item into the second integrated application data item, and determine the metadata of the data (i.e., the second integrated application data item) obtained by conversion according to the integrated stream configuration script, and then expose the metadata of the second integrated application data item. Therefore, a user (namely a worker) can know whether the output data is correct or not, and the speed and the accuracy of compiling the integrated stream configuration script are improved. In other words, if the user finds that the metadata of the data converted by the already written integrated stream configuration script does not conform to the desired data, the user can modify the integrated stream configuration script as soon as possible to improve the accuracy of the integrated stream configuration script.
In some embodiments, the method may further include: correspondingly showing the first integrated application data item and the second integrated application data item with the conversion relation, and showing the metadata of the first integrated application data item.
Here, the conversion relationship indicates that the second integrated application data item is converted based on the first integrated application data item.
Here, the specific manner of the conversion relationship may be set according to an actual application scenario, and is not limited herein. In some application scenarios, the conversion 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. As an example, the output field name is "mobile phone number", and the input field name is "contact address"; and directly mapping the value in the input field into the output field to complete direct mapping.
Here, the conversion based on the intermediate variable may include that the conversion between the input field and the output field needs to be completed by means of the intermediate variable.
Here, the function-based conversion may include that conversion between an input field and an output field needs to be completed by means of a function.
Referring to fig. 2, fig. 2 is a diagram illustrating metadata of a first integrated application data item and a second integrated application data item.
In fig. 2, a first presentation area 201 is used to present an integrated stream configuration script. The second presentation area 202 is used for presenting the detection result of the integrated stream configuration script. Specifically, the metadata of the second integrated application data item may be presented in the second presentation area 202; for example, the metadata number of the second integrated application data item aaa may be presented; as another example, the metadata string of the second integrated application data item bbb may be exposed.
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 transition relationship, and this connection may indicate that the second integrated application data item aaa is correspondingly exposed with the first integrated application data item ddd.
Therefore, the metadata of the first integrated application data item is correspondingly displayed with the first integrated application data item, the first integrated application data item and the second integrated application data item with the conversion relation are correspondingly displayed, and the metadata of the second integrated application data item is also correspondingly displayed with the second integrated application data item. The user can check the converted metadata of the second integrated application data item along the corresponding relation according to the metadata of the first integrated application data item, so that the user can compare the metadata of the first integrated application data item with the metadata of the second integrated application data item conveniently, and whether the metadata of the second integrated application data item is correct or not can be determined quickly. And then can make things convenient for the user to adjust fast.
In some embodiments, step 102 may include step 301, step 302, step 303, and step 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 (AST), or simply Syntax Tree (Syntax Tree), is an Abstract representation of the Syntax structure of the source code. It represents the syntactic structure of the programming language in the form of a tree, each node on the tree representing a structure in the source code. The syntax is said to be "abstract" in that the syntax does not represent every detail that appears in the true syntax. For example, nesting brackets are implicit in the structure of the tree, not present in the form of nodes, and the like.
Step 302, a scope linked list is established for the integrated stream configuration script.
Scoping 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 its domain from easily leaking out, that is, the scope can isolate the variables, and the same-name variables in different scopes will not conflict.
Scope Chain (Scope Chain) may be understood as a linked list of variable objects for multiple execution contexts. In other words, when searching for a variable, the variable object of the current context is searched for, and if not found, the variable object of the context is searched for from the variable object of the parent level (the parent level on the lexical level), and the variable object of the global context, that is, the global object is always found.
Step 303, determining metadata of data returned by the nodes in the abstract syntax tree based on the established scope linked list.
Here, a scope linked list may be understood as a path that provides a basis for tracking metadata that determines the data returned by a node.
Alternatively, for each node in the abstract syntax tree, metadata for the data returned by that node may be determined. Metadata for data returned by a 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 the metadata of the data returned by the nodes in the abstract syntax tree.
It will be appreciated that the second integration application data has corresponding nodes in the abstract syntax tree. In other words, the second integrated application data may be data returned by certain nodes in the abstract syntax tree. In general, the data returned by the end node of the abstract syntax tree may include the second integrated application data.
It should be noted that, through the flow shown in fig. 3, the integrated flow configuration script may be first parsed into an abstract syntax tree, and then the behavior of the script parser at runtime is simulated, so as to perform dynamic analysis and traverse the abstract syntax tree. And tracking metadata of data returned by the nodes through the scope linked list in the traversal process. Thus, metadata of the second integrated application data output by the integrated stream configuration script can be determined by analyzing the syntax in the integrated stream configuration script without actually inputting usage data during writing of the integrated stream configuration script. Therefore, the metadata of the output data can be automatically determined quickly and accurately, the convenience of checking the integrated stream configuration script by a user is improved, and the accuracy of compiling the integrated stream configuration script is improved.
It should be noted that, because the integration scenario is complex and the number of data conversion steps is large, the input field may not be a direct mapping of the input field, but complex intermediate steps such as function call and intermediate variable need to be introduced for calculation, so as to form the final output data. The method provided by fig. 3 uses the abstract syntax tree and scope chain to track variables, and can track a complete variable transformation chain, so that accurate metadata can be determined in indirect transformation scenarios such as function calls, intermediate variables, and the like.
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 step 401 and step 402.
Step 401, adding metadata and script built-in functions of the first integrated application data item to a header of the established scope linked list.
Here, the first integration application data item may be an integration stream configuration script input data item. The metadata of the data is known.
Here, the script built-in function may be used to characterize the correspondence between the function type and the metadata. In other words, the script built-in function may include a correspondence between a function name and metadata to represent metadata of data output by the function indicated by the function name.
Step 402, for the node in the abstract syntax tree, updating the terminal 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, and also include adding a new variable in the end scope of the scope linked list.
By way of example, referring to FIG. 4B, FIG. 4B illustrates a schematic diagram of a scope linked list. Each circle in fig. 4B may visually represent a scope. The arrows between scopes may identify the direction from downstream to upstream. The most upstream scope may be referred to as the head of the scope linked list, or may be referred to as the head, as indicated by the "head" word in the figure; the most downstream scope may be referred to as the table tail of the scope linked list, or may be referred to as the tail, as indicated by the "tail" word in the figure.
In some application scenarios, the updated end scope may include the variable name of the variable to be looked up (e.g., aaa); the variable name can be searched in the scope, and if the variable name is searched in the scope, the variable name can be searched in the upstream scope sequentially along the scope linked list. Before searching, metadata corresponding to the variable name may or may not exist in the scope or the upstream scope. Therefore, if the variable name is not found in the head-most list, returning a null value; if the variable name (e.g., aaa) is found in the local scope or the upstream scope, the metadata corresponding to the variable name (e.g., aaa) can be used as the metadata corresponding to the variable name (e.g., aaa) in the end scope.
It should be noted that, based on the nodes 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 in time, and thus the metadata of the data returned by the node can be accurately determined.
In some embodiments, referring to fig. 5, fig. 5 illustrates an alternative implementation of step 402 described above. In the flow shown in fig. 5, step 501, step 502 and step 503 may be included.
Step 501, if the currently executed node indicates a variable, adding the variable name of the variable to the end scope of the scope linked list.
When variables are declared, corresponding variables can be added to the end scope of the scope linked list.
Step 502, using the end scope as the starting point, looking up 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 variable indicated by the node.
In the actual use process, corresponding push (push) and pop (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 a scenario of indirect variable conversion (for example, introducing an intermediate variable to perform introduction conversion), the above variable tracking manner can find accurate metadata along a conversion path, thereby improving the application range and accuracy of the script verification manner.
In some embodiments, step 503 may include: if a reading instruction is received, responding to the searched variable name, and using the 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.
In some application scenarios, metadata corresponding to a second integrated application data item in the script needs to be exposed, possibly during the process of writing the integrated stream configuration script by the user or after the writing is completed, and at this time, the computer may generate a read instruction to perform a read scenario. In the read scenario, if the corresponding metadata is found, the found metadata may be used as metadata of the returned data. If the corresponding metadata is not found, it means that the metadata corresponding to the node is determined based on the integrated stream configuration script that has been written, and it is appropriate to return a null value.
In some embodiments, step 503 may include: if the fact that the user writes in the metadata corresponding to the variable name is detected, when the variable name is found, the found metadata corresponding to the variable name is modified into the metadata written by the user; when the variable name is not found, adding metadata written by the user to the variable name in the end scope.
In some application scenarios, it may be possible that during the process of writing the elementary stream configuration script by the user, the staff member may actively write the metadata, and this process may be referred to as a write scenario. In a writing scene, metadata written by a user can be accurately written into a corresponding position through a scope chain, and the metadata can be quickly written and displayed.
In some embodiments, referring to fig. 6, fig. 6 illustrates an alternative implementation of step 402. The flow shown in fig. 6 may include step 601, step 602, and step 603.
Step 601, if the currently executed node indicates a function, adding a variable scope corresponding to the function at the tail of the scope linked list.
When function calls are encountered, 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 added variable scope corresponds to the function.
Step 602, adding the metadata of the parameter of the function to the variable action domain corresponding to the function by using the parameter name as the variable name.
In practical application, the parameter metadata of the above function can be added into the variable action domain one by one. When adding the variable scope, the parameter name is used as the variable name.
Step 603, parsing the statement in the function to obtain a return value of the function.
Here, the statement of the function may be parsed by some preset rule, and metadata of the return value of the function may be obtained. The preset rules may be set according to an actual application scenario, and are not limited herein.
In general, the return value of the function may be understood as the data returned by the currently executing node. Accordingly, the metadata of the returned value of the function can also be used as the metadata of the data returned by the node.
In some application scenarios, the statements in the function may be analyzed statement by statement along the abstract syntax tree corresponding to the function. When a 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 computed from the expression in the return statement. After the metadata is computed, the scope corresponding to the function may be removed from the scope linked list.
It should be noted that, if the currently executed node indicates a function, the metadata of the function return value may be determined in combination with the entry parameter during execution of the function and the visible variable during execution, the function definition (which may be associated with the script built-in function). Therefore, the second integrated application data item can be obtained immediately after the first integrated application data item is subjected to function processing, and the metadata of the second integrated application data item can also be accurately obtained.
With further reference to fig. 7, as an implementation of the methods shown in the above-mentioned figures, the present disclosure provides an embodiment of a script detection apparatus, which corresponds to the method embodiment shown in fig. 1, and which can be applied in various electronic devices.
As shown in fig. 7, the scenario detection 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 processing unit and a processing 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; a determining unit, configured to determine, for a second integrated application data item obtained by the script conversion for the integrated stream, metadata describing the second integrated application data item; and the display unit is used for displaying the metadata of the second integrated application data item.
In this embodiment, specific processing of the obtaining unit 701, the determining unit 702, and the displaying unit 703 of the script detecting apparatus and the technical effects brought by the processing can refer to the related descriptions of step 101, step 102, and step 103 in the corresponding embodiment of fig. 1, which are not described herein again.
In some embodiments, the apparatus is further configured to: correspondingly showing a first integrated application data item and a second integrated application data item with a conversion relation, and showing 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.
In some embodiments, the determining metadata describing the second integrated application data item for the second integrated application data item obtained by the script conversion of the integrated stream configuration includes: analyzing the integrated stream configuration script to obtain an abstract syntax tree of the integrated stream configuration script; aiming at the integrated flow configuration script, establishing a scope linked list; determining metadata of data returned by nodes in the abstract syntax tree based on the established scope linked list; metadata of the second integrated application data is determined from metadata of data returned by the nodes in the abstract syntax tree.
In some embodiments, the determining metadata of data returned by the nodes 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; for the nodes in the abstract syntax tree, updating the tail end nodes of the scope linked list based on the nodes; 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.
In some embodiments, the updating, for a node in the abstract syntax tree, an end node of the scope linked list 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, including: if the currently executed node indicates a variable, adding the variable name of the variable into the terminal scope of the scope linked list; searching the variable name along the direction from the tail end to the head of the scope linked list by taking the tail end scope as a starting point; and determining the metadata of the variable indicated by the node according to the search result.
In some embodiments, the determining metadata of the variable indicated by the node according to the search result includes: if a reading instruction is received, responding to the searched variable name, and using the 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.
In some embodiments, the determining metadata of the variable indicated by the node according to the search result includes: if the fact that the user writes in the metadata corresponding to the variable name is detected, when the variable name is found, the found metadata corresponding to the variable name is modified into the metadata written by the user; when the variable name is not found, adding metadata written by the user to the variable name in the end scope.
In some embodiments, the updating, for a node in the abstract syntax tree, an end node of the scope linked list 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, including: 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; adding the parameters of the function into a variable action domain corresponding to the function by taking the parameter name as a variable name; and analyzing the statement 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 to which the 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 to provide a medium for communication links between the terminal devices 801, 802, 803 and the server 805. Network 804 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
The terminal devices 801, 802, 803 may interact with a server 805 over a network 804 to receive or send messages or the like. The terminal devices 801, 802, 803 may have various client applications installed thereon, such as a web browser application, a search-type application, and a news-information-type application. The client application in the terminal device 801, 802, 803 may receive the instruction of the user, and complete the corresponding function according to the instruction of the user, for example, add the corresponding information in 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, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, mpeg compression standard Audio Layer 3), MP4 players (Moving Picture Experts Group Audio Layer IV, mpeg compression standard Audio Layer 4), laptop portable computers, desktop computers, and the like. When the terminal devices 801, 802, 803 are software, they can be installed in the electronic devices listed above. It may be implemented as multiple pieces of software or software modules (e.g., software or software modules used to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The server 805 may be a server providing various services, for example, receiving an information acquisition request sent by the terminal devices 801, 802, and 803, and acquiring presentation information corresponding to the information acquisition request in various ways according to the information acquisition request. And the relevant data of the presentation 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 a terminal device, and accordingly, the script detection apparatus may be disposed in the terminal devices 801, 802, and 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, a script detection apparatus may be provided 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, shown is a schematic diagram of an electronic device (e.g., a terminal device or a server of fig. 8) suitable for use in implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 9 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 9, the electronic device may include a processing means (e.g., a central processing unit, a graphic 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 apparatus 900 are also stored. The processing apparatus 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 bus 904.
Generally, the following devices may be connected to the I/O interface 905: input devices 906 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 907 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 908 including, for example, magnetic tape, hard disk, etc.; and a communication device 909. The communication means 909 may allow the electronic device to perform wireless or wired communication with other devices to exchange data. While fig. 9 illustrates an electronic device having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication device 909, or installed from the storage device 908, or installed from the ROM 902. The computer program performs the above-described functions defined in the methods of the embodiments of the present disclosure when executed by the processing apparatus 901.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the 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 present 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 contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. 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 wires, optical cables, RF (radio frequency), etc., 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 (hypertext transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications 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 network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled 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: acquiring an integrated flow configuration script to be detected, wherein the integrated flow 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; and showing the metadata of the second integrated application data item.
Computer program code for carrying out operations for the present disclosure may be written in any combination of 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 type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart 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 described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of a unit does not in some cases constitute a limitation of the unit itself, for example, a presentation unit may also be described as a "unit that presents metadata of the above-mentioned second integrated application data item".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components 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. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while 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. Under 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 limitations on the scope of the 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 disclosed as example forms of implementing the claims.

Claims (11)

1. A script detection method, comprising:
acquiring an integrated flow configuration script to be detected, wherein the integrated flow 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 for the second integrated application data item obtained by script conversion of the integrated stream configuration;
and showing the metadata of the second integrated application data item.
2. The method of claim 1, further comprising:
correspondingly showing a first integrated application data item and a second integrated application data item with a conversion relation, and showing 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 the determining metadata describing a second integrated application data item for the second integrated application data item converted from the integrated stream configuration script comprises:
analyzing the integrated stream configuration script to obtain an abstract syntax tree of the integrated stream configuration script;
establishing a scope linked list aiming at the integrated flow configuration script;
determining metadata of data returned by nodes in the abstract syntax tree based on the established scope linked list;
metadata of the second integrated application data is determined from metadata of data returned by the nodes in the abstract syntax tree.
4. The method of claim 3, wherein determining metadata for data returned by nodes in the abstract syntax tree based on the established scope linked list comprises:
adding metadata and script built-in functions of a first integrated application data item to a header of the established scope linked list;
for a node in the abstract syntax tree, updating an end node 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.
5. The method of claim 4, wherein for a node in the abstract syntax tree, updating an end node of the scope linked list 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:
if the currently executed node indicates a variable, adding the variable name of the variable into the terminal scope of the scope linked list;
searching the variable name along the direction from the tail end to the head of the scope linked list by taking the tail end scope as a starting point;
and determining the metadata of the variable indicated by the node according to the search result.
6. The method of claim 5, wherein determining metadata of the variable indicated by the node according to the search result comprises:
if a reading instruction is received, responding to the searched variable name, and using the 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.
7. The method of claim 5, wherein determining metadata of the variable indicated by the node according to the search result comprises:
if the fact that the user writes in the metadata corresponding to the variable name is detected, when the variable name is found, the found metadata corresponding to the variable name is modified into the metadata written by the user; when the variable name is not found, adding metadata written by the user to the variable name in the end scope.
8. The method of claim 4, wherein for a node in the abstract syntax tree, updating an end node of the scope linked list 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:
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;
adding the parameters of the function into a variable action domain corresponding to the function by taking the parameter name as a variable name;
and analyzing the statement in the function to obtain the metadata of the return value of the function.
9. A script detection apparatus, comprising:
the system comprises an acquisition unit, a processing unit and a processing 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;
a determining unit, configured to determine, for a second integrated application data item obtained by script conversion for the integrated stream configuration, metadata describing the second integrated application data item;
and the display unit is used for displaying the metadata of the second integrated application data item.
10. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-8.
11. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-8.
CN202111148009.3A 2021-09-28 2021-09-28 Script detection method and device and electronic equipment Pending CN113849409A (en)

Priority Applications (1)

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

Applications Claiming Priority (1)

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

Publications (1)

Publication Number Publication Date
CN113849409A true CN113849409A (en) 2021-12-28

Family

ID=78976887

Family Applications (1)

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

Country Status (1)

Country Link
CN (1) CN113849409A (en)

Similar Documents

Publication Publication Date Title
CN109062563B (en) Method and device for generating page
CN110096584B (en) Response method and device
CN110543297B (en) Method and apparatus for generating source code
CN109726217B (en) Database operation method, device, equipment and storage medium
CN110764748B (en) Code calling method, device, terminal and storage medium
CN111324342B (en) Method, device, medium and electronic equipment for generating interface layer code
CN110780874B (en) Method and device for generating information
US20210200806A1 (en) Method and apparatus for parallel processing of information
CN114035805A (en) Code conversion method, apparatus, medium, and device for pre-compiler
CN111506900A (en) Vulnerability detection method and device, electronic equipment and computer storage medium
CN111309304B (en) Method, device, medium and electronic equipment for generating IDL file
CN112115153A (en) Data processing method, device, equipment and storage medium
CN111338944B (en) Remote Procedure Call (RPC) interface testing method, device, medium and equipment
CN111752644A (en) Interface simulation method, device, equipment and storage medium
CN111506904A (en) Method and device for online vulnerability repair
CN111124541A (en) Configuration file generation method, device, equipment and medium
CN111539200B (en) Method, device, medium and electronic equipment for generating rich text
CN113849409A (en) Script detection method and device and electronic equipment
CN114115908A (en) Instruction set generation method, program analysis method, device and storage medium
CN113419740A (en) Program data stream analysis method and device, electronic device and readable storage medium
CN113468207A (en) Query method, device, equipment and storage medium
CN114035804A (en) Code conversion method, device, medium and electronic equipment
CN114047923A (en) Error code positioning method, device, storage medium and electronic equipment
CN111797009A (en) Method and device for detecting code compatibility and electronic equipment
CN112068814A (en) Method, device, system and medium for generating executable file

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