CN116627488A - Component decoupling and activating method and system for digital resources - Google Patents

Component decoupling and activating method and system for digital resources Download PDF

Info

Publication number
CN116627488A
CN116627488A CN202310638822.1A CN202310638822A CN116627488A CN 116627488 A CN116627488 A CN 116627488A CN 202310638822 A CN202310638822 A CN 202310638822A CN 116627488 A CN116627488 A CN 116627488A
Authority
CN
China
Prior art keywords
component
level
abstract
components
function
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
CN202310638822.1A
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.)
Beihang University
Original Assignee
Beihang University
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 Beihang University filed Critical Beihang University
Priority to CN202310638822.1A priority Critical patent/CN116627488A/en
Publication of CN116627488A publication Critical patent/CN116627488A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/216Parsing using statistical methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/43Checking; Contextual analysis
    • G06F8/436Semantic checking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0464Convolutional networks [CNN, ConvNet]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/0985Hyperparameter optimisation; Meta-learning; Learning-to-learn
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/19Recognition using electronic means
    • G06V30/19007Matching; Proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/40Document-oriented image-based pattern recognition
    • G06V30/41Analysis of document content
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention relates to a component decoupling and activating method and a system for digital resources, wherein the method comprises the following steps: s1: performing function level decoupling according to a digital resource service program source code provided by a user to generate a function level code segment with a code abstract; generating a component-level code segment by using a component-level coupling algorithm; finally, generating a component-level abstract through a component abstract generating module; s2: uniformly packaging the component-level code segments and the component-level abstracts and storing the component-level code segments and the component-level abstracts into a component packaging database; s3: selecting executable packaged components to form an operation flow; s4: instantiating the packaged component selected by the user into a memory; s5: inputting icon images contained in the components in the operation flow into an inverse aspect ratio picture and text recognition neural network, and outputting the icon images as coordinates of the icons or text box components; and automatically and sequentially carrying out corresponding operation on the coordinates according to the operation flow sequence. The method provided by the invention has the advantage that the source code resource is decoupled into the functional component with reusability and flexibility.

Description

Component decoupling and activating method and system for digital resources
Technical Field
The invention relates to the technical field of information, in particular to a component decoupling and activating method and system for digital resources.
Background
A large number of components with similar functions exist in the existing computing, display program or system serving the digital resources, and if the components can be reused, the development cost can be greatly saved, and the development period can be shortened. However, these digital resource programs are complex, and the application systems are inconsistent, so that when new demands occur, the existing achievements are difficult to be effectively integrated into the new systems.
Methods for automatically generating summaries, introductions, or notes for program source code are called code translations or code summaries, and the academic community is currently mainly implemented in a cyclic convolution network or a self-attention network. However, these methods are to generate code digests at the statement level or function level, and components are the basic units of code multiplexing, and there is currently no method of coupling the function level digests into component level digests, and there is no method of automatically decoupling codes into components.
Existing digital resource service programs can be presented in two ways, browser/server (B/S) architecture and client/server (C/S) architecture. The webpage can be operated in a mode of analyzing webpage elements under the B/S architecture, and meanwhile, the value of an output result is obtained, so that the implementation can be completed through tools such as BeautifulSoap, selenium. However, the manner of parsing the web page elements to control and obtain the output is not suitable for the C/S architecture, and the client under the C/S architecture cannot be controlled by parsing the elements, so that the currently used client automation software mostly simulates the operation of a person by recording the positions of the elements and manipulating the mouse/keyboard. In order to unify the execution modes under the C/S and B/S systems, the method searches for a target element by using a visual registration and similarity comparison algorithm, and operates a mouse to simulate the operation of a person to finish the automatic execution flow, so that the actual application business scene is effectively supported.
Disclosure of Invention
In order to solve the technical problems, the invention provides a component decoupling and activating method and system for digital resources.
The technical scheme of the invention is as follows: a method of component decoupling and activation for digital resources, comprising:
1. a method for decoupling and activating components oriented to digital resources, comprising:
step S1: performing function level decoupling according to a digital resource service program source code provided by a user, and generating a function level abstract for each function of the source code, thereby obtaining a function level code segment with a code abstract; recombining the function level code segments capable of forming the components into independent component level code segments by using a component level coupling algorithm; finally, the component level abstract is generated by uniformly packaging the component according to the content of the component, the type of input and output and the characteristics of the component through the component abstract generating module according to the function level abstract and the component level code segment;
step S2: according to the content of the component-level code segment, the type of input and output and the attribute thereof, uniformly packaging the component-level code segment and the component-level abstract, and storing the packaged components into a component packaging database;
step S3: selecting executable components after encapsulation from the component encapsulation database; judging according to a keyword matching algorithm, and if the keyword matching algorithm accords with a framework capable of automatically extracting an execution element, comprehensively forming an operation flow by reading a document, an attribute and a method of the packaged component, wherein the operation flow comprises the following steps: executing the step and executing the component image of the object; if not, recording an operation process through a LOADRUNNER library function, splitting the operation process into operation flows, acquiring an icon image in a source code for each operation in the operation flows, and storing the icon image in the operation flows;
step S4: the user puts forward an execution request of the operation flow, inputs actual parameters, instantiates the corresponding packaged component into a memory, and obtains an execution step of the packaged component and an icon image contained in the component;
step S5: using a visual positioning application image matching algorithm to input icon images contained in components in the operation flow into an inverse aspect ratio picture and text recognition neural network, and outputting the icon images as coordinates of the to-be-operated icons or text box components in the operation flow; and automatically and sequentially carrying out corresponding operation on the coordinates according to the operation flow sequence.
Compared with the prior art, the invention has the following advantages:
1. the invention discloses a component decoupling and activating method for digital resources, which aims at the characteristics that a time sequence model generated by the existing code abstract is too dependent on high-frequency words, and the high-frequency words in codes are often variable names, and uses a high-frequency keyword and low-frequency keyword fusion method based on AST (automatic test) retrieval and NMT (network management) conversion, and by combining with the information of the low-frequency words fused by the closest abstract semantic tree of the retrieval, a more accurate function-level code abstract is generated, the function-level code segments are recombined into independent component-level code segments, and the corresponding component-level code abstract is generated, so that the defect that the function-level code abstract can only be generated in the prior art is overcome.
2. Compared with the method for directly recording the operation coordinates of a mouse, the method can be more accurately executed on user systems with different length-width ratios, and has stronger robustness to network delay. Meanwhile, the two-step search strategy avoids time waste.
Drawings
FIG. 1 is a flow chart of a method for decoupling and activating components for digital resources according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an encoder-decoder neural network based on time-series attention in an embodiment of the present invention;
FIG. 3 is a schematic diagram of a timing-attention network block according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of an inverse aspect ratio picture frame and text recognition neural network according to an embodiment of the present invention;
fig. 5 is a block diagram of a component decoupling and activation system for digital resources according to an embodiment of the present invention.
Detailed Description
The invention provides a component decoupling and activating method for digital resources, which utilizes a digital resource component activating technology to decouple source code resources into functional components with reusability and flexibility, solves the problem that application systems among different programs are heterogeneous and are difficult to effectively gather and share, and further promotes data fusion and technology fusion of urban services.
The present invention will be further described in detail below with reference to the accompanying drawings by way of specific embodiments in order to make the objects, technical solutions and advantages of the present invention more apparent.
Example 1
As shown in fig. 1, a method for decoupling and activating a component oriented to a digital resource according to an embodiment of the present invention includes the following steps:
step S1: performing function level decoupling according to a digital resource service program source code provided by a user, and generating a function level abstract for each function of the source code, thereby obtaining a function level code segment with a code abstract; the function level code segments capable of forming the components are recombined into independent component level code segments by utilizing a component level coupling algorithm; finally, the component is uniformly packaged according to the content of the component, the type of input and output and the characteristics of the component by a component digest generation module according to the function digest and the component code segment, and a component digest is generated;
step S2: according to the content of the component-level code segment, the type of input and output and the attribute thereof, uniformly packaging the component-level code segment and the component-level abstract, and storing the packaged components into a component packaging database;
step S3: selecting executable packaged components from a component packaging database; judging according to a keyword matching algorithm, and if the keyword matching algorithm accords with a framework capable of automatically extracting an execution element, comprehensively forming an operation flow by reading three modes of a document, an attribute and a method of the packaged component, wherein the operation flow comprises the following steps: executing the step and executing the component image of the object; if not, recording an operation process through a LOADRUNNER library function, splitting the operation process into operation flows, acquiring an icon image in a source code for each operation in the operation flows, and storing the icon image in the operation flows;
step S4: the user puts forward an execution request of the operation flow, inputs actual parameters, instantiates the corresponding packaged components into the memory, and obtains an execution step of the packaged components and icon images contained in the components;
step S5: using a visual positioning application image matching algorithm to input icon images contained in components in the operation flow into an inverse aspect ratio picture and text recognition neural network, and outputting the icon images as coordinates of the to-be-operated icons or text box components in the operation flow; and automatically and sequentially carrying out corresponding operation on the coordinates according to the operation flow sequence.
In one embodiment, the step S1 of performing function level decoupling according to a source code of a digital resource service program provided by a user, generating a function level abstract for each function of the source code, thereby obtaining a function level code segment with a code abstract, and specifically includes:
step S101: converting the source code of the digital resource service program into vector representation through a word bag model embedding layer: constructing word list according to words in source code of digital resource service program, calculating word frequency of each word in source code of digital resource service program, and making each wordThe position of each word in the word list is used as the dimension of the vector, the word frequency is used as the value of the vector, and the vector sequence n= { n of the source code of the digital resource service program is constructed 1 ,n 2 …,n j },n j ∈[0,1] |N| Where N is the number of natural language corpora;
step S102: inputting the vector sequence into an encoder of a time-series attention-based encoder-decoder neural network, wherein the encoder comprises a plurality of time-series attention network blocks;
FIG. 2 is a schematic diagram of an encoder-decoder neural network based on time-series attention;
in the time-attention network block as shown in fig. 3, the vector sequence n at the current time t will be t And last time hidden state sequence h t-1 Obtaining an influence factor eta of the previous moment on the current moment through the first full connection layer FC t Will eta t And the time sequence state vector c at the last moment t-1 Multiplying to obtain the time sequence state correction theta t The method comprises the steps of carrying out a first treatment on the surface of the At the same time, n t And h t-1 Obtaining the input state index after passing through the second full connection layer FCThe method comprises the steps of carrying out a first treatment on the surface of the Using an activation function tanh for n t After non-linearization and->Multiplying to obtain current time sequence input correction phi t The method comprises the steps of carrying out a first treatment on the surface of the Will be theta t And phi is equal to t Adding to obtain the current time sequence state c t The method comprises the steps of carrying out a first treatment on the surface of the Will c t Nonlinear with n after activation function tanh t And the calculation result alpha of one-dimensional convolution and attention mechanism calculation t Multiplying to obtain hidden state sequence h of current time sequence t
Hidden state sequence h of current time sequence t And timing state c t The calculation is performed by the following formula:
η t =W ·h t-1 +W ·n t +b η
θ t =η t ·c t-1
c t =φ tt
h t =α t ·tanh(c t )
wherein W is __ And b _ Representing parameters to be trained;
the attention mechanism is calculated by the following formula:
wherein W is attn Is one-dimensional convolution sum, W _attn Representing a matrix to be trained in the attention calculation, representing convolution operation, and l is the length of a vector sequence;
the output of the last time sequence-attention network block in the encoder is the code coding representation C in the time sequence state;
finally, inputting the code representation C into a decoder network, and generating a natural language abstract y= { y by calculating the product of conditional probabilities of the next word as the probability of the natural language abstract of the code sentence 1 ,…,y l′ };
Wherein y is i Representing the ith word in the generated abstract; l' isAbstractIs a length of (2);
through the steps, the direct natural language abstract of the source code segment can be obtained, and the process is called NMT conversion;
step S103: generating an abstract syntax tree AST by using a digital resource service program source code;
step S104: searching a server code AST data set to obtain a similar code segment with the minimum cosine distance from the AST, wherein the low-frequency word difference in the similar code segment has larger weight on the cosine distance;
step S105: inputting the similar code segments into an encoder-decoder neural network model based on time sequence attention, and obtaining an encoder output result C'; c and C 'are merged and then input into a decoder, wherein C is more sensitive to high-frequency words in source codes of the digital resource service program, weights of low-frequency words in similar code segments are added to C', and finally the decoder outputs a function-level abstract for balanced merging of the high-frequency keywords and the low-frequency keywords.
According to the method, the function level abstract of the high-low frequency keyword fusion is generated through AST retrieval and NMT conversion, and the effect of the function or the method can be accurately described.
In one embodiment, the step S1 of recombining the function-level code segments capable of forming the component into separate component-level code segments by using the component-level coupling algorithm specifically includes:
step S111: determining the type of the framework used by the digital resource service program according to the grammar and the keywords in the source code of the digital resource service program;
determining whether a real framework, an element UI framework, a Vue. Js framework or other frameworks are used according to digital resource service program source code;
step S112: checking whether the function-level code segment accords with the component structure according to the component structure of the frame type;
for example, the act component needs to inherit from the act. Component and implement the render method, while the vue. Js component needs to define a template or render function, etc.;
step S113: analyzing the attribute of the component according to the component attribute definition mode of the frame type;
for example, the properties of the act component are typically defined using tips keywords, while the properties of the Vue. Js component are typically defined using tips properties;
step S114: analyzing a method of the component according to a component method definition mode of the frame type;
methods such as the act component are typically defined in classes, while the method of the vue.js component is typically defined in methods attributes;
step S115: analyzing the event of the component according to the component event definition mode of the frame type;
for example, the state of a real component is typically defined using a state attribute, while the state of a vue.js component is typically defined using a data attribute;
step S116: analyzing the state of the component according to the component state definition mode of the frame type;
for example, the state of a real component is typically defined using a state attribute, while the state of a vue.js component is typically defined using a data attribute;
step S117: analyzing the life cycle of the component according to the definition mode of the life cycle of the component of the frame type and carrying out unified processing;
for example, the lifecycle method of a reaction component is typically defined prefixed with component, while the lifecycle method of a vue.
According to the embodiment of the invention, the function-level code abstract is used for coupling the function granularity code into the component granularity code through the algorithm of the component-level coupling module, and the independent component code segments are separated from the whole code through analyzing and combining functions or methods.
And finally, carrying out unified packaging on the components according to the content of the components, the types of input and output and the characteristics of the components by a component digest generation module according to the function-level digests and the component-level code segments, and generating component-level digests.
Aiming at the characteristic that the time sequence model generated by the existing code abstract is too dependent on high-frequency words, and the high-frequency words in the code are often variable names, the invention uses a high-frequency keyword and low-frequency keyword fusion method based on AST (AST) retrieval and NMT (network management T) conversion, and fuses low-frequency word information by combining with the retrieval of the nearest abstract semantic tree, thereby generating a more accurate function-level code abstract, recombining the function-level code segments into independent component-level code segments, and generating a corresponding component-level code abstract, and overcoming the defect that only the function-level code abstract can be generated in the prior art.
In one embodiment, step S2 above: according to the content of the component-level code segment, the type of input and output and the attribute thereof, uniformly packaging the component-level code segment and the component-level abstract, and storing the packaged components into a component packaging database;
and (3) uniformly packaging the components according to the component-level code segments and the corresponding component-level abstracts generated in the step (S1), the content of the components, the types of input and output and the characteristics of the components, and storing the components in a component packaging database. By packaging the components, all the decoupled components can have uniform interface description. The packaged component only exposes information necessary for calling the component to the outside, and specific composition information inside the component is hidden.
In one embodiment, the step S3: selecting executable packaged components from a component packaging database; judging according to a keyword matching algorithm, and if the keyword matching algorithm accords with a framework capable of automatically extracting an execution element, comprehensively forming an operation flow by reading three modes of a document, an attribute and a method of the packaged component, wherein the operation flow comprises the following steps: executing the step and executing the component image of the object; if not, recording an operation process through a LOADRUNNER library function, splitting the operation process into operation flows, acquiring an icon image in a source code for each operation in the operation flows, and storing the icon image in the operation flows;
after selecting one component in the component packaging database, executing the following steps:
(1) Firstly judging the type of a component, and if the component uses a common exact framework, an elementUI framework and a vue framework, entering a step (3); if components of other frames are used, go to step (2);
(2) The system records the operation of the user on the component, analyzes the operation into the atomic operation of the component such as mouse click, keyboard typing, mouse movement, roller scrolling, icon positioning and the like, and stores the atomic operation into an execution element database;
(3) The documents of the components are viewed, the execution elements in the documents are extracted by a named entity recognition algorithm, and for the operations, the names and descriptions of the verbs and adjectives in the component documents are determined by looking up them. For example, if a verb such as "click" or "click" is included in the document, the name of the operation is determined as "click".
And forming an operation flow according to the execution element dependency relationship in the document. If the document is not successfully read, the step (5) is carried out;
(4) And the attribute of the view component is matched with the attribute used for specifying the user operation, and an operation flow is formed according to the dependency relationship. For example, according to the component frame classification, the "onClick" attribute, "@ click" attribute, and "@ click" attribute are respectively matched, which specify the method that should be performed when the button is clicked;
(5) And the attribute of the view component is matched with the attribute used for specifying the user operation, and an operation flow is formed according to the dependency relationship. For example, according to the component frame classification, the "onClick" attribute, "@ click" attribute, and "@ click" attribute are respectively matched, which specify the method that should be performed when the button is clicked;
(6) For the web side component, the requests are used to request web content specifying the URL, and then the beautfulso library is used to parse the HTML document. Traversing all < img > tags in the HTML document, obtaining a link for each picture. If the link is a relative path, it is converted to an absolute path. Finally, the program uses the requests library to download each picture and saves it to the designated folder. For the client component, the PNG, ICO, SVG format resource file in the program code is looked up and the icoextract tool is used to extract the icon in the ICO file. Recording corresponding pictures of each step of execution elements in the operation flow, for example, icons to be clicked, and storing the pictures in a dictionary data structure;
in one embodiment, step S4 above: the user puts forward an execution request of the operation flow, inputs actual parameters, instantiates the corresponding packaged components into the memory, and obtains an execution step of the packaged components and icon images contained in the components;
when a user makes an execution request of an operation flow, reading corresponding packaged component information in a component packaging database, wherein the method comprises the following steps: the attribute, the parameter, the input and output interface and the real parameters transmitted by the user are received;
creating an instance of the packaged component and allocating resources for the instance;
initializing the packaged component comprises setting the initial state of the component, initializing the internal data structure of the component and the like.
In one embodiment, the step S5 is as follows: using a visual positioning application image matching algorithm to input icon images contained in components in the operation flow into an inverse aspect ratio picture and text recognition neural network, and outputting the icon images as coordinates of the to-be-operated icons or text box components in the operation flow; and automatically and sequentially carrying out corresponding operation on the coordinates according to the sequence of operation flows, which comprises the following steps:
step S51: the method comprises the steps of inputting icon images contained in a component corresponding to a component execution step and an operation flow, wherein the execution step is formed by component atomic operation: mouse click, keyboard typing, mouse movement, scroll wheel scrolling, icon positioning;
step S52: constructing an inverse aspect ratio picture frame and a text recognition neural network, resetting an input page image to be operated to 224 x 224 size, obtaining a high-dimensional feature image with 32 x 32 size through an 18-layer res-net backbone network, and performing inverse aspect ratio transformation on the high-dimensional feature image to obtain an aspect ratio of 3:4,9:16, 10:16 three feature graphs, wherein 8 x 8, 16 x 16 and 1 x 2,1 x 5 and 1 x 8 anchor frames are used for each feature graph, classification scores and regression scores are calculated for each anchor frame, and finally target component pictures and coordinates thereof and text contents of target components in a page image to be operated are identified through a multi-task loss function;
FIG. 4 is a schematic diagram of an inverse aspect ratio picture frame and a text recognition neural network;
step S53: acquiring the coordinate position of a picture of a target component and the content of a text, and constructing a dictionary for storing the picture, the text and the position;
step S54: inquiring whether the picture frame position coordinates of the target component are cached in the dictionary, if so, entering step S55, otherwise, entering step S56;
step S55: searching an icon in the area near the cache coordinates, returning to the coordinates of the picture if the picture is found, updating the coordinates of the icon in the dictionary, and entering step S57, otherwise entering step S56;
step S56: s52, inquiring the target picture of the page to be operated again, if the target picture is inquired, returning the coordinates of the target picture, and updating the picture coordinates in the dictionary; if not found, returning prompt information of the found picture, and waiting for the next operation of the user;
step S57: the target picture coordinates and the operation flow in the page to be operated are sent to a concurrency control module, and the concurrency control module performs actual operation, and specifically comprises the following steps:
(1) Identifying concurrent operation, and classifying read-only and modifiable read-write conditions of sharing and privately owned data objects;
(2) Selecting proper concurrency control strategies, which are classified into blocking (Locking), time stamp (Timestamp), optimistic lock (OptimisticLocking), etc.;
(3) Implementing a control mechanism according to a policy, including locking, checking version numbers, rolling back transactions, and the like;
(4) And monitoring the execution condition of concurrent operation, including logging, detecting deadlock and optimizing performance.
Compared with the direct recording of mouse operation coordinates, the operation flow of the algorithm can be more accurately executed on a user system with different length-width ratios, and has stronger robustness to network delay. Meanwhile, the two-step search strategy avoids time waste.
Example two
As shown in fig. 5, an embodiment of the present invention provides a component decoupling and activation system for digital resources, which includes the following modules:
the component decoupling module is used for generating a function level code segment with a code abstract, a component level code segment and a component level abstract according to the input digital resource service program source code, and comprises the following modules:
function level decoupling module: the function level decoupling module is used for performing function level decoupling according to the source codes of the digital resource service program provided by the user, and generating a function level abstract for each function of the source codes so as to obtain a function level code section with the code abstract;
component level coupling module: recombining function-level code segments capable of forming components into independent component-level code segments by utilizing a component-level coupling algorithm;
component abstract generation module: the method comprises the steps that a component digest generation module is used for uniformly packaging components according to the function-level digest and component-level code segments and according to the content of the components, the types of input and output and the characteristics of the components, so as to generate component-level digests;
the component packaging module is used for uniformly packaging the component-level code segments and the component-level abstracts according to the content of the component-level code segments, the types of input and output and the attributes of the input and output, and storing the packaged components into the component packaging database;
the execution element extraction module is used for selecting executable packaged components from the component packaging database; judging according to a keyword matching algorithm, and if the keyword matching algorithm accords with a framework capable of automatically extracting an execution element, comprehensively forming an operation flow by reading three modes of a document, an attribute and a method of the packaged component, wherein the operation flow comprises the following steps: executing the step and executing the component image of the object; if not, recording an operation process through a LOADRUNNER library function, splitting the operation process into operation flows, acquiring an icon image in a source code for each operation in the operation flows, and storing the icon image in the operation flows;
the component instantiation module is used for providing an execution request of an operation flow for a user, inputting actual parameters, instantiating the corresponding packaged component into a memory, and obtaining an execution step of the packaged component and an icon image contained in the component;
the operation execution module is used for inputting icon images contained in the components in the operation flow into the inverse aspect ratio picture and text recognition neural network by using a visual positioning application image matching algorithm, and outputting the icon images as coordinates of the to-be-operated icons or text box components in the operation flow; and automatically and sequentially carrying out corresponding operation on the coordinates according to the operation flow sequence.
The above examples are provided for the purpose of describing the present invention only and are not intended to limit the scope of the present invention. The scope of the invention is defined by the appended claims. Various equivalents and modifications that do not depart from the spirit and principles of the invention are intended to be included within the scope of the invention.

Claims (5)

1. A method for decoupling and activating components oriented to digital resources, comprising:
step S1: performing function level decoupling according to a digital resource service program source code provided by a user, and generating a function level abstract for each function of the source code, thereby obtaining a function level code segment with a code abstract; recombining the function level code segments capable of forming the components into independent component level code segments by using a component level coupling algorithm; finally, the component level abstract is generated by uniformly packaging the component according to the content of the component, the type of input and output and the characteristics of the component through the component abstract generating module according to the function level abstract and the component level code segment;
step S2: according to the content of the component-level code segment, the type of input and output and the attribute thereof, uniformly packaging the component-level code segment and the component-level abstract, and storing the packaged components into a component packaging database;
step S3: selecting executable components after encapsulation from the component encapsulation database; judging according to a keyword matching algorithm, and if the keyword matching algorithm accords with a framework capable of automatically extracting an execution element, comprehensively forming an operation flow by reading a document, an attribute and a method of the packaged component, wherein the operation flow comprises the following steps: executing the step and executing the component image of the object; if not, recording an operation process through a LOADRUNNER library function, splitting the operation process into operation flows, acquiring an icon image in a source code for each operation in the operation flows, and storing the icon image in the operation flows;
step S4: the user puts forward an execution request of the operation flow, inputs actual parameters, instantiates the corresponding packaged component into a memory, and obtains an execution step of the packaged component and an icon image contained in the component;
step S5: using a visual positioning application image matching algorithm to input icon images contained in components in the operation flow into an inverse aspect ratio picture and text recognition neural network, and outputting the icon images as coordinates of the to-be-operated icons or text box components in the operation flow; and automatically and sequentially carrying out corresponding operation on the coordinates according to the operation flow sequence.
2. The method for decoupling and activating components for digital resources according to claim 1, wherein in step S1, function-level decoupling is performed according to a digital resource service program source code provided by a user, and a function-level abstract is generated for each function of the source code, so as to obtain a function-level code segment with a code abstract, and the method specifically comprises:
step S101: converting the source code of the digital resource service program into vector representation through a word bag model embedding layer: constructing a word list according to words in the source codes of the digital resource service program, calculating word frequency of each word in the source codes of the digital resource service program, taking the position of each word in the word list as the dimension of a vector, taking the word frequency as the value of the vector, and constructing a vector sequence n= { n of the source codes of the digital resource service program 1 ,n 2 ...,n j },n j ∈[0,1] |N| Where N is the number of natural language corpora;
step S102: inputting the vector sequence into an encoder of a time-series attention-based encoder-decoder neural network, wherein the encoder comprises a plurality of time-series attention network blocks;
in the time sequence-attention network block, the direction of the current moment t is to be determinedQuantity sequence n t And last time hidden state sequence h t-1 Obtaining an influence factor eta of the previous moment on the current moment through the full connection layer t Will eta t And the time sequence state vector c at the last moment t-1 Multiplying to obtain the time sequence state correction theta t The method comprises the steps of carrying out a first treatment on the surface of the At the same time, n t And h t-1 Obtaining the input state index after passing through the second full connection layerUsing an activation function for n t After non-linearization and->Multiplying to obtain current time sequence input correction phi t The method comprises the steps of carrying out a first treatment on the surface of the Will be theta t And phi is equal to t Adding to obtain the current time sequence state c t The method comprises the steps of carrying out a first treatment on the surface of the Will c t Nonlinear with n after activation function t And the calculation result alpha of one-dimensional convolution and attention mechanism calculation t Multiplying to obtain hidden state sequence h of current time sequence t
Hidden state sequence h of current time sequence t And timing state c t The calculation is performed by the following formula:
η t =W ·h t-1 +W ·n t +b η
θ t =η t ·c t-1
c t =φ tt
h t =α t ·tanh(c t )
wherein W __ and b_represent parameters to be trained;
the attention mechanism is calculated by the following formula:
wherein W is attn Is one-dimensional convolution sum, W _attn Representing a matrix to be trained in attention calculation, representing convolution operation, and l is the length of the vector sequence;
the output of the last time sequence-attention network block in the encoder is that the time sequence state is a code coding representation C;
finally, inputting the code representation C into a decoder network, and generating a natural language abstract y= { y by calculating the product of conditional probabilities of the next word as the probability of the natural language abstract of the code sentence 1 ,...,y l′ };
Wherein y is i Representing the ith word in the generated abstract; l' isAbstractIs a length of (2);
through the steps, the direct natural language abstract of the source code segment can be obtained, and the process is called NMT conversion;
step S103: generating an abstract syntax tree AST by the source code of the digital resource service program;
step S104: searching a server code AST data set to obtain a similar code segment with the minimum cosine distance from the AST, wherein the low-frequency word difference in the similar code segment has larger weight on the cosine distance;
step S105: inputting the similar code segments into an encoder-decoder neural network model based on time sequence attention to obtain an encoder output result C The method comprises the steps of carrying out a first treatment on the surface of the C and C Merging and inputting to the decoder, wherein C is equal to CThe high frequency words in the source code of the digital resource service program are more sensitive to C And increasing the weight of the low-frequency words in the similar code segments, and finally outputting the function level abstract of the high-frequency and low-frequency keyword balanced fusion by the decoder.
3. The method for decoupling and activating components for digital resources according to claim 1, wherein in step S1, the function-level code segments capable of forming components are recombined into independent component-level code segments by using a component-level coupling algorithm, and the method specifically comprises:
step S111: determining the type of the framework used by the digital resource service program according to the grammar and the keywords in the source code of the digital resource service program;
step S112: checking whether the function level code segment accords with a component structure according to the component structure of the frame type;
step S113: analyzing the attribute of the component according to the component attribute definition mode of the frame type;
step S114: analyzing a method of the component according to a component method definition mode of the frame type;
step S115: analyzing the event of the component according to the component event definition mode of the frame type;
step S116: analyzing the state of the component according to the component state definition mode of the frame type;
step S117: and analyzing the life cycle of the component according to the definition mode of the life cycle of the component of the frame type and carrying out unified processing.
4. The method for decoupling and activating components for digital resources according to claim 1, wherein said step S5: using a visual positioning application image matching algorithm to input icon images contained in components in the operation flow into an inverse aspect ratio picture and text recognition neural network, and outputting the icon images as coordinates of the to-be-operated icons or text box components in the operation flow; and automatically and sequentially carrying out corresponding operation on the coordinates according to the operation flow sequence, which comprises the following steps:
step S51: inputting a component execution step and icon images contained in corresponding components in the operation flow, wherein the execution step is formed by component atomic operations: mouse click, keyboard typing, mouse movement, scroll wheel scrolling, icon positioning;
step S52: constructing an inverse aspect ratio picture frame and a text recognition neural network, resetting an input page image to be operated to 224 x 224 size, obtaining a high-dimensional feature image with 32 x 32 size through an 18-layer res-net backbone network, and performing inverse aspect ratio transformation on the high-dimensional feature image to obtain an aspect ratio of 3:4,9:16, 10:16 three feature graphs, wherein 8 x 8, 16 x 16 and 1 x 2,1 x 5 and 1 x 8 anchor frames are used for each feature graph, classification scores and regression scores are calculated for each anchor frame, and finally target component pictures and coordinates thereof in the page image to be operated and text contents of the target components are identified through a multi-task loss function;
step S53: acquiring the coordinate position and text content of the target component picture, and constructing a dictionary for storing the picture, the text and the position;
step S54: inquiring whether the picture frame position coordinates of the target component are cached in the dictionary, if so, entering step S55, otherwise, entering step S56;
step S55: searching an icon in the area near the cache coordinates, returning to the coordinates of the picture if the picture is found, updating the coordinates of the icon in the dictionary, and entering a step S57, otherwise entering a step S56;
step S56: s52, inquiring the target picture of the page to be operated again, if the target picture is inquired, returning the coordinates of the target picture, and updating the picture coordinates in the dictionary; if not found, returning prompt information of the found picture, and waiting for the next operation of the user;
step S57: and sending the target picture coordinates and the operation flow in the page to be operated to a concurrency control module, and executing actual operation by the concurrency control module.
5. A digital resource oriented component decoupling and activation system comprising the following modules:
the component decoupling module is used for performing function level decoupling according to a digital resource service program source code provided by a user, and generating a function level abstract for each function of the source code so as to obtain a function level code segment with a code abstract; recombining the function level code segments capable of forming the components into independent component level code segments by using a component level coupling algorithm; finally, the component level abstract is generated by uniformly packaging the component according to the content of the component, the type of input and output and the characteristics of the component through the component abstract generating module according to the function level abstract and the component level code segment;
the component packaging module is used for uniformly packaging the component-level code segments and the component-level abstracts according to the content, the input and output types and the attributes of the component-level code segments, and storing the packaged components into a component packaging database;
the execution element extraction module is used for selecting the executable packaged components from the component packaging database; judging according to a keyword matching algorithm, and if the keyword matching algorithm accords with a framework capable of automatically extracting an execution element, comprehensively forming an operation flow by reading a document, an attribute and a method of the packaged component, wherein the operation flow comprises the following steps: executing the step and executing the component image of the object; if not, recording an operation process through a LOADRUNNER library function, splitting the operation process into operation flows, acquiring an icon image in a source code for each operation in the operation flows, and storing the icon image in the operation flows;
the component instantiation module is used for providing an execution request of an operation flow for a user, inputting a real parameter, instantiating the corresponding packaged component into a memory, and obtaining an execution step of the packaged component and an icon image contained in the component;
the operation execution module is used for inputting icon images contained in the components in the operation flow into the anti-aspect ratio picture and text recognition neural network by using a visual positioning application image matching algorithm, and outputting the icon images as coordinates of the to-be-operated icons or text box components in the operation flow; and automatically and sequentially carrying out corresponding operation on the coordinates according to the operation flow sequence.
CN202310638822.1A 2023-06-01 2023-06-01 Component decoupling and activating method and system for digital resources Pending CN116627488A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310638822.1A CN116627488A (en) 2023-06-01 2023-06-01 Component decoupling and activating method and system for digital resources

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310638822.1A CN116627488A (en) 2023-06-01 2023-06-01 Component decoupling and activating method and system for digital resources

Publications (1)

Publication Number Publication Date
CN116627488A true CN116627488A (en) 2023-08-22

Family

ID=87641570

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310638822.1A Pending CN116627488A (en) 2023-06-01 2023-06-01 Component decoupling and activating method and system for digital resources

Country Status (1)

Country Link
CN (1) CN116627488A (en)

Similar Documents

Publication Publication Date Title
US11417131B2 (en) Techniques for sentiment analysis of data using a convolutional neural network and a co-occurrence network
US20210049053A1 (en) Application interface governance platform to harmonize, validate, and replicate data-driven definitions to execute application interface functionality
KR102128571B1 (en) Efficient state machine for real-time dataflow programming
US8510237B2 (en) Machine learning method to identify independent tasks for parallel layout in web browsers
US10796084B2 (en) Methods, systems, and articles of manufacture for automatic fill or completion for application software and software services
US8745026B1 (en) Collaborative modeling environment
CN104704489A (en) Predicting the usage of document resources
CN111507086B (en) Automatic discovery of translated text locations in localized applications
JP2010501096A (en) Cooperative optimization of wrapper generation and template detection
CN104583949A (en) Pre-processing of scripts in web browsers
CN104603756A (en) Speculative resource pre-fetching via sandboxed execution
CN112100401B (en) Knowledge graph construction method, device, equipment and storage medium for science and technology services
CN112148356B (en) Document generation method, interface development method, device, server and storage medium
Vokác An efficient tool for recovering Design Patterns from C++ Code.
US20220414463A1 (en) Automated troubleshooter
Athanasopoulos et al. Extracting REST resource models from procedure-oriented service interfaces
Zhou et al. Effective approaches to combining lexical and syntactical information for code summarization
CN114385148A (en) Method, device, equipment and storage medium for realizing linkage function
CN116627488A (en) Component decoupling and activating method and system for digital resources
US20140279743A1 (en) Jabba-type override for correcting or improving output of a model
CN110502483B (en) Data processing method, data processing device, computer equipment and storage medium
Ogboada et al. A model for optimizing the runtime of GraphQL queries
CN116991459B (en) Software multi-defect information prediction method and system
Singh et al. Internet Surfing Prediction System using Association Rule Mining based on FP-Growth
CN114924721A (en) Code generation method and device, computer 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