WO2020052090A1 - 数据自动导入方法、装置、计算机设备及存储介质 - Google Patents

数据自动导入方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2020052090A1
WO2020052090A1 PCT/CN2018/117860 CN2018117860W WO2020052090A1 WO 2020052090 A1 WO2020052090 A1 WO 2020052090A1 CN 2018117860 W CN2018117860 W CN 2018117860W WO 2020052090 A1 WO2020052090 A1 WO 2020052090A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
data
imported
target
cell data
Prior art date
Application number
PCT/CN2018/117860
Other languages
English (en)
French (fr)
Inventor
刘万坤
陈盈楷
平海峰
曹衡
Original Assignee
深圳市泰洲科技有限公司
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 深圳市泰洲科技有限公司 filed Critical 深圳市泰洲科技有限公司
Publication of WO2020052090A1 publication Critical patent/WO2020052090A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/177Editing, e.g. inserting or deleting of tables; using ruled lines
    • G06F40/18Editing, e.g. inserting or deleting of tables; using ruled lines of spreadsheets

Definitions

  • the present application relates to a data import method, and more particularly, to an automatic data import method, device, computer device, and storage medium.
  • Enterprise resource sharing refers to the transmission of enterprise data.
  • the transmission of enterprise data includes the import and export of enterprise data.
  • the enterprise resource planning system Enterprise Resource Planning System from several first systems
  • the purpose of this application is to overcome the shortcomings of the prior art, and to provide a method, an apparatus, a computer device, and a storage medium for automatically importing data.
  • a method for automatically importing data including:
  • a further technical solution thereof is: before the obtaining a file to be imported, further comprising:
  • the scanning the file to be imported to obtain cell data that meets preset requirements includes:
  • the converting the cell data that meets a preset requirement into an expression having a target format includes:
  • the constructing an object file according to an expression having a target format includes: [0023] constructing a plurality of target cell objects according to an expression having a target format;
  • the present application also provides an automatic data importing device, including:
  • a file obtaining unit configured to obtain a file to be imported
  • a scanning unit configured to scan a file to be imported to obtain cell data conforming to a preset format
  • a conversion unit configured to convert cell data conforming to a preset requirement into an expression having a target format
  • a construction unit configured to construct an object file according to an expression having a target format
  • an import unit configured to import a target file.
  • the device further comprises:
  • a preset unit configured to preset a conversion relationship of cell data of a file to be imported.
  • the conversion unit includes:
  • Meaning acquisition subunits which are used to obtain the meaning of the cell data that meets the preset requirements according to the conversion relationship
  • integration subunits which are used to integrate the cell data and meanings that meet the preset requirements to obtain the objectives Formatted expression.
  • the present application also provides a computer device.
  • the computer device includes a memory and a processor.
  • the memory stores a computer program, and the processor implements the foregoing automatic data import method when the processor executes the computer program.
  • the present application further provides a storage medium, where the storage medium stores a computer program, and when the computer program is executed by a processor, the foregoing automatic data import method can be implemented.
  • the beneficial effects of this application compared with the prior art are as follows: By setting a conversion relationship, the application scans the cell data of the file to be imported to form an expression with a target format, and converts the expression into a target file. Therefore, the file to be imported is converted into a target file of a uniform format, and the data in tables of different formats can be converted to a uniform format and imported, which reduces the workload of data import, and does not need to develop multiple programs to import table data of different formats, which is convenient Fast.
  • FIG. 1 is a schematic diagram of an application scenario of an automatic data import method according to an embodiment of the present application
  • FIG. 2 is a schematic flowchart of an automatic data import method according to an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a sub-flow of a method for automatically importing data provided by an embodiment of the present application
  • FIG. 4 is a schematic diagram of a sub-flow of a method for automatically importing data provided by an embodiment of the present application
  • FIG. 5 is a schematic block diagram of a data automatic importing device provided by an embodiment of the present application.
  • FIG. 6 is a schematic block diagram of a conversion unit of a data automatic import device provided by an embodiment of the present application.
  • FIG. 7 is a schematic block diagram of a construction unit of a data automatic import device provided by an embodiment of the present application.
  • FIG. 8 is a schematic block diagram of a computer device according to an embodiment of the present application.
  • FIG. 1 and FIG. 2 are schematic diagrams of an application scenario of an automatic data import method according to an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of a method for automatically importing data provided by an embodiment of the present application.
  • This automatic data import method is applied to the imported server 20.
  • the imported server 20 may be a server in a distributed service platform.
  • An imported platform is deployed in the imported server 20.
  • the imported platform of the imported server 20 receives a file to be imported from the imported server 10 for file import.
  • FIG. 2 only one import server 10 is illustrated. In an actual operation process, the imported server 20 may import files in multiple import servers 10.
  • FIG. 2 is a schematic flowchart of a method for automatically importing data provided by an embodiment of the present application. As shown, the method includes the following steps S110 to S160.
  • the conversion relationship refers to the meaning represented by the data in each cell of the file to be imported, that is, the data in the cell of the file to be imported and its target in the imported server 20 File mapping.
  • a template is set in advance, and the template is scanned to form a conversion relationship, and the conversion relationship is stored in the server. Once the import server transmits data to the imported server, the data The target file will be formed according to the conversion relationship.
  • the cell data corresponding to the second row and third column of the file to be imported represents the customs declaration amount, which corresponds to the cell data corresponding to the third row and second column of the target file imported into the server 20.
  • Set the conversion relationship for the cell data in the import inquiry so that the imported server 20 does not need to develop multiple programs to import table data in different formats, and only needs to obtain the cell data according to the conversion relationship to convert it into importable data It is convenient and quick to import the target file into the corresponding cell of the server 20.
  • S120 Acquire a file to be imported.
  • the file to be imported is obtained from the import server 10, and the format of the file to be imported output by each import server 10 is the same. Therefore, the imported server 20 may set different conversion relationships according to different import servers 10. In order to receive the import of multiple files to be imported in different formats at one time, and improve the import efficiency.
  • S130 Scan the file to be imported to obtain cell data that meets preset requirements.
  • the cell data meeting the preset requirements refers to data filled in a cell with a conversion relationship.
  • S140 Convert the cell data that meets the preset requirements into an expression with a target format.
  • the system converts the excel data file into system data according to a preset rule, saves it after performing an operation in the system to form an expression with a target format.
  • the target format is a format in which the meaning of the cell data and the cell data is expressed according to a certain expression, for example: O.fl 1.
  • the corresponding cell in the first row and the first column in the imported file 0 is the number of customs declarations, and the corresponding cell data is 10.
  • This target format is not the data filled in by the user, but the server converts it according to the data transmitted by the user .
  • the number of customs declarations is 0, which means that in the Excel import file, the first row and the first column correspond to the number of customs declarations whose data structure is object 0 in the program, that is, Form such a corresponding relationship (1, 1)-0.
  • the number of customs declarations When the number in the first row and the first column of Excel's actual import file is 10, the import program will assign the number 10 to "0" in the program.
  • "Customs declaration quantity" data structure, and then subsequent algorithm calculation, storage and transmission; and the preset correspondences in the file to be imported include correspondences with common data structures (such as 0. quantity), and correspondences with sub-object data structures Relationships (such as 0. goods. Unit price) also include list-type data relationships. For example, there is a list of multiple goods with an indefinite quantity. Each goods includes name, quantity, unit price, etc.
  • presetting in the file to be imported, and after the program scans the preset file to be imported, forming a description file of the file to be imported includes: [0072] Ordinary data structure and cell correspondence, such as (1, 1) — 0. name;
  • the sub-object data structure and cell correspondence may be multi-layered sub-objects, such as (1,10)-0. transportation means. Name;
  • a template ID of the data file is first determined, a description file of the file to be imported is called according to the template ID, and the content of the actual data file is scanned according to the description file. And assign the data content to the internal data object of the program according to the description file for subsequent algorithm calculation, storage, and transmission.
  • step S140 may include steps S141 to S142.
  • the cell data that meets the preset requirements has a meaning, which can be obtained from the conversion relationship. Therefore, only the relationship between the conversion relationship and the cell data that meets the preset requirements is required. You can know the meaning of the cell data that meets the preset requirements.
  • S142 Integrate cell data and meanings that meet preset requirements to obtain an expression with a target format.
  • the cell location, and the meaning the format of the cell data is integrated with the cell data and meaning that meet the preset requirements to form an expression with the target format.
  • the target file refers to a file in which cell data corresponding to a file to be imported is filled in according to a form set by the imported server 20.
  • step S150 may include steps S151 to S152.
  • S151 Construct a plurality of target cell objects according to an expression having a target format.
  • S152 Combine several target cell objects to obtain a satisfying target file.
  • a target cell object of meaning cell data is formed, where the cell data is the calculated data.
  • the generated target file is imported into the database of the imported server 20.
  • the data carried by the target file is constructed into the data structure required by the information system, so that related computer programs can calculate, save and transmit this data structure algorithmically.
  • the cell data of the file to be imported is scanned to form an expression with a target format, and the expression is converted into a target file, thereby converting the file to be imported into a unified
  • the target file in the format can convert the data in the tables of different formats into a unified format and import it, reducing the workload of data import, and eliminating the need to develop multiple programs to import table data in different formats, which is convenient and fast.
  • FIG. 5 is a schematic block diagram of an automatic data importing device 300 according to an embodiment of the present application. As shown in FIG. 5, corresponding to the above automatic data import method, the present application further provides an automatic data import device 300.
  • the automatic data importing device 300 includes a unit for performing the above-mentioned automatic data importing method, and the device may be configured in a server. Specifically, referring to FIG. 5, the automatic data importing device 300 includes: [0092] a file obtaining unit 302, configured to obtain a file to be imported;
  • a scanning unit 303 configured to scan a file to be imported to obtain cell data conforming to a preset format
  • a conversion unit 304 configured to convert cell data that meets a preset requirement into an expression having a target format
  • a construction unit 305 configured to construct an object file according to an expression having a target format
  • the import unit 306 is configured to import a target file.
  • the foregoing apparatus further includes:
  • a preset unit 301 configured to preset a conversion relationship of cell data of a file to be imported
  • the conversion unit 304 includes: [0100]
  • a meaning acquisition subunit 3041 is configured to obtain the meaning of the cell data that meets the preset requirements according to the conversion relationship.
  • the integration subunit 3042 is configured to integrate cell data and meanings that meet preset requirements to obtain an expression with a target format.
  • the construction unit 305 includes:
  • an object construction subunit 3051 configured to construct a plurality of target cell objects according to an expression having a target format
  • a combination subunit 3052 configured to combine several target cell objects to obtain a satisfying target file.
  • the above-mentioned automatic data importing device 300 may be implemented in the form of a computer program, which may be run on a computer device as shown in FIG. 8.
  • FIG. 8 is a schematic block diagram of a computer device according to an embodiment of the present application.
  • the computer device 500 is a server, and the server may be an independent server or a server cluster composed of multiple servers.
  • the computer device 500 includes a processor 502, a memory, and a network interface 505 connected through a system bus 501.
  • the memory may include a non-volatile storage medium 503 and an internal memory 504.
  • the non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032.
  • the computer program 5032 includes program instructions. When the program instructions are executed, the processor 502 can execute a method for automatically importing data.
  • the processor 502 is configured to provide computing and control capabilities to support the operation of the entire computer device 500.
  • the internal memory 504 provides an environment for running the computer program 5032 in the non-volatile storage medium 503.
  • the processor 502 can execute an automatic data import method.
  • the network interface 505 is configured to perform network communication with other devices.
  • FIG. 8 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer equipment 500 to which the solution of the present application is applied.
  • the specific computer equipment 500 can include There are more or fewer parts than shown in the figure, or some parts are combined, or have different parts arrangements
  • the processor 502 is configured to run a computer program 5032 stored in a memory to implement the following steps:
  • processor 502 before the processor 502 implements the step of obtaining a file to be imported, it further implements the following steps:
  • the processor 502 when the processor 502 implements the expression step of converting the cell data that meets the preset requirements into an expression format with a target format, it also implements the following steps:
  • processor 502 when the processor 502 implements the step of constructing a target file according to an expression having a target format, it also implements the following steps:
  • the processor 502 may be a central processing unit (Central
  • the processor 502 may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), and ready-made programmable gate arrays (Field- Programmable Gate Array (FPGA) or Other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • DSPs digital signal processors
  • ASICs application specific integrated circuits
  • FPGA ready-made programmable gate arrays
  • the general-purpose processor may be a microprocessor, or the processor may be any conventional processor.
  • the computer program includes a program instruction, and the computer program may be stored in a storage medium, and the storage medium is a computer-readable storage medium.
  • the program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiment of the method.
  • the present application also provides a storage medium.
  • the storage medium may be a computer-readable storage medium.
  • the storage medium stores a computer program, and when the computer program is executed by the processor, the processor executes the following steps:
  • the processor before the processor executes the computer program to implement the step of obtaining a file to be imported, the processor further implements the following steps:
  • the processor when the processor executes the computer program to implement the step of converting cell data that meets a preset requirement into an expression step having a target format, the processor further implements the following steps:
  • the processor when the processor executes the computer program to implement the step of constructing an object file according to an expression having a target format, the processor further implements the following steps: [0145] constructing several target cell objects according to an expression having a target format;
  • the storage medium may be various computer-readable storage media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a magnetic disk, or an optical disk.
  • program codes such as a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a magnetic disk, or an optical disk.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product
  • the technical solution of the present application is essentially a part that contributes to the existing technology, or all or part of the technical solution may be embodied in the form of a software product, which is stored in a storage medium.
  • the method includes several instructions for causing a computer device (which may be a personal computer, a terminal, or a network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

本申请涉及数据自动导入方法、装置、计算机设备及存储介质,该方法获取待导入文件;对待导入文件进行扫描,获取符合预设要求的单元格数据;将符合预设要求的单元格数据转换为具备目标格式的表达式;根据具备目标格式的表达式构建目标文件;导入目标文件。本申请通过设定填写规则,对待导入文件的单元格数据进行扫描,形成具备目标格式的表达式,将表达式转为目标文件,从而将待导入文件转为统一格式的目标文件,可将不同格式表格内的数据转换为统一格式并导入,减少数据导入的工作量,且无需开发多个程序进行不同格式表格数据的导入,方便快捷。

Description

数据自动导入方法、 装置、 计算机设备及存储介质
[0001] 本申请是以申请号为 201811048318.1、 申请日为 2018年 9月 10日的中国专利申请 为基础, 并主张其优先权, 该申请的全部内容在此作为整体引入本申请中。
[0002] 技术领域
[0003] 本申请涉及数据导入方法, 更具体地说是指数据自动导入方法、 装置、 计算机 设备及存储介质。
[0004] 背景技术
[0005] 企业资源共享是指企业数据的传递, 企业数据的传递包括企业数据的导入和导 出, 从若干个第一个系统的企业资源计划系统 (Enterprise Resource
Planning , ERP)中导出多个 Excel文件, 这些 Excel文件内包含了若干企业数据, 这些 Excel文件的格式不同, 将这些 Excel文件导入第二系统中, 这样就要求第二 个系统具备多个应用程序以接收不同格式文件的导入, 工作量较大, 效率低下
[0006] 因此, 有必要设计一种新的方法, 实现无需开设多个程序接收不同格式文件的 导入, 效率高。
[0007] 申请内容
[0008] 本申请的目的在于克服现有技术的缺陷, 提供数据自动导入方法、 装置、 计算 机设备及存储介质。
[0009] 为实现上述目的, 本申请采用以下技术方案: 数据自动导入方法, 包括:
[0010] 获取待导入文件;
[0011] 对待导入文件进行扫描, 获取符合预设要求的单元格数据;
[0012] 将符合预设要求的单元格数据转换为具备目标格式的表达式;
[0013] 根据具备目标格式的表达式构建目标文件;
[0014] 导入目标文件。
[0015] 其进一步技术方案为: 所述获取待导入文件之前, 还包括:
[0016] 预设待导入文件单元格数据的转换关系。 [0017] 其进一步技术方案为: 所述对待导入文件进行扫描, 获取符合预设要求的单元 格数据, 包括:
[0018] 扫描待导入文件内具有转换关系的单元格, 获取具有转换关系的单元格, 以得 到符合预设要求的单元格数据。
[0019] 其进一步技术方案为: 所述将符合预设要求的单元格数据转换为具备目标格式 的表达式, 包括:
[0020] 根据转换关系获取符合预设要求的单元格数据的含义;
[0021] 整合满足预设要求的单元格数据与含义, 以得到具备目标格式的表达式。
[0022] 其进一步技术方案为: 所述根据具备目标格式的表达式构建目标文件, 包括: [0023] 依据具备目标格式的表达式构建若干个目标单元格对象;
[0024] 组合若干个目标单元格对象, 以得到满足目标文件。
[0025] 本申请还提供了数据自动导入装置, 包括:
[0026] 文件获取单元, 用于获取待导入文件;
[0027] 扫描单元, 用于对待导入文件进行扫描, 获取符合预设格式的单元格数据; [0028] 转换单元, 用于将符合预设要求的单元格数据转换为具备目标格式的表达式; [0029] 构建单元, 用于根据具备目标格式的表达式构建目标文件;
[0030] 导入单元, 用于导入目标文件。
[0031] 其进一步技术方案为: 所述装置还包括:
[0032] 预设单元, 用于预设待导入文件单元格数据的转换关系。
[0033] 其进一步技术方案为: 所述转换单元包括:
[0034] 含义获取子单元, 用于根据转换关系获取符合预设要求的单元格数据的含义; [0035] 整合子单元, 用于整合满足预设要求的单元格数据与含义, 以得到具备目标格 式的表达式。
[0036] 本申请还提供了一种计算机设备, 所述计算机设备包括存储器及处理器, 所述 存储器上存储有计算机程序, 所述处理器执行所述计算机程序时实现上述的数 据自动导入方法。
[0037] 本申请还提供了一种存储介质, 所述存储介质存储有计算机程序, 所述计算机 程序被处理器执行时可实现上述的数据自动导入方法。 [0038] 本申请与现有技术相比的有益效果是: 本申请通过设定转换关系, 对待导入文 件的单元格数据进行扫描, 形成具备目标格式的表达式, 将表达式转为目标文 件, 从而将待导入文件转为统一格式的目标文件, 可将不同格式表格内的数据 转换为统一格式并导入, 减少数据导入的工作量, 且无需开发多个程序进行不 同格式表格数据的导入, 方便快捷。
[0039] 下面结合附图和具体实施例对本申请作进一步描述。
[0040] 附图说明
[0041] 为了更清楚地说明本申请实施例技术方案, 下面将对实施例描述中所需要使用 的附图作简单地介绍, 显而易见地, 下面描述中的附图是本申请的一些实施例 , 对于本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以根据 这些附图获得其他的附图。
[0042] 图 1为本申请实施例提供的数据自动导入方法的应用场景示意图;
[0043] 图 2为本申请实施例提供的数据自动导入方法的流程示意图;
[0044] 图 3为本申请实施例提供的数据自动导入方法的子流程示意图;
[0045] 图 4为本申请实施例提供的数据自动导入方法的子流程示意图;
[0046] 图 5为本申请实施例提供的数据自动导入装置的示意性框图;
[0047] 图 6为本申请实施例提供的数据自动导入装置的转换单元的示意性框图;
[0048] 图 7为本申请实施例提供的数据自动导入装置的构建单元的示意性框图;
[0049] 图 8为本申请实施例提供的计算机设备的示意性框图。
[0050] 具体实施方式
[0051] 下面将结合本申请实施例中的附图, 对本申请实施例中的技术方案进行清楚、 完整地描述, 显然, 所描述的实施例是本申请一部分实施例, 而不是全部的实 施例。 基于本申请中的实施例, 本领域普通技术人员在没有做出创造性劳动前 提下所获得的所有其他实施例, 都属于本申请保护的范围。
[0052] 应当理解, 当在本说明书和所附权利要求书中使用时, 术语“包括”和“包含”指 示所描述特征、 整体、 步骤、 操作、 元素和 /或组件的存在, 但并不排除一个或 多个其它特征、 整体、 步骤、 操作、 元素、 组件和 /或其集合的存在或添加。
[0053] 还应当理解, 在此本申请说明书中所使用的术语仅仅是出于描述特定实施例的 目的而并不意在限制本申请。 如在本申请说明书和所附权利要求书中所使用的 那样, 除非上下文清楚地指明其它情况, 否则单数形式的“一”、 “一个”及“该”意 在包括复数形式。
[0054] 还应当进一步理解, 在本申请说明书和所附权利要求书中使用的术语“和 /或” 是指相关联列出的项中的一个或多个的任何组合以及所有可能组合, 并且包括 这些组合。
[0055] 请参阅图 1和图 2, 图 1为本申请实施例提供的数据自动导入方法的应用场景示 意图。 图 2为本申请实施例提供的数据自动导入方法的示意性流程图。 该数据自 动导入方法应用于被导入服务器 20中。 该被导入服务器 20可以为分布式服务平 台中的一台服务器, 该被导入服务器 20中部署有导入平台, 该被导入服务器 20 的导入平台接收导入服务器 10的待导入文件, 以进行文件导入。
[0056] 需要说明的是, 图 2中仅仅示意出一台导入服务器 10, 在实际操作过程中, 被 导入服务器 20可以对多个导入服务器 10中文件进行导入。
[0057] 图 2是本申请实施例提供的数据自动导入方法的流程示意图。 如图所示, 该方 法包括以下步骤 S110至 S160。
[0058] S110、 预设待导入文件单元格数据的转换关系。
[0059] 在本实施例中, 转换关系指的是指对待导入文件的每个单元格内数据所代表的 含义, 也就是待导入文件的单元格内的数据与其在被导入服务器 20内的目标文 件的映射关系。
[0060] 在本实施例中, 预先设定一个模板, 在对该模板进行扫描, 以形成转换关系, 并将该转换关系存储于服务器内, 一旦导入服务器传输数据到被导入服务器时 , 该数据会按照该转换关系形成目标文件。
[0061] 比如, 待导入文件的第二行第三列对应的单元格数据代表报关量, 则对应着被 导入服务器 20内目标文件的第三行第二列对应的单元格数据。 对待导入问价内 的单元格数据进行转换关系设定, 可使得被导入服务器 20无需开发多个程序进 行不同格式表格数据的导入, 只需要依据转换关系获取单元格数据便可转换为 可导入被导入服务器 20的目标文件对应单元格内, 方便快捷。
[0062] S120、 获取待导入文件。 [0063] 具体地, 从导入服务器 10内获取待导入文件, 每个导入服务器 10输出的待导入 文件的格式都是一致, 因此, 被导入服务器 20可以依据不同的导入服务器 10设 置不同的转换关系, 以便于一次接收多个不同格式的待导入文件的导入, 提高 导入效率。
[0064] S130、 对待导入文件进行扫描, 获取符合预设要求的单元格数据。
[0065] 在本实施例中, 符合预设要求的单元格数据是指带有转换关系的单元格内所填 写的数据。
[0066] 在本实施例中, 具体是扫描待导入文件内具有转换关系的单元格, 获取具有转 换关系的单元格, 以得到满足预设要求的单元格数据。 对于一些原先未设定转 换关系的单元格不进行扫描, 可以提高扫描的效率。
[0067] S140、 将符合预设要求的单元格数据转换为具备目标格式的表达式。
[0068] 具体地, 系统根据预设的规则, 将 excel数据文件转为系统数据, 在系统中进行 运算后保存, 以形成具备目标格式的表达式。
[0069] 在本实施例中, 目标格式是单元格数据与单元格数据的含义按照一定的表达方 式表达的格式, 比如: O.fl l.报关数量 =10的格式则为目标格式, 代表待导入文 件 0中的第一行第一列对应的单元格为报关数量, 对应的单元格数据为 10, 这一 目标格式并非用户填写形成的数据, 而是服务器根据用户传输过来的数据转换 而得。
[0070] 具体地, 在 Excel模板文件的第一行第一列填写 0.报关数量, 则代表在 Excel导 入文件中, 第一行第一列对应程序中数据结构为对象 0的报关数量, 即形成这样 一个对应关系 (1, 1) 一 0.报关数量, 当 Excel实际导入文件的第一行第一列中 数字是 10的时候, 导入程序将会把这个数字 10赋值给程序中的”0.报关数量”这个 数据结构, 然后进行后续的算法计算、 存储和传输; 而待导入文件中预设的对 应关系包括和普通数据结构的对应关系 (如 0.数量) 、 子对象数据结构的对应 关系 (如 0.货物 .单价) , 还包括列表型的数据关系, 比方说有不确定数量的多 个货物的列表, 每个货物中包括名称、 数量、 单价等。
[0071] 在待导入文件中进行预设, 程序扫描预设好的待导入文件后, 形成该待导入文 件的描述文件, 包括: [0072] 普通数据结构和单元格对应关系, 如 (1, 1) — 0.名称;
[0073] 子对象数据结构和单元格对应关系, 可以是多层子对象, 如(1,10)— 0.运输 工具.名称;
[0074] 列表型对应关系 (需要循环获取的) , 如 (4, 1) - (x,l)“合计”— 0.货物,
1— 0.货物 .名称, 表示从第 4行第 1列开始, 一直往后面循环, 直到某一行的第 一列为“合计”位置, 所有的数据都赋值给 0.货物对象, 其中, 每一行的第一列为 货物.名称, 而货物是一个列表类型。
[0075] 输入实际文件与待导入文件对应的数据文件后, 首先会判断该数据文件的模板 ID, 根据模板 ID调出该待导入文件的描述文件, 根据描述文件对实际数据文件 的内容进行扫描, 并且根据描述文件把该数据内容赋值给程序内部数据对象, 进行后续的算法计算、 存储和传输。
[0076] 在一实施例中, 如图 3所示, 上述的步骤 S140可包括步骤 S141~S142。
[0077] S141、 根据转换关系获取满足预设要求的单元格数据的含义;
[0078] 在本实施例中, 满足预设要求的单元格数据都具备有一个含义, 该含义可以从 转换关系中获取, 因此, 只需要从转换关系与满足预设要求的单元格数据的关 系即可得知满足预设要求的单元格数据的含义。
[0079] S142、 整合满足预设要求的单元格数据与含义, 以得到具备目标格式的表达式
[0080] 在本实施例中, 具体是按照待导入文件名称 .单元格位置 .含义 =单元格数据的格 式整合满足预设要求的单元格数据和含义, 以形成具备目标格式的表达式。
[0081] S150、 根据具备目标格式的表达式构建目标文件。
[0082] 在本实施例中, 目标文件是指按照被导入服务器 20所设定的表格填入待导入文 件对应单元格数据的文件。
[0083] 在一实施例中, 如图 4所示, 上述的步骤 S150可包括步骤 S151~S152。
[0084] S151、 依据具备目标格式的表达式构建若干个目标单元格对象。
[0085] S152、 组合若干个目标单元格对象, 以得到满足目标文件。
[0086] 在本实施例中, 目标单元格对象是指按照被导入服务器 20所设定的表格的单元 格数据。 具体地, 按照待导入文件名称 .单元格位置 .含义 =单元格数据的目标格 式, 构建含义=单元格数据的目标单元格对象, 并将若干个目标单元格对象组合 成表格, 以得到目标文件。
[0087] 于其他实施例, 若含义为计算字符, 则对单元格数据内的数据进行运算后, 在 形成含义=单元格数据的目标单元格对象, 其中, 该单元格数据则为运算后的数 据。
[0088] S160、 导入目标文件。
[0089] 在本实施例中, 将生成的目标文件导入至被导入服务器 20的数据库内。 将目标 文件所承载的数据构建成为信息系统需要的数据结构, 以方便相关的计算机程 序对这个数据结构进行算法计算、 保存和传输。
[0090] 上述的数据自动导入方法, 通过设定转换关系, 对待导入文件的单元格数据进 行扫描, 形成具备目标格式的表达式, 将表达式转为目标文件, 从而将待导入 文件转为统一格式的目标文件, 可将不同格式表格内的数据转换为统一格式并 导入, 减少数据导入的工作量, 且无需开发多个程序进行不同格式表格数据的 导入, 方便快捷。
[0091] 图 5是本申请实施例提供的一种数据自动导入装置 300的示意性框图。 如图 5所 示, 对应于以上数据自动导入方法, 本申请还提供一种数据自动导入装置 300。 该数据自动导入装置 300包括用于执行上述数据自动导入方法的单元, 该装置可 以被配置于服务器中。 具体地, 请参阅图 5 , 该数据自动导入装置 300包括: [0092] 文件获取单元 302, 用于获取待导入文件;
[0093] 扫描单元 303 , 用于对待导入文件进行扫描, 获取符合预设格式的单元格数据
[0094] 转换单元 304, 用于将符合预设要求的单元格数据转换为具备目标格式的表达 式;
[0095] 构建单元 305, 用于根据具备目标格式的表达式构建目标文件;
[0096] 导入单元 306, 用于导入目标文件。
[0097] 另外, 上述的装置还包括:
[0098] 预设单元 301, 用于预设待导入文件单元格数据的转换关系
[0099] 在一实施例中, 如图 6所示, 所述转换单元 304包括: [0100] 含义获取子单元 3041, 用于根据转换关系获取符合预设要求的单元格数据的含 义。
[0101] 整合子单元 3042, 用于整合满足预设要求的单元格数据与含义, 以得到具备目 标格式的表达式。
[0102] 在一实施例中, 如图 7所示, 所述构建单元 305包括:
[0103] 对象构建子单元 3051, 用于依据具备目标格式的表达式构建若干个目标单元格 对象;
[0104] 组合子单元 3052, 用于组合若干个目标单元格对象, 以得到满足目标文件。
[0105] 需要说明的是, 所属领域的技术人员可以清楚地了解到, 上述数据自动导入装 置 300和各单元的具体实现过程, 可以参考前述方法实施例中的相应描述, 为了 描述的方便和简洁, 在此不再赘述。
[0106] 上述数据自动导入装置 300可以实现为一种计算机程序的形式, 该计算机程序 可以在如图 8所示的计算机设备上运行。
[0107] 请参阅图 8 , 图 8是本申请实施例提供的一种计算机设备的示意性框图。 该计算 机设备 500是服务器, 该服务器可以是独立的服务器, 也可以是多个服务器组成 的服务器集群。
[0108] 参阅图 8 , 该计算机设备 500包括通过系统总线 501连接的处理器 502、 存储器和 网络接口 505, 其中, 存储器可以包括非易失性存储介质 503和内存储器 504。
[0109] 该非易失性存储介质 503可存储操作系统 5031和计算机程序 5032。 该计算机程 序 5032包括程序指令, 该程序指令被执行时, 可使得处理器 502执行一种数据自 动导入方法。
[0110] 该处理器 502用于提供计算和控制能力, 以支撑整个计算机设备 500的运行。
[0111] 该内存储器 504为非易失性存储介质 503中的计算机程序 5032的运行提供环境, 该计算机程序 5032被处理器 502执行时, 可使得处理器 502执行一种数据自动导 入方法。
[0112] 该网络接口 505用于与其它设备进行网络通信。 本领域技术人员可以理解, 图 8 中示出的结构, 仅仅是与本申请方案相关的部分结构的框图, 并不构成对本申 请方案所应用于其上的计算机设备 500的限定, 具体的计算机设备 500可以包括 比图中所示更多或更少的部件, 或者组合某些部件, 或者具有不同的部件布置
[0113] 其中, 所述处理器 502用于运行存储在存储器中的计算机程序 5032, 以实现如 下步骤:
[0114] 获取待导入文件;
[0115] 对待导入文件进行扫描, 获取符合预设要求的单元格数据;
[0116] 将符合预设要求的单元格数据转换为具备目标格式的表达式;
[0117] 根据具备目标格式的表达式构建目标文件;
[0118] 导入目标文件。
[0119] 在一实施例中, 处理器 502在实现所述获取待导入文件步骤之前, 还实现如下 步骤:
[0120] 预设待导入文件单元格数据的转换关系。
[0121] 在一实施例中, 处理器 502在实现所述对待导入文件进行扫描, 获取符合预设 要求的单元格数据步骤时, 具体实现如下步骤:
[0122] 扫描待导入文件内具有转换关系的单元格, 获取具有转换关系的单元格, 以得 到符合预设要求的单元格数据。
[0123] 在一实施例中, 处理器 502在实现所述将符合预设要求的单元格数据转换为具 备目标格式的表达式步骤时, 还实现如下步骤:
[0124] 根据转换关系获取符合预设要求的单元格数据的含义;
[0125] 整合满足预设要求的单元格数据与含义, 以得到具备目标格式的表达式。
[0126] 在一实施例中, 处理器 502在实现所述根据具备目标格式的表达式构建目标文 件步骤时, 还实现如下步骤:
[0127] 依据具备目标格式的表达式构建若干个目标单元格对象;
[0128] 组合若干个目标单元格对象, 以得到满足目标文件。
[0129] 应当理解, 在本申请实施例中, 处理器 502可以是中央处理单元 (Central
Processing Unit, CPU) , 该处理器 502还可以是其他通用处理器、 数字信号处理 器 (Digital Signal Processor, DSP)、 专用集成电路 (Application Specific Integrated Circuit, ASIC)、 现成可编程门阵列 (Field- Programmable Gate Array, FPGA)或 者其他可编程逻辑器件、 分立门或者晶体管逻辑器件、 分立硬件组件等。 其中 , 通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
[0130] 本领域普通技术人员可以理解的是实现上述实施例的方法中的全部或部分流程 , 是可以通过计算机程序来指令相关的硬件来完成。 该计算机程序包括程序指 令, 计算机程序可存储于一存储介质中, 该存储介质为计算机可读存储介质。 该程序指令被该计算机系统中的至少一个处理器执行, 以实现上述方法的实施 例的流程步骤。
[0131] 因此, 本申请还提供一种存储介质。 该存储介质可以为计算机可读存储介质。
该存储介质存储有计算机程序, 其中该计算机程序被处理器执行时使处理器执 行如下步骤:
[0132] 获取待导入文件;
[0133] 对待导入文件进行扫描, 获取符合预设要求的单元格数据;
[0134] 将符合预设要求的单元格数据转换为具备目标格式的表达式;
[0135] 根据具备目标格式的表达式构建目标文件;
[0136] 导入目标文件。
[0137] 在一实施例中, 所述处理器在执行所述计算机程序而实现所述获取待导入文件 步骤之前, 还实现如下步骤:
[0138] 预设待导入文件单元格数据的转换关系。
[0139] 在一实施例中, 所述处理器在执行所述计算机程序而实现所述对待导入文件进 行扫描, 获取符合预设要求的单元格数据步骤时, 具体实现如下步骤:
[0140] 扫描待导入文件内具有转换关系的单元格, 获取具有转换关系的单元格, 以得 到符合预设要求的单元格数据。
[0141] 在一实施例中, 所述处理器在执行所述计算机程序而实现所述将符合预设要求 的单元格数据转换为具备目标格式的表达式步骤时, 还实现如下步骤:
[0142] 根据转换关系获取符合预设要求的单元格数据的含义;
[0143] 整合满足预设要求的单元格数据与含义, 以得到具备目标格式的表达式。
[0144] 在一实施例中, 所述处理器在执行所述计算机程序而实现所述根据具备目标格 式的表达式构建目标文件步骤时, 还实现如下步骤: [0145] 依据具备目标格式的表达式构建若干个目标单元格对象;
[0146] 组合若干个目标单元格对象, 以得到满足目标文件。
[0147] 所述存储介质可以是 U盘、 移动硬盘、 只读存储器 (Read-Only Memory, ROM ) 、 磁碟或者光盘等各种可以存储程序代码的计算机可读存储介质。
[0148] 本领域普通技术人员可以意识到, 结合本文中所公开的实施例描述的各示例的 单元及算法步骤, 能够以电子硬件、 计算机软件或者二者的结合来实现, 为了 清楚地说明硬件和软件的可互换性, 在上述说明中已经按照功能一般性地描述 了各示例的组成及步骤。 这些功能究竟以硬件还是软件方式来执行, 取决于技 术方案的特定应用和设计约束条件。 专业技术人员可以对每个特定的应用来使 用不同方法来实现所描述的功能, 但是这种实现不应认为超出本申请的范围。
[0149] 在本申请所提供的几个实施例中, 应该理解到, 所揭露的装置和方法, 可以通 过其它的方式实现。 例如, 以上所描述的装置实施例仅仅是示意性的。 例如, 各个单元的划分, 仅仅为一种逻辑功能划分, 实际实现时可以有另外的划分方 式。 例如多个单元或组件可以结合或者可以集成到另一个系统, 或一些特征可 以忽略, 或不执行。
[0150] 本申请实施例方法中的步骤可以根据实际需要进行顺序调整、 合并和删减。 本 申请实施例装置中的单元可以根据实际需要进行合并、 划分和删减。 另外, 在 本申请各个实施例中的各功能单元可以集成在一个处理单元中, 也可以是各个 单元单独物理存在, 也可以是两个或两个以上单元集成在一个单元中。
[0151] 该集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时
, 可以存储在一个存储介质中。 基于这样的理解, 本申请的技术方案本质上或 者说对现有技术做出贡献的部分, 或者该技术方案的全部或部分可以以软件产 品的形式体现出来, 该计算机软件产品存储在一个存储介质中, 包括若干指令 用以使得一台计算机设备 (可以是个人计算机, 终端, 或者网络设备等) 执行 本申请各个实施例所述方法的全部或部分步骤。
[0152] 以上所述, 仅为本申请的具体实施方式, 但本申请的保护范围并不局限于此, 任何熟悉本技术领域的技术人员在本申请揭露的技术范围内, 可轻易想到各种 等效的修改或替换, 这些修改或替换都应涵盖在本申请的保护范围之内。 因此 , 本申请的保护范围应以权利要求的保护范围为准。 发明概述
技术问题
问题的解决方案
发明的有益效果

Claims

权利要求书
[权利要求 1] 数据自动导入方法, 其特征在于, 包括:
获取待导入文件;
对待导入文件进行扫描, 获取符合预设要求的单元格数据; 将符合预设要求的单元格数据转换为具备目标格式的表达式; 根据具备目标格式的表达式构建目标文件;
导入目标文件。
[权利要求 2] 根据权利要求 1所述的数据自动导入方法, 其特征在于, 所述获取待 导入文件之前, 还包括:
预设待导入文件单元格数据的转换关系。
[权利要求 3] 根据权利要求 2所述的数据自动导入方法, 其特征在于, 所述对待导 入文件进行扫描, 获取符合预设要求的单元格数据, 包括: 扫描待导入文件内具有转换关系的单元格, 获取具有转换关系的单元 格, 以得到符合预设要求的单元格数据。
[权利要求 4] 根据权利要求 3所述的数据自动导入方法, 其特征在于, 所述将符合 预设要求的单元格数据转换为具备目标格式的表达式, 包括: 根据转换关系获取符合预设要求的单元格数据的含义;
整合满足预设要求的单元格数据与含义, 以得到具备目标格式的表达 式。
[权利要求 5] 根据权利要求 4所述的数据自动导入方法, 其特征在于, 所述根据具 备目标格式的表达式构建目标文件, 包括:
依据具备目标格式的表达式构建若干个目标单元格对象;
组合若干个目标单元格对象, 以得到满足目标文件。
[权利要求 6] 数据自动导入装置, 其特征在于, 包括:
文件获取单元, 用于获取待导入文件;
扫描单元, 用于对待导入文件进行扫描, 获取符合预设格式的单元格 数据;
转换单元, 用于将符合预设要求的单元格数据转换为具备目标格式的 表达式;
构建单元, 用于根据具备目标格式的表达式构建目标文件; 导入单元, 用于导入目标文件。
[权利要求 7] 根据权利要求 6所述的数据自动导入装置, 其特征在于, 所述装置还 包括:
预设单元, 用于预设待导入文件单元格数据的转换关系。
[权利要求 8] 根据权利要求 7所述的数据自动导入装置, 其特征在于, 所述转换单 元包括:
含义获取子单元, 用于根据转换关系获取符合预设要求的单元格数据 的含义;
整合子单元, 用于整合满足预设要求的单元格数据与含义, 以得到具 备目标格式的表达式。
[权利要求 9] 一种计算机设备, 其特征在于, 所述计算机设备包括存储器及处理器 , 所述存储器上存储有计算机程序, 所述处理器执行所述计算机程序 时实现如权利要求 1至 5中任一项所述的数据自动导入方法。
[权利要求 10] 一种存储介质, 其特征在于, 所述存储介质存储有计算机程序, 所述 计算机程序被处理器执行时可实现如权利要求 1至 5中任一项所述的数 据自动导入方法。
PCT/CN2018/117860 2018-09-10 2018-11-28 数据自动导入方法、装置、计算机设备及存储介质 WO2020052090A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811048318.1 2018-09-10
CN201811048318.1A CN109241514A (zh) 2018-09-10 2018-09-10 数据自动导入方法、装置、计算机设备及存储介质

Publications (1)

Publication Number Publication Date
WO2020052090A1 true WO2020052090A1 (zh) 2020-03-19

Family

ID=65067675

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/117860 WO2020052090A1 (zh) 2018-09-10 2018-11-28 数据自动导入方法、装置、计算机设备及存储介质

Country Status (2)

Country Link
CN (1) CN109241514A (zh)
WO (1) WO2020052090A1 (zh)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111859596B (zh) * 2019-04-16 2024-02-02 萨姆森控制设备(中国)有限公司 控制阀选型方法和控制阀选型装置
CN110334018A (zh) * 2019-06-18 2019-10-15 梁俊杰 一种大数据导入方法以及相关设备
CN110377563A (zh) * 2019-07-23 2019-10-25 中国工商银行股份有限公司 文件处理方法和装置、以及电子设备和可读存储介质
CN110688826B (zh) * 2019-08-14 2023-07-25 中国平安人寿保险股份有限公司 无序行列转置方法、装置、计算机设备及存储介质
CN110991150B (zh) * 2019-12-16 2023-10-03 中国铁塔股份有限公司 一种数据格式转换方法、装置及报账系统
CN112035412A (zh) * 2020-08-31 2020-12-04 北京奇虎鸿腾科技有限公司 数据文件导入方法、设备、存储介质及装置
CN112733491A (zh) * 2020-12-31 2021-04-30 北京乐学帮网络技术有限公司 一种数据转化方法、装置、计算机设备和存储介质
CN112650477A (zh) * 2020-12-31 2021-04-13 深圳软牛科技有限公司 一种项目数据批量转移方法、装置及电子设备
CN112957742A (zh) * 2021-04-07 2021-06-15 北京格瑞拉科技有限公司 一种配置文件的处理方法及处理装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7002580B1 (en) * 2003-05-14 2006-02-21 At&T Corp Method and apparatus for automatically generating charts
CN103853806A (zh) * 2013-09-26 2014-06-11 深圳海联讯科技股份有限公司 一种表格转换方法及装置
CN106919618A (zh) * 2015-12-28 2017-07-04 航天信息股份有限公司 excel数据导入方法及系统
CN107122473A (zh) * 2017-05-02 2017-09-01 山东浪潮通软信息科技有限公司 一种Excel数据的导入导出方法及装置

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7415664B2 (en) * 2001-08-09 2008-08-19 International Business Machines Corporation System and method in a spreadsheet for exporting-importing the content of input cells from a scalable template instance to another
CA2862387C (en) * 2011-12-29 2023-03-14 Michael J. Chen Spreadsheet-based programming language adapted for report generation
US8914419B2 (en) * 2012-10-30 2014-12-16 International Business Machines Corporation Extracting semantic relationships from table structures in electronic documents
CN105868196A (zh) * 2015-01-21 2016-08-17 张家口沪东电子科技有限公司 一种服务器端工业数据报表生成方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7002580B1 (en) * 2003-05-14 2006-02-21 At&T Corp Method and apparatus for automatically generating charts
CN103853806A (zh) * 2013-09-26 2014-06-11 深圳海联讯科技股份有限公司 一种表格转换方法及装置
CN106919618A (zh) * 2015-12-28 2017-07-04 航天信息股份有限公司 excel数据导入方法及系统
CN107122473A (zh) * 2017-05-02 2017-09-01 山东浪潮通软信息科技有限公司 一种Excel数据的导入导出方法及装置

Also Published As

Publication number Publication date
CN109241514A (zh) 2019-01-18

Similar Documents

Publication Publication Date Title
WO2020052090A1 (zh) 数据自动导入方法、装置、计算机设备及存储介质
WO2020186783A1 (zh) 数据导入方法、装置、计算机设备和存储介质
WO2019200756A1 (zh) 数据审批方法、装置、计算机设备和存储介质
US8949258B2 (en) Techniques to manage file conversions
WO2021036810A1 (zh) 证据的验证方法、系统、装置、设备及可读存储介质
CN105808365A (zh) His接口调用方法及his接口配置方法
US20210389976A1 (en) Techniques to facilitate a migration process to cloud storage
CA2922129A1 (en) Automatically generating certification documents
CN110830604A (zh) Dns调度方法、装置
WO2021151294A1 (zh) 一种文档转码方法、装置、调度服务器和存储介质
KR102245358B1 (ko) 네트워크 리소스 요청을 제로 레이팅 네트워크 요청으로 변환하는 기술
US20110016181A1 (en) Reducing Errors in Sending File Attachments
CN112422450A (zh) 计算机设备、服务请求的流量控制方法及装置
CN105824926A (zh) 一种动态选择调用外部系统接口的方法
CN114936254A (zh) 云链融合机制下的食品安全大数据共享管理方法及系统
CN114090672A (zh) 一种业务数据导入导出方法、系统、计算机设备及介质
CN112732468A (zh) 数据处理方法、数据交互系统及计算设备
WO2024016957A1 (zh) 数据处理方法、数据核算系统、设备和介质
JP2022552435A (ja) モノのインターネットにおいてサブスクリプションデータをプッシュするための方法および装置、並びにそれらのデバイスおよび記憶媒体
WO2023207529A1 (zh) 数据处理方法、装置及设备、介质、产品
US20130282655A1 (en) Query-oriented message characterization
US9733994B2 (en) Method and system for communicating information between a mobile device and an enterprise system
CN109814916B (zh) 一种ivr流程的配置方法、装置、存储介质和服务器
CN110827167A (zh) 面向协同制造的产品设计工艺性知识共享方法及装置
CN116069725A (zh) 文件迁移方法、装置、设备、介质和程序产品

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18933139

Country of ref document: EP

Kind code of ref document: A1