CN117707854A - Self-recovery method and device for reading information abnormality of IC card - Google Patents
Self-recovery method and device for reading information abnormality of IC card Download PDFInfo
- Publication number
- CN117707854A CN117707854A CN202311775908.5A CN202311775908A CN117707854A CN 117707854 A CN117707854 A CN 117707854A CN 202311775908 A CN202311775908 A CN 202311775908A CN 117707854 A CN117707854 A CN 117707854A
- Authority
- CN
- China
- Prior art keywords
- data
- check
- sector
- matching degree
- check data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000011084 recovery Methods 0.000 title claims abstract description 42
- 238000000034 method Methods 0.000 title claims abstract description 38
- 230000005856 abnormality Effects 0.000 title claims abstract description 14
- 238000012795 verification Methods 0.000 claims abstract description 72
- 230000002159 abnormal effect Effects 0.000 claims abstract description 30
- 238000004590 computer program Methods 0.000 claims abstract description 25
- 238000004422 calculation algorithm Methods 0.000 claims abstract description 21
- 238000004891 communication Methods 0.000 description 5
- 238000013500 data storage Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 4
- 230000008859 change Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- OKTJSMMVPCPJKN-UHFFFAOYSA-N Carbon Chemical compound [C] OKTJSMMVPCPJKN-UHFFFAOYSA-N 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000013523 data management Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 229910021389 graphene Inorganic materials 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000004377 microelectronic Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 1
Landscapes
- Storage Device Security (AREA)
Abstract
The present application relates to a self-recovery method, apparatus, computer device, storage medium, and computer program product when reading an abnormality of IC card information. The method comprises the following steps: acquiring verification data of a verification sector corresponding to the target sector; decrypting the check data of the check sector and matching with pre-stored standard check data; judging whether the matching degree of the check data reaches a matching degree threshold value or not; if yes, acquiring backup data corresponding to a pre-stored target sector, and writing the backup data into the target sector to complete data recovery; and generating new check data according to a preset algorithm, writing the new check data into the check sector, and replacing the standard check data with the new check data. By adopting the method, when the information in the IC card is abnormal, the information in the IC card can be recovered, thereby providing convenience for users.
Description
Technical Field
The present invention relates to the field of data management technologies, and in particular, to a self-recovery method, apparatus, computer device, storage medium, and computer program product when reading information of an IC card is abnormal.
Background
The IC card (Integrated Circuit Card ) is an article which is formed by embedding a microelectronic chip into a compliant card base and has data storage and can complete contact or non-contact communication based on the ISO 7816 standard, and frequently occurs in daily life in the forms of smart water cards, smart electric cards, campus cards, bus cards and the like.
The present invention with publication number CN116522414B discloses a data storage method, an IC card and a data storage device, the method comprising the steps of: setting one sector in the IC card as a main sector and the other sectors as authority sectors; the authority sector is used for storing authority information, and the authority information has independent authority numbers; setting a specific data set according to the application environment of the IC card, and inputting user information; and selecting a plurality of data in the data set, setting each data to be associated with a corresponding authority number, and setting each equipment number to be associated with the corresponding authority number. The invention can classify and manage the user authority information in a multi-dimensional way by setting the relation between the data and the authority number so as to improve the flexibility of the authority management of the system; meanwhile, through the relation between the equipment number and the authority number, the multi-factor authority verification selection can be provided for equipment with higher security requirements, so that the data security is ensured.
However, when the information in the IC card is abnormal or missing, the card holder is required to find the management with enough authority to restore the content of the card or reset the card, which brings a lot of inconveniences to the card holder.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a self-recovery method, apparatus, computer device, computer-readable storage medium, and computer program product when reading an abnormality in IC card information.
In a first aspect, a self-recovery method when reading information of an IC card is abnormal, the method comprising:
acquiring verification data of a verification sector corresponding to the target sector;
decrypting the check data of the check sector and matching with pre-stored standard check data;
judging whether the matching degree of the check data reaches a matching degree threshold value or not;
if yes, acquiring backup data corresponding to a pre-stored target sector, and writing the backup data into the target sector to complete data recovery;
and generating new check data according to a preset algorithm, writing the new check data into the check sector, and replacing the standard check data with the new check data.
In one embodiment, the obtaining the verification data of the verification sector corresponding to the target sector specifically includes:
reading a check sector indicator bit in the target sector, wherein the check sector indicator bit is used for recording and indicating the position of the check sector;
judging whether the data of the check sector indicating bit is abnormal or not;
if not, reading the check data stored in the check sector corresponding to the check sector indication bit.
In one embodiment, the specific steps of decrypting the verification data of the verification sector and matching with the pre-stored standard verification data include:
reading encrypted check data in the check sector;
obtaining key data in pre-stored standard check data, decrypting the encrypted check data to obtain decrypted check data;
comparing the pre-stored standard check data with the decrypted check data, and judging whether the decrypted check data is consistent with the pre-stored standard check data or not;
if yes, the decrypted check data is matched with the pre-stored standard check data;
if not, the decrypted check data is not matched with the pre-stored standard check data.
In one embodiment, the number of check sectors corresponding to the target sector is set according to the security level of the target sector data, the number of check sectors corresponding to one target sector is at least three, the matching degree threshold is percentage data set according to the security level of the target sector data, and the specific step of judging whether the matching degree of the check data reaches the matching degree threshold comprises:
calculating the ratio of the number of check sectors storing the decrypted check data matched with the pre-stored standard check data to all check sectors corresponding to the target sector, and taking the ratio as the actual matching degree;
comparing the actual matching degree with a matching degree threshold value;
if the actual matching degree is higher than or equal to the matching degree threshold value, the actual matching degree reaches the matching degree threshold value;
if the actual matching degree is lower than the matching degree threshold, the actual matching degree does not reach the matching degree threshold.
In one embodiment, the specific steps of obtaining backup data corresponding to a pre-stored target sector and writing the backup data into the target sector to complete data recovery include:
reading identity information, and taking the identity information as an index to obtain backup data pre-stored in a database;
the backup data is entered into the non-verified sector indicator bits within the target sector.
In one embodiment, the specific step of generating new verification data according to a preset algorithm includes:
acquiring a pre-stored historical data record;
randomly extracting a plurality of historical data in the historical data record, wherein the number of the historical data is related to the matching degree of the check data;
and obtaining a new key according to a preset asymmetric encryption algorithm, and encrypting a plurality of historical data to obtain new verification data.
In a second aspect, the present application further provides a self-recovery device when reading information of an IC card is abnormal, the device including:
the data reading and writing module is used for reading the data in the target sector and the check sector and writing the data into the target sector and the check sector;
the storage module is used for storing standard check information, backup data and new check information;
the operation module is used for encrypting and/or decrypting the check data, comparing the check data with the standard check data, calculating the matching degree, and comparing the matching degree with the matching degree threshold value.
In a third aspect, the present application also provides a computer device comprising a memory storing a computer program and a processor implementing the following steps when executing the computer program:
acquiring verification data of a verification sector corresponding to the target sector;
decrypting the check data of the check sector and matching with pre-stored standard check data;
judging whether the matching degree of the check data reaches a matching degree threshold value or not;
if yes, acquiring backup data corresponding to a pre-stored target sector, and writing the backup data into the target sector to complete data recovery;
and generating new check data according to a preset algorithm, writing the new check data into the check sector, and replacing the standard check data with the new check data.
In a fourth aspect, the present application also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
acquiring verification data of a verification sector corresponding to the target sector;
decrypting the check data of the check sector and matching with pre-stored standard check data;
judging whether the matching degree of the check data reaches a matching degree threshold value or not;
if yes, acquiring backup data corresponding to a pre-stored target sector, and writing the backup data into the target sector to complete data recovery;
and generating new check data according to a preset algorithm, writing the new check data into the check sector, and replacing the standard check data with the new check data.
In a fifth aspect, the present application also provides a computer program product comprising a computer program which, when executed by a processor, performs the steps of:
acquiring verification data of a verification sector corresponding to the target sector;
decrypting the check data of the check sector and matching with pre-stored standard check data;
judging whether the matching degree of the check data reaches a matching degree threshold value or not;
if yes, acquiring backup data corresponding to a pre-stored target sector, and writing the backup data into the target sector to complete data recovery;
and generating new check data according to a preset algorithm, writing the new check data into the check sector, and replacing the standard check data with the new check data.
The self-recovery method, apparatus, computer device, storage medium and computer program product for reading IC card information abnormality.
Drawings
FIG. 1 is an application environment diagram of a self-recovery method when reading IC card information abnormality in one embodiment;
FIG. 2 is a flow chart of a self-recovery method when reading IC card information is abnormal in one embodiment;
FIG. 3 is a schematic flow chart of step S100 in one embodiment;
FIG. 4 is a schematic flow chart of step S200 in one embodiment;
FIG. 5 is a flowchart illustrating the step S300 in one embodiment;
fig. 6 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The self-recovery method for reading the information of the IC card when the information of the IC card is abnormal can be applied to an application environment shown in FIG. 1. Wherein the terminal 102 communicates with the server 104 via a network. The data storage system may store data that the server 104 needs to process. The data storage system may be integrated on the server 104 or may be located on a cloud or other network server. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices, and portable wearable devices, where the internet of things devices may be smart speakers, smart televisions, smart air conditioners, smart vehicle devices, and the like. The portable wearable device may be a smart watch, smart bracelet, headset, or the like. The server 104 may be implemented as a stand-alone server or as a server cluster of multiple servers.
In one embodiment, as shown in fig. 2, there is provided a self-recovery method when reading an abnormality of IC card information, comprising the steps of:
step S100: and acquiring the verification data of the verification sector corresponding to the target sector.
The target sector is a storage space in the IC card for storing data for the read-write device to read, respond and call specific data, the data storable in the target sector includes, but is not limited to, identity identification information, account balance and the like, in this embodiment, the information stored in the target sector includes identity identification information and account balance information, before executing the step, the read-write device for reading the IC card information will acquire the data in the target sector, and complete verification of the data in the identification process, one of the reading sequences may be that the identity identification information and the account balance information are read, the account balance information matched with the identity identification information is acquired from a database connected to the read device, and the account balance information acquired from the database is compared with the account balance information read from the IC card, if the two information are different, the information in the IC card is abnormal, and data recovery is required, but before recovering, the IC card needs to be identified and verified for safety. The specific steps of step S100 include:
step S110: and reading a check sector indicator bit in the target sector, wherein the check sector indicator bit is used for recording the position of the check sector.
The verification sector is a storage space for storing verification data, the verification data is data of an actual transaction record of the IC card, and particularly, the data of the actual transaction record can be encrypted through an asymmetric encryption algorithm to obtain verification data with higher data security level. The typical IC card has a plurality of memory sectors, for example, M1 type cards, which contain 16 sectors, and the remaining 15 sectors can be defined and store data by developing the unique code for the memory card except the first sector; in this embodiment, the sector area that can be defined by 15 is divided into 3 account information blocks, and each account information block includes a target sector and four check sectors; each account information block comprises 5 customizable sectors, each account information block is used for storing account information of a cardholder under a certain scene, for example, one account information block is used for storing bus account information of the cardholder, one account information block is used for storing catering card account information of the cardholder, and one account information block is used for storing parking lot account information of the cardholder. In addition, in the actual use process, the number of the account information blocks of one IC card is not limited, and the number of the sectors included in each account information block is not specifically defined, and the method can be defined according to different account types and corresponding data security standards, but the use process of the self-recovery method when the read IC card information is abnormal is conveniently shown and described by taking the above example as an example. By defining and dividing the sector, the data security of the target sector can be improved by checking the check data stored in the check sector before recovering the data of the target sector, and in addition, the function of a plurality of accounts corresponding to one IC card can be reserved.
Step S120: and judging whether the data of the check sector indicating bit is abnormal or not.
In this embodiment, five last bytes in the target sector are selected as sector indicating bits, the first four of the five bytes are used for storing codes indicating the corresponding check sector of the target sector, and the last byte is used for storing check codes, wherein the check codes are the exclusive or operation results of four codes indicating the four check sectors; the specific judging mode for judging whether the data of the sector indicating bit is abnormal or not is that whether the exclusive OR value of the first four bits of the sector indicating bit is equal to the numerical value of the fifth bit of the sector indicating bit is recalculated, if yes, the data of the sector indicating bit is not abnormal, and if not, the data of the sector indicating bit is abnormal. If yes, the IC card is indicated to have serious abnormality, and prompt information indicating that the card information is abnormal and self-repairing cannot be completed is output.
Step S130: if not, reading the check data stored in the check sector corresponding to the check sector indication bit. In this step, if there is no abnormality in the data of the sector indicating bit, the data of the sector indicated by the data of the first four bits of the sector indicating bit is read, so as to facilitate the subsequent data decryption and verification.
Step S200: decrypting the check data of the check sector and matching with the pre-stored standard check data.
The verification data is data of an actual transaction record corresponding to the account after being encrypted by an asymmetric encryption algorithm, and for a newly registered account, random temporary verification data can be generated by the system for encryption, and the verification data is stored in the storage device for verification. In particular, since the IC further has a partition encryption function, if the account information block stores important data, the verification data included in the account information block may be encrypted by using different keys, so that the data security is further improved, and the specific steps of step S200 include:
step S210: the encrypted verification data within the verification sector is read.
Step S220: and obtaining key data in the pre-stored standard check data, decrypting the encrypted check data to obtain decrypted check data.
Step S230: and comparing the pre-stored standard check data with the decrypted check data, and judging whether the decrypted check data is consistent with the pre-stored standard check data or not.
Step S241: if yes, the decrypted check data is matched with the pre-stored standard check data.
Step S242: if not, the decrypted check data is not matched with the pre-stored standard check data.
After the confidential verification data in the verification sector corresponding to the target sector is read, the corresponding secret key and the pre-stored standard verification data are searched in the database through account identity information or the unique code of the card stored in the first sector of the IC card, then the encrypted data are decrypted through the secret key to obtain decrypted verification data, and the decrypted data are compared with the data which are stored in the database and searched through the unique code of the account identity information or the IC card, so that whether the decrypted verification data are consistent with the verified data or not can be judged. The verification data is generally the data of the actual transaction record, the storage space in the database can be saved, the additional storage of the verification information and codes is not needed, when the standard verification data is acquired, the encrypted calibration data can be decrypted by adopting the acquired key, then the related actual transaction record data is acquired by taking part or all bits in the decrypted verification data as indexes, and then the data matching is completed.
Step S300: and judging whether the matching degree of the check data reaches a matching degree threshold value or not.
In one embodiment, the number of check sectors corresponding to the target sector is set according to the security level of the target sector data, the number of check sectors corresponding to one target sector is at least three, the matching degree threshold is percentage data set according to the security level of the target sector data, specifically, in this embodiment, the number of check sectors corresponding to one target sector is four, and the matching degree threshold is preset to 75%. The specific steps of step S300 include:
step S310: and calculating the ratio of the number of the check sectors with the decrypted check data matched with the pre-stored standard check data to all the check sectors corresponding to the target sector, and taking the ratio as the actual matching degree.
In this step, since there are a plurality of check sectors, each check sector has check data stored therein, when calculating the matching degree, if the check data stored in one check sector is different from the standard check data after decryption, the check sector is a check sector with failed matching, and taking four check sectors with two check failure sectors as an example, the actual matching degree of the check data of the account information block is fifty percent.
Step S320: and comparing the actual matching degree with a matching degree threshold value.
Step S331: if the actual matching degree is higher than or equal to the matching degree threshold value, the actual matching degree reaches the matching degree threshold value;
step S332: if the actual matching degree is lower than the matching degree threshold, the actual matching degree does not reach the matching degree threshold.
Through the steps, the actual matching degree obtained through calculation is compared with the matching degree threshold, the threshold matching degree is seventy-five percent in the embodiment, if two or more unsuccessfully matched check sectors exist in the four check sectors, the check data of the IC card account is shown to have serious information loss or serious risk, the data self-recovery cannot be carried out in the mode, and if only one unsuccessfully matched check sector exists in the four check sectors or the unsuccessfully matched check sector does not exist, the check data of the IC card account is shown to be relatively complete, the risk is lower, and the subsequent data self-recovery can be carried out.
Step S400: if yes, the backup data corresponding to the pre-stored target sector is obtained, and the backup data is written into the target sector to complete data recovery.
The backup data may be balance information stored in the database and indicating that the account information is last used, the last account balance is used as backup data, and the designated bytes of the target sector are rewritten to complete data recovery, in another embodiment, the last account balance may be subjected to specific data encoding, and the digital encoding is written as backup data into the designated bytes of the target sector to complete data recovery. Specifically, step S400 includes:
step S410: and reading the identity information, and taking the identity information as an index to acquire backup data pre-stored in a database.
Step S420: the backup data is entered into the non-verified sector indicator bits within the target sector.
In the above step, the identity information includes the account information corresponding to the read account information block and the unique code of the card stored in the first sector, when the two have conflict, the unique code of the card stored in the first sector is used to take the backup data, and when the target sector is restored, the correct account information is written into the target sector together, so as to change the account information abnormal in the corresponding position of the target sector.
Step S500: and generating new check data according to a preset algorithm, writing the new check data into the check sector, and replacing the standard check data with the new check data. The specific steps for generating the new verification data according to the preset algorithm are as follows:
step S510: and obtaining a pre-stored historical data record.
Step S520: and randomly extracting a plurality of historical data in the historical data record, wherein the number of the historical data is related to the matching degree of the verification data.
Step S530: and obtaining a new key according to a preset asymmetric encryption algorithm, and encrypting a plurality of historical data to obtain new verification data.
In the step, the number of the random extraction historical data is the same as the number of the check sectors successfully matched, when the check data is rewritten, only the check data in the check sectors successfully matched are replaced, and the sector data unsuccessfully matched is selected and reserved, so that the fault tolerance of the stored data of the IC card can be reduced, namely, the detected abnormal check data can be continuously reserved, the abnormal data can be refreshed, when the data of the IC card is abnormal again, the matching degree can be further reduced, the data of the IC card can not be recovered, and the difficulty of copying the IC card can be improved, and the safety of an account can be further improved.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a self-recovery device for reading the abnormal IC card information, which is used for realizing the self-recovery method for reading the abnormal IC card information. The implementation scheme of the device for solving the problem is similar to that described in the above method, so the specific limitation in the embodiment of the self-recovery device provided in the following when one or more read IC card information is abnormal may be referred to the limitation of the self-recovery method when the read IC card information is abnormal, and is not repeated herein.
In one embodiment, there is provided a self-recovery apparatus when reading information abnormality of an IC card, including: the device comprises a data reading and writing module, a storage module and an operation module, wherein:
the data reading and writing module is used for reading the data in the target sector and the check sector and writing the data into the target sector and the check sector;
the storage module is used for storing standard check information, backup data and new check information;
the operation module is used for encrypting and/or decrypting the check data, comparing the check data with the standard check data, calculating the matching degree, and comparing the matching degree with the matching degree threshold value.
Each module in the self-recovery device when the read IC card information is abnormal may be implemented in whole or in part by software, hardware, or a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a terminal, and the internal structure of which may be as shown in fig. 6. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. The computer program, when executed by the processor, implements a self-recovery method when reading an abnormality of the IC card information. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 6 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided comprising a memory and a processor, the memory having stored therein a computer program, the processor when executing the computer program performing the steps of:
step S100: and acquiring the verification data of the verification sector corresponding to the target sector. The specific steps of step S100 include:
step S110 reads a check sector indicator bit in the target sector for recording a position indicating the check sector.
Step S120: and judging whether the data of the check sector indicating bit is abnormal or not.
Step S130: if not, reading the check data stored in the check sector corresponding to the check sector indication bit.
Step S200: decrypting the check data of the check sector and matching with the pre-stored standard check data. The specific steps of step S200 include:
step S210: the encrypted verification data within the verification sector is read.
Step S220: and obtaining key data in the pre-stored standard check data, decrypting the encrypted check data to obtain decrypted check data.
Step S230: and comparing the pre-stored standard check data with the decrypted check data, and judging whether the decrypted check data is consistent with the pre-stored standard check data or not.
Step S241: if yes, the decrypted check data is matched with the pre-stored standard check data.
Step S242: if not, the decrypted check data is not matched with the pre-stored standard check data.
Step S300: and judging whether the matching degree of the check data reaches a matching degree threshold value or not. The specific steps of step S300 include:
step S310: and calculating the ratio of the number of the check sectors with the decrypted check data matched with the pre-stored standard check data to all the check sectors corresponding to the target sector, and taking the ratio as the actual matching degree.
Step S320: and comparing the actual matching degree with a matching degree threshold value.
Step S331: if the actual matching degree is higher than or equal to the matching degree threshold value, the actual matching degree reaches the matching degree threshold value;
step S332: if the actual matching degree is lower than the matching degree threshold, the actual matching degree does not reach the matching degree threshold.
Step S400: if yes, the backup data corresponding to the pre-stored target sector is obtained, and the backup data is written into the target sector to complete data recovery. The specific steps of step S400 include:
step S410: and reading the identity information, and taking the identity information as an index to acquire backup data pre-stored in a database.
Step S420: the backup data is entered into the non-verified sector indicator bits within the target sector.
Step S500: and generating new check data according to a preset algorithm, writing the new check data into the check sector, and replacing the standard check data with the new check data. The specific steps of step S500 include:
step S510: and obtaining a pre-stored historical data record.
Step S520: and randomly extracting a plurality of historical data in the historical data record, wherein the number of the historical data is related to the matching degree of the verification data.
Step S530: and obtaining a new key according to a preset asymmetric encryption algorithm, and encrypting a plurality of historical data to obtain new verification data.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of:
step S100: and acquiring the verification data of the verification sector corresponding to the target sector. The specific steps of step S100 include:
step S110 reads a check sector indicator bit in the target sector for recording a position indicating the check sector.
Step S120: and judging whether the data of the check sector indicating bit is abnormal or not.
Step S130: if not, reading the check data stored in the check sector corresponding to the check sector indication bit.
Step S200: decrypting the check data of the check sector and matching with the pre-stored standard check data. The specific steps of step S200 include:
step S210: the encrypted verification data within the verification sector is read.
Step S220: and obtaining key data in the pre-stored standard check data, decrypting the encrypted check data to obtain decrypted check data.
Step S230: and comparing the pre-stored standard check data with the decrypted check data, and judging whether the decrypted check data is consistent with the pre-stored standard check data or not.
Step S241: if yes, the decrypted check data is matched with the pre-stored standard check data.
Step S242: if not, the decrypted check data is not matched with the pre-stored standard check data.
Step S300: and judging whether the matching degree of the check data reaches a matching degree threshold value or not. The specific steps of step S300 include:
step S310: and calculating the ratio of the number of the check sectors with the decrypted check data matched with the pre-stored standard check data to all the check sectors corresponding to the target sector, and taking the ratio as the actual matching degree.
Step S320: and comparing the actual matching degree with a matching degree threshold value.
Step S331: if the actual matching degree is higher than or equal to the matching degree threshold value, the actual matching degree reaches the matching degree threshold value;
step S332: if the actual matching degree is lower than the matching degree threshold, the actual matching degree does not reach the matching degree threshold.
Step S400: if yes, the backup data corresponding to the pre-stored target sector is obtained, and the backup data is written into the target sector to complete data recovery. The specific steps of step S400 include:
step S410: and reading the identity information, and taking the identity information as an index to acquire backup data pre-stored in a database.
Step S420: the backup data is entered into the non-verified sector indicator bits within the target sector.
Step S500: and generating new check data according to a preset algorithm, writing the new check data into the check sector, and replacing the standard check data with the new check data. The specific steps of step S500 include:
step S510: and obtaining a pre-stored historical data record.
Step S520: and randomly extracting a plurality of historical data in the historical data record, wherein the number of the historical data is related to the matching degree of the verification data.
Step S530: and obtaining a new key according to a preset asymmetric encryption algorithm, and encrypting a plurality of historical data to obtain new verification data.
In one embodiment, a computer program product is provided comprising a computer program which, when executed by a processor, performs the steps of:
step S100: and acquiring the verification data of the verification sector corresponding to the target sector. The specific steps of step S100 include:
step S110 reads a check sector indicator bit in the target sector for recording a position indicating the check sector.
Step S120: and judging whether the data of the check sector indicating bit is abnormal or not.
Step S130: if not, reading the check data stored in the check sector corresponding to the check sector indication bit.
Step S200: decrypting the check data of the check sector and matching with the pre-stored standard check data. The specific steps of step S200 include:
step S210: the encrypted verification data within the verification sector is read.
Step S220: and obtaining key data in the pre-stored standard check data, decrypting the encrypted check data to obtain decrypted check data.
Step S230: and comparing the pre-stored standard check data with the decrypted check data, and judging whether the decrypted check data is consistent with the pre-stored standard check data or not.
Step S241: if yes, the decrypted check data is matched with the pre-stored standard check data.
Step S242: if not, the decrypted check data is not matched with the pre-stored standard check data.
Step S300: and judging whether the matching degree of the check data reaches a matching degree threshold value or not. The specific steps of step S300 include:
step S310: and calculating the ratio of the number of the check sectors with the decrypted check data matched with the pre-stored standard check data to all the check sectors corresponding to the target sector, and taking the ratio as the actual matching degree.
Step S320: and comparing the actual matching degree with a matching degree threshold value.
Step S331: if the actual matching degree is higher than or equal to the matching degree threshold value, the actual matching degree reaches the matching degree threshold value;
step S332: if the actual matching degree is lower than the matching degree threshold, the actual matching degree does not reach the matching degree threshold.
Step S400: if yes, the backup data corresponding to the pre-stored target sector is obtained, and the backup data is written into the target sector to complete data recovery. The specific steps of step S400 include:
step S410: and reading the identity information, and taking the identity information as an index to acquire backup data pre-stored in a database.
Step S420: the backup data is entered into the non-verified sector indicator bits within the target sector.
Step S500: and generating new check data according to a preset algorithm, writing the new check data into the check sector, and replacing the standard check data with the new check data. The specific steps of step S500 include:
step S510: and obtaining a pre-stored historical data record.
Step S520: and randomly extracting a plurality of historical data in the historical data record, wherein the number of the historical data is related to the matching degree of the verification data.
Step S530: and obtaining a new key according to a preset asymmetric encryption algorithm, and encrypting a plurality of historical data to obtain new verification data.
It should be noted that, user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, presented data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the various embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the various embodiments provided herein may include at least one of relational databases and non-relational databases. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic units, quantum computing-based data processing logic units, etc., without being limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples only represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the present application. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application shall be subject to the appended claims.
Claims (10)
1. A self-recovery method when reading an abnormality of IC card information, the method comprising:
acquiring verification data of a verification sector corresponding to the target sector;
decrypting the check data of the check sector and matching with pre-stored standard check data;
judging whether the matching degree of the check data reaches a matching degree threshold value or not;
if yes, acquiring backup data corresponding to a pre-stored target sector, and writing the backup data into the target sector to complete data recovery;
generating new check data according to a preset algorithm, writing the new check data into the check sector, and replacing the standard check data with the new check data.
2. The method for self-recovery when reading IC card information abnormality according to claim 1, wherein the specific acquisition of the verification data of the verification sector corresponding to the target sector includes:
reading a check sector indicator bit in the target sector, wherein the check sector indicator bit is used for recording and indicating the position of the check sector;
judging whether the data of the check sector indicating bit is abnormal or not;
and if not, reading the check data stored in the check sector corresponding to the check sector indicating bit.
3. The method for self-recovery when reading information anomalies of an IC card according to claim 2, characterized in that said specific step of decrypting the verification data of said verification sector and matching with pre-stored standard verification data comprises:
reading encrypted check data in the check sector;
obtaining key data in the pre-stored standard check data, decrypting the encrypted check data to obtain decrypted check data;
comparing the pre-stored standard check data with the decrypted check data, and judging whether the decrypted check data is consistent with the pre-stored standard check data or not;
if yes, the decrypted check data is matched with the pre-stored standard check data;
if not, the decrypted check data is not matched with the pre-stored standard check data.
4. The method for self-recovery when information of an IC card is abnormal according to claim 3, wherein the number of check sectors corresponding to a target sector is set according to a security level of the target sector data, the number of check sectors corresponding to one target sector is at least three, the matching degree threshold is percentage data set according to the security level of the target sector data, and the specific step of determining whether the matching degree of the check data reaches the matching degree threshold comprises:
calculating the ratio of the number of check sectors with decrypted check data matched with the pre-stored standard check data to all the check sectors corresponding to the target sector, and taking the ratio as the actual matching degree;
comparing the actual matching degree with the matching degree threshold value;
if the actual matching degree is higher than or equal to the matching degree threshold value, the actual matching degree reaches the matching degree threshold value;
and if the actual matching degree is lower than the matching degree threshold, the actual matching degree does not reach the matching degree threshold.
5. The method for self-recovering when information of an IC card is abnormal according to any one of claims 2 to 4, wherein the specific steps of obtaining backup data corresponding to a pre-stored target sector and writing the backup data into the target sector to complete data recovery include:
reading identity information, and taking the identity information as an index to acquire the backup data pre-stored in a database;
and inputting the backup data into a non-check sector indicating bit in the target sector.
6. The method for self-recovery when reading information anomalies on an IC card according to claim 1, characterized in that said specific step of generating new verification data according to a preset algorithm comprises:
acquiring a pre-stored historical data record;
randomly extracting a plurality of historical data in a historical data record, wherein the number of the historical data is related to the matching degree of the check data;
and acquiring a new key according to a preset asymmetric encryption algorithm, and encrypting a plurality of historical data to acquire the new verification data.
7. A self-restoring apparatus when reading an abnormality of IC card information, the apparatus comprising:
the data reading and writing module is used for reading the data in the target sector and the check sector and writing the data into the target sector and the check sector;
the storage module is used for storing standard check information, backup data and new check information;
the operation module is used for encrypting and/or decrypting the check data, comparing the check data with the standard check data, calculating the matching degree, and comparing the matching degree with the matching degree threshold value.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311775908.5A CN117707854B (en) | 2023-12-22 | 2023-12-22 | Self-recovery method and device for reading information abnormality of IC card |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311775908.5A CN117707854B (en) | 2023-12-22 | 2023-12-22 | Self-recovery method and device for reading information abnormality of IC card |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117707854A true CN117707854A (en) | 2024-03-15 |
CN117707854B CN117707854B (en) | 2024-07-02 |
Family
ID=90162094
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311775908.5A Active CN117707854B (en) | 2023-12-22 | 2023-12-22 | Self-recovery method and device for reading information abnormality of IC card |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117707854B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105137227A (en) * | 2015-08-03 | 2015-12-09 | 昆腾微电子股份有限公司 | Testing device and method for power-down protection of intelligent card |
CN112596672A (en) * | 2020-12-18 | 2021-04-02 | 珠海格力电器股份有限公司 | Storage processing method and device of main control chip, processor and electronic equipment |
US20210216646A1 (en) * | 2019-11-22 | 2021-07-15 | Pure Storage, Inc. | Hardware Token Based Management of Recovery Datasets for a Storage System |
CN115080308A (en) * | 2022-06-20 | 2022-09-20 | 北京字跳网络技术有限公司 | Data recovery method, device, electronic equipment, medium and program product |
CN115599607A (en) * | 2022-11-29 | 2023-01-13 | 苏州浪潮智能科技有限公司(Cn) | Data recovery method of RAID array and related device |
CN116341603A (en) * | 2023-05-23 | 2023-06-27 | 深圳市亲邻科技有限公司 | Data storage device, IC card and data storage method |
-
2023
- 2023-12-22 CN CN202311775908.5A patent/CN117707854B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105137227A (en) * | 2015-08-03 | 2015-12-09 | 昆腾微电子股份有限公司 | Testing device and method for power-down protection of intelligent card |
US20210216646A1 (en) * | 2019-11-22 | 2021-07-15 | Pure Storage, Inc. | Hardware Token Based Management of Recovery Datasets for a Storage System |
CN112596672A (en) * | 2020-12-18 | 2021-04-02 | 珠海格力电器股份有限公司 | Storage processing method and device of main control chip, processor and electronic equipment |
CN115080308A (en) * | 2022-06-20 | 2022-09-20 | 北京字跳网络技术有限公司 | Data recovery method, device, electronic equipment, medium and program product |
CN115599607A (en) * | 2022-11-29 | 2023-01-13 | 苏州浪潮智能科技有限公司(Cn) | Data recovery method of RAID array and related device |
CN116341603A (en) * | 2023-05-23 | 2023-06-27 | 深圳市亲邻科技有限公司 | Data storage device, IC card and data storage method |
Non-Patent Citations (1)
Title |
---|
邹志财: "基于金融IC卡的AFC读写器系统的研究", 《中国优秀硕士学位论文全文数据库 工程科技Ⅱ辑》, no. 5, 15 May 2019 (2019-05-15), pages 033 - 206 * |
Also Published As
Publication number | Publication date |
---|---|
CN117707854B (en) | 2024-07-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP1519275B1 (en) | Information storage device, memory access control method, and computer program | |
EP1517244B1 (en) | Information storage device, memory access control system and method, and computer program | |
CN106155596B (en) | Data writing method and device | |
US8769309B2 (en) | Flash memory storage system, and controller and method for anti-falsifying data thereof | |
EP1519277A1 (en) | Information storage device, memory access control method, and computer program | |
US20100115184A1 (en) | Flash memory storage system and controller and data protection method thereof | |
KR20090043823A (en) | Memory system for sensing external attack | |
US9208351B2 (en) | Processing information | |
CN109685190B (en) | Power-down protection method and device for IC card | |
CN114519360B (en) | Data read-write method, login method and device of service system and computer equipment | |
CN103338107A (en) | A secret key generation method and a secret key generation apparatus | |
CN117707854B (en) | Self-recovery method and device for reading information abnormality of IC card | |
US20100031088A1 (en) | Method and system for processing information | |
CN115687368B (en) | Data storage method, device and system and storage medium | |
CN114553556B (en) | Data encryption method, device, computer equipment and storage medium | |
CN117370941A (en) | SDK authorization method, device, computer equipment and storage medium | |
CN118264468A (en) | Telegram code translating method, telegram code translating device, telegram code translating apparatus, telegram code translating program product, and telegram code translating device | |
CN117742586A (en) | Data storage method, device, computer equipment and storage medium | |
US8275960B2 (en) | Method for protecting data in the hard disk | |
CN116523720A (en) | Social security card changing method and device, computer equipment and storage medium | |
CN116980140A (en) | Digital signature processing method, device, computer equipment and storage medium | |
CN115630527A (en) | Detection method and device for clearing abnormal model, computer equipment and storage medium | |
CN114254574A (en) | Security chip design method and device | |
CN117318928A (en) | Password setting method, password setting device, password setting apparatus, password setting program, storage medium, and computer program product | |
CN118133331A (en) | Privacy protection method and device for chip stored data and computer equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant |