CN103544151B - The method and system of data processing in Linux system - Google Patents

The method and system of data processing in Linux system Download PDF

Info

Publication number
CN103544151B
CN103544151B CN201210236760.3A CN201210236760A CN103544151B CN 103544151 B CN103544151 B CN 103544151B CN 201210236760 A CN201210236760 A CN 201210236760A CN 103544151 B CN103544151 B CN 103544151B
Authority
CN
China
Prior art keywords
data
data processing
request
linux system
loading
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
Application number
CN201210236760.3A
Other languages
Chinese (zh)
Other versions
CN103544151A (en
Inventor
刘宏文
刘玉喜
胡大伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Song Yixiao
Original Assignee
Shanghai Feixun Data Communication Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Feixun Data Communication Technology Co Ltd filed Critical Shanghai Feixun Data Communication Technology Co Ltd
Priority to CN201210236760.3A priority Critical patent/CN103544151B/en
Publication of CN103544151A publication Critical patent/CN103544151A/en
Application granted granted Critical
Publication of CN103544151B publication Critical patent/CN103544151B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a kind of method of data processing in Linux system, comprise the following steps:Step S1, when Linux system starts log-on data treatment progress;Step S2, loading configuration file is into internal memory;Step S3, receive application program data processing request;Step S4, the data in the current file are handled by hash algorithm and result is returned into application program.The invention also discloses a kind of system of data processing in Linux system.The present invention is able to quick processing data, read storage device when starting except system(A such as flash)Beyond middle configuration data, digital independent generally is carried out in the hash tables in internal memory, and under the auxiliary of hash algorithm, searching the corresponding value of relevant parameter name becomes rapider, simultaneously because after reduction flash read-write number, data are not easy to damage and lost.

Description

The method and system of data processing in Linux system
Technical field
The present invention relates to a kind of Linux system(Linux is a kind of class Unix operating systems of free and open source code (UNIX operating system was AT & T Corp. of the U.S. in the operating system run on PDP-11 in 1971.With multi-user, more The characteristics of business, various processor framework is supported, earliest by agreeing Thompson(Kenneth Lane Thompson), Denis Ritchie(Dennis MacAlistair Ritchie)Opened with Douglas McIlroy in 1969 in AT&T AT&T Labs Hair))The method and system of middle data processing, more particularly to data processing in a kind of Linux system of quick processing data Method and system.
Background technology
Traditional read-write operation method to configuration file is:Flash is read first(Flash memory)In configuration internal memory, and Value corresponding to certain parameter name is searched in such arrangements, after then carrying out corresponding operating to this value, if changing, then in renewal Value corresponding to middle relevant parameter name is deposited, and these configurations are re-write flash, if do not changed, releasing memory.
Similar this method, management and operation to data are carried out in a manner of string matching, often search a ginseng Several values will scan for matching to whole configuration, and speed is very slow, reduces the processing speed of equipment;And this mode meeting Frequently read-write operation is carried out to flash, flash service life can be reduced.
With the increase of the function of communication equipment, configuration file is increasing, while the number of access equipment configuration parameter Also more and more, traditional data processing method can not meet demand.
The content of the invention
The technical problem to be solved in the present invention is that prior art data search speed is slow, frequently read-write operation in order to overcome The defects of shortening flash service life, there is provided one kind can quickly to processing configuration parameter be written and read associative operation and The method and system of data processing in the Linux system to flash infringements are reduced to the full extent.
The present invention is that solve above-mentioned technical problem by following technical proposals:
A kind of method of data processing in Linux system, its feature are that it comprises the following steps:
Step S1, when Linux system starts log-on data treatment progress;
Step S2, loading configuration file is into internal memory;
Step S3, receive application program data processing request;
Step S4, by hash algorithm handle current file in data and result is returned into application program.
Because the operations such as the lookup of data, setting are carried out in internal memory, be different from needs from storage in the prior art The storage device of data(A such as flash)Middle reading related data, data are operated in conjunction with hash algorithm so that this The method of data processing has faster data processing speed for comparing prior art in the described Linux system of invention.
Preferably, step S2In also include:Log-on data handle monitoring process, with monitor the data processing process whether when Carve and exist.The hash tables in internal memory are maintain due to data processing module process, setting can quickly be inquired about by the hash tables Data, the data processing process play a part of an interface, when other any system process need inquiry or set data all Thus to need to ensure that the data processing process exists always by the data processing process.
Preferably, step S3In pass through socket(Socket English original meaning is " hole " or " socket ".As 4BDS UNIX Interprocess Communication Mechanism, takes latter to look like.Commonly referred to as " socket ", it is one for describing IP address and port The handle of individual communication chain)Communication mode receives the data processing request.
Preferably, the data processing request is selected from:Data inquiry request, data modification request(Including adding, deleting, repairing Change), data preserve ask summed data display request.
Preferably, step S2In also include:Judge whether Linux system is to start for the first time or is to recover default configuration Startup afterwards, if so, then loading default configuration file, and the check code of the default configuration file is carried out in loading procedure Checking, if it is not, then loading user profile, and the check code of the user profile is tested in loading procedure Card.Also including carrying out configuration file the step of judgement verifies during loading configuration file to internal memory.
Wherein, default configuration file is the initial configuration file of equipment or system(Also referred to as dispatch from the factory configuration), when user couple sets When function problem or user configuration damage occurs later in standby improper configuration, this can be called by way of recovering default configuration Default configuration file with ensure equipment normally start and operation.User profile, which is user, to be made to equipment or system with postponing guarantor Leave the configuration file come(For example user opens fire wall, Dynamic Host Configuration Protocol server), can all load this under normal circumstances later Configuration file, start fire wall and dhcp server functionality.
Preferably, the data storage in the current file is in a hash tables of internal memory(Hashing defines a kind of by character The character string of composition is converted to regular length(Usually more short length)Numerical value or index value method, referred to as hashing, It is Hash method)In.
Preferably, step S4Also include afterwards:Judge whether the hash tables in internal memory have data variation, if so, at this Hash tables are stored in the user profile in a storage device after data processing request.Whetheing there is data variation, this judges Only occur in after some the request operations that may change hash table data, no data will not then carry out any operation when changing; So do to be reduced to flash to greatest extent(Storage device)Read-write operation, extend flash service life(flash Read-write number be limited).
The system that the present invention also provides data processing in a kind of Linux system, its feature are that it includes:
One loading device, loading configuration file is into internal memory;
One request of data device, for receive application program data processing request and by the data processing request send to One data processing equipment;
The data processing equipment is used for log-on data treatment progress, and configuration file is loaded onto in internal memory as ought be above Part, and Data Concurrent in the current file is handled after receiving the data processing request by hash algorithm send processing to tie Fruit is to the request of data device so that the result is returned into application program.
Preferably, the system of data processing also includes a supervising device in the Linux system, is supervised for log-on data processing To monitor the data processing process, whether the moment exists control process.
Preferably, the data processing equipment is used to receive the data processing request by socket communication modes, and leads to Cross socket communication modes and send result to the request of data device.
Preferably, the data processing request is selected from:Data inquiry request, data modification request, data preserve request sum Asked according to display.
Preferably, the loading device is additionally operable to judge whether Linux system is to start for the first time or is to recover acquiescence to match somebody with somebody The startup postponed, if so, then loading default configuration file, and the check code of the default configuration file is entered in loading procedure Row checking, if it is not, then loading user profile, and the check code of the user profile is tested in loading procedure Card.
Preferably, the data storage in the current file is in a hash tables of internal memory.
Preferably, the system of data processing also includes a judgment means in the Linux system, for judging in internal memory Whether hash tables have data variation, if so, hash tables are stored in the use in a storage device after this data processing request In the configuration file of family.
The positive effect of the present invention is:The method and system of data processing in Linux system of the present invention Quick processing data is able to, read storage device when starting except system(A such as flash)Beyond middle configuration data, ordinary circumstance Under digital independent be all to be carried out in the hash tables in internal memory, under the auxiliary of hash algorithm, it is corresponding to search relevant parameter name Value become rapider, simultaneously because after reducing flash read-write number, data are not easy to damage and lost.
Brief description of the drawings
Fig. 1 be one embodiment of the invention Linux system in data processing method flow chart.
Fig. 2 be one embodiment of the invention Linux system in data processing system structured flowchart.
Embodiment
Present pre-ferred embodiments are provided below in conjunction with the accompanying drawings, to describe technical scheme in detail.
With reference to figure 1, the method for introducing data processing in Linux system of the present invention, comprise the following steps:
Step S1, when Linux system starts log-on data treatment progress;
Step S2, loading configuration file is into internal memory;
Step S3, receive application program data processing request;
Step S4, the data in the current file are handled by hash algorithm and result is returned into application program.
Wherein, step S2In also include:Log-on data handle monitoring process, with monitor the data processing process whether the moment In the presence of.The hash tables in internal memory are maintain due to data processing module process, setting number can quickly be inquired about by the hash tables According to the data processing process plays a part of an interface, and other any system process will when needing inquiry or setting data By the data processing process, thus need to ensure that the data processing process exists always.
Specifically, step S3In the data processing request received by socket communication modes.
In general, the data processing request is selected from:Data inquiry request, data modification request(Including adding, deleting, Modification), data preserve ask summed data display request.
Wherein, step S2In also include:Judge whether Linux system is to start for the first time or is after recovering default configuration Startup, if so, then loading default configuration file, and the check code of the default configuration file is tested in loading procedure Card, if it is not, then loading user profile, and the check code of the user profile is verified in loading procedure. Also including carrying out configuration file the step of judgement verifies during loading configuration file to internal memory.
Wherein, default configuration file is the initial configuration file of equipment or system(Also referred to as dispatch from the factory configuration), when user couple sets When function problem or user configuration damage occurs later in standby improper configuration, this can be called by way of recovering default configuration Default configuration file with ensure equipment normally start and operation.User profile, which is user, to be made to equipment or system with postponing guarantor Leave the configuration file come(For example user opens fire wall, Dynamic Host Configuration Protocol server), can all load this under normal circumstances later Configuration file, start fire wall and dhcp server functionality.
Wherein, the data storage in the current file is in a hash tables of internal memory.
And in step S4Also include afterwards:Judge whether the hash tables in internal memory have data variation, if so, in this number Hash tables are stored in the user profile in a storage device after being asked according to processing.Whetheing there is data variation, this judges only Occur after it may change some request operations of hash table data, no data will not then carry out any operation when changing;This Sample, which is done, to be reduced to greatest extent to flash(Storage device)Read-write operation, extend flash service life.
With reference to figure 2, the system for introducing data processing in Linux system of the present invention, it includes:
One loading device 1, loading configuration file is into internal memory;
One request of data device 2, for receiving the data processing request of application program and sending the data processing request To a data processing equipment 3;
The data processing equipment 3 is used for log-on data treatment progress, and configuration file is loaded onto in internal memory as ought be above Part, and Data Concurrent in the current file is handled after receiving the data processing request by hash algorithm send processing to tie Fruit is to the request of data device so that the result is returned into application program.
Specifically, the system of data processing also includes a supervising device in the Linux system(Not shown in figure), it is used for Log-on data handles monitoring process, and to monitor the data processing process, whether the moment is present.More specifically, described monitoring module Structure and code for monitoring data processing unit 3.
Wherein, the data processing equipment is used to receive the data processing request by socket communication modes, and passes through Socket communication modes send result to the request of data device.
Specifically, the data processing request is selected from:Data inquiry request, data modification request, data preserve request sum Asked according to display.
More specifically, the loading device 1 is additionally operable to judge whether Linux system is to start for the first time or is to recover acquiescence With the startup postponed, if so, default configuration file is then loaded, and to the check code of the default configuration file in loading procedure Verified, if it is not, then loading user profile, and the check code of the user profile is carried out in loading procedure Checking.
Especially, the data storage in the current file is in a hash tables of internal memory.
In addition, the system of data processing also includes a judgment means in the Linux system(Not shown in figure), for judging Whether the hash tables in internal memory have data variation, if so, hash tables are stored in storage dress after this data processing request In the user profile put.
Below, with reference to specific application example, technical scheme is introduced again.
1st, Linux system electrifying startup, Linux system can automatic start data processing process and monitoring process, monitor into Journey is for monitoring data processing module process, ensures that the data processing module process moment is present.Data processing process initiation with After first pass through hash algorithm loading data file, monitored data operation request.
2nd, after data processing process initiation, data file is loaded, data file is divided into default document and current file, is System initial start-up can load default document into current file, and the data of current file are loaded directly into startup afterwards.This The default document of a little data is that the configuration file configured according to programmer converts, and the default document of generation can add verification Code.The file of programmer's configuration should meet this forms of Name=value.
3rd, when there is program to need to operate data, the interface of routine call data processing equipment, request of data dress Put operation requests being packaged and be sent to data processing equipment, data processing equipment receives request, is grasped by hash algorithm Make data, and result is returned into request of data device, finally give result to program by request of data device.Specifically, When program needs to operate data, the interface of request of data device is called, is led to by request of data device by socket Letter mode sends request to data processing equipment and such as inquires about data, modification data, interpolation data, display data etc., at data When reason device receives request, data are operated by hash algorithm, and result is returned into number by socket modes According to request unit, result is finally returned into program.
The beneficial effects of the present invention are data are handled in this manner, efficiency high faster than original mode speed, While improving data processing speed, the present invention is for compatible original linux data processing form, in data demand module Retain original function interface, and be extended on the basis of original, to support more call.Except Linux system Being read during startup in flash beyond configuration data, digital independent generally is carried out in the hash tables in internal memory, Under the auxiliary of hash algorithm, searching the corresponding value of relevant parameter name becomes rapider, simultaneously because reducing flash read-write time After number, data are not easy to damage and lost.
Although the foregoing describing the embodiment of the present invention, it will be appreciated by those of skill in the art that these It is merely illustrative of, protection scope of the present invention is defined by the appended claims.Those skilled in the art is not carrying on the back On the premise of principle and essence from the present invention, various changes or modifications can be made to these embodiments, but these are changed Protection scope of the present invention is each fallen within modification.

Claims (6)

1. a kind of method of data processing in Linux system, it is characterised in that it comprises the following steps:
Step S1, the log-on data treatment progress when Linux system starts;
Step S2, loading configuration file is into internal memory;Log-on data handles monitoring process, whether to monitor the data processing process Moment is present;Judge whether Linux system is to start for the first time or is to recover the startup after default configuration, if so, then loading Default configuration file, and the check code of the default configuration file is verified in loading procedure, if it is not, then loading user Configuration file, and the check code of the user profile is verified in loading procedure;
Step S3, the data processing request of application program is received;
Step S4, the data in current file are handled by hash algorithm and result is returned into application program;This is current Data storage in file is in a hash tables of internal memory;Judge whether the hash tables in internal memory have data variation, if so, herein Hash tables are stored in the user profile in a storage device after secondary data processing request.
2. the method for data processing in Linux system as claimed in claim 1, it is characterised in that pass through in step S3 Socket communication modes receive the data processing request.
3. the method for data processing in the Linux system as described in any one in claim 1-2, it is characterised in that the number It is selected from according to processing request:Data inquiry request, data modification request, data, which preserve, asks summed data display request.
4. the system of data processing in a kind of Linux system, it is characterised in that it includes:
One loading device, loading configuration file is into internal memory;The loading device is additionally operable to judge whether Linux system is for the first time Start or to recover the startup after default configuration, if so, default configuration file is then loaded, and it is silent to this in loading procedure The check code for recognizing configuration file is verified, if it is not, then loading user profile, and the user is matched somebody with somebody in loading procedure The check code for putting file is verified;
One request of data device, for receiving the data processing request of application program and sending the data processing request to a number According to processing unit;
The data processing equipment is used for log-on data treatment progress, and configuration file is loaded onto in internal memory as current file, with And the Data Concurrent in the current file is handled after receiving the data processing request by hash algorithm send result extremely The request of data device by the result to return to application program;Data storage in the current file is in the one of internal memory In hash tables;
One supervising device, handling monitoring process for log-on data, whether the moment is present to monitor the data processing process;
One judgment means, whether the hash tables for judging in internal memory have data variation, if so, after this data processing request Hash tables are stored in the user profile in a storage device.
5. the system of data processing in Linux system as claimed in claim 4, it is characterised in that the data processing equipment is used Result is sent to should in receiving the data processing request by socket communication modes, and by socket communication modes Request of data device.
6. the system of data processing in the Linux system as described in any one in claim 4-5, it is characterised in that the number It is selected from according to processing request:Data inquiry request, data modification request, data, which preserve, asks summed data display request.
CN201210236760.3A 2012-07-09 2012-07-09 The method and system of data processing in Linux system Active CN103544151B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210236760.3A CN103544151B (en) 2012-07-09 2012-07-09 The method and system of data processing in Linux system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210236760.3A CN103544151B (en) 2012-07-09 2012-07-09 The method and system of data processing in Linux system

Publications (2)

Publication Number Publication Date
CN103544151A CN103544151A (en) 2014-01-29
CN103544151B true CN103544151B (en) 2018-01-02

Family

ID=49967616

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210236760.3A Active CN103544151B (en) 2012-07-09 2012-07-09 The method and system of data processing in Linux system

Country Status (1)

Country Link
CN (1) CN103544151B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104463031B (en) * 2014-12-01 2018-01-02 上海斐讯数据通信技术有限公司 A kind of method that Linux hides configuration file
CN105528213A (en) * 2015-12-04 2016-04-27 上海斐讯数据通信技术有限公司 Method for preventing same parameters from being written in Flash configuration area
CN107329782A (en) * 2017-06-23 2017-11-07 武汉长光科技有限公司 A kind of method for lifting embedded device configuration file read-write efficiency
CN110399371B (en) * 2018-04-23 2023-06-23 湖南湘谷信息科技有限公司 Redis database-based memory consumption reduction method, storage medium and device
CN111752541B (en) * 2020-06-25 2023-09-01 武汉众邦银行股份有限公司 Payment routing method based on Rete algorithm
CN111901677B (en) * 2020-07-24 2022-08-02 海信视像科技股份有限公司 Method for uniformly controlling process starting and display equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1904852A (en) * 2006-08-01 2007-01-31 西安西电捷通无线网络通信有限公司 Method for monitoring and abnormal processing of computer application program
CN101419571A (en) * 2008-12-04 2009-04-29 上海大学 Method for storing configuration parameter in NOR FLASH based on Hash arithmetic
CN101872400A (en) * 2009-04-24 2010-10-27 汪家祥 Method for establishing computer information security protection capable of judging security of computer operation request according to associative relation of computing system operation request

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100559763C (en) * 2007-08-28 2009-11-11 中国科学院软件研究所 A kind of integrity check method of telecommunication network service
CN101556583B (en) * 2008-04-10 2012-09-19 上海宝康电子控制工程有限公司 Method for efficiently controlling embedded linux file system version
CN101360127A (en) * 2008-09-10 2009-02-04 金蝶软件(中国)有限公司 File updating method and transmission system
US20100146496A1 (en) * 2008-12-02 2010-06-10 Slideshow Technologies, Llc Displaying Presentations

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1904852A (en) * 2006-08-01 2007-01-31 西安西电捷通无线网络通信有限公司 Method for monitoring and abnormal processing of computer application program
CN101419571A (en) * 2008-12-04 2009-04-29 上海大学 Method for storing configuration parameter in NOR FLASH based on Hash arithmetic
CN101872400A (en) * 2009-04-24 2010-10-27 汪家祥 Method for establishing computer information security protection capable of judging security of computer operation request according to associative relation of computing system operation request

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于嵌入式的教学检测系统的设计;景玉冰等;《计算机技术与发展》;20091231;第19卷(第07期);第2节第2段,第2.2节第3-5段 *

Also Published As

Publication number Publication date
CN103544151A (en) 2014-01-29

Similar Documents

Publication Publication Date Title
CN103544151B (en) The method and system of data processing in Linux system
CN102216899B (en) Managing cache data and metadata
US9934105B2 (en) Fault tolerance for complex distributed computing operations
JP4760491B2 (en) Event processing system, event processing method, event processing apparatus, and event processing program
CN109831500A (en) The synchronous method of configuration file and Pod in Kubernetes cluster
CN109788055B (en) Service management system and method based on micro-service architecture
CN103220352B (en) Terminal, server, file storage system and file storage method
CN106547612A (en) A kind of multi-task processing method and device
CN110221845A (en) Using dispositions method, device, equipment and medium
CN111399988B (en) Memory security detection system and method for cloud platform
CN109254832A (en) A kind of virtual machine starting method, apparatus, storage medium and computer equipment matter
CN113220367A (en) Applet running method and device, electronic equipment and storage medium
WO2016095644A1 (en) High availability solution method and device for database
JP2016099857A (en) Fraudulent program handling system and fraudulent program handling method
CN107329836A (en) Multi-system memory management method and device and mobile terminal
CN107621945A (en) A kind of method and device for the mark for determining ios device
CN106875184A (en) Abnormal scene analogy method, device and equipment
CN101226666A (en) Bank self-help equipment and method for improving performance thereof
CN108255578A (en) The method that virtual machine remote booting is realized based on zero terminal
CN104699513B (en) A kind of document handling method and device
CN110134546A (en) Batch restarts windows systems approach, electronic device and storage medium
TWI465072B (en) Method for updating system firmware and server system using the same
CN115756322A (en) Data storage method and device, electronic equipment and storage medium
CN112162964B (en) Self-adaptive data synchronization method, device, computer equipment and storage medium
US8090997B2 (en) Run-time fault resolution from development-time fault and fault resolution path identification

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20201116

Address after: 221700 4-1-110-shop, Nanyuan new town, Fengxian County, Xuzhou City, Jiangsu Province

Patentee after: Song Yixiao

Address before: Songjiang District shihudong Town Tower Road 201617 min 579 Lane Shanghai No. -26

Patentee before: Phicomm (Shanghai) Co.,Ltd.