A card data writing method, device, equipment and medium

By defining data formats for different data and adopting offline mode card data protocol, the data to be written is converted into target data, which solves the problems of capacity waste and difficulty in expansion in the Mifare card data writing method, and realizes efficient utilization and flexible expansion of storage space.

CN115952819BActive Publication Date: 2025-10-10ZKTECO CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211550553.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-05
Publication Date
2025-10-10
Estimated Expiration
2042-12-05

AI Technical Summary

Technical Problem

In the prior art, the data writing method of Mifare cards has the problems of large capacity waste and difficulty in expansion, especially when there are many system modules and a single card is required, the number of sectors and capacity allocated to the modules are limited.

Method used

By determining the data format of the data to be written, the offline mode card data protocol is used to convert the data to be written into the target data, and the data is written into the storage area to adapt to different writing requirements to avoid wasting storage space and making the location structure difficult to expand.

Benefits of technology

It effectively utilizes storage space, avoids the waste of storage space caused by rigid writing formats, realizes flexible expansion of data formats, and adapts to the writing requirements of different card types.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115952819B_ABST
    Figure CN115952819B_ABST
Patent Text Reader

Abstract

The application discloses a card data writing method, device and equipment and a medium, and is used for solving the technical problems that the existing card data writing mode is large in capacity waste and difficult to expand. The application comprises the following steps: determining preset to-be-written data of a ladder control module and a storage area of a card; acquiring an offline mode card data protocol of the card; determining a data format of the to-be-written data; converting the to-be-written data into target data by using the offline mode card data protocol and the data format; and writing the target data into the storage area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of card writing technology, and in particular to a card data writing method, device, equipment and medium. Background Art

[0002] With the advancement of the times, some older residential communities are renovating and installing elevators. Online elevator control has certain limitations, such as cumbersome wiring and network issues, so the equipment can only be operated offline. In this case, access control requires card configuration. The main card types used in existing technologies are Mifare cards and CPU cards.

[0003] There are two types of Mifare cards: S50 and S70. Their storage space data is as follows:

[0004] S50 has 16 sectors, each sector has 4 blocks, each block has 16 bytes, and the maximum number of available bytes is 16*4*16=1024 bytes;

[0005] S70 has 40 sectors. The first 32 sectors have 4 blocks each, and each block has 16 bytes. The last 8 sectors have 16 blocks each, and each block has 16 bytes. The maximum number of available bytes is 32*4*16+8*16*16=4096 bytes.

[0006] The data storage area of ​​the CPU card is the files in the directory created in the card. The card capacity is larger than that of the Mifare card.

[0007] When there are many system modules and a single card is required, it is usually necessary to allocate the card sectors to modules. In this case, the number of sectors that can be allocated to the module and the capacity that can be used will be more limited.

[0008] In the existing technology, data is usually written in JSON format or in the form of "+" splicing. However, the JSON format has many symbols, resulting in a small amount of data that can be written, wasting capacity; the symbol splicing method has a relatively fixed position and is not easy to expand. Summary of the Invention

[0009] The present invention provides a card data writing method, device, equipment and medium, which are used to solve the technical problems of large capacity waste and difficulty in expansion in the existing Mifare card data writing method.

[0010] The present invention provides a card data writing method, comprising:

[0011] Determining the data to be written into the preset elevator control module and the storage area of ​​the card;

[0012] Obtaining the offline mode card data protocol of the card;

[0013] Determining the data format of the data to be written;

[0014] Converting the data to be written into target data using the offline mode card data protocol and the data format;

[0015] The target data is written into the storage area.

[0016] Optionally, the step of determining the data format of the data to be written includes:

[0017] Obtaining the card type to be configured for the data to be written;

[0018] The data format of the data to be written is determined according to the card type.

[0019] Optionally, the step of converting the data to be written into target data using the offline mode card data protocol and the data format includes:

[0020] Converting the data to be written into format data according to the data format;

[0021] Obtaining the data length and check code of the data to be written;

[0022] Target data is generated based on the offline mode card data protocol using the data length, the card type, the format data, and the check code.

[0023] Optionally, the step of converting the data to be written into formatted data according to the data format includes:

[0024] When the data format is a configuration management card data format, the card number, device time, configuration information, device number, device sequence, floor selection release time, floor configuration information and expansion board number are obtained from the data to be written;

[0025] According to the configuration management card data format, format data is generated using the card number, the device time, the configuration information, the device number, the device sequence, the floor selection release duration, the floor configuration information and the expansion board number.

[0026] Optionally, the step of converting the data to be written into formatted data according to the data format includes:

[0027] When the data format is a user card data format, the user's work number, card number, user validity period, configuration information, device number, direct access floor number and floor selection authority information are obtained from the data to be written;

[0028] The format data is generated using the user ID, the card number, the user validity period, the configuration information, the device number, the direct floor number and the floor selection authority information.

[0029] Optionally, the step of converting the data to be written into formatted data according to the data format includes:

[0030] When the data format is a lost card management card data format, the card number, lost card clearing selection information, lost card number information, and lost card unblocking number information are obtained from the data to be written;

[0031] The format data is generated using the card number, the lost card clearing selection information, the lost card number information and the lost card unblocking number information.

[0032] Optionally, the step of writing the target data into the storage area includes:

[0033] encrypting the target data to obtain encrypted data;

[0034] Obtain the timestamp of the encrypted data, and send the encrypted data and the timestamp to a preset encapsulation interface; the encapsulation interface is used to decrypt the encrypted data and write it into the storage area when it is determined that the time interval between the timestamp and the current time is less than a preset time interval.

[0035] The present invention also provides a card data writing device, comprising:

[0036] A module for determining data to be written and a storage area, for determining data to be written to a preset elevator control module and a storage area on the card;

[0037] An offline mode card data protocol acquisition module, configured to acquire the offline mode card data protocol of the card;

[0038] A data format determination module, configured to determine the data format of the data to be written;

[0039] a target data conversion module, configured to convert the data to be written into target data using the offline mode card data protocol and the data format;

[0040] A writing module is used to write the target data into the storage area.

[0041] The present invention further provides an electronic device, comprising a processor and a memory:

[0042] The memory is used to store program code and transmit the program code to the processor;

[0043] The processor is configured to execute any one of the above methods for writing Mifare card data according to the instructions in the program code.

[0044] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store program code, and the program code is used to execute the card data writing method as described in any one of the above items.

[0045] It can be seen from the above technical solution that the present invention has the following advantages: The present invention discloses a card data writing method, including: determining the data to be written in the preset elevator control module and the storage area of ​​the card; obtaining the offline mode card data protocol of the card; determining the data format of the data to be written; using the offline mode card data protocol and data format to convert the data to be written into target data; and writing the target data into the storage area.

[0046] The present invention adapts to different writing requirements by defining different data formats for different data, thereby avoiding the waste of storage space caused by an overly rigid writing format and the problem that an overly fixed position structure is difficult to expand. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0048] Figure 1 A flowchart of a card data writing method provided by an embodiment of the present invention;

[0049] Figure 2 A flowchart of a card data writing method provided by another embodiment of the present invention;

[0050] Figure 3 This is a structural block diagram of a card data writing device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0051] The embodiments of the present invention provide a card data writing method, apparatus, device and medium, which are used to solve the technical problems of large capacity waste and difficulty in expansion in the existing card data writing method.

[0052] In order to make the purpose, features, and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described below are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0053] See also Figure 1 , Figure 1 This is a flowchart of the steps of a card data writing method provided by an embodiment of the present invention.

[0054] The present invention provides a card data writing method, which may specifically include the following steps:

[0055] Step 101, determining the data to be written into the preset elevator control module and the storage area on the card;

[0056] The elevator control module is used to configure permissions for the card so that the card can use the corresponding elevator.

[0057] In practical applications, cards can be Mifare cards or CPU cards. Mifare cards are inductive smart IC cards. CPU cards, also known as smart cards, contain an integrated circuit containing a microprocessor (CPU), a memory unit, and a chip operating system (COS). A CPU card with COS is equivalent to a microcomputer, providing not only data storage but also command processing and data security protection.

[0058] Taking the Mifare card as an example, in this embodiment of the present invention, the elevator control module can allocate a Mifare card's storage sector as a storage area, including the number and range of sectors, to store the data to be written on the Mifare card. This data is used to configure the corresponding elevator permissions for the Mifare card.

[0059] In one example, sectors 5-8 of the S50 card can be allocated to the elevator control module, with an available size of 4*3*16=192 bytes; sectors 33-34 of the S70 card can be allocated, with an available size of 2*15*16=480 bytes; a block in each sector is used to store the physical card number or production batch, etc.

[0060] It should be noted that the above is only an example of sector allocation and does not constitute a limitation to the present invention. Those skilled in the art may require other sector allocation methods according to actual needs.

[0061] Taking the CPU card as an example, the CPU needs to create a read-write directory and a file stored under the directory as a storage area, and set the storable size of the file; wherein the directory, the file name and the storable size of the file can be defined according to needs. In an example, a data directory 57091 can be allocated to the providing module, a file name 1, and a data size of 1kb of the file as the storage area.

[0062] In step 102, the offline mode card data protocol of the card is acquired.

[0063] In the embodiment of the present application, the offline mode card data protocol defines a storage rule of the to-be-written data in the card.

[0064] In the embodiment of the present application, the offline mode card data protocol can include data length (4 bytes), card type (1 byte), data (N bytes, determined by the size of the content to be written), CRC16_L (1 byte, low word check), and CRC_H (1 byte, high word check). Wherein the data length and the CRC16 check code are used to check whether the data is modified and complete, and the specific structure is shown in Table 1 as follows:

[0065]

[0066] Table 1

[0067] In step 103, the data format of the to-be-written data is determined.

[0068] After the to-be-written data is acquired, the data format of the to-be-written data can be determined. Different to-be-written data can correspond to different data formats.

[0069] In step 104, the to-be-written data is converted into target data by using the offline mode card data protocol and the data format.

[0070] In the embodiment of the present application, after the offline mode card data protocol and the data format are acquired, the to-be-written data can be converted into target data by using the offline mode card data protocol and the data format. The target data is data with the data format and in accordance with the offline mode card data protocol.

[0071] In step 105, the target data is written into the storage area.

[0072] After the target data is acquired, the target data can be written into the storage area.

[0073] The present application defines different data formats for different data to adapt to different writing requirements, thereby avoiding the waste of storage space caused by too rigid writing format and the problem of not easy to expand caused by too fixed position structure.

[0074] See also Figure 2 , Figure 2 This is a flowchart of a card data writing method provided by another embodiment of the present invention. This embodiment of the present invention is a supplement and refinement of the above embodiment, and specifically may include the following steps:

[0075] Step 201, determining the data to be written into the preset elevator control module and the storage area on the card;

[0076] Step 202, obtaining the card's offline mode card data protocol;

[0077] Steps 201-202 are the same as steps 101-102. For details, please refer to the description of steps 101-102, which will not be repeated here.

[0078] Step 203, obtaining the card type to be configured for the data to be written;

[0079] In the embodiment of the present invention, the card types may include three types as shown in Table 2, and different card types have different elevator permissions.

[0080] type Remarks 0x01 Configuring the Management Card 0x02 User Card 0x03 Lost management card

[0081] Table 2

[0082] Step 204, determining the data format of the data to be written according to the card type;

[0083] In the embodiment of the present invention, different data formats may be configured for different card types according to their different data requirements, so as to avoid wasting storage space due to excessively large data being written.

[0084] Step 205, using the offline mode card data protocol and data format to convert the data to be written into the target data;

[0085] In an embodiment of the present invention, after obtaining the offline mode card data protocol and data format, the offline mode card data protocol and data format can be used to convert the data to be written into target data. The target data is data having the data format and conforming to the offline mode card data protocol.

[0086] In one example, the step of converting the data to be written into the target data using the offline mode card data protocol and data format may include the following sub-steps:

[0087] S51, converting the data to be written into format data according to the data format;

[0088] S52, obtaining the data length and check code of the data to be written;

[0089] S53, generating target data based on the offline mode card data protocol using the data length, card type, format data and check code.

[0090] In a specific implementation, the data to be written to the card can be extracted from the data to be written, and converted into formatted data according to the data format. Then, combined with other types of data defined in the offline mode card data protocol, including card type, data length, and checksum, the target data to be written to the card can be generated.

[0091] In one example, step S51 may include the following sub-steps:

[0092] S1a, when the data format is the configuration management card data format, obtain the card number, device time, configuration information, device number, device sequence, floor selection release time, floor configuration information and expansion board number from the data to be written;

[0093] S1b, according to the configuration management card data format, uses the card number, device time, configuration information, device number, device sequence, floor selection release time, floor configuration information and expansion board number to generate format data.

