CN111611440A - Method for rapidly improving OFD signature, signature and verification - Google Patents

Method for rapidly improving OFD signature, signature and verification Download PDF

Info

Publication number
CN111611440A
CN111611440A CN202010367768.8A CN202010367768A CN111611440A CN 111611440 A CN111611440 A CN 111611440A CN 202010367768 A CN202010367768 A CN 202010367768A CN 111611440 A CN111611440 A CN 111611440A
Authority
CN
China
Prior art keywords
ofd
calculation
signature
file
task
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
Application number
CN202010367768.8A
Other languages
Chinese (zh)
Other versions
CN111611440B (en
Inventor
王珂
王永起
魏建民
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Tongzhi Weiye Software Co ltd
Original Assignee
Shandong Tongzhi Weiye Software Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Tongzhi Weiye Software Co ltd filed Critical Shandong Tongzhi Weiye Software Co ltd
Priority to CN202010367768.8A priority Critical patent/CN111611440B/en
Publication of CN111611440A publication Critical patent/CN111611440A/en
Application granted granted Critical
Publication of CN111611440B publication Critical patent/CN111611440B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/80Information retrieval; Database structures therefor; File system structures therefor of semi-structured data, e.g. markup language structured data such as SGML, XML or HTML
    • G06F16/81Indexing, e.g. XML tags; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Storage Device Security (AREA)

Abstract

The invention discloses a method for rapidly improving OFD signature, signature and verification, which comprises the following steps of putting all document paths which do not participate in calculation into a file directory M before calculation; and reading the currently set parallel task number. And decompressing the OFD, reading the OFD document list, and acquiring a corresponding file path according to the number of tasks. And S4, starting a plurality of task numbers in parallel. Comparing whether the current document path is in M or not, and if so, ending the current task; if not, starting HASH calculation. After the task of calculating HASH is calculated, the file path and the HASH value are sent to a task queue for writing the HASH value into XML. And after all OFD documents participate in the completion, writing a completion calculation signal into the task queue written with the HASH value. The invention can simultaneously calculate and write in, and improves the processing efficiency of multi-page files and multi-resource files.

Description

Method for rapidly improving OFD signature, signature and verification
Technical Field
The invention relates to a method for rapidly improving OFD signature, signature and verification.
Background
According to the technical specification of the OFD, the digital signature, signature and verification process of the OFD all needs HASH calculation on some protected files in the OFD to obtain HASH values, and HASH algorithms, HASH values, corresponding file paths and other information are formed into new XML files which are placed in corresponding directories to serve as calculation original texts of the digital signature, signature or verification. In the existing calculation, the files to be calculated are usually polled one by one to obtain HASH values, and the HASH values are written into XML files. In the existing mode, the problem of slow calculation exists, and especially when the number of pages and resources of a file are more, a large amount of time is occupied by sequential single HASH calculation, so that the performance is low, and the HASH calculation of each page needs to be completed for a long time.
Disclosure of Invention
In order to solve the problems, the method for rapidly improving the OFD signature, signature and verification of the invention improves the existing calculation mode, performs parallel optimization on the original linear processes of polling, HASH calculation, insertion and the like, can perform calculation and write-in simultaneously, can fully exert calculation potential, and improves the processing efficiency of multi-page files and multi-resource files.
The technical scheme of the invention is as follows:
a method for rapidly improving OFD signature, signature and verification is characterized by comprising the following steps,
and S1, definitely not participating in the operation of the file directory M. Before calculation, all document paths not participating in calculation are put into a file directory M
And S2, reading the currently set parallel task number.
S3, decompressing the OFD, reading the OFD document list, and acquiring the corresponding file path according to the number of tasks.
And S4, starting a plurality of task numbers in parallel.
S5, comparing whether the current document path is in M, if yes, ending the current task; if not, starting HASH calculation.
S6, after each HASH calculation task is completed, the file path and the HASH value are sent to a task queue for writing the HASH value into XML, and the task calculation of the current time is completed
S7, after all the tasks are finished, whether the polling of all the files of the OFD file is finished is determined; if there are remaining files, repeatedly performing S4-S6;
s8, after all OFD documents are involved, writing a completion calculation signal to the job queue in which the HASH value is written. And outputting a final XML document after the task queue takes the signal, and finishing HASH calculation of the whole OFD file.
Has the advantages that:
the method can synchronously perform HASH calculation on certain files by drawing up the HASH task pool, and further write the files into a completed task queue, and write the files into the XML file synchronously. The method converts the original single file HASH operation into simultaneous HASH operation of a plurality of files on one hand, and converts the original HASH operation after calculation into simultaneous calculation and writing in of the files on the other hand, thereby greatly accelerating the original calculation speed.
Compared with the existing working mode, the invention has the following remarkable performance advantages while meeting all the functional requirements of the prior technical scheme:
1. efficiency of parallel HASH is improved
In the invention, the parallel HASH calculation of a plurality of files can be rapidly completed by performing the parallel HASH calculation of a plurality of task lists in a mode of fully playing the calculation capability
2. Improving efficiency of final XML generation
In the prior art, multi-task calculation is adopted, one calculation is written in one, the bottleneck that a HASH generation task is executed independently after parallel operation is solved, and the efficiency is higher.
Drawings
FIG. 1 is a flow chart of the present invention;
Detailed Description
The invention will be described in detail below with reference to the accompanying drawing 1:
the invention filters the files to be calculated in the task by setting a mode of not calculating the directory blacklist in advance. Synchronous HASH calculation of a plurality of files of OFD is realized by a plurality of HASH tasks; and uniformly finishing the content generation of the HASH file list in the OFD specification by the HASH in a queue mode. The specific method comprises the following steps:
and S1, definitely not participating in the operation of the file directory M. Before calculation, all document paths which do not participate in calculation are put into a file directory M.
And S2, reading the currently set parallel task number.
S3, decompressing the OFD, reading the OFD document list, and acquiring the corresponding file path according to the number of tasks.
And S4, starting a plurality of task numbers in parallel.
S5, comparing whether the current document path is in M, if yes, ending the current task; if not, starting HASH calculation.
S6, after each HASH calculation task is completed, the file path and the HASH value are sent to a task queue for writing the HASH value into XML, and the task calculation of the current time is completed
S7, after all the tasks are finished, whether the polling of all the files of the OFD file is finished is determined; if there are remaining files, repeatedly performing S4-S6;
s8, after all OFD documents are involved, writing a completion calculation signal to the job queue in which the HASH value is written. And outputting a final XML document after the task queue takes the signal, and finishing HASH calculation of the whole OFD file.
The specific application scenarios are as follows:
1. digital signature and signature of OFD
The file list information in the OFD packet and the in-packet files that do not need protection are collected first to form a protected file list. And if the document is locked after signature, protecting the signature list document.
And then the thread pool is used for carrying out parallel abstract calculation on the file according to the file path recorded in the file protection list. And recording the file name and the abstract result of the protected file in the signature description file. The signature description file simultaneously records information such as a security algorithm provider, a signature algorithm, signature time, positions in a seal file package (required during signature and not required for signature), positions in a signature value file package and the like. The signature describes the structure of the file and the storage path in the packet, and conforms to the relevant GB/T33190 specification.
And calculating the abstract of the signature description file, and organizing the abstract information and the version number of the signature, the electronic seal (required when signing, and not required when signing), the signature certificate, the signature time and other information into a structure to be signed according to GM/T0031, C0120 or GM/T0010 specifications.
And calculating a signature for the structure to be signed according to a signature algorithm specified in the signature description file, and generating a signature value file according to GM/T0031, C0120 or GM/T0010 specifications.
And storing the seal file (required when signing and not required for signing) and the signature value file into an OFD file package according to the specified path in the signature description file.
2. Digital signature and signature verification of OFD
And according to the selected seal, positioning the corresponding signature description file by analyzing the signature list file.
And analyzing the signature description file to obtain a protection file list.
And calculating the abstract of the protected file according to an abstract algorithm recorded in the signature description file, comparing the abstract with the abstract recorded in the signature description file, and indicating that the file is modified if the comparison fails.
After the comparison of the abstracts is completed, the abstracts are calculated for the signature description files and are compared with the abstracts of the signature description files recorded in the signature value structure, and if the comparison fails, the files are modified.
And verifying the signature value file according to the GM/T0031, C0120 or GM/T0010 standard to ensure that the signature value file is not changed, if the signature value file is changed, modifying the instruction file, and if not, modifying the instruction file, and successfully verifying.

Claims (1)

1. A method for rapidly improving OFD signature, signature and verification is characterized by comprising the following steps,
s1, determining that the file directory M does not participate in calculation, and putting all the file paths not participating in calculation into a file directory M;
s2, reading the number of the currently set parallel tasks;
s3, decompressing the OFD, reading an OFD document list, and acquiring a corresponding file path according to the number of tasks;
s4, starting a plurality of tasks in parallel;
s5, comparing whether the current document path is in M, if yes, ending the current task; if not, starting HASH calculation;
s6, after the task of calculating HASH is completed, the file path and the HASH value are sent to a task queue for writing the HASH value into XML, and the task calculation is completed;
s7, after all the tasks are finished, whether the polling of all the files of the OFD file is finished is determined; if there are remaining files, repeatedly performing S4-S6;
s8, writing a completion calculation signal into the task queue written with the HASH value after all OFD documents participate in the completion; and outputting a final XML document after the task queue takes the signal, and finishing HASH calculation of the whole OFD file.
CN202010367768.8A 2020-05-01 2020-05-01 Method for rapidly improving OFD signature, signature and verification Active CN111611440B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010367768.8A CN111611440B (en) 2020-05-01 2020-05-01 Method for rapidly improving OFD signature, signature and verification

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010367768.8A CN111611440B (en) 2020-05-01 2020-05-01 Method for rapidly improving OFD signature, signature and verification

Publications (2)

Publication Number Publication Date
CN111611440A true CN111611440A (en) 2020-09-01
CN111611440B CN111611440B (en) 2023-05-05

Family

ID=72199544

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010367768.8A Active CN111611440B (en) 2020-05-01 2020-05-01 Method for rapidly improving OFD signature, signature and verification

Country Status (1)

Country Link
CN (1) CN111611440B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112732649A (en) * 2020-12-21 2021-04-30 航天信息股份有限公司 OFD document signing method, electronic device and medium
WO2023098448A1 (en) * 2021-12-02 2023-06-08 江苏中威科技软件系统有限公司 Method for converting ofd file

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101526948A (en) * 2009-04-23 2009-09-09 山东中创软件商用中间件股份有限公司 Multithreading file traversal technology
CN102567341A (en) * 2010-12-09 2012-07-11 腾讯科技(深圳)有限公司 Method and system for synchronizing internal directory and external directory of software
US20130346719A1 (en) * 2012-06-21 2013-12-26 Alexander I. Tomlinson Systems and methods for efficient memory access
CN106446715A (en) * 2016-10-11 2017-02-22 武汉斗鱼网络科技有限公司 File encryption method and device
CN106789091A (en) * 2017-02-24 2017-05-31 中金金融认证中心有限公司 The implementation method and device of a kind of Open XML documents digital signature and sign test
CN109492367A (en) * 2018-10-17 2019-03-19 平安国际融资租赁有限公司 Electronic contract signature processing method, device, computer equipment and storage medium
CN109840425A (en) * 2019-01-22 2019-06-04 北京数科网维技术有限责任公司 A kind of method and apparatus of file encryption
CN111027969A (en) * 2019-10-21 2020-04-17 国信电子票据平台信息服务有限公司 Method for storing and acquiring electronic document format file template

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101526948A (en) * 2009-04-23 2009-09-09 山东中创软件商用中间件股份有限公司 Multithreading file traversal technology
CN102567341A (en) * 2010-12-09 2012-07-11 腾讯科技(深圳)有限公司 Method and system for synchronizing internal directory and external directory of software
US20130346719A1 (en) * 2012-06-21 2013-12-26 Alexander I. Tomlinson Systems and methods for efficient memory access
CN106446715A (en) * 2016-10-11 2017-02-22 武汉斗鱼网络科技有限公司 File encryption method and device
CN106789091A (en) * 2017-02-24 2017-05-31 中金金融认证中心有限公司 The implementation method and device of a kind of Open XML documents digital signature and sign test
CN109492367A (en) * 2018-10-17 2019-03-19 平安国际融资租赁有限公司 Electronic contract signature processing method, device, computer equipment and storage medium
CN109840425A (en) * 2019-01-22 2019-06-04 北京数科网维技术有限责任公司 A kind of method and apparatus of file encryption
CN111027969A (en) * 2019-10-21 2020-04-17 国信电子票据平台信息服务有限公司 Method for storing and acquiring electronic document format file template

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
王观上: "云存储中共享数据安全审计技术研究", 《中国优秀硕士学位论文全文库 信息科技辑》 *
陈性元;高元照;唐慧林;杜学绘;: "大数据安全技术研究进展", 中国科学:信息科学 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112732649A (en) * 2020-12-21 2021-04-30 航天信息股份有限公司 OFD document signing method, electronic device and medium
CN112732649B (en) * 2020-12-21 2024-03-12 航天信息股份有限公司 OFD document signing method, electronic equipment and medium
WO2023098448A1 (en) * 2021-12-02 2023-06-08 江苏中威科技软件系统有限公司 Method for converting ofd file

Also Published As

Publication number Publication date
CN111611440B (en) 2023-05-05

Similar Documents

Publication Publication Date Title
CN106874348B (en) File storage and index method and device and file reading method
CN111611440A (en) Method for rapidly improving OFD signature, signature and verification
CN109240607B (en) File reading method and device
CN101763433B (en) Data storage system and method
CN104572781A (en) Method and device for generating transaction log
EP3933639B1 (en) Transaction processing method, apparatus, and electronic device for blockchain
CN113177090A (en) Data processing method and device
CN108573172B (en) Data checking and storing method and device
CN107423425A (en) A kind of data quick storage and querying method to K/V forms
CN108198582B (en) NAND Flash control method and device and SSD
CN112463880B (en) Block chain data storage method and related device
CN112765112A (en) Installation package packing and unpacking method
CN107481764B (en) 3D Nand Flash scanning detection method and system
CN103246611B (en) A kind of document handling method and system
CN114328747A (en) Data synchronization method, data synchronization device, computer equipment and medium
CN110286995B (en) Data reading and writing method and device
CN112312043A (en) Optimization method and device for deriving animation video
CN102253940B (en) Method and device for processing data by tree view
CN110059075A (en) A kind of method, apparatus of database migration, equipment and computer-readable medium
CN115509763B (en) Fingerprint calculation method and device
CN115952172B (en) Data matching method and device based on database temporary table
CN114637581B (en) Optimization system for submitting rendering model
CN110879721B (en) Method and device for generating help document
CN112486925B (en) A2L file processing method, device and storage medium
CN107391029B (en) File storage and reading method and corresponding system thereof

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
CB02 Change of applicant information

Address after: 250101 room 2301, 6 tower, Shun Tai Plaza, 2000 Shun Hua Road, hi tech Zone, Ji'nan, Shandong.

Applicant after: Tongzhi Weiye Software Co.,Ltd.

Address before: 250101 room 2301, 6 tower, Shun Tai Plaza, 2000 Shun Hua Road, hi tech Zone, Ji'nan, Shandong.

Applicant before: SHANDONG TONGZHI WEIYE SOFTWARE Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant