CN104182236B - A kind of software path decoding method based on genetic code - Google Patents
A kind of software path decoding method based on genetic code Download PDFInfo
- Publication number
- CN104182236B CN104182236B CN201410431087.8A CN201410431087A CN104182236B CN 104182236 B CN104182236 B CN 104182236B CN 201410431087 A CN201410431087 A CN 201410431087A CN 104182236 B CN104182236 B CN 104182236B
- Authority
- CN
- China
- Prior art keywords
- control
- code
- block
- flow
- basic
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Landscapes
- Stored Programmes (AREA)
Abstract
The invention provides a kind of software path decoding method based on genetic code, in a manner of DNA encoding and DNA verification modes are source, realize a kind of coded system to software flow path clustering, including the coding, transcoding, verification to flow and basic block, the correct operation of software flow is ensured by the coding to basic block, verification, so as to strengthen software reliability, the risk of software sneak path is reduced.
Description
Technical field
It is specifically according to genetic code the present invention relates to a kind of software path decoding method based on genetic code
Whether principle gives software path encoding and decoding, for determining program it is anticipated that the method for design path normal operation;Belong to calculating
Machine technical field.
Background technology
Early in the 1980s, people have begun to set about the analysis and research to software sneak path.Sneak path refers to
Some potential paths in software systems, they belong to not in path in the works, are that we are undesirable.Sneak path
It is constantly present, because subsystem designer lacks the behavior of overall point of view's either some carelessness of total system, has
Logical problem when being then Software for Design, also have some data interactions be difficult by look-ahead, or even also have some sneak paths be
Due to caused by electromagnetic interference or other factorses.
Causing the factor of software sneak path has a lot, here can be for an example that may produce software sneak path.
At present in real-time software design, to the processing of interruption usually in accordance with its priority, the high interruption of priority, which can seize, is
System resource, this is the state for the processing procedure being preempted to be preserved, and continues to complete and is hung after the completion of interrupt processing
The processing procedure risen.But these are required for developer to go to handle one by one, many times it is likely to occur not preserve and is preempted
The state of processing procedure preserves imperfect.Be as shown in Figure 1 one due to sneak path caused by interruption, if do not examined during design
Consider such case, it is likely that routine call does not return.The appearance of sneak path problem can to program perform bring it is many can not
Prediction and uncontrollable factor.If necessary processing is not done to sneak path in program operation, it will the software item to entirety
Mesh engineering brings huge risk.
Biological heredity password is DNA sequence dna, is by adenine (A), thymidine (T), cytimidine (C), guanine (G) group
Into sequence, DNA forms by two DNA being mutually matched are single-stranded with helical structure, wherein A-U (uracil), T-A, C-G,
G-C is matched two-by-two respectively.
At present, it at home and abroad there is no the pertinent literature report of the sneak path problem occurred in settlement procedure running.In
This simultaneously, prior art when improving software reliability, mostly by design method, thinking either software architecture, these skills
Art improves software reliability in programming.And these technologies can not ensure program well in running software can
Lean on, the present invention is in order to precisely in order to reliability when ensureing running software, while solves the problems, such as the sneak path of software and propose.
The content of the invention
The technology of the present invention solves problem:When overcoming Current software specific coding, rely only on individual and write code level
Carry out the deficiency of control software reliability, at the same solve when program is run can not to ensure program operational process correctness this ask
A kind of topic, there is provided the mode of software path decoding method based on genetic code, efficient coding and coding checkout, it is ensured that journey
The reliability of flow when being run during sequence, maximum possible makes the flow of control occur without sneak path situation, reliable so as to strengthen software
Property, the risk of reduction software sneak path.
The present invention uses the term in control flow chart, and control is completed by the basic block of control program, ensures each base
The correct operation of this block.
The core concept of the present invention is using the encoding model of DNA sequence dna as with reference to source, is each stream in Software for Design
The unique DNA sequence dnas of Cheng Tianjia, while add and verify at each step of flow and flow ending.When being run by controlling
DNA sequence dna, current path is uniquely determined, ensure the complete correctly operation of flow.
The purpose of the present invention is realized with step by the following method:
The first step, the control flow chart of construction procedures., can be by the logic of whole program by the structure of control flow chart
Comb clear.
Second step, by control flow chart, developer determines the number of all basic blocks, and to each basic block according to
Identify the ID of create-rule generation unique mark.It is as follows to identify create-rule:
Based on DNA sequence dna create-rule, there is alphabet Σ={ A, T, G, C },Wherein:L is block coded identification
String length, S are block sum.To any block coded identification string x, y, it is the symbol string on alphabet Σ to have x, y, x ≠ y, and | x |=
| y |=L.
3rd step, developer determine the number of the statement block (hereinafter referred to as control block) of the overall required control of definition, and
ID to each control block according to mark create-rule generation unique mark.
By the step of second step the 3rd, while combined with DNA sequence encoding, can be according to formula:
P=CB
Wherein P is Row control code, and C is control block identification code, and B is current basic block identification code.
The flow that can be controlled can obtain uniquely generated code.From DNA BER Basic Encoding Rules, compiled in DNA sequence dna
In code:A-T, T-A, G-C, C-G are four basic correspondence codes.According to the rule, must be controlled by the unique control code of control flow
Unique check code of flow.
4th step, coding checkout function and transcoding function are inserted in each basic block in program, you can ensure stream
The normal operation of journey.In transcoding function, the Row control code that is generated from previous step will be encoded, it is special to rewrite cost step institute
Some Row control codes, so as to which the flow that Row control code performs with program be bound together.Meanwhile coding checkout function enters
The control of row flow, ensure that flow correctly performs, in function, the Row control code generated as flow performs is in function
In verified with unique check code, ensure that the order of each basic block is correct.
The present invention compared with prior art the advantages of be:The load mechanism of genetic code and the information based on genetic code
It is complementary that path, which describes method,.One of father's step carrying genetic code is single-stranded, and sub-step carries the another of genetic code
One is single-stranded, when two it is single-stranded can match each other when, then the path is correct, otherwise path mistake.DNA is that each nucleus is taken
Genetic code in the chromosome of band, the present invention can not carry genetic code in every line program in software, can cause like that big
The reading and matching of the encrypted message of amount, can have a strong impact on execution efficiency.Therefore, program structure is also divided according to sneak path classification
Solution only carries genetic code as nucleus into cell one by one, the initial address of each cell in nucleus.When program runs into
Branch, start to divide just as cell, bifurcation is single-stranded by decomposing an only DNA, and every legal branch will be progressively complete
The synthesis single-stranded into an other DNA, two single-stranded matchings are carried out until branch terminates place.So present invention ensures that program
The reliability of flow during Shi Yunhang, maximum possible make the flow of control occur without sneak path situation, reduce software sneak path
Risk, improve software reliability.
Brief description of the drawings
Fig. 1 is to interrupt the situation for producing sneak path;
The step of Fig. 2 encodes implementation process for the present invention, including structure control flow chart, determine basic block, it is determined that control
Block, insertion verification and transcoding function;
Fig. 3 is the coding of example procedure in the present invention, includes the identification code and control block of each basic block of example procedure
Identification code.
Embodiment
The foregoing of the present invention, logical construction, function and work are easier to understand with reference to description below in conjunction with the accompanying drawings
Principle, target, characteristic and its advantage.
Term included below, initial and the simple words of abbreviation, it will help understand the following examples
It is described in detail, but these details are not meant to limit the present invention.Those skilled in the art obviously can deviate these
The present invention is put into practice in other embodiments of detail.
Term " DNA sequence dna " represents biological heredity password;Term " control flow chart " is one used in compiler
Image;Term " basic block " refers to the statement sequence that program-order performs, only one of which entrance and one outlet, entrance
Be exactly therein the-individual sentence, outlet is exactly last sentence therein.Term " control block ", which refers to developer, to be needed to make
The statement block of all sentences correctly performed with present invention guarantee sentence.Term " sneak path " refers to some potential in software systems
Path, they belong to not in path in the works, are undesirable.
According to needed for the present invention, specific implementation shares eight steps.As shown in Figure 2:
The first step, the control flow chart of construction procedures.
Second step, by control flow chart, developer determines the number of all basic blocks.
3rd step, the ID to each basic block according to mark create-rule generation unique mark, i.e. basic block identification code.Mark
It is as follows to know create-rule:
Based on DNA sequence dna create-rule, there is alphabet Σ={ A, T, G, C }, A, T, C, G are the symbol in alphabet Σ,
Have simultaneouslyWherein L is block coded identification string length, and S is block sum;To any block coded identification string x, y, have x ≠
Y, and | x |=| y |=L;X, y are the symbol strings on alphabet Σ;
4th step, developer determine to define the number of control block needed for totality.
5th step, the ID to each control block according to mark create-rule generation unique mark, i.e. control block identification code.
6th step, by formula P=CB, wherein P is Row control code, and C is control block identification code, and B is current basic block
Identification code.The flow that can be controlled can obtain uniquely generated code.
7th step, according to Row control code, from DNA BER Basic Encoding Rules, in DNA sequence encoding:A-T,T-A,
G-C, C-G are four basic correspondence codes.According to the rule, the check code of each program operational process can be obtained.
8th step, coding checkout function and transcoding function are inserted in the basic block in program, you can ensure flow
Normal operation.
Implementation steps are specifically showed with example below:
As shown in figure 3, in the program of a C language design, the program possesses 9 statement blocks, and needs to 2 flows
It is controlled.
(1) before program coding, developer needs to design the control flow chart of whole program.
(2) by control flow chart, developer determines the number of all basic blocks, and passes through mark to each basic block
Create-rule defines the ID of fixed unique mark.Such as:9 statement blocks are shared, ID is respectively:
AA,AT,AG,AC,TA,TT,TG,TC,CA。
(3) developer determines the number of control block, and to by identify each control block of create-rule define it is fixed
Unique mark.Such as:2 control blocks are shared, ID is respectively A, T.
(4) setup code is added in program entry function, defines the check code array of each basic block in program,
Check code generates check code by check code create-rule.Such as:Flow AAA corresponds to check code TTT, calls initialization function initial
Change coding structure body, the executory current process control code of program, basic block sum and check code are contained in coding structure body
The initial address of array linked list.
(5) start the addition of basic block original position in each control block and start function, basic block ID and control will be started
Clamp dog ID is passed to, and generates the unique control code of control flow.Such as by basic block AA in control block A, then control code is generated as
AAA。
(6) (except starting and terminating basic block), original position addition verifies function in the basic block in control block, by base
This block ID is passed to, and is obtained the check code array of the basic block by basic block ID and is verified, and is terminated if failure is verified
Program simultaneously returns to error basic block ID.Afterwards, transcoding function is added after function is verified, basic block ID is passed to, by basic
The control code of a upper basic block is changed into the control code of current basic block by block ID.Basic block AT is reached such as in control block A, then
Control code AAA first and check code TTT is verified, and control code is changed into AAT afterwards.
(7) addition terminates function in END block in control block, and it is a kind of special verification function to terminate function, will
Control block ID and END block ID are passed to, and are synthesized terminating control code in function with control block ID and END block ID
Coding verified, ensure END block correct execution, verification failure then terminator and return error basic block ID,
Verify and successfully then control the correct of control block to terminate.
By the checking of actual items, when finding the flow using control program of the present invention, the speed of service of program can be slightly
It is micro- to have declined, but can effectively control program run when flow, when sneak path occurs in program or enters not just
During true path, program can automatically terminate and show final position, prevent whole program from paralysing, and effectively raise program can
By property, stability.
Above example is provided just for the sake of the description purpose of the present invention, and is not intended to limit the scope of the present invention.This
The scope of invention is defined by the following claims.The various equivalent substitutions that do not depart from spirit and principles of the present invention and make and repair
Change, all should cover within the scope of the present invention.
Claims (1)
1. a kind of software path decoding method based on genetic code, its character are to realize that step is as follows;
(1) control flow chart of construction procedures;The control flow chart is used in an abstract data structure in compiler, leads to
The structure of control flow chart is crossed, the logic putting in order of whole program is understood;
(2) by control flow chart, developer determines the number of all basic blocks, and each basic block is generated according to mark
The ID of rule generation unique mark, mark create-rule are as follows:
Based on DNA sequence dna create-rule, there is alphabet Σ={ A, T, G, C }, A, T, C, G are the symbol in alphabet Σ, simultaneously
HaveWherein L is block coded identification string length, and S is block sum;To any block coded identification string x, y, there is x ≠ y,
And | x |=| y |=L;X, y are the symbol strings on alphabet Σ;
(3) developer determine definition it is overall needed for control statement block be control block number, and to each control block according to
Identify the ID of create-rule generation unique mark;
By above-mentioned steps (2), (3), while combined with DNA encoding, according to formula:
P=CB
Wherein P is Row control code, and C is control block identification code, and B is current basic block identification code,
The flow controlled can obtain uniquely generated code;By DNA BER Basic Encoding Rules, in DNA encoding:A-T,T-A,G-C,
C-G is four basic correspondence codes;According to the rule, unique check code of control flow is obtained by the unique control code of control flow;
(4) coding checkout function and transcoding function are inserted in each basic block in program, that is, ensures the normal fortune of flow
OK;In transcoding function, the Row control code that is generated from previous step will be encoded, rewrite flow control specific to cost step
Code processed, so as to which the flow that Row control code performs with program be bound together;Meanwhile coding checkout function carries out the control of flow
System, ensure that flow correctly performs;In coding checkout function, the Row control code for performing and generating with the flow of program exists
Verified in function with unique check code, ensure that the order of each basic block is correct.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410431087.8A CN104182236B (en) | 2014-08-28 | 2014-08-28 | A kind of software path decoding method based on genetic code |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410431087.8A CN104182236B (en) | 2014-08-28 | 2014-08-28 | A kind of software path decoding method based on genetic code |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104182236A CN104182236A (en) | 2014-12-03 |
CN104182236B true CN104182236B (en) | 2017-12-12 |
Family
ID=51963315
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410431087.8A Active CN104182236B (en) | 2014-08-28 | 2014-08-28 | A kind of software path decoding method based on genetic code |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104182236B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH08136620A (en) * | 1994-11-10 | 1996-05-31 | Nissan Motor Co Ltd | Method and device for detecting sneak circuit |
CN1791875A (en) * | 2003-05-29 | 2006-06-21 | 独立行政法人产业技术综合研究所 | Method for designing DNA codes used as information carrier |
CN101091157A (en) * | 2004-07-12 | 2007-12-19 | 哈利尔·基利克 | Digital processor and method of processing digital data |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070266434A1 (en) * | 2006-05-11 | 2007-11-15 | Reifer Consultants, Inc. | Protecting Applications Software Against Unauthorized Access, Reverse Engineering or Tampering |
-
2014
- 2014-08-28 CN CN201410431087.8A patent/CN104182236B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH08136620A (en) * | 1994-11-10 | 1996-05-31 | Nissan Motor Co Ltd | Method and device for detecting sneak circuit |
CN1791875A (en) * | 2003-05-29 | 2006-06-21 | 独立行政法人产业技术综合研究所 | Method for designing DNA codes used as information carrier |
CN101091157A (en) * | 2004-07-12 | 2007-12-19 | 哈利尔·基利克 | Digital processor and method of processing digital data |
Also Published As
Publication number | Publication date |
---|---|
CN104182236A (en) | 2014-12-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Wang et al. | Learning deep transformer models for machine translation | |
Chollampatt et al. | A multilayer convolutional encoder-decoder neural network for grammatical error correction | |
CN107293296B (en) | Voice recognition result correction method, device, equipment and storage medium | |
CN110287111A (en) | A kind of method for generating test case and device of user interface | |
CN107632981A (en) | A kind of neural machine translation method of introducing source language chunk information coding | |
CN113064586B (en) | Code completion method based on abstract syntax tree augmented graph model | |
CN106325596B (en) | A kind of written handwriting automatic error correction method and system | |
CN112631611A (en) | Intelligent Pompe deception contract identification method and device | |
CN109558723A (en) | Password dictionary generation method, device and computer equipment | |
CN104717219A (en) | Vocal print login method and device based on artificial intelligence | |
CN111680480A (en) | Template-based job approval method and device, computer equipment and storage medium | |
CN106250725A (en) | A kind of ARM platform prevents the method that UEFI program is illegally transplanted | |
CN111401080A (en) | Neural machine translation method and neural machine translation device | |
Bao et al. | Have my arguments been replied to? argument pair extraction as machine reading comprehension | |
Salekin et al. | Predicting sites of epitranscriptome modifications using unsupervised representation learning based on generative adversarial networks | |
Hajipour et al. | Samplefix: Learning to generate functionally diverse fixes | |
CN104182236B (en) | A kind of software path decoding method based on genetic code | |
CN102841988B (en) | A kind of system and method that nucleic acid sequence information is mated | |
WO2021180243A1 (en) | Machine learning-based method for optimizing image information recognition, and device | |
CN104932407B (en) | A kind of modularization robot driving control system and method based on PLC | |
CN115952265A (en) | Knowledge-driven dialogue method based on unified generative model | |
CN111008279B (en) | Entity relation extraction method and device | |
CN114297408A (en) | Relation triple extraction method based on cascade binary labeling framework | |
CN104317572B (en) | Circulation boundary inward direction analysis method of real-time system | |
CN115169330B (en) | Chinese text error correction and verification method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |