Summary of the invention
The embodiment of the invention provides the generation methods and mobile terminal of a kind of block chain operating system, for improving
The portability and ease for use of block catenary system reduce power consumption.
The first aspect of the embodiment of the present invention provides a kind of generation method of block catenary system, comprising: in original system
On the basis of add block chain user;Configure the user data of the block chain user;According to the user data to preset journey
The scanning entrance of sequence is modified, and the preset program is that the block chain user needs relative program to be used;It will be described
Preset program is compiled into generation block catenary system in system image file.In the embodiment of the present invention, pass through the base in original system
Block chain user is added on plinth, and configures the user data of the block chain user, by preset journey relevant to user data
The scanning entrance of sequence is modified, and finally preset program is compiled into system image file, on mobile terminals generation area
Block catenary system improves the portability and ease for use of block catenary system, and only load program relevant to block catenary system, reduces
The power consumption of block catenary system.
In a kind of possible embodiment, addition block chain user on the basis of original system includes: in the original
It is added in the userlist.xml file of the source code of system<user id="10"/>code.
In a kind of possible embodiment, the user data of the configuration block chain user includes: in the former system
10.xml is added in the source code of system configures user data;Block catenary system is set by the title of the user data.
It is described to be repaired according to scanning entrance of the user data to preset program in a kind of possible embodiment
Change includes: to add in the userlist.xml file of the source code of the original system using arbitration functions code, the application
Whether the system that arbitration functions code is used to judge to be currently up is the block catenary system.
In a kind of possible embodiment, the method also includes: judge whether the system being currently up is the block
Catenary system;If whether the system being currently up is the block catenary system, loaded in the block catenary system described preset
Program.
The second aspect of the embodiment of the present invention provides a kind of mobile terminal, comprising: adding unit, in original system
On the basis of add block chain user;Configuration unit, for configuring the user data of the block chain user;Unit is modified, is used for
It is modified according to scanning entrance of the user data to preset program, the preset program is the block chain user
Need relative program to be used;Generation unit generates block for the preset program to be compiled into system image file
Catenary system.In the embodiment of the present invention, by adding block chain user on the basis of original system, and the block chain user is configured
User data, the scanning entrance of preset program relevant to user data is modified, finally compiles preset program
It translates in system image file, generates block catenary system on mobile terminals, improve the portability of block catenary system and easy-to-use
Property, only load program relevant to block catenary system, reduces the power consumption of block catenary system.
In a kind of possible embodiment, the adding unit is specifically used for: in the source code of the original system
It is added in userlist.xml file<user id="10"/>code.
In a kind of possible embodiment, the configuration unit is specifically used for: adding in the source code of the original system
10.xml configures user data;Block catenary system is set by the title of the user data.
In a kind of possible embodiment, the modification unit is specifically used for: in the source code of the original system
In userlist.xml file arbitration functions code is applied in addition, described to be used to judge to be currently up using arbitration functions code
Whether system is the block catenary system.
In a kind of possible embodiment, the mobile terminal further include:
Judging unit, for judging whether the system being currently up is the block catenary system;
Loading unit, if whether the system being currently up is the block catenary system, in the block catenary system
The middle load preset program.
Third aspect present invention provides a kind of electronic equipment, including memory, processor, which is characterized in that the place
Reason device realizes the block linkwork as described in above-mentioned any one when being used to execute the computer management class method stored in memory
The step of generation method of system.
Fourth aspect present invention provides a kind of computer readable storage medium, is stored thereon with computer management class
Sequence, it is characterised in that: the block as described in above-mentioned any one is realized when the computer management class method is executed by processor
The step of generation method of catenary system.
As can be seen from the above technical solutions, the embodiment of the present invention has the advantage that and adds on the basis of original system
Block chain user;Configure the user data of block chain user;It is repaired according to scanning entrance of the user data to preset program
Change, preset program is that block chain user needs relative program to be used;Preset program is compiled into system image file
Generate block catenary system.In the embodiment of the present invention, by adding block chain user on the basis of original system, and block chain is configured
The user data of user modifies the scanning entrance of preset program relevant to user data, finally by preset journey
Sequence is compiled into system image file, on mobile terminals generate block catenary system, improve block catenary system portability and
Ease for use, only load program relevant to block catenary system, reduces the power consumption of block catenary system.
Specific embodiment
The embodiment of the invention provides the generation methods and mobile terminal of a kind of block catenary system, for improving block
The portability and ease for use of catenary system reduce power consumption.
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, those skilled in the art's every other implementation obtained without making creative work
Example, shall fall within the protection scope of the present invention.
The description and claims of this application and term " first ", " second ", " third ", " in above-mentioned attached drawing
The (if present)s such as four " are to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should manage
The data that solution uses in this way are interchangeable under appropriate circumstances, so that the embodiments described herein can be in addition to illustrating herein
Or the sequence other than the content of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that
Cover it is non-exclusive include, for example, containing the process, method, system, product or equipment of a series of steps or units need not limit
In step or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, produce
The other step or units of product or equipment inherently.
Referring to Fig. 1, the flow chart of the generation method for block chain operating system provided in an embodiment of the present invention, specific to wrap
It includes:
101, block chain user is added on the basis of original system.
Block chain user is added on the basis of original system.
Specifically, userlist.xml file in the source code of modification original system, addition<user id="10"/>part,
Such as:
<deviceOwnerUserId id=" -10000 "/>
<user id="0"/>// normal users
<user id="10"/>// block chain user
</users>
Wherein,<user id="0"/>for the normal users in source code,<user id="10"/>for this addition
Block chain user.
102, the user data of block chain user is configured.
Configure the user data of block chain user.
Concrete configuration code is as follows:
103, it is modified according to scanning entrance of the user data to preset program.
It is modified according to scanning entrance of the user data to preset program, preset program is block chain user needs
The relative program used.
Concrete configuration code is as follows:
104, preset program is compiled into generation block catenary system in system image file.
Preset program is compiled into generation block catenary system in system image file.
Specifically, preset program is placed into data/app catalogue, preset program can be wallet sequence, dig mine journey
Sequence etc., specifically herein without limitation.
Block catenary system may include application service layer, kernel service layer and protocol layer, wherein application service layer includes number
According to transmission assembly, authentication component, data Synchronization Component, data protection component, Software Development Kit (software
Development kit, SDK) and application programming interface (Application Programming Interface,
API), kernel service layer include dynamic common recognition (Dynamic Consensus) component, safety (Safty Strategy) component,
It calculates power and plans as a whole (CoC Planning) component, AI collaboration (Artificial Intelligence Synergism) component and body
Part certification (Identity Authentication) component;Protocol layer includes registration/certification agreement, authorized agreement, data reading
Write/exchange agreement, trust management framework, data storage/protection, intelligent contract, network communication protocol and basis storage agreement.
Have in block catenary system based on block chain message application program needed for block chain, dig mine application program, wallet is answered
With program etc., user can carry out digging mine, operation wallet etc. in block catenary system, in block catenary system, mobile terminal storage
Space be largely used to memory block information, if terminal space is insufficient, application combine with a computer digging mine, will be newest
A part of block information place at the terminal, the block informations of more parts passes through computer preservation, computer statistics corresponding portion
Account information is transferred to mobile terminal side, and mobile terminal is based on local storage space account information and adds computer sections account letter
Breath forms intact block chain information, and final realize can dig mine state.
It should be noted that in block catenary system the structure of block chain include block size, block head, file counter and
The length of file content, block size field is 4 bytes, with the block size after the field of byte representation;Block head word
The length of section is 80 bytes, several fields including forming block head;The length of file counter field is 1-9 byte, the area
The local area block file quantity that block includes;The indefinite length of file content field, the file information being recorded in block, use are primary
The file information format, and the position in file must be with the leaf node sequence consensus of Merkel tree tree.
Wherein, the data structure of block head includes version, father's block head cryptographic Hash, Merkel Merkle root, timestamp, difficulty
Spend target and random number N once.The length of version field is 4 bytes, records block version number, indicates the verifying that this block is abided by
Rule;The length of father's block head cryptographic Hash is that 32 bytes are calculated for indicating the cryptographic Hash of previous block using SHA256;It is silent
The length of Ke Er Merkle root is 32 bytes, and the Merkle tree root cryptographic Hash of the block All Files is equally counted using SHA256
It calculates;The length of timestamp is 4 bytes, which generates time proximity, be accurate to the UNIX timestamp of second, must be strictly larger than preceding 11
The intermediate value of a block time, full node can also refuse those blocks for exceeding oneself 2 hour timestamp;The length of difficulty target
For 4 bytes, the difficulty target of the block proof of work algorithm is encoded using special algorithm;The length of random number N once is 4
Byte meets random number set by difficulty target to find, and is used for adjustment difficulty, and adjustment is packaged block time interval.
In the embodiment of the present invention, by adding block chain user on the basis of original system, and configures the block chain and use
The user data at family modifies the scanning entrance of preset program relevant to user data, finally by preset program
Be compiled into system image file, on mobile terminals generate block catenary system, improve block catenary system portability and easily
With property, only load program relevant to block catenary system, reduces the power consumption of block catenary system.
The block catenary system that the present invention generates is the operating system that secondary development is carried out based on Android, and compare computer client
End have it is more portable with it is energy saving, while mobile terminal participate in it is true dig mine, block chain operating system is user's customization block chain
Message application, digs mine application, wallet application etc., and portable hand-held client provides a kind of new digging mine approach for block chain, makes
Each corner that block chain is really gone into the thick of life.
Optionally, on the basis of above-mentioned Fig. 1 corresponding embodiment, block chain operating system provided in an embodiment of the present invention
Generation method alternative embodiment in, it is described on the basis of original system add block chain user include: in the original system
Source code userlist.xml file in add<user id="10"/>code.
Optionally, on the basis of above-mentioned Fig. 1 corresponding embodiment, block chain operating system provided in an embodiment of the present invention
Generation method alternative embodiment in, the user data of the configuration block chain user includes: in the original system
10.xml is added in source code configures user data;Block catenary system is set by the title of the user data.
Optionally, on the basis of above-mentioned Fig. 1 corresponding embodiment, block chain operating system provided in an embodiment of the present invention
Generation method alternative embodiment in, it is described to be modified packet according to scanning entrance of the user data to preset program
Include: addition is using arbitration functions code, the application judgement in the userlist.xml file of the source code of the original system
Whether the system that function code is used to judge to be currently up is the block catenary system.
Optionally, on the basis of above-mentioned Fig. 1 corresponding embodiment, block chain operating system provided in an embodiment of the present invention
Generation method alternative embodiment in, the method also includes: judge whether the system being currently up is the block linkwork
System;If whether the system being currently up is the block catenary system, the preset journey is loaded in the block catenary system
Sequence.
The embodiment of the present invention is described from the angle of the generation method of block chain operating system above, below from shifting
The embodiment of the present invention is described in the angle of dynamic terminal.
Referring to Fig. 2, Fig. 2 is a kind of embodiment schematic diagram of possible mobile terminal provided in an embodiment of the present invention,
In, which includes:
Adding unit 201, for adding block chain user on the basis of original system;
Configuration unit 202, for configuring the user data of the block chain user;
Unit 203 is modified, it is described pre- for being modified according to scanning entrance of the user data to preset program
The program set is that the block chain user needs relative program to be used;
Generation unit 204, for the preset program to be compiled into generation block catenary system in system image file.
In the embodiment of the present invention, by adding block chain user on the basis of original system, and configures the block chain and use
The user data at family modifies the scanning entrance of preset program relevant to user data, finally by preset program
Be compiled into system image file, on mobile terminals generate block catenary system, improve block catenary system portability and easily
With property, only load program relevant to block catenary system, reduces the power consumption of block catenary system.
Optionally, in some possible implementations, the adding unit 201 is specifically used for:
It is added in the userlist.xml file of the source code of the original system<user id="10"/>code.
Optionally, in some possible implementations, the configuration unit 202 is specifically used for:
10.xml is added in the source code of the original system configures user data;
Block catenary system is set by the title of the user data.
Optionally, in some possible implementations, the modification unit 203 is specifically used for:
Arbitration functions code, the application are applied in addition in the userlist.xml file of the source code of the original system
Whether the system that arbitration functions code is used to judge to be currently up is the block catenary system.
Optionally, in some possible implementations, the mobile terminal further include:
Judging unit 205, for judging whether the system being currently up is the block catenary system;
Loading unit 206, if whether the system being currently up is the block catenary system, in the block linkwork
The preset program is loaded in system.
Referring to Fig. 3, Fig. 3 is the embodiment schematic diagram of electronic equipment provided in an embodiment of the present invention.
As shown in figure 3, the embodiment of the invention provides a kind of electronic equipment, including memory 310, processor 320 and deposit
The computer program 311 that can be run on memory 320 and on the processor 320 is stored up, processor 320 executes computer program
Addition block chain user on the basis of original system is performed the steps of when 311;Configure the number of users of the block chain user
According to;It is modified according to scanning entrance of the user data to preset program, the preset program is the block chain
User needs relative program to be used;The preset program is compiled into generation block catenary system in system image file.
In the embodiment of the present invention, by adding block chain user on the basis of original system, and configures the block chain and use
The user data at family modifies the scanning entrance of preset program relevant to user data, finally by preset program
Be compiled into system image file, on mobile terminals generate block catenary system, improve block catenary system portability and easily
With property, only load program relevant to block catenary system, reduces the power consumption of block catenary system.
Optionally, in a kind of possible embodiment, the processor 320 is also used to:
It is added in the userlist.xml file of the source code of the original system<user id="10"/>code.
Optionally, in a kind of possible embodiment, the processor 320 is specifically also used to:
10.xml is added in the source code of the original system configures user data;The title of the user data is arranged
For block catenary system.
Optionally, in a kind of possible embodiment, the processor 320 is specifically also used to:
Arbitration functions code, the application are applied in addition in the userlist.xml file of the source code of the original system
Whether the system that arbitration functions code is used to judge to be currently up is the block catenary system.
Optionally, in a kind of possible embodiment, the processor 320 is specifically also used to:
Judge whether the system being currently up is the block catenary system;
If whether the system being currently up is the block catenary system, loaded in the block catenary system described preset
Program.
Since the electronic equipment that the present embodiment is introduced is to implement a kind of block chain operating system in the embodiment of the present invention
Equipment used by generation method, so based on method described in the embodiment of the present invention, those skilled in the art's energy
The specific embodiment and its various change form of the electronic equipment of solution the present embodiment much of that, so being set herein for the electronics
It is standby how to realize that the method in the embodiment of the present invention is no longer discussed in detail, as long as those skilled in the art implement the present invention in fact
Equipment used by the method in example is applied, the range of the invention to be protected is belonged to.
Referring to Fig. 4, Fig. 4 is a kind of embodiment signal of computer readable storage medium provided in an embodiment of the present invention
Figure.
As shown in figure 4, present embodiments providing a kind of computer readable storage medium 400, it is stored thereon with computer journey
Sequence 411, the computer program 411 realize following steps when being executed by processor: adding block chain on the basis of original system and use
Family;Configure the user data of the block chain user;It is repaired according to scanning entrance of the user data to preset program
Change, the preset program is that the block chain user needs relative program to be used;The preset program is compiled into and is
Block catenary system is generated in system image file.
In the embodiment of the present invention, by adding block chain user on the basis of original system, and configures the block chain and use
The user data at family modifies the scanning entrance of preset program relevant to user data, finally by preset program
Be compiled into system image file, on mobile terminals generate block catenary system, improve block catenary system portability and easily
With property, only load program relevant to block catenary system, reduces the power consumption of block catenary system.
Optionally, in a kind of possible embodiment, it is specifically used for realizing when which is executed by processor
Following steps: it is added in the userlist.xml file of the source code of the original system<user id="10"/>code.
Optionally, in a kind of possible embodiment, it is specifically used for realizing when which is executed by processor
Following steps: 10.xml is added in the source code of the original system and configures user data;The title of the user data is set
It is set to block catenary system.
Optionally, in a kind of possible embodiment, it is specifically used for realizing when which is executed by processor
Following steps: arbitration functions code is applied in addition in the userlist.xml file of the source code of the original system, described to answer
It whether is the block catenary system with the system that arbitration functions code is used to judge to be currently up.
Optionally, in a kind of possible embodiment, it is specifically used for realizing when which is executed by processor
Following steps: judge whether the system being currently up is the block catenary system;If whether the system being currently up is the area
Block catenary system then loads the preset program in the block catenary system.
It should be noted that in the above-described embodiments, all emphasizing particularly on different fields to the description of each embodiment, in some embodiment
The part being not described in may refer to the associated description of other embodiments.
It should be understood by those skilled in the art that, the embodiment of the present invention can provide as method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the present invention
Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the present invention, which can be used in one or more,
The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces
The form of product.
The present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that each process in flowchart and/or the block diagram can be realized by computer program instructions
And/or the combination of the process and/or box in box and flowchart and/or the block diagram.It can provide these computer programs to refer to
Enable the processor of general purpose computer, special purpose computer, embedded computer or other programmable data processing devices to produce
A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real
The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates,
Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or
The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one
The step of function of being specified in a box or multiple boxes.
Although preferred embodiments of the present invention have been described, it is created once a person skilled in the art knows basic
Concept, then additional changes and modifications may be made to these embodiments.So it includes preferred that the following claims are intended to be interpreted as
Embodiment and all change and modification for falling into the scope of the invention.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art
Mind and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies
Within, then the invention is also intended to include including these modification and variations.