CN108920621A - Data-updating method, mobile terminal and computer readable storage medium - Google Patents
Data-updating method, mobile terminal and computer readable storage medium Download PDFInfo
- Publication number
- CN108920621A CN108920621A CN201810692664.7A CN201810692664A CN108920621A CN 108920621 A CN108920621 A CN 108920621A CN 201810692664 A CN201810692664 A CN 201810692664A CN 108920621 A CN108920621 A CN 108920621A
- Authority
- CN
- China
- Prior art keywords
- data
- update
- request
- alternative condition
- mobile terminal
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 44
- 230000002159 abnormal effect Effects 0.000 claims abstract description 25
- 238000011084 recovery Methods 0.000 claims description 19
- 230000007246 mechanism Effects 0.000 claims description 18
- 238000001514 detection method Methods 0.000 abstract description 11
- 230000006870 function Effects 0.000 description 15
- 230000006854 communication Effects 0.000 description 13
- 238000004891 communication Methods 0.000 description 12
- 238000010586 diagram Methods 0.000 description 9
- 238000012545 processing Methods 0.000 description 8
- 230000008569 process Effects 0.000 description 4
- 230000006399 behavior Effects 0.000 description 3
- 238000010295 mobile communication Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 230000005764 inhibitory process Effects 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 230000007774 longterm Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- 230000001133 acceleration Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000005314 correlation function Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 230000008030 elimination Effects 0.000 description 1
- 238000003379 elimination reaction Methods 0.000 description 1
- 230000005484 gravity Effects 0.000 description 1
- 238000003780 insertion Methods 0.000 description 1
- 230000037431 insertion Effects 0.000 description 1
- 230000001404 mediated effect Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000000149 penetrating effect Effects 0.000 description 1
- 238000009527 percussion Methods 0.000 description 1
- 230000008439 repair process Effects 0.000 description 1
- 230000011664 signaling Effects 0.000 description 1
- 230000005236 sound signal Effects 0.000 description 1
- 238000010897 surface acoustic wave method Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Landscapes
- Mobile Radio Communication Systems (AREA)
Abstract
The invention discloses a kind of data-updating method, this method includes:When the data for receiving developer's triggering update request, detect whether the alternative condition that the data update in request is empty;If it is sky that the data, which update the alternative condition in request, intercepts corresponding data and update operation, and generate corresponding prompt information, to prompt user data update abnormal and corresponding abnormal cause;If it is not sky that the data, which update the alternative condition in requesting, corresponding data update is executed according to data update request and is operated.The invention also discloses a kind of mobile terminal and computer readable storage mediums.The case where present invention is failed to write by the alternative condition of detection discovery in time, and intercept corresponding data and update operation, to reduce the risk that database is destroyed.
Description
Technical field
The present invention relates to data update method field more particularly to data-updating methods, mobile terminal and computer-readable
Storage medium.
Background technique
For Android Android system, usually carried out by Content Provider (Content Provider) corresponding
Database manipulation, such as data insertion, data delete, data update etc..During data update, although developer is
The data parameters updated needed for being specified in sdk (Software Development Kit, software data update packet), but
It is that developer is easy to forget to write primary corresponding alternative condition again when calling, to will appear following situations:Developer is originally
It only to operate and update some field and due to forgetting to write alternative condition can make the field whole quilt of entire database table
It updates, other fields for not needing to update all fail, and corresponding Android database is caused integrally to be destroyed, and cause serious
Consequence.Therefore, how to avoid the problem that above situation is developer's urgent need to resolve, to reduce the wind that database is destroyed
Danger.
Above content is only used to facilitate the understanding of the technical scheme, and is not represented and is recognized that above content is existing skill
Art.
Summary of the invention
It is a primary object of the present invention to propose a kind of data-updating method, mobile terminal and computer-readable storage medium
Matter, it is intended to by detecting the case where discovery alternative condition is failed to write in time, and intercept corresponding data and update operation, to reduce
The risk that database is destroyed.
To achieve the above object, the present invention provides a kind of data-updating method, and the data-updating method includes:
When the data for receiving developer's triggering update request, detecting the alternative condition that the data update in request is
No is empty;
If it is sky that the data, which update the alternative condition in requesting, intercepts corresponding data and update operation, and generation pair
The prompt information answered, to prompt user data update abnormal and corresponding abnormal cause;
If it is not sky that the data, which update the alternative condition in request, executed according to data update request corresponding
Data update operation.
Optionally, described to be updated according to the data before requesting to execute the step of corresponding data update operates, including:
It is whether all the same that the key column data in request inquiry correspondence database is updated according to the data;
If the key column data presence in correspondence database is not identical, then follow the steps:Request is updated according to the data to hold
The corresponding data of row update operation.
Optionally, whether described updated according to the data requests the key column data in inquiry correspondence database all the same
After step, further include:
If the key column data in correspondence database is all the same, start corresponding time data recovery mechanism;
Restoration Mechanism restores the data that corresponding mistake updates based on the data, and updates request pair according to the data
Data after recovery execute corresponding data and update operation.
Optionally, the data-updating method further includes:
When receiving data call request, corresponding called side is determined according to data call request, and detect institute
Called side is stated whether in default white list;
If the called side in default white list, responds the data call request.
Optionally, the data-updating method further includes:
If the called side not in default white list, refuses the data call request.
In addition, to achieve the above object, the present invention also provides a kind of mobile terminal, the mobile terminal includes including storage
Device, processor and it is stored in the date update program that can be run on the memory and on the processor, the data are more
New procedures realize following steps when being executed by the processor:
When the data for receiving developer's triggering update request, detecting the alternative condition that the data update in request is
No is empty;
If it is sky that the data, which update the alternative condition in requesting, intercepts corresponding data and update operation, and generation pair
The prompt information answered, to prompt user data update abnormal and corresponding abnormal cause;
If it is not sky that the data, which update the alternative condition in request, executed according to data update request corresponding
Data update operation.
Optionally, following steps are also realized when the date update program is executed by the processor:
It is whether all the same that the key column data in request inquiry correspondence database is updated according to the data;
If the key column data presence in correspondence database is not identical, then follow the steps:Request is updated according to the data to hold
The corresponding data of row update operation.
Optionally, following steps are also realized when the date update program is executed by the processor:
If the key column data in correspondence database is all the same, start corresponding time data recovery mechanism;
Restoration Mechanism restores the data that corresponding mistake updates based on the data, and updates request pair according to the data
Data after recovery execute corresponding data and update operation.
Optionally, following steps are also realized when the date update program is executed by the processor:
When receiving data call request, corresponding called side is determined according to data call request, and detect institute
Called side is stated whether in default white list;
If the called side in default white list, responds the data call request.
In addition, to achieve the above object, it is described computer-readable the present invention also provides a kind of computer readable storage medium
Date update program is stored on storage medium, the date update program realizes following steps when being executed by processor:
When the data for receiving developer's triggering update request, detecting the alternative condition that the data update in request is
No is empty;
If it is sky that the data, which update the alternative condition in requesting, intercepts corresponding data and update operation, and generation pair
The prompt information answered, to prompt user data update abnormal and corresponding abnormal cause;
If it is not sky that the data, which update the alternative condition in request, executed according to data update request corresponding
Data update operation.
The present invention provides a kind of data-updating method, mobile terminal and computer readable storage medium, moves in the present invention
Terminal receive developer triggering data update request when, first detect the data update request in alternative condition whether be
Whether sky, i.e. detection developer fail to write the alternative condition;If it is sky that the data, which update the alternative condition in request, correspondence is intercepted
Data update operation, block in time the data update operation execution, to avoid data by mistake update, cause database whole
Body is destroyed.If it is not sky that the data, which update the alternative condition in request, request is updated according to the data and executes corresponding number
It is operated according to updating.The case where being failed to write in the present invention by the alternative condition of detection discovery in time, and intercept corresponding data and update
Operation avoids in the prior art once failing to write alternative condition and database being caused integrally to be destroyed, and the present invention can reduce number
The risk being destroyed according to library guarantees the safety of data in database.
Detailed description of the invention
Fig. 1 is the terminal structure schematic diagram for the hardware running environment that the embodiment of the present invention is related to;
Fig. 2 is a kind of communications network system architecture diagram provided in an embodiment of the present invention;
Fig. 3 is the flow diagram of data-updating method first embodiment of the present invention;
Fig. 4 is the flow diagram of data-updating method second embodiment of the present invention.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
In subsequent description, it is only using the suffix for indicating such as " module ", " component " or " unit " of element
Be conducive to explanation of the invention, itself there is no a specific meaning.Therefore, " module ", " component " or " unit " can mix
Ground uses.
Terminal can be implemented in a variety of manners.For example, terminal described in the present invention may include such as mobile phone, plate
Computer, laptop, palm PC, personal digital assistant (Personal Digital Assistant, PDA), portable
Media player (Portable Media Player, PMP), navigation device, wearable device, Intelligent bracelet, pedometer etc. move
The fixed terminals such as dynamic terminal, and number TV, desktop computer.
It will be illustrated by taking mobile terminal as an example in subsequent descriptions, it will be appreciated by those skilled in the art that in addition to special
Except element for moving purpose, the construction of embodiment according to the present invention can also apply to the terminal of fixed type.
Referring to Fig. 1, Fig. 1 is the terminal structure schematic diagram for the hardware running environment that the embodiment of the present invention is related to, it should
Mobile terminal 100 may include:RF (Radio Frequency, radio frequency) unit 101, Wi-Fi module 102, audio output unit
103, A/V (audio/video) input unit 104, sensor 105, display unit 106, user input unit 107, interface unit
108, the components such as memory 109, processor 110 and power supply 111.It will be understood by those skilled in the art that shown in Fig. 1
Mobile terminal structure does not constitute the restriction to mobile terminal, and mobile terminal may include components more more or fewer than diagram,
Perhaps certain components or different component layouts are combined.
It is specifically introduced below with reference to all parts of the Fig. 1 to mobile terminal:
Radio frequency unit 101 can be used for receiving and sending messages or communication process in, signal sends and receivees, specifically, by base station
Downlink information receive after, to processor 110 handle;In addition, the data of uplink are sent to base station.In general, radio frequency unit 101
Including but not limited to antenna, at least one amplifier, transceiver, coupler, low-noise amplifier, duplexer etc..In addition, penetrating
Frequency unit 101 can also be communicated with network and other equipment by wireless communication.Any communication can be used in above-mentioned wireless communication
Standard or agreement, including but not limited to GSM (Global System of Mobile communication, global system for mobile telecommunications
System), GPRS (General Packet Radio Service, general packet radio service), CDMA2000 (Code
Division Multiple Access 2000, CDMA 2000), WCDMA (Wideband Code Division
Multiple Access, wideband code division multiple access), TD-SCDMA (Time Division-Synchronous Code
Division Multiple Access, TD SDMA), FDD-LTE (Frequency Division
Duplexing-Long Term Evolution, frequency division duplex long term evolution) and TDD-LTE (Time Division
Duplexing-Long Term Evolution, time division duplex long term evolution) etc..
Wi-Fi belongs to short range wireless transmission technology, and mobile terminal can help user to receive and dispatch by Wi-Fi module 102
Email, browsing webpage and access streaming video etc., it provides wireless broadband internet access for user.Although Fig. 1
Wi-Fi module 102 is shown, but it is understood that, and it is not belonging to must be configured into for mobile terminal, it completely can basis
It needs to omit within the scope of not changing the essence of the invention.
Audio output unit 103 can be in call signal reception pattern, call mode, record mould in mobile terminal 100
When under the isotypes such as formula, speech recognition mode, broadcast reception mode, by radio frequency unit 101 or Wi-Fi module 102 it is received or
The audio data that person stores in memory 109 is converted into audio signal and exports to be sound.Moreover, audio output unit
103 can also provide executed to mobile terminal 100 the relevant audio output of specific function (for example, call signal receive sound,
Message sink sound etc.).Audio output unit 103 may include loudspeaker, buzzer etc..
A/V input unit 104 is for receiving audio or video signal.A/V input unit 104 may include graphics processor
(Graphics Processing Unit, GPU) 1041 and microphone 1042, graphics processor 1041 is in video acquisition mode
Or the image data of the static images or video obtained in image capture mode by image capture apparatus (such as camera) carries out
Reason.Treated, and picture frame may be displayed on display unit 106.Through graphics processor 1041, treated that picture frame can be deposited
Storage is sent in memory 109 (or other storage mediums) or via radio frequency unit 101 or Wi-Fi module 102.Mike
Wind 1042 can connect in telephone calling model, logging mode, speech recognition mode etc. operational mode via microphone 1042
Quiet down sound (audio data), and can be audio data by such acoustic processing.Audio that treated (voice) data can
To be converted to the format output that can be sent to mobile communication base station via radio frequency unit 101 in the case where telephone calling model.
Microphone 1042 can be implemented various types of noises elimination (or inhibition) algorithms and send and receive sound to eliminate (or inhibition)
The noise generated during frequency signal or interference.
Mobile terminal 100 further includes at least one sensor 105, such as optical sensor, motion sensor and other biographies
Sensor.Specifically, optical sensor includes ambient light sensor and proximity sensor, wherein ambient light sensor can be according to environment
The light and shade of light adjusts the brightness of display panel 1061, and proximity sensor can close when mobile terminal 100 is moved in one's ear
Display panel 1061 and/or backlight.As a kind of motion sensor, accelerometer sensor can detect in all directions (general
For three axis) size of acceleration, it can detect that size and the direction of gravity when static, can be used to identify the application of mobile phone posture
(such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, percussion) etc.;
The fingerprint sensor that can also configure as mobile phone, pressure sensor, iris sensor, molecule sensor, gyroscope, barometer,
The other sensors such as hygrometer, thermometer, infrared sensor, details are not described herein.
Display unit 106 is for showing information input by user or being supplied to the information of user.Display unit 106 can wrap
Display panel 1061 is included, liquid crystal display (Liquid Crystal Display, LCD), Organic Light Emitting Diode can be used
Forms such as (Organic Light-Emitting Diode, OLED) configure display panel 1061.
User input unit 107 can be used for receiving the number or character information of input, and generate the use with mobile terminal
Family setting and the related key signals input of function control.Specifically, user input unit 107 may include touch panel 1071 with
And other input equipments 1072.Touch panel 1071, also referred to as touch screen collect the touch operation of user on it or nearby
(for example user uses any suitable objects or attachment such as finger, stylus on touch panel 1071 or in touch panel 1071
Neighbouring operation), and corresponding attachment device is driven according to preset formula.Touch panel 1071 may include touch detection
Two parts of device and touch controller.Wherein, the touch orientation of touch detecting apparatus detection user, and detect touch operation band
The signal come, transmits a signal to touch controller;Touch controller receives touch information from touch detecting apparatus, and by it
It is converted into contact coordinate, then gives processor 110, and order that processor 110 is sent can be received and executed.In addition, can
To realize touch panel 1071 using multiple types such as resistance-type, condenser type, infrared ray and surface acoustic waves.In addition to touch panel
1071, user input unit 107 can also include other input equipments 1072.Specifically, other input equipments 1072 can wrap
It includes but is not limited in physical keyboard, function key (such as volume control button, switch key etc.), trace ball, mouse, operating stick etc.
It is one or more, specifically herein without limitation.
Further, touch panel 1071 can cover display panel 1061, when touch panel 1071 detect on it or
After neighbouring touch operation, processor 110 is sent to determine the type of touch event, is followed by subsequent processing device 110 according to touch thing
The type of part provides corresponding visual output on display panel 1061.Although in Fig. 1, touch panel 1071 and display panel
1061 be the function that outputs and inputs of realizing mobile terminal as two independent components, but in certain embodiments, it can
The function that outputs and inputs of mobile terminal is realized so that touch panel 1071 and display panel 1061 is integrated, is not done herein specifically
It limits.
Interface unit 108 be used as at least one external device (ED) connect with mobile terminal 100 can by interface.For example,
External device (ED) may include wired or wireless headphone port, external power supply (or battery charger) port, wired or nothing
Line data port, memory card port, the port for connecting the device with identification module, audio input/output (I/O) end
Mouth, video i/o port, ear port etc..Interface unit 108 can be used for receiving the input from external device (ED) (for example, number
It is believed that breath, electric power etc.) and the input received is transferred to one or more elements in mobile terminal 100 or can be with
For transmitting data between mobile terminal 100 and external device (ED).
Memory 109 can be used for storing software program and various data.Memory 109 can mainly include storing program area
The storage data area and, wherein storing program area can (such as the sound of application program needed for storage program area, at least one function
Sound playing function, image player function etc.) etc.;Storage data area can store according to mobile phone use created data (such as
Audio data, phone directory etc.) etc..In addition, memory 109 may include high-speed random access memory, it can also include non-easy
The property lost memory, a for example, at least disk memory, flush memory device or other volatile solid-state parts.
Processor 110 is the control centre of mobile terminal, utilizes each of various interfaces and the entire mobile terminal of connection
A part by running or execute the software program and/or module that are stored in memory 109, and calls and is stored in storage
Data in device 109 execute the various functions and processing data of mobile terminal, to carry out integral monitoring to mobile terminal.Place
Managing device 110 may include one or more processing units;Preferably, processor 110 can integrate application processor and modulatedemodulate is mediated
Manage device, wherein the main processing operation system of application processor, user interface and application program etc., modem processor is main
Processing wireless communication.It is understood that above-mentioned modem processor can not also be integrated into processor 110.
Mobile terminal 100 can also include the power supply 111 (such as battery) powered to all parts, it is preferred that power supply 111
Can be logically contiguous by power-supply management system and processor 110, to realize management charging by power-supply management system, put
The functions such as electricity and power managed.
Although Fig. 1 is not shown, mobile terminal 100 can also be including bluetooth module etc., and details are not described herein.
As shown in Figure 1, as may include operating system, net in a kind of memory 109 of computer readable storage medium
Network communication module, Subscriber Interface Module SIM and date update program, processor 110 can be used for calling to be stored in memory 109
Date update program, and execute following steps:
When the data for receiving developer's triggering update request, detecting the alternative condition that the data update in request is
No is empty;
If it is sky that the data, which update the alternative condition in requesting, intercepts corresponding data and update operation, and generation pair
The prompt information answered, to prompt user data update abnormal and corresponding abnormal cause;
If it is not sky that the data, which update the alternative condition in request, executed according to data update request corresponding
Data update operation.
Further, processor 110 can be used for calling the date update program stored in memory 109, also execute with
Lower step:
It is whether all the same that the key column data in request inquiry correspondence database is updated according to the data;
If the key column data presence in correspondence database is not identical, then follow the steps:Request is updated according to the data to hold
The corresponding data of row update operation.
Further, processor 110 can be used for calling the date update program stored in memory 109, also execute with
Lower step:
If the key column data in correspondence database is all the same, start corresponding time data recovery mechanism;
Restoration Mechanism restores the data that corresponding mistake updates based on the data, and updates request pair according to the data
Data after recovery execute corresponding data and update operation.
Further, processor 110 can be used for calling the date update program stored in memory 109, also execute with
Lower step:
When receiving data call request, corresponding called side is determined according to data call request, and detect institute
Called side is stated whether in default white list;If the called side in default white list, responds the data call request.
Further, processor 110 can be used for calling the date update program stored in memory 109, also execute with
Lower step:
If the called side not in default white list, refuses the data call request.
Embodiment to facilitate the understanding of the present invention, the communications network system that mobile terminal of the invention is based below into
Row description.
Referring to Fig. 2, Fig. 2 is a kind of communications network system architecture diagram provided in an embodiment of the present invention, the communication network system
System is the LTE system of universal mobile communications technology, which includes UE (User Equipment, the use of successively communication connection
Family equipment) (the land Evolved UMTS Terrestrial Radio Access Network, evolved UMTS 201, E-UTRAN
Ground wireless access network) 202, EPC (Evolved Packet Core, evolved packet-based core networks) 203 and operator IP operation
204。
Specifically, UE201 can be above-mentioned terminal 100, and details are not described herein again.
E-UTRAN202 includes eNodeB2021 and other eNodeB2022 etc..Wherein, eNodeB2021 can be by returning
Journey (backhaul) (such as X2 interface) is connect with other eNodeB2022, and eNodeB2021 is connected to EPC203,
ENodeB2021 can provide the access of UE201 to EPC203.
EPC203 may include MME (Mobility Management Entity, mobility management entity) 2031, HSS
(Home Subscriber Server, home subscriber server) 2032, other MME2033, SGW (Serving Gate Way,
Gateway) 2034, PGW (PDN Gate Way, grouped data network gateway) 2035 and PCRF (Policy and
Charging Rules Function, policy and rate functional entity) 2036 etc..Wherein, MME2031 be processing UE201 and
The control node of signaling, provides carrying and connection management between EPC203.HSS2032 is all to manage for providing some registers
Such as the function of home location register (not shown) etc, and preserves some related service features, data rates etc. and use
The dedicated information in family.All customer data can be sent by SGW2034, and PGW2035 can provide the IP of UE 201
Address distribution and other functions, PCRF2036 are strategy and the charging control strategic decision-making of business data flow and IP bearing resource
Point, it selects and provides available strategy and charging control decision with charge execution function unit (not shown) for strategy.
IP operation 204 may include internet, Intranet, IMS (IP Multimedia Subsystem, IP multimedia
System) or other IP operations etc..
Although above-mentioned be described by taking LTE system as an example, those skilled in the art should know the present invention is not only
Suitable for LTE system, be readily applicable to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA with
And the following new network system etc., herein without limitation.
Based on above-mentioned mobile terminal hardware configuration and communications network system, each reality of data-updating method of the present invention is proposed
Apply example.
The present invention provides a kind of data-updating method.
Referring to Fig. 2, Fig. 2 is the flow diagram of data-updating method first embodiment of the present invention.
In the present embodiment, the data-updating method be applied to mobile terminal, the mobile terminal include the first display screen and
Second display screen, this method include:
Step S10 detects the data and updates the choosing in requesting when the data for receiving developer's triggering update request
Select whether condition is empty;
Since in the prior art, developer is when carrying out data update operation by Content Provider, in number
During according to update, although the data parameters updated needed for specifying in sdk, developer is easy when calling
Forget to write primary corresponding alternative condition again, to will appear following situations:Developer will only operate originally updates some
Field, due to forgetting to write alternative condition, the field of entire database table can be made all to be updated, other do not need update
Field all fails, and causes corresponding Android database to be integrally destroyed, causes serious consequence.
For example, the B that developer needs to update the second row data in following tables of data is updated to B2, although in sdk
Data parameters through having write show the second row ID being updated to B2 for the data in 2, but are easy to forget to write again when calling
Alternative condition ID=2, at this point, the data of every row will all be updated to B2 after data update.
ID | Name |
1 | A |
2 | B |
3 | C |
4 | D |
Table 1
For the generation for avoiding above situation, in the present embodiment, mobile terminal is receiving the data of developer's triggering more
When new request, it can first detect whether the alternative condition that the data update in request is sky, i.e. whether detection developer fails to write the choosing
Select condition.
If it is sky that the data, which update the alternative condition in request, S21 is thened follow the steps:It intercepts corresponding data and updates behaviour
Make, and generate corresponding prompt information, to prompt user data update abnormal and corresponding abnormal cause;
In the present embodiment, if it is sky that the data, which update the alternative condition in request, i.e., developer does not fill in the selector bar
Part blocks the data to update the execution of operation in time at this point, then intercepting corresponding data updates operation, wrong to avoid data
It accidentally updates, causes database to be integrally destroyed, cause serious consequence.At the same time it can also generate corresponding prompt information, to mention
Show that user data update is abnormal and corresponding abnormal cause.Prompting mode can include but is not limited to:1) text is reminded, in terminal
The message and abnormal cause of data update abnormal are shown in display screen, to inform that developer fails to write alternative condition;2) voice reminder,
User data update exception is informed by way of voice broadcast, abnormal cause is to fail to write alternative condition;3) alarm and group of text
It closes and reminds, user data update can be reminded abnormal by specific alarm call (or the tinkle of bells), and pop up in display screen corresponding
Textbox, it is to fail to write alternative condition that text, which reminds abnormal cause,.
If it is not sky that the data, which update the alternative condition in request, S22 is thened follow the steps:It is asked according to data update
It asks and executes corresponding data update operation.
In the present embodiment, if it is not sky that the data, which update the alternative condition in request, i.e., developer has filled in the selection
Condition updates operation at this point, then updating request according to the data and executing corresponding data.For example, in above-mentioned example, then by the second row
B be updated to B2.After data are updated successfully, corresponding prompt information also can be generated, to prompt user to be updated successfully, may be used also
To show updated data so that developer confirms.The mode of corresponding prompt information can be with the above-mentioned mode enumerated
It is similar, it can be in such a way that text prompting or voice reminder or particular ringtone and spelling words intellectual be reminded.
The present invention provides a kind of data-updating method, and mobile terminal updates request in the data for receiving developer's triggering
When, first detect whether the alternative condition that the data update in request is sky, i.e. whether detection developer fails to write the alternative condition;If
It is sky that the data, which update the alternative condition in request, then intercepts corresponding data and update operation, the data is blocked to update behaviour in time
The execution of work is updated by mistake to avoid data, database is caused integrally to be destroyed.If the data update the selector bar in request
Part is not sky, then updates the corresponding data update of request execution according to the data and operate.Pass through detection discovery in time in the present invention
The case where alternative condition is failed to write, and intercept corresponding data and update operation, it avoids and once fails to write selector bar in the prior art
Part and cause database to be integrally destroyed, the present invention can reduce the risk that database is destroyed, and guarantee data in database
Safety.
It further, is the flow diagram of data-updating method second embodiment of the present invention referring to Fig. 3, Fig. 3.Based on upper
First embodiment shown in Fig. 2 is stated, before step S22, which can also include:
Whether all the same step S30 updates the key column data in request inquiry correspondence database according to the data;
If the key column data presence in correspondence database is not identical, S22 is thened follow the steps:It is updated and is requested according to the data
It executes corresponding data and updates operation.
To avoid the data in the database from being updated by mistake, i.e., the key column data person of having been developed that in database misses more
For all identical data, and when this data being caused to update, can not find corresponding data is updated, therefore, in this implementation
In example, executed before corresponding data update operation updating request according to the data that receive, can first according to the data more
Whether the key column data in new request inquiry correspondence database is all the same, if the key column data in correspondence database has not phase
Together, then illustrate that the data in the database are not updated by mistake, at this point, it is corresponding then request execution can be updated according to the data
Data update operation.
After step S30, further include:
If the key column data in correspondence database is all the same, S40 is thened follow the steps:Start corresponding time data recovery mechanism;
Step S50, Restoration Mechanism restores the data that corresponding mistake updates based on the data, and more according to the data
New request executes corresponding data to the data after recovery and updates operation.
In the present embodiment, if the key column data in correspondence database is all the same, illustrate data in the database
It is updated by mistake, at this point, then starting corresponding time data recovery mechanism, corresponding mistake is restored based on the time data recovery mechanism and is updated
Data, and according to the data update request corresponding data executed to the data after recovery and update operation.For example, above-mentioned example
In, when the data of all column are all updated to B2, it is primarily based on time data recovery mechanism and reverts to data in table 1, then
The B of the second row will be updated to B2 again.Therefore, can whether homogeneous by the key column data in inquiry database in the present embodiment
Together, whether updated by mistake with the data in Test database, when developer being avoided to carry out data update, correspondence can not be found
Data be updated.In addition, also the data that mistake updates are restored by time data recovery mechanism in the present embodiment,
Guarantee the correctness of data in database.
It should be noted that step S30 can not be located at before step S22.In a particular embodiment, according to the data
After updating the corresponding data update operation of request execution, if data update failure, then step S30 is executed:According to the data
Whether the key column data updated in request inquiry correspondence database is all the same.If the key column data in correspondence database is all the same,
Then follow the steps S40:Start corresponding time data recovery mechanism;And then step S50 is executed, Restoration Mechanism is restored based on the data
The data that corresponding mistake updates, and update request according to the data and behaviour is updated to the corresponding data of data execution after recovery
Make.If key column data in correspondence database exists different, it can detecte and fail with the presence or absence of causing to update the reason of other,
Or corresponding prompt information is generated, prompt developer's data to update failure, can also prompt developer's reason not is that data are wrong
It accidentally updates, developer is asked to detect reason.
In above process, after updating request according to the data and executing corresponding data update operation, if data are more
New failure prompts developer to update failure at this point, corresponding prompt information also can be generated, when receiving developer's triggering
When Data Detection is requested, then request the key column data in inquiry correspondence database whether all the same according to the Data Detection;Afterwards
Continuous step is referred to described in above-described embodiment.
Further, it is also possible to it is whether all the same every the key column data in preset time Test database, to carry out in time
It repairs, to ensure the correctness and safety of data in database.
Further, it is based on above-mentioned first embodiment and second embodiment, after step s 21 or after step S50,
The data-updating method can also include:
Step S60 determines corresponding called side according to data call request when receiving data call request,
And the called side is detected whether in default white list;
Step S71, if the called side in default white list, responds the data call request;
Step S72, if the called side not in default white list, refuses the data call request.
To avoid rogue's application from calling the data of database, the safety of data in guarantee database, in the present embodiment,
When receiving data call request, corresponding called side first can be determined according to the request of data, and whether detect the called side
In default white list, that is, determine whether the called side is regular application, and then determine whether that it is allowed to be called.Wherein,
The default white list can be that developer is preset, and certainly, later development person can also preset white list to this and carry out more
Change, for example, increasing or deleting the called side in the white list of part.
If the called side in default white list, responds data call request, that is, the called side is allowed to be called.
If the called side in default white list, refuses data call request, i.e., does not allow the called side to be called.Therefore,
The present embodiment receive data call request when, by detection initiate the data call request called side whether preset it is white
Whether in list, i.e., be positive rule application, then determines whether that it calls data, to can guarantee the peace of data in database
Quan Xing.
The present invention also provides a kind of computer readable storage mediums.
Date update program is stored on computer readable storage medium of the present invention, the date update program is by processor
The step of data-updating method as described in any of the above item embodiment is realized when execution.
The specific embodiment of computer readable storage medium of the present invention and the basic phase of each embodiment of above-mentioned data-updating method
Together, therefore not to repeat here.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row
His property includes, so that the process, method, article or the device that include a series of elements not only include those elements, and
And further include other elements that are not explicitly listed, or further include for this process, method, article or device institute it is intrinsic
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do
There is also other identical elements in the process, method of element, article or device.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art
The part contributed out can be embodied in the form of software products, which is stored in a storage medium
In (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal (can be mobile phone, computer, service
Device or the network equipment etc.) execute method described in each embodiment of the present invention.
The embodiment of the present invention is described with above attached drawing, but the invention is not limited to above-mentioned specific
Embodiment, the above mentioned embodiment is only schematical, rather than restrictive, those skilled in the art
Under the inspiration of the present invention, without breaking away from the scope protected by the purposes and claims of the present invention, it can also make very much
Form, all of these belong to the protection of the present invention.
Claims (10)
1. a kind of data-updating method, which is characterized in that the data-updating method includes the following steps:
When the data for receiving developer's triggering update request, detect the data update alternative condition in request whether be
It is empty;
If it is sky that the data, which update the alternative condition in request, intercepts corresponding data and update operation, and generate corresponding
Prompt information, to prompt user data update abnormal and corresponding abnormal cause;
If it is not sky that the data, which update the alternative condition in request, request is updated according to the data and executes corresponding data
Update operation.
2. data-updating method as described in claim 1, which is characterized in that described to update request execution pair according to the data
Before the data answered update the step of operation, including:
It is whether all the same that the key column data in request inquiry correspondence database is updated according to the data;
If the key column data presence in correspondence database is not identical, then follow the steps:Request execution pair is updated according to the data
The data answered update operation.
3. data-updating method as claimed in claim 2, which is characterized in that described to update request inquiry pair according to the data
After the step for answering the key column data in database whether all the same, further include:
If the key column data in correspondence database is all the same, start corresponding time data recovery mechanism;
Restoration Mechanism restores the data that corresponding mistake updates based on the data, and updates request to recovery according to the data
Data afterwards execute corresponding data and update operation.
4. data-updating method as described in claim 1, which is characterized in that the data-updating method further includes:
When receiving data call request, corresponding called side is determined according to data call request, and detect the tune
With side whether in default white list;
If the called side in default white list, responds the data call request.
5. data-updating method as claimed in claim 4, which is characterized in that the data-updating method further includes:
If the called side not in default white list, refuses the data call request.
6. a kind of mobile terminal, which is characterized in that the mobile terminal includes memory, processor and is stored in the memory
Date update program that is upper and can running on the processor, the date update program are realized when being executed by the processor
Following steps:
When the data for receiving developer's triggering update request, detect the data update alternative condition in request whether be
It is empty;
If it is sky that the data, which update the alternative condition in request, intercepts corresponding data and update operation, and generate corresponding
Prompt information, to prompt user data update abnormal and corresponding abnormal cause;
If it is not sky that the data, which update the alternative condition in request, request is updated according to the data and executes corresponding data
Update operation.
7. mobile terminal as claimed in claim 6, which is characterized in that when the date update program is executed by the processor
Also realize following steps:
It is whether all the same that the key column data in request inquiry correspondence database is updated according to the data;
If the key column data presence in correspondence database is not identical, then follow the steps:Request execution pair is updated according to the data
The data answered update operation.
8. mobile terminal as claimed in claim 7, which is characterized in that when the date update program is executed by the processor
Also realize following steps:
If the key column data in correspondence database is all the same, start corresponding time data recovery mechanism;
Restoration Mechanism restores the data that corresponding mistake updates based on the data, and updates request to recovery according to the data
Data afterwards execute corresponding data and update operation.
9. mobile terminal as claimed in claim 6, which is characterized in that when the date update program is executed by the processor
Also realize following steps:
When receiving data call request, corresponding called side is determined according to data call request, and detect the tune
With side whether in default white list;
If the called side in default white list, responds the data call request.
10. a kind of computer readable storage medium, which is characterized in that be stored with data on the computer readable storage medium more
New procedures, the date update program realize following steps when being executed by processor:
When the data for receiving developer's triggering update request, detect the data update alternative condition in request whether be
It is empty;
If it is sky that the data, which update the alternative condition in request, intercepts corresponding data and update operation, and generate corresponding
Prompt information, to prompt user data update abnormal and corresponding abnormal cause;
If it is not sky that the data, which update the alternative condition in request, request is updated according to the data and executes corresponding data
Update operation.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810692664.7A CN108920621A (en) | 2018-06-28 | 2018-06-28 | Data-updating method, mobile terminal and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810692664.7A CN108920621A (en) | 2018-06-28 | 2018-06-28 | Data-updating method, mobile terminal and computer readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108920621A true CN108920621A (en) | 2018-11-30 |
Family
ID=64422289
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810692664.7A Pending CN108920621A (en) | 2018-06-28 | 2018-06-28 | Data-updating method, mobile terminal and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108920621A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2021081758A1 (en) * | 2019-10-29 | 2021-05-06 | 深圳市欢太科技有限公司 | Data update method, device, terminal apparatus, and computer readable storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH08235032A (en) * | 1995-02-22 | 1996-09-13 | Nec Software Kansai Ltd | Logical check system for data base updating |
JP2007128337A (en) * | 2005-11-04 | 2007-05-24 | Nec Corp | Database access device, program and data updating method |
US20140032610A1 (en) * | 2012-07-30 | 2014-01-30 | Sap Ag | Optimized Database Content Provisioning |
CN104331444A (en) * | 2014-10-27 | 2015-02-04 | 北京京东尚科信息技术有限公司 | Method and device for protecting database |
CN106033422A (en) * | 2015-03-11 | 2016-10-19 | 中国移动通信集团内蒙古有限公司 | A database operation control method, device and system |
-
2018
- 2018-06-28 CN CN201810692664.7A patent/CN108920621A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH08235032A (en) * | 1995-02-22 | 1996-09-13 | Nec Software Kansai Ltd | Logical check system for data base updating |
JP2007128337A (en) * | 2005-11-04 | 2007-05-24 | Nec Corp | Database access device, program and data updating method |
US20140032610A1 (en) * | 2012-07-30 | 2014-01-30 | Sap Ag | Optimized Database Content Provisioning |
CN104331444A (en) * | 2014-10-27 | 2015-02-04 | 北京京东尚科信息技术有限公司 | Method and device for protecting database |
CN106033422A (en) * | 2015-03-11 | 2016-10-19 | 中国移动通信集团内蒙古有限公司 | A database operation control method, device and system |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2021081758A1 (en) * | 2019-10-29 | 2021-05-06 | 深圳市欢太科技有限公司 | Data update method, device, terminal apparatus, and computer readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108924364A (en) | Message prompt method, mobile terminal and computer readable storage medium | |
CN109407957A (en) | Screen touch control method, terminal and computer readable storage medium | |
CN109086164A (en) | A kind of application crashes processing method, terminal and computer readable storage medium | |
CN107465841A (en) | A kind of fault information reporting method and terminal | |
CN110187808A (en) | Dynamic wallpaper setting method, device and computer readable storage medium | |
CN109375846A (en) | Spirogram target display methods and device, mobile terminal and readable storage medium storing program for executing | |
CN109254972A (en) | A kind of offline order Word library updating method, terminal and computer readable storage medium | |
CN108829302A (en) | A kind of interaction regulation method, equipment and computer readable storage medium | |
CN110020551A (en) | One kind preventing the method for divulging a secret, terminal and computer readable storage medium | |
CN109618377A (en) | Call processing method, terminal, network side apparatus and computer readable storage medium | |
CN109101301A (en) | A kind of display control method, mobile terminal and computer readable storage medium | |
CN109068084A (en) | Video calling picture display process, mobile terminal and computer readable storage medium | |
CN107911778A (en) | A kind of playback method based on loudspeaker in parallel, mobile terminal and readable storage medium storing program for executing | |
CN110167004A (en) | A kind of network registering method, mobile terminal and computer readable storage medium | |
CN109683741A (en) | Function triggering method, device and computer readable storage medium | |
CN108920621A (en) | Data-updating method, mobile terminal and computer readable storage medium | |
CN108845821A (en) | Application program update method, terminal and computer readable storage medium | |
CN109587320A (en) | Contact management method, terminal and storage medium | |
CN109032621A (en) | A kind of application program installation method, mobile terminal and computer storage medium | |
CN109639898A (en) | A kind of multi-display method, equipment and computer readable storage medium | |
CN109918101A (en) | Terminal and its application component management method, computer readable storage medium | |
CN109451438A (en) | A kind of finding method of intelligent terminal, intelligent terminal and storage medium | |
CN108833687A (en) | Terminal prot open method, terminal and computer readable storage medium | |
CN109408184A (en) | A kind of icon processing method, mobile terminal and computer storage medium | |
CN109901882A (en) | Game application adding method, terminal and storage medium based on gamespace |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20181130 |
|
RJ01 | Rejection of invention patent application after publication |