[0094] In a specific implementation, the configuration management card data format may be as shown in Table 3 below:

[0095]

[0096]

[0097] Table 3

[0098] The fields are defined as follows:

[0099] CardNo: hexadecimal card number;

[0100] DevTime: device time, used to set time, timestamp converted to hexadecimal;

[0101] Data: configuration information;

[0102] DevID: device ID;

[0103] SN: device serial number;

[0104] OutTime: the duration of the selected layer release, in seconds;

[0105] FloorsInfo: floor configuration information, maximum 8 bytes (7 extension boards), from right to left, the first byte represents the total number of floors, the second byte represents the extension board information corresponding to the floor in order, and the high four bits of each byte represent the extension board number and the low four bits represent the extension board type (1: indicates 8-layer extension board, 2: indicates 16-layer extension board);

[0106] ExtBoardsInfo: extension board configuration information, maximum 7 bytes, from right to left, the high four bits of each byte represent the extension board number and the low four bits represent the 485 address of the extension board;

[0107] Example:

[0108] 1=01F59324; 2=60A75A70; 3=4:xx,5:123456789ASDFGHJKLQxxxxx,6:xxx,7:xxxxxxxxxx111228,8:xxxxxxxxxx2211&4:xx,5:123456789ASDFGHJKLQxxxxx,6:xxx,7:xxxxxxxxxx111228,8:xxxxxxxxxx2211;

[0109] It should be noted that in one example, the different serial numbers can be separated by “:”, the different configuration information can be separated by “&”, and the different fields of the configuration information can be separated by “:”.

[0110] In another example, step S51 can include the following sub-steps:

[0111] S2a, when the data format is a user card data format, obtaining the user ID, card number, user validity period, configuration information, device number, direct floor number and selected floor permission information from the data to be written;

[0112] S2b, generating format data using the user ID, card number, user validity period, configuration information, device number, direct floor number and selected floor permission information.

[0113] In a specific implementation, the user card data format can be as shown in Table 4:

[0114]

[0115] Table 4

[0116] Wherein, the fields are defined as follows:

[0117] Pin: user ID;

[0118] CardNo: 16 hexadecimal card number;

[0119] ValidTime: User validity period;

[0120] AuthsInfo: configuration information;

[0121] DevID: device ID;

[0122] FloorID: Direct access floor number;

[0123] FloorsInfo: floor selection authority information;

[0124] example:

[0125] 1=FFFFFFFF; 2=FFFFFFFF; 3=9999999999999999; 4=5:xx,6:xxx,7:FFFFFFFFFFFFFFFFFFFFFFFFFFFF&5:xx,6:xxx,7:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;

[0126] It should be noted that, in one example, different sequence numbers may be separated by a “:”, different configuration information may be separated by an “&”, and different fields of the configuration information may be separated by a “:”.

[0127] In another example, step S51 may include the following sub-steps:

[0128] S3a, when the data format is the lost card management card data format, obtain the card number, lost card clear selection information, lost card number information, and unblocked card number information from the data to be written;

[0129] S3b, using the card number, lost card clear selection information, lost card number information and unblocked card number information to generate format data.

[0130] In a specific implementation, the data format of the loss report management card can be as shown in Table 5 below:

[0131]

[0132]

[0133] Table 5

[0134] The fields are defined as follows:

[0135] CardNo: hexadecimal card number;

[0136] Clear: whether to clear the card loss / unblocking information;

[0137] InvalidCards: Lost card number information, hexadecimal card number;

[0138] ValidCards: unblocked card number information, hexadecimal card number;

[0139] example:

[0140] 1=2; 2=01F59324; 3=0; 4=xxxxxxxx,xxxxxxxx; 5=xxxxxxxx,xxxxxxxx;

[0141] Step 206: Write the target data into the storage area.

[0142] After the target data is acquired, the target data may be written into the storage area.

[0143] In one example, the step of writing target data into the storage area may include the following sub-steps:

[0144] S61, encrypting target data to obtain encrypted data;

[0145] S62, obtaining the timestamp of the encrypted data, and sending the encrypted data and the timestamp to a preset encapsulation interface; the encapsulation interface is used to decrypt the encrypted data and write it into the storage area when it determines that the time interval between the timestamp and the current time is less than the preset time interval.

[0146] In a specific implementation, the encapsulation interface can be an ISSOnline encapsulation interface. After the target data is generated, the ISSOnline interface can be called to transfer the data to the ISSOnline encapsulation interface. During the transmission process, the target data can be encrypted using RC4 and accompanied by a timestamp. The ISSOnline encapsulation interface can decrypt the encrypted data and write it into the storage area of ​​the card when it determines that the time interval between the current time and the timestamp is less than the preset time interval (such as 3 seconds).

[0147] The present invention adapts to different writing requirements by defining different data formats for different data, thereby avoiding the waste of storage space caused by an overly rigid writing format and the problem that an overly fixed position structure is difficult to expand.

[0148] See also Figure 3 , Figure 3 This is a structural block diagram of a card data writing device provided by an embodiment of the present invention.

[0149] An embodiment of the present invention provides a card data writing device, comprising:

[0150] The module 301 for determining the data to be written and the storage area is used to determine the data to be written in the preset elevator control module and the storage area on the card;

[0151] Offline mode card data protocol acquisition module 302, used to obtain the offline mode card data protocol of the card;

[0152] A data format determination module 303 is used to determine the data format of the data to be written;

[0153] The target data conversion module 304 is used to convert the data to be written into the target data using the offline mode card data protocol and data format;

[0154] The writing module 305 is used to write the target data into the storage area.

[0155] In this embodiment of the present invention, the data format determination module 303 includes:

[0156] The card type acquisition submodule is used to obtain the card type to be configured for the data to be written;

[0157] The data format determination submodule is used to determine the data format of the data to be written according to the card type.

[0158] In this embodiment of the present invention, the target data conversion module 304 includes:

[0159] The format data conversion submodule is used to convert the data to be written into format data according to the data format;

[0160] The data length and check code acquisition submodule is used to obtain the data length and check code of the data to be written;

[0161] The first target data generating submodule is configured to generate target data based on an offline mode card data protocol using data length, card type, format data and a check code.

[0162] In an embodiment of the present invention, the format data conversion submodule includes:

[0163] A first acquisition unit is configured to acquire the card number, device time, configuration information, device number, device sequence, floor selection release time, floor configuration information, and expansion board number from the data to be written when the data format is a configuration management card data format;

[0164] The first format data generating unit is used to generate format data according to the configuration management card data format using the card number, device time, configuration information, device number, device sequence, floor selection release time, floor configuration information and expansion board number.

[0165] In an embodiment of the present invention, the format data conversion submodule includes:

[0166] The second acquisition unit is used to acquire the user's work number, card number, user validity period, configuration information, device number, direct floor number and floor selection authority information from the data to be written when the data format is the user card data format;

[0167] The second format data generating unit is used to generate format data using the user's work number, card number, user validity period, configuration information, equipment number, direct floor number and floor selection authority information.

[0168] In an embodiment of the present invention, the format data conversion submodule includes:

[0169] The third acquiring unit is configured to acquire the card number, lost card clearing selection information, lost card number information, and unblocked card number information from the data to be written when the data format is a lost card management card data format;

[0170] The third format data generating unit is used to generate format data using the card number, the lost card clearing selection information, the lost card number information and the lost card unblocking number information.

[0171] In an embodiment of the present invention, the writing module 305 includes:

[0172] The encryption submodule is used to encrypt the target data and obtain encrypted data;

[0173] The writing submodule is used to obtain the timestamp of the encrypted data and send the encrypted data and timestamp to the preset encapsulation interface; the encapsulation interface is used to decrypt the encrypted data and write it into the storage area when it determines that the time interval between the timestamp and the current time is less than the preset time interval.

[0174] An embodiment of the present invention further provides an electronic device, the device including a processor and a memory:

[0175] The memory is used to store program codes and transmit the program codes to the processor;

[0176] The processor is configured to execute the card data writing method of the embodiment of the present invention according to the instructions in the program code.

[0177] An embodiment of the present invention further provides a computer-readable storage medium, which is used to store program code, and the program code is used to execute the card data writing method of the embodiment of the present invention.

[0178] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0179] The various embodiments in the specification are described in progressive manner, and each embodiment focuses on the difference from other embodiments, and the same or similar parts between the embodiments can be mutually referred to.

[0180] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, device, or computer program product. Therefore, the embodiments of the present application can adopt a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present application can adopt a computer program product in the form of being implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program codes.

[0181] The embodiments of the present application are described with reference to flowcharts and / or block diagrams of the method, terminal device (system), and computer program product according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the computer or other programmable data processing terminal device produce a device implemented in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that performs the functions specified in the flow(s) or block(s).

[0182] These computer program instructions can also be stored in a computer readable memory capable of directing the computer or other programmable data processing terminal device to work in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including instruction apparatus, which implements the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that performs the functions specified in the flow(s) or block(s).

[0183] These computer program instructions can also be loaded into the computer or other programmable data processing terminal device, so that a series of operation steps are performed on the computer or other programmable terminal device to produce a computer implemented process, so that the instructions executed on the computer or other programmable terminal device provide a process for implementing the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that performs the functions specified in the flow(s) or block(s).

[0184] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they become aware of the basic creative concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0185] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or terminal device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or terminal device that includes the element.

[0186] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions described in the above embodiments can still be modified, or some of the technical features thereof can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A card data writing method, characterized in that: include: Determining the data to be written into the preset elevator control module and the storage area of ​​the card; Obtaining the offline mode card data protocol of the card; Determining the data format of the data to be written; Converting the data to be written into target data using the offline mode card data protocol and the data format; Writing the target data into the storage area; The step of determining the data format of the data to be written includes: Obtaining the card type to be configured for the data to be written; determining the data format of the data to be written according to the card type; The step of converting the data to be written into target data using the offline mode card data protocol and the data format includes: Converting the data to be written into format data according to the data format; Obtaining the data length and check code of the data to be written; Target data is generated based on the offline mode card data protocol using the data length, the card type, the format data, and the check code.

2. The method according to claim 1, characterized in that The step of converting the data to be written into formatted data according to the data format includes: When the data format is a configuration management card data format, the card number, device time, configuration information, device number, device sequence, floor selection release time, floor configuration information and expansion board number are obtained from the data to be written; According to the configuration management card data format, format data is generated using the card number, the device time, the configuration information, the device number, the device sequence, the floor selection release duration, the floor configuration information and the expansion board number.

3. The method according to claim 1, characterized in that The step of converting the data to be written into formatted data according to the data format includes: When the data format is a user card data format, the user's work number, card number, user validity period, configuration information, device number, direct access floor number and floor selection authority information are obtained from the data to be written; The format data is generated using the user ID, the card number, the user validity period, the configuration information, the device number, the direct floor number and the floor selection authority information.

4. The method according to claim 1, wherein The step of converting the data to be written into formatted data according to the data format includes: When the data format is a lost card management card data format, the card number, lost card clearing selection information, lost card number information, and lost card unblocking number information are obtained from the data to be written; The format data is generated using the card number, the lost card clearing selection information, the lost card number information and the lost card unblocking number information.

5. The method according to claim 1, wherein The step of writing the target data into the storage area comprises: encrypting the target data to obtain encrypted data; Obtain the timestamp of the encrypted data, and send the encrypted data and the timestamp to a preset encapsulation interface; the encapsulation interface is used to decrypt the encrypted data and write it into the storage area when it is determined that the time interval between the timestamp and the current time is less than a preset time interval.

6. A card data writing device, characterized in that: include: A module for determining data to be written and a storage area, for determining data to be written to a preset elevator control module and a storage area on the card; An offline mode card data protocol acquisition module, configured to acquire the offline mode card data protocol of the card; A data format determination module, configured to determine the data format of the data to be written; a target data conversion module, configured to convert the data to be written into target data using the offline mode card data protocol and the data format; A writing module, configured to write the target data into the storage area; The data format determination module includes: The card type acquisition submodule is used to obtain the card type to be configured for the data to be written; The data format determination submodule is used to determine the data format of the data to be written according to the card type; Among them, the target data conversion module includes: The format data conversion submodule is used to convert the data to be written into format data according to the data format; The data length and check code acquisition submodule is used to obtain the data length and check code of the data to be written; The first target data generating submodule is configured to generate target data based on an offline mode card data protocol using data length, card type, format data and a check code.

7. An electronic device, characterized in that: The device includes a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is configured to execute the card data writing method according to any one of claims 1 to 5 according to instructions in the program code.

8. A computer-readable storage medium, characterized in that The computer-readable storage medium is used to store program codes, and the program codes are used to execute the card data writing method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Non-contact IC card data processing method and device, computer equipment and medium

    CN114218968A