CN110532782A - A kind of detection method of task execution program, device and storage medium - Google Patents
A kind of detection method of task execution program, device and storage medium Download PDFInfo
- Publication number
- CN110532782A CN110532782A CN201910694843.9A CN201910694843A CN110532782A CN 110532782 A CN110532782 A CN 110532782A CN 201910694843 A CN201910694843 A CN 201910694843A CN 110532782 A CN110532782 A CN 110532782A
- Authority
- CN
- China
- Prior art keywords
- task execution
- reinspection
- execution program
- block chain
- program
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/50—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
- G06F21/55—Detecting local intrusion or implementing counter-measures
- G06F21/56—Computer malware detection or handling, e.g. anti-virus arrangements
- G06F21/562—Static detection
- G06F21/563—Static detection by source code analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/50—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
- G06F21/57—Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
- G06F21/577—Assessing vulnerabilities and evaluating computer system security
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2221/00—Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F2221/03—Indexing scheme relating to G06F21/50, monitoring users, programs or devices to maintain the integrity of platforms
- G06F2221/033—Test or assess software
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Hardware Design (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Virology (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- Debugging And Monitoring (AREA)
Abstract
The present invention relates to a kind of detection method of task execution program, device and storage medium, method includes: the source code for obtaining task execution program in block chain network, and source code is formatted processing, obtains the abstract syntax tree AST of intermediate language;The nodal information and optimization processing in AST are extracted, detection file destination is translated into;Hole Detection is carried out to file destination again, when detecting that file destination there are when loophole, if task execution program is state to be released, wouldn't publish in block chain network, the notification information of output detection failure;If issued state, then examining report is generated, and sends warning information and examining report to Warning Service device;When do not detect spring a leak when, if task execution program is state to be released, publish in block chain network, if issued state, then execute processing logic corresponding with the task execution program.This method improves the safety of block chain network.
Description
Technical field
The invention belongs to field of computer technology more particularly to a kind of detection method of task execution program, device and deposit
Storage media.
Background technique
Intelligent contract (Smart Contract) is a kind of to be intended to be propagated, verify or executed in terms of contract in information-based mode
Calculation machine agreement.Intelligent contract permission carries out credible transaction in no third-party situation, these transaction are traceable and irreversible
Turn.Based on security considerations, the source code of the task execution program this kind of to intelligent contract is needed to detect.Mainly pass through at present
The methods of keyword match, canonical matching detect source code, and above two method is right mainly according to preset keyword
The full text of source code carries out keyword match.
In terms of the positioning of method and variable, when there is the mechanism for inheriting parent or interface in task execution program,
The simple keyword by source code positions, and can not accurately identify all methods and variable that a task execution program is possessed
Information.Therefore, for there is the task execution program and logic loophole of inheriting parent or interface mechanism, the inspection of above two method
It is bad to survey effect.The safety of block chain network is unable to get guarantee.
Summary of the invention
The present invention provides detection method, device and the storage medium of a kind of task execution program, to solve the prior art
In detection methods matched etc. using keyword match, canonical to the task execution program of intelligent contract class lead to detection effect not
The technical issues of good, block chain network safety is unable to get guarantee.
On the one hand the present invention provides a kind of detection method of task execution program, and method includes:
Obtain it is to be released in block chain network or issued the source code of the task execution program in block chain network, will
Obtain the source code be formatted processing, obtain intermediate language abstract syntax tree (Abstract Syntax Tree,
AST);
Extract the nodal information of each node in the abstract syntax tree;
Processing is optimized according to different types to the nodal information of extraction, and the nodal information after optimization processing is turned
Turn to the corresponding file destination of task execution program;
Hole Detection is carried out to file destination;
When detecting file destination there are when loophole, if task execution program is task execution program to be released, temporarily
Task execution program is not published in block chain network, the notification information of output detection failure;If task execution program is area
Announced task execution program in block chain then generates examining report, and sends warning information and detection report to Warning Service device
It accuses;
When not detecting file destination there are when loophole, if task execution program is task execution program to be released,
Task execution program is published in block chain network, if task execution program is announced task execution journey in block chain
Sequence then executes processing logic corresponding with task execution program.
Second aspect, the present invention provide a kind of task execution program detection device, and detection device includes:
Module is obtained, to be released in block chain network or has issued the task execution journey in block chain network for obtaining
The source code of sequence, and the source code that will acquire is formatted processing, obtains the abstract syntax tree of intermediate language;
Extraction module, for extracting the nodal information of each node in abstract syntax tree;
Optimization module optimizes processing according to different types for the nodal information to extraction, and by optimization processing
Nodal information afterwards is converted into the corresponding file destination of task execution program;
Hole Detection module carries out Hole Detection to file destination;
Execution module, for when detecting file destination there are when loophole, if task execution program is task to be released
Program is executed, then task execution program wouldn't be published in block chain network, the notification information of output detection failure;If task
Executing program is announced task execution program in block chain, then generates examining report, and send early warning to Warning Service device
Information and examining report;
When not detecting file destination there are when loophole, if task execution program is task execution program to be released,
Task execution program is published in block chain network, if task execution program is announced task execution journey in block chain
Sequence then executes processing logic corresponding with task execution program.
The third aspect, the present invention provide a kind of readable storage medium storing program for executing, are stored thereon with computer program, comprising: computer
When program is executed by processor, each step in first aspect task execution detection method is realized.
From the embodiments of the present invention it is found that before the embodiment of the present invention issues task execution program to be released
Hole Detection, and the Hole Detection after issuing to the issued task execution program in block chain network, can be with
It avoids the task execution program there are loophole from being published, and realizes there are the early warning of the release process of loophole, improve block
The safety of chain network.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those skilled in the art without any creative labor, can be with root
Other attached drawings are obtained according to these attached drawings.
Fig. 1 is the structural schematic diagram of block chain network in the embodiment of the present application;
Fig. 2 is a flow diagram of task execution program detection method in the embodiment of the present application;
Fig. 3 is the embodiment of the present application interior joint Advance data quality flow diagram;
Fig. 4 is an optimized flow chart of task execution program detection method in the embodiment of the present application;
Fig. 5 is another optimized flow chart of task execution program detection method in the embodiment of the present application;
Fig. 6 is the module diagram of task execution program detection device in the embodiment of the present application.
Specific embodiment
In order to make the invention's purpose, features and advantages of the invention more obvious and easy to understand, below in conjunction with the present invention
Attached drawing in embodiment, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described reality
Applying example is only a part of the embodiment of the present invention, and not all embodiments.Based on the embodiments of the present invention, those skilled in the art
Member's every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
Fig. 1 be the present invention in block chain network structural schematic diagram, the block chain network 100 include computer equipment 110,
Recheck other terminals 141,142,143 etc. in server 120, Warning Service device 130 and block chain network.
It should be understood that block chain network is the network of P2P, in the network system of block chain, each node is
Equity, each node provides network service jointly, while being client and server.In the technical program, above-mentioned calculating
Machine equipment 110 can be the terminal in block chain network, relative to submit task execution program terminal for its
It can be management server.
Technical solution in for a better understanding of the invention, referring to Fig. 2, for task execution program in the embodiment of the present application
Detection method flow diagram, comprising:
Step 201 obtains and to be released in block chain network or has issued the task execution program in block chain network
Source code, the source code that will acquire are formatted processing, obtain the abstract syntax tree of intermediate language;
In the embodiment of the present application, computer equipment 110 receives the publication of the submission of terminal 141 in block chain in Fig. 1
In network 100 or the task execution program to be released into block chain network 100, and get the source generation of the task execution program
Code.Task execution program for example can be intelligent contract program, programming language solidity, by the source generation of task execution program
Code, which is formatted, to be handled and parses grammatical and semantic therein, and then according to the grammatical and semantic of parsing, generation is held comprising task
The AST of metadata information in the source code of line program, AST are existed in the form of node, nesting layer by layer.It can be in AST
But it is not limited to comprising attributes, children, id, the parts such as name and src mapsrc.Wherein, attributes packet
Containing the distinctive information attribute of node;Children is child list;Id is node identification, and each node is believed with unique identification
Breath, and ancestor node can be positioned according to nodal community etc. for reference node;Name is nodename;Src mapsrc is used
In positioning source code.Specifically, being compiled using solc compiling to the source code of task execution program, AST is obtained.
Step 202, extract abstract syntax tree in each node nodal information;
In embodiments of the present invention, computer equipment 110 includes but is not limited to from the information that abstract syntax tree extracts: each section
The attribute of point, specific type, corresponding code source information;From the connection relationship obtained in abstract syntax tree between each node.
Step 203 optimizes processing according to different types to the nodal information of extraction, and by the section after optimization processing
Point information is converted into the corresponding file destination of task execution program;
In embodiments of the present invention, computer equipment 110 optimizes the nodal information got, uses python journey
The nodal information that ordered pair extracts optimizes processing according to different types, is mainly merged by same category information, redundancy is deleted
It removes, formed and track, source code supplement, stain tracking is called to optimize, and be translated into the file destination of Json format.
The optimization processing will be described in detail in subsequent embodiment, this is not repeated them here.
Step 204 carries out Hole Detection to file destination;
In embodiments of the present invention, based on file destination derived above, computer equipment 110 to task execution program into
Row Hole Detection.I.e. from file destination, the information of target to be detected in corresponding with task to be detected object is obtained, and is analyzed
The consistency of information and preset task the detection program information of acquisition, to judge whether there is loophole.
Step 205, when detecting file destination there are when loophole, if task execution program is task execution journey to be released
Task execution program wouldn't be then published in block chain network by sequence, the notification information of output detection failure;If task execution journey
Sequence is announced task execution program in block chain, then generates examining report, and to Warning Service device send warning information and
Examining report;
In embodiments of the present invention, when computer equipment 110 detect the task execution program there are when loophole, if this
It is task execution program to be released that business, which executes program, then wouldn't be published to the task execution program in block chain network 100,
So that the task execution program does not come into force, while exporting the notification information of detection failure;If the task execution program is block
Announced task execution program in chain then generates examining report, and sends warning information and the detection to Warning Service device 130
Report, to carry out early warning.
Step 206, when not detecting file destination there are when loophole, if task execution program is task execution to be released
Task execution program is then published in block chain network by program, if task execution program is announced task in block chain
Program is executed, then executes processing logic corresponding with task execution program;
In embodiments of the present invention, when computer equipment 110 does not detect the task execution program there are when loophole, if should
Task execution program is task execution program to be released, then the task execution program is published in block chain network 100, with
So that the task execution program comes into force;If the task execution program is announced task execution program in block chain, execute
Processing logic corresponding with the task execution program.
In embodiments of the present invention, by the Hole Detection before being issued to task execution program to be released, and
Hole Detection after issuing to the issued task execution program in block chain network, can be to avoid there are loopholes
Task execution program is published, and is realized there are the early warning of the release process of loophole, and the safety of block chain network is improved.
Based on embodiment illustrated in fig. 2, referring to Fig. 3, to be saved in task execution program detection method in the embodiment of the present application
The flow diagram of point Advance data quality, comprising the following steps:
Step 301, to each node in abstract syntax tree, attribute, specific type based on node and connection relationship carry out
Merge or is associated with;
In embodiments of the present invention, computer equipment 110 closes method or variable similar in task execution program
And be associated with, avoid to same problem repeat detect;Similar method or variable are marked, in the mistake of subsequent Hole Detection
Cheng Zhong is not detected to label and the non-method first appeared or variable.
Step 302, to each node after merging or association, based on being inherited from parent in code source information or realize interface
Method carries out redundancy deletion;
In embodiments of the present invention, computer equipment 110 is to being inherited from parent or realize interface in task execution program
Method carries out redundancy deletion, improves detection efficiency.
Step 303, redundancy is deleted after each node, generated using the reference between each node and the relationship being cited each
The calling track of node;
In embodiments of the present invention, computer equipment 110, which is extracted, specifies sensitive method or variable in task execution program
Recalls information, and according to the calling track of the recalls information of extraction generation sensitive method or variable, the calling track is for judging
Whether sensitive method or variable cause practical harm and coverage, so that tune when detecting to loophole, can be used
The erroneous judgement to loophole is further decreased with track.
Step 304, to redundancy delete after each node, carry out code source supplement process, obtain that there is each of full code source
Node;
In embodiments of the present invention, computer equipment 110 supplements the source code of the node of reference complete, to avoid next
Occur judging by accident and fail to judge because code occur and not completing in the Hole Detection of step.
Step 305, using stain tracking technique, tracking is marked for each node, and label tracking information is saved
Into nodal information;
In embodiments of the present invention, computer equipment 110 utilizes stain tracking technique, in task execution program
Tracking is marked in storage categorical variable and default critical operations, to be based on file destination in next step, holds to task
When line program completes Hole Detection, determining has whether the variable of the label and method have detected, and has to what is do not detected
The variable and method of the label carry out supplement detection.In conjunction with stain tracking technique and call track can further reduce for
The erroneous judgement of loophole.
It is preferably based on Fig. 2 embodiment, please refers to Fig. 4 flow chart, is the process of the addition step of embodiment illustrated in fig. 2
Schematic diagram, comprising:
Step 401, when detecting that file destination there are when loophole, generates examining report, and will test report and task is held
Line program is sent to reinspection server;
In the embodiment of the present application, when detecting the task execution program there are when loophole, examining report is generated, and will inspection
It observes and predicts announcement and the task execution program is sent to reinspection server 120, to be rechecked to the task execution program.Herein may be used
To be that computer equipment is rechecked, it is also possible to manually be rechecked.
Step 402, when the reinspection result that the reinspection server received returns is qualified for reinspection, if task execution program
For task execution program to be released, then task execution program is published in block chain network, and exports task execution program
Announced notification information;If task execution program is announced task execution program, execute and task execution program pair
The processing logic answered;
Receive the reinspection that reinspection server returns as a result, and determine to recheck result it is whether qualified: if task execution program is
State to be released, then publish in network, and exports announced notification information;If issued state, then execute with
The corresponding processing logic of task execution program.
Step 403, when the reinspection result that the reinspection server received returns is rechecks unqualified, if task execution journey
Sequence is task execution program to be released, then wouldn't be published to task execution program in block chain network, output detection failure
Notification information;If task execution program is announced task execution program in block chain, reverification test report is generated, and
Warning information and reverification test report are sent to Warning Service device;
In the embodiment of the present application, when the reinspection result that the reinspection server that computer equipment 110 receives returns is multiple
It when examining unqualified, if task execution program is state to be released, wouldn't publish in network, output detection failure is led to
Know information;If issued state in block chain, then generate reverification test report, and to Warning Service device send warning information and
Reverification test report.
By being rechecked using reinspection server, can to avoid because default reinspection it is regular it is incomplete caused by judge by accident,
Further increase the accuracy of judging result.
Further, it is based on Fig. 2 embodiment, referring to Fig. 5, the process of another additional step for embodiment illustrated in fig. 2
Schematic diagram, comprising:
Step 501, when detecting file destination there are when loophole, examining report is generated, and generate for task execution program
Task execution program is rechecked, and file destination, examining report and reinspection task execution program are published in block chain network
Each terminal is rechecked, and will test report and task execution program is sent to reinspection server, within a preset time, receives block
The reinspection result that each terminal and reinspection server in chain network return;
In the embodiment of the present application, when computer equipment 110 detects the task execution program there are when loophole, in addition to will
Examining report and the task execution program are sent to except reinspection server rechecked, and computer equipment can also generate multiple simultaneously
Task execution program is examined, and the examining report and the reinspection task execution program of file destination and generation are published to block link network
In network, so that other terminals 141,142,143 etc. in block chain network are based on the examining report and file destination to task
Program is executed to be rechecked.Then, within a preset time receive reinspection server and other terminals return reinspection as a result, according to
The reinspection result that other terminals and reinspection server return determines whether that reinspection is qualified.
Step 502, according to the reinspection of each terminal and reinspection server return in block chain network as a result, determining that reinspection is
No qualification;
In the embodiment of the present application, each terminal in block chain network and reinspection server may return reinspection as a result,
For a better understanding, being illustrated separately below:
If the terminal in reinspection server and block chain network returns to reinspection as a result, if rechecked according to receive more parts
As a result reinspection qualification rate is determined;If rechecking qualification rate is greater than or equal to preset qualification rate, determine that reinspection is qualified;If reinspection is closed
Lattice rate is less than preset qualification rate, then determines to recheck unqualified;
If in block chain network terminal or reinspection server in either return to reinspection as a result, if according to receiving
Reinspection is as a result, determine whether reinspection is qualified, and terminate the notification information of reinspection to another party's transmission;
If in preset time, not receiving either one and returning to reinspection as a result, determining to recheck unqualified.
In the embodiment of the present application, if in preset time, other terminals rechecked in server 130 and block chain network are equal
Reinspection is returned as a result, the then reinspection task execution program in computer equipment, according to more parts of reinspections received in preset time knot
The reinspection result that fruit and reinspection server return determines reinspection qualification rate, if reinspection qualification rate is greater than preset qualification rate, sentences
Fixed reinspection is qualified;If rechecking qualification rate is not more than preset qualification rate, determine to recheck unqualified;If in preset time, block
Reinspection is returned as a result, then according to the reinspection received as a result, determining either in terminal or reinspection server in chain network
Whether reinspection is qualified, and the notification information for terminating reinspection is sent to another party;If in preset time, not receiving either one and returning again
Inspection is as a result, then determine to recheck unqualified.
Specifically, when the terminal in reinspection server and block chain returns to reinspection result, reinspection server and area are determined
The first qualified number, and the first sum of reinspection result are rechecked in the reinspection result that each terminal returns in block chain network;
The first quotient for calculating the first qualified number of the reinspection and first sum, using first quotient as
Recheck qualification rate;
When rechecking either one return reinspection result of terminal in server or block chain, recheck what server returned when receiving
When rechecking result, if the reinspection result that server returns is qualification, it is determined that reinspection result is qualified;If the reinspection that server returns
It as a result is unqualified, it is determined that reinspection is unqualified.
When receiving the reinspection result that each terminal returns in block chain, determine that the reinspection that each terminal returns in block chain is closed
Second sum of the reinspection result of the second number and return of lattice, calculates the second of the second qualified number of reinspection and reinspection result
Second quotient of sum is preset qualification rate when reinspection qualification rate is greater than or equal to, is then sentenced using the second quotient as reinspection qualification rate
Fixed reinspection is qualified;If rechecking qualification rate is less than default qualification rate, determine to recheck unqualified.
In the embodiment of the present application, it determines that default reinspection qualification rate is X, rechecks other ends in server 130 and block chain
When end returns to reinspection result, it is qualified to recheck in the reinspection result that each terminal returns in determining reinspection server and block chain network
The first number a, and reinspection result the first sum b, as a/b >=X, then determine reinspection qualification;As a/b < X, then determine to recheck
It is unqualified.
When only reinspection server 130 returns to reinspection result, reinspection server is returned the result as qualification, then determines that reinspection is closed
Lattice;Reinspection server returns the result to be unqualified, then determines to recheck unqualified.
When the network terminal returns to reinspection result in only block chain, the reinspection qualification that each terminal returns in block chain is determined
The second sum B of second number A and the reinspection result of return determine that reinspection is qualified as A/B >=X;As A/B < X, determine
It rechecks unqualified.
Step 503, if reinspection is qualified, when task execution program is task execution program to be released, then task is held
Line program is published in block chain network, and exports publication result;When task execution program is announced task execution program
When, then execute processing logic corresponding with task execution program;
If reinspection is qualified, when task execution program is state to be released, then publish in network, and export publication
As a result;When for announced state, then processing logic corresponding with task execution program is executed.
Step 504, it if reinspection is unqualified, when task execution program is task execution program to be released, then wouldn't incite somebody to action
Task execution program is published in block chain network, while exporting the notification information of detection failure;When task execution program is
When the task execution program of publication, then combination reverification test report is generated, and send warning information and combination to Warning Service device
Reverification test report;
It in the embodiment of the present application,, then wouldn't be by it when task execution program is state to be released if reinspection is unqualified
It is published in network, while exporting the notification information of detection failure;When announced state, then combination reverification test report is generated
It accuses, and sends warning information and combination reverification test report to Warning Service device.
By being rechecked using other terminals in block chain network to task execution program to be released, it is possible to reduce
The waiting time rechecked by rechecking server, and then improve the timeliness of data processing and program publication and further mention
The accuracy of high data processed result.
Referring to Fig. 6, for task execution program structure of the detecting device schematic diagram in the present invention, comprising:
Module 601 is obtained, to be released in block chain network or the task in block chain network issued for obtaining and holds
The source code of line program, the source code that will acquire are formatted processing, obtain the abstract syntax tree of intermediate language;
Extraction module 602, for extracting the nodal information of each node in abstract syntax tree;
It include: attribute, the specific type, corresponding code source information that each node is extracted from the abstract syntax tree;
From the connection relationship obtained in the abstract syntax tree between each node.
Optimization module 603 optimizes processing according to different types for the nodal information to extraction, and will be at optimization
Nodal information after reason is converted into the corresponding file destination of task execution program;
Hole Detection module 604, for carrying out Hole Detection to file destination;
Execution module 605, for when detecting file destination there are when loophole, if task execution program is to be released appoints
Business executes program, then wouldn't be published to task execution program in block chain network, the notification information of output detection failure;If appointing
It is announced task execution program in block chain that business, which executes program, then generates examining report, and send in advance to Warning Service device
Alert information and examining report;When not detecting file destination there are when loophole, if task execution program is that task to be released is held
Task execution program is then published in block chain network by line program, if task execution program is announced in block chain
Business executes program, then executes processing logic corresponding with task execution program.
It should be noted that being described in the content and embodiment illustrated in fig. 2 of detection device described in embodiment illustrated in fig. 6
Detection method content it is similar, can be specifically not repeated herein refering to content described in embodiment illustrated in fig. 2.
In embodiments of the present invention, by the Hole Detection before being issued to task execution program to be released, and
Hole Detection after issuing to the issued task execution program in block chain network, can be to avoid there are loopholes
Task execution program is published, and is realized there are the early warning of the release process of loophole, and the safety of block chain network is improved.
It should be noted that above-mentioned task execution program detection device can also include such as on the basis of Fig. 6 embodiment
Flowering structure:
Optimization module 603 includes:
Merge relating module, for each node in abstract syntax tree, attribute, specific type and connection based on node
Relationship is merged or is associated with;
Redundancy removing module, for each node after merging or association, based on be inherited from code source information parent or
The method for realizing interface carries out redundancy deletion;
Generation module generates each nodal information according to the recalls information of extraction for extracting the recalls information of each node
Call track;
Source code complementary module carries out the supplement process in code source for each node after deleting redundancy, obtains having complete
Each node in code source;
Mark module carries out the supplement process in code source, obtains with full code source for each node after deleting redundancy
Each node.
Execution module 605 includes:
First sending module, for detecting that file destination there are when loophole, generates examining report, will test report and
Task execution program is sent to reinspection server;
First receiving module, the reinspection result returned for receiving reinspection server;
First processing module, when the reinspection result for returning when the reinspection server received is qualified for reinspection, if appointing
It is task execution program to be released that business, which executes program, then task execution program is published in block chain network, and exports and appoint
Business executes the announced notification information of program;If task execution program is announced task execution program, execution and task
Execute the corresponding processing logic of program;
When the reinspection result that the reinspection server received returns is rechecks unqualified, if task execution program is pending
Task execution program wouldn't be then published in block chain network by the task execution program of cloth, the notice letter of output detection failure
Breath;If task execution program is announced task execution program in block chain, reverification test report is generated, and to pre- police uniform
Device transmission warning information of being engaged in and reverification test report.
Execution module 605 further include:
Second sending module generates examining report when detecting file destination there are when loophole, and is task execution program
Reinspection task execution program is generated, and file destination, examining report and reinspection task execution program are published to block chain network
In each terminal rechecked, will test report and task execution program be sent to reinspection server;
Second receiving module is returned within a preset time, receiving each terminal in block chain network and reinspection server
The reinspection result returned;
Judgment module, for according in block chain network each terminal and reinspection server return reinspection as a result, determine
Whether reinspection is qualified;
Second processing module, if qualified for rechecking, when task execution program is task execution program to be released, then
Task execution program is published in block chain network, and exports publication result;When task execution program is announced task
When executing program, then processing logic corresponding with task execution program is executed;
It, then wouldn't be by task execution when task execution program is task execution program to be released if reinspection is unqualified
Program is published in block chain network, while exporting the notification information of detection failure;When task execution program is announced
When business executes program, then combination reverification test report is generated, and send warning information and combination reverification test to Warning Service device
Report.
It is understood that the content of above-described embodiment description, into embodiment illustrated in fig. 5, optimization method is described with Fig. 3
Content it is similar, the content being specifically referred in method described in Fig. 3 to embodiment shown in fig. 5, details are not described herein again.
The present invention by the Hole Detection before being issued to task execution program to be released, and to it is issued
Task execution program in block chain network issued after Hole Detection, can be to avoid there are the task execution programs of loophole
It is published, and realizes there are the early warning of the release process of loophole, improve the safety of block chain network.
The present invention also provides a kind of storage mediums, are stored thereon with computer program, which is held by processor
Each step in the detection method method for the task execution program that implementation method embodiment provides when row.
It is right the above are the description of detection method, device and storage medium to task execution program provided by the present invention
In those skilled in the art, thought according to an embodiment of the present invention has change in specific embodiments and applications
Become place, to sum up, the contents of this specification are not to be construed as limiting the invention.
Claims (10)
1. a kind of detection method of task execution program is applied to computer equipment, which is characterized in that the detection method packet
It includes:
Obtain it is to be released in block chain network or issued the source code of the task execution program in block chain network, will acquire
The source code be formatted processing, obtain the abstract syntax tree of intermediate language;
Extract the nodal information of each node in the abstract syntax tree;
Processing is optimized according to different types to the nodal information of extraction, and the nodal information after optimization processing is turned
Turn to the corresponding file destination of the task execution program;
Hole Detection is carried out to the file destination;
When detecting the file destination there are when loophole, if the task execution program is task execution program to be released,
The task execution program wouldn't be then published in block chain network, the notification information of output detection failure;If the task
Executing program is announced task execution program in block chain, then generates examining report, and send early warning to Warning Service device
Information and the examining report;
When not detecting the file destination there are when loophole, if the task execution program is task execution journey to be released
The task execution program is then published in block chain network by sequence, if the task execution program is to have issued in block chain
Task execution program, then execute corresponding with task execution program processing logic.
2. detection method according to claim 1, which is characterized in that each node extracted in the abstract syntax tree
Nodal information, comprising:
Attribute, the specific type, corresponding code source information of each node are extracted from the abstract syntax tree;
From the connection relationship obtained in the abstract syntax tree between each node.
3. detection method according to claim 2, which is characterized in that the nodal information of described pair of extraction is according to difference
Type optimize processing, and convert the corresponding target text of the task execution program for the nodal information after optimization processing
Part, comprising:
To each node in the abstract syntax tree, attribute, specific type and the connection relationship based on node are merged
Or association;
To each node after merging or association, redundancy is carried out based on the method for being inherited from parent in code source information or realizing interface
It deletes;
Each node after deleting redundancy, the calling rail of each node is generated using the reference between each node and the relationship being cited
Mark;
The supplement process that code source is carried out to each node, obtains each node with full code source;
Using stain tracking technique, tracking is marked to each node, and label tracking information is saved into nodal information;
The calling track of nodal information and each node to each node carries out file format conversion, obtains target text
Part.
4. according to claim 1 to detection method described in 3 any one, which is characterized in that the method also includes:
When detecting that the file destination generates examining report there are when loophole, and the examining report and the task are held
Line program is sent to reinspection server;
When receiving the reinspection result that the reinspection server returns is that reinspection is qualified, if the task execution program is pending
The task execution program is then published in block chain network by the task execution program of cloth, and exports task execution program
The notification information of publication;If the task execution program is announced task execution program, execute and the task execution
The corresponding processing logic of program;
When receive it is described reinspection server return reinspection result for recheck it is unqualified when, if the task execution program be to
The task execution program wouldn't be then published in block chain network by the task execution program of publication, output detection failure
Notification information;If the task execution program is announced task execution program in block chain, reverification test report is generated,
And warning information and reverification test report are sent to Warning Service device.
5. according to claim 1 to detection method described in 3 any one, which is characterized in that the detection method further include:
When detecting the file destination there are when loophole, examining report is generated, and generate reinspection for the task execution program
Task execution program, and the file destination, the examining report and the reinspection task execution program are published to block chain
Each terminal in network is rechecked, and the examining report and the task execution program is sent to reinspection server, pre-
If in the time, receiving the reinspection result that each terminal and the reinspection server in the block chain network return;
According to the reinspection of each terminal and reinspection server return in the block chain network as a result, determining whether reinspection is qualified;
If reinspection is qualified, when task execution program is task execution program to be released, then the task execution program is sent out
Cloth exports publication result into block chain network;When task execution program is announced task execution program, then execute
Processing logic corresponding with the task execution program;
It, then wouldn't be by the task execution when task execution program is task execution program to be released if reinspection is unqualified
Program is published in block chain network, while exporting the notification information of detection failure;When task execution program is announced
When business executes program, then combination reverification test report is generated, and send warning information and combination reinspection to Warning Service device
Examining report.
6. detection method according to claim 5, which is characterized in that each terminal according in the block chain network
And the reinspection that reinspection server returns is as a result, determine whether reinspection is qualified, comprising:
If the terminal in the reinspection server and the block chain network returns to reinspection as a result, if basis receive more parts
It rechecks result and determines reinspection qualification rate;If rechecking qualification rate is greater than or equal to preset qualification rate, determine that reinspection is qualified;If multiple
It examines qualification rate and is less than preset qualification rate, then determine to recheck unqualified;
If in block chain network terminal or reinspection server in either return to reinspection as a result, if according to the reinspection that receives
As a result, whether determine reinspection qualified, and the notification information for terminating reinspection is sent to another party;
If do not receive either one return reinspection as a result, if determine to recheck it is unqualified.
7. detection method according to claim 6, which is characterized in that the more parts of reinspection results that the basis receives determine
Recheck qualification rate, comprising:
It determines in the reinspection server and the block chain network and rechecks qualified first in the reinspection result of each terminal return
Number, and the first sum of reinspection result;
The first quotient for calculating the first qualified number of the reinspection and first sum, using first quotient as reinspection
Qualification rate.
8. detection method according to claim 6, which is characterized in that if terminal or reinspection clothes in the block chain network
Reinspection is returned either in business device as a result, then according to the reinspection received as a result, determining whether reinspection is qualified, comprising:
When receiving the reinspection result that reinspection server returns, if the reinspection result that the server returns is qualification, really
Surely reinspection result is qualified;If the reinspection result that the server returns is unqualified, it is determined that reinspection is unqualified;
When receiving the reinspection result that each terminal returns in block chain, determine that the reinspection that each terminal returns in the block chain is closed
Second sum of the reinspection result of the second number and return of lattice, calculates the second qualified number of reinspection and the reinspection is tied
Second quotient of the second sum of fruit, using second quotient as reinspection qualification rate, when reinspection qualification rate is greater than or equal to institute
Default qualification rate is stated, then determines that reinspection is qualified;If rechecking qualification rate is less than the default qualification rate, determine to recheck unqualified.
9. a kind of task execution program detection device, which is characterized in that the detection device includes:
Module is obtained, to be released in block chain network or has issued the task execution program in block chain network for obtaining
Source code, and the source code that will acquire is formatted processing, obtains the abstract syntax tree of intermediate language;
Extraction module, for extracting the nodal information of each node in the abstract syntax tree;
Optimization module optimizes processing according to different types for the nodal information to extraction, and by optimization processing
Nodal information afterwards is converted into the corresponding file destination of the task execution program;
Hole Detection module, for carrying out Hole Detection to the file destination;
Execution module, for when detecting the file destination there are when loophole, if the task execution program is to be released
The task execution program wouldn't be then published in block chain network by task execution program, the notice letter of output detection failure
Breath;If the task execution program is announced task execution program in block chain, examining report is generated, and to pre- police uniform
Business device sends warning information and the examining report;When not detecting the file destination there are when loophole, if the task is held
Line program is task execution program to be released, then the task execution program is published in block chain network, if described
It is announced task execution program in block chain that business, which executes program, then executes processing corresponding with the task execution program and patrol
Volume.
10. a kind of readable storage medium storing program for executing, is stored thereon with computer program, which is characterized in that the computer program is processed
When device executes, each step in the task execution detection method as described in claim 1 to 8 any one is realized.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910694843.9A CN110532782B (en) | 2019-07-30 | 2019-07-30 | Method and device for detecting task execution program and storage medium |
PCT/CN2019/117235 WO2021017278A1 (en) | 2019-07-30 | 2019-11-11 | Task execution program detection method and apparatus, and computer device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910694843.9A CN110532782B (en) | 2019-07-30 | 2019-07-30 | Method and device for detecting task execution program and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110532782A true CN110532782A (en) | 2019-12-03 |
CN110532782B CN110532782B (en) | 2023-02-21 |
Family
ID=68662038
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910694843.9A Active CN110532782B (en) | 2019-07-30 | 2019-07-30 | Method and device for detecting task execution program and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN110532782B (en) |
WO (1) | WO2021017278A1 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113051069A (en) * | 2019-12-28 | 2021-06-29 | 华为技术有限公司 | Data analysis method and device based on multiple tasks and terminal equipment |
CN113254931A (en) * | 2021-05-28 | 2021-08-13 | 平安普惠企业管理有限公司 | Block chain based code system updating method, device, equipment and storage medium |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113467919B (en) * | 2021-07-19 | 2024-02-02 | 中国银行股份有限公司 | Block chain-based flow management method, system and storage medium |
CN114501501B (en) * | 2022-02-09 | 2024-03-29 | 北京恒安嘉新安全技术有限公司 | Configuration management method, device, equipment and medium for mobile communication network target range |
CN115987673B (en) * | 2022-12-30 | 2023-12-08 | 北京天融信网络安全技术有限公司 | Vulnerability penetration test system, method, device, medium and equipment based on event driving |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103455759A (en) * | 2012-06-05 | 2013-12-18 | 深圳市腾讯计算机系统有限公司 | Page loophole detection device and page loophole detection method |
US20140283081A1 (en) * | 2013-03-14 | 2014-09-18 | Whitehat Security, Inc. | Techniques for correlating vulnerabilities across an evolving codebase |
CN104462981A (en) * | 2013-09-12 | 2015-03-25 | 深圳市腾讯计算机系统有限公司 | Detecting method and device for vulnerabilities |
CN104657267A (en) * | 2015-02-10 | 2015-05-27 | 上海创景计算机系统有限公司 | Elastic source code syntax tree resolving system and method |
CN109063477A (en) * | 2018-07-18 | 2018-12-21 | 成都链安科技有限公司 | A kind of intelligent contract aacode defect detection system and method for automation |
CN109241484A (en) * | 2018-09-06 | 2019-01-18 | 平安科技(深圳)有限公司 | A kind of sending method and equipment of the web data based on encryption technology |
US20190080392A1 (en) * | 2017-03-08 | 2019-03-14 | Ip Oversight Corporation | Method for creating commodity assets from unrefined commodity reserves utilizing blockchain and distributed ledger technology |
CN109635569A (en) * | 2018-12-10 | 2019-04-16 | 国家电网有限公司信息通信分公司 | A kind of leak detection method and device |
CN109933991A (en) * | 2019-03-20 | 2019-06-25 | 杭州拜思科技有限公司 | A kind of method, apparatus of intelligence contract Hole Detection |
CN109948345A (en) * | 2019-03-20 | 2019-06-28 | 杭州拜思科技有限公司 | A kind of method, the system of intelligence contract Hole Detection |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11151018B2 (en) * | 2018-04-13 | 2021-10-19 | Baidu Usa Llc | Method and apparatus for testing a code file |
-
2019
- 2019-07-30 CN CN201910694843.9A patent/CN110532782B/en active Active
- 2019-11-11 WO PCT/CN2019/117235 patent/WO2021017278A1/en active Application Filing
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103455759A (en) * | 2012-06-05 | 2013-12-18 | 深圳市腾讯计算机系统有限公司 | Page loophole detection device and page loophole detection method |
US20140283081A1 (en) * | 2013-03-14 | 2014-09-18 | Whitehat Security, Inc. | Techniques for correlating vulnerabilities across an evolving codebase |
CN104462981A (en) * | 2013-09-12 | 2015-03-25 | 深圳市腾讯计算机系统有限公司 | Detecting method and device for vulnerabilities |
CN104657267A (en) * | 2015-02-10 | 2015-05-27 | 上海创景计算机系统有限公司 | Elastic source code syntax tree resolving system and method |
US20190080392A1 (en) * | 2017-03-08 | 2019-03-14 | Ip Oversight Corporation | Method for creating commodity assets from unrefined commodity reserves utilizing blockchain and distributed ledger technology |
CN109063477A (en) * | 2018-07-18 | 2018-12-21 | 成都链安科技有限公司 | A kind of intelligent contract aacode defect detection system and method for automation |
CN109241484A (en) * | 2018-09-06 | 2019-01-18 | 平安科技(深圳)有限公司 | A kind of sending method and equipment of the web data based on encryption technology |
CN109635569A (en) * | 2018-12-10 | 2019-04-16 | 国家电网有限公司信息通信分公司 | A kind of leak detection method and device |
CN109933991A (en) * | 2019-03-20 | 2019-06-25 | 杭州拜思科技有限公司 | A kind of method, apparatus of intelligence contract Hole Detection |
CN109948345A (en) * | 2019-03-20 | 2019-06-28 | 杭州拜思科技有限公司 | A kind of method, the system of intelligence contract Hole Detection |
Non-Patent Citations (2)
Title |
---|
DHIKA RIZKI ANBIYA等: "Vulnerability Detection in PHP Web Application Using Lexical Analysis Approach with Machine Learning", 《2018 5TH INTERNATIONAL CONFERENCE ON DATA AND SOFTWARE ENGINEERING (ICODSE)》 * |
尹茗等: "基于源码分析的缓冲区溢出漏洞检测方法", 《江苏大学学报(自然科学版)》 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113051069A (en) * | 2019-12-28 | 2021-06-29 | 华为技术有限公司 | Data analysis method and device based on multiple tasks and terminal equipment |
CN113051069B (en) * | 2019-12-28 | 2023-12-08 | 华为技术有限公司 | Data analysis method and device based on multitasking and terminal equipment |
CN113254931A (en) * | 2021-05-28 | 2021-08-13 | 平安普惠企业管理有限公司 | Block chain based code system updating method, device, equipment and storage medium |
CN113254931B (en) * | 2021-05-28 | 2024-02-06 | 深圳点链科技有限公司 | Block chain-based code system updating method, device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
WO2021017278A1 (en) | 2021-02-04 |
CN110532782B (en) | 2023-02-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110532782A (en) | A kind of detection method of task execution program, device and storage medium | |
US11928144B2 (en) | Clustering of log messages | |
CN110414242B (en) | Method, device, equipment and medium for detecting business logic loophole | |
US9483387B1 (en) | Tree comparison functionality for services | |
US20110289301A1 (en) | Tracing Flow of Data in a Distributed Computing Application | |
CN109768970A (en) | It is a kind of based on configurable puppy parc generation method | |
JP6324534B2 (en) | Promotion status data monitoring method, apparatus, device, and non-executable computer storage medium | |
CN102123058A (en) | Test equipment and method for testing network protocol decoder | |
CN114500690A (en) | Interface data processing method and device, electronic equipment and storage medium | |
CN109033203A (en) | A kind of feature extraction method for parallel processing towards big data | |
CN107040613A (en) | A kind of message transmitting method and system | |
CN106027284A (en) | Network fault diagnosis method and device | |
CN112765217A (en) | Data processing method and system based on edge calculation and path analysis | |
CN105071991B (en) | The test method of the IP connectivity of multiple fire walls | |
CN110287700A (en) | A kind of iOS application safety analytical method and device | |
CN110245050A (en) | A method of it realizing script error monitoring and reports | |
CN116346961B (en) | Financial message processing method and device, electronic equipment and storage medium | |
CN111193631B (en) | Information processing method, system, and computer-readable storage medium | |
CN110188033B (en) | Data detection device, method, computer device, and computer-readable storage medium | |
CN116628061A (en) | Multi-source heterogeneous data acquisition method, device, equipment and storage medium | |
CN110427179A (en) | MSVL programming automatic generation method and system towards intelligent contract language | |
CN106257257A (en) | A kind of detect the method for optical module planisphere, device and virtual vector analyser | |
CN109995603A (en) | The method, apparatus and electronic equipment that packet loss measures under a kind of Tag model | |
CN114579809A (en) | Event analysis method and device, electronic equipment and storage medium | |
CN114492324A (en) | Component data statistical method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |