CN112860773A - Data transmission method and device - Google Patents

Data transmission method and device Download PDF

Info

Publication number
CN112860773A
CN112860773A CN201911191690.2A CN201911191690A CN112860773A CN 112860773 A CN112860773 A CN 112860773A CN 201911191690 A CN201911191690 A CN 201911191690A CN 112860773 A CN112860773 A CN 112860773A
Authority
CN
China
Prior art keywords
target data
data
preset
database
data model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911191690.2A
Other languages
Chinese (zh)
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.)
Lianyi Software Co ltd
Original Assignee
Lianyi 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 Lianyi Software Co ltd filed Critical Lianyi Software Co ltd
Priority to CN201911191690.2A priority Critical patent/CN112860773A/en
Publication of CN112860773A publication Critical patent/CN112860773A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24564Applying rules; Deductive queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/254Extract, transform and load [ETL] procedures, e.g. ETL data flows in data warehouses

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure provides a data transmission method and device, relates to the technical field of electronic information, and can solve the problem of poor compatibility of a database and an application system. The specific technical scheme is as follows: after the target data are obtained, the target data are verified through the target data model, and after the target data are verified, the target data are sent to the shared database, and a storage result is fed back to the application system. The present disclosure is for data transmission.

Description

Data transmission method and device
Technical Field
The present disclosure relates to the field of electronic information technologies, and in particular, to a data transmission method and apparatus.
Background
In order to solve the purpose of data validity check bits in the data sharing process and provide the functions of data standard preparation, release, maintenance and other services, data conversion and check are needed. In the prior art, data conversion and verification are realized by formulating a uniform data interface rule and a data structure standard and issuing the uniform standard to a corresponding database and an application system. According to the data interface rule and the data structure standard, the application system can program data and provide the data, and simultaneously develop a data interface for the shared database to finish synchronous data storage.
However, in order to implement verification during data conversion in the above processing process, the design of the database needs to be completed at the initial stage of software design, and this design results in poor expansibility of the strongly coupled application system during data maintenance; and the database has poor compatibility when compatible with each application system participating in data sharing.
Disclosure of Invention
The embodiment of the disclosure provides a data transmission method and device, which can solve the problem of poor compatibility between a database and an application system. The technical scheme is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a data transmission method, including:
acquiring target data, wherein the target data is data acquired according to an application system;
according to a preset rule, verifying the target data;
and when the target data passes the verification, sending the target data to a target database.
In one embodiment, the method further comprises:
and when the target data is not verified, generating failure information and sending the failure information to the application system, wherein the failure information is used for including a verification result of the target data.
In one embodiment, the verifying the target data according to the preset rule in the method includes:
acquiring a preset data model;
analyzing the target data according to the preset data model to obtain a target data model corresponding to the target data;
and according to a preset rule, obtaining a comparison result of the target data model and the preset data model, and generating a target data verification result.
In one embodiment, the method for obtaining the preset data model includes:
obtaining at least one database, the at least one data comprising a target database;
analyzing the database, and determining field constraint information and a check rule corresponding to the database;
and generating a preset data model according to the field constraint rule and the check rule.
In one embodiment, the method further comprises:
sending the preset data model and the database corresponding to the preset data model to the terminal equipment;
acquiring a user operation instruction through the terminal equipment, wherein the user operation instruction is used for indicating modification of field constraint information and a verification rule in the preset data model;
and modifying the preset data model according to the user operation instruction.
In one embodiment, the method further comprises:
according to the data transmission method provided by the embodiment of the disclosure, after the target data is acquired, the target data is verified through the target data model, and after the target data is verified, the target data is sent to the shared database, and the storage result is fed back to the application system.
The method adopts a flow mode to be connected between the application system and the shared database in a butt joint mode, and avoids the pollution of invalid data to the shared database by verifying the validity and integrity of data uploaded by the application system; meanwhile, the method can be used as plug-in system docking to reduce the coupling degree between application systems, can provide personalized function expansion to improve flexibility, and improves the compatibility between the database and the application systems.
According to a second aspect of the embodiments of the present disclosure, there is provided a data transmission apparatus including:
a receiver, a processor and a transmitter,
the processor is respectively connected with the receiver and the transmitter;
the receiver is used for acquiring target data, and the target data is data acquired according to an application system;
the processor is used for verifying the target data according to a preset rule;
the transmitter is used for transmitting the target data to the target database after the target data passes the verification.
In one embodiment, the processor in the apparatus is further configured to,
when the target data is not verified, generating failure information,
the transmitter is further configured to transmit, to the application system, the failure information including a verification result of the target data.
In one embodiment, the processor in the apparatus is further configured to,
acquiring a preset data model;
analyzing the target data according to the preset data model to obtain a target data model corresponding to the target data;
and according to a preset rule, obtaining a comparison result of the target data model and the preset data model, and generating a target data verification result.
In one embodiment, the processor in the apparatus is further configured to,
obtaining at least one database, the at least one data comprising a target database;
analyzing the database, and determining field constraint information and a check rule corresponding to the database;
and generating a preset data model according to the field constraint rule and the check rule.
In one embodiment, the processor in the apparatus is further configured to,
sending the preset data model and the database corresponding to the preset data model to the terminal equipment;
acquiring a user operation instruction through the terminal equipment, wherein the user operation instruction is used for indicating modification of field constraint information and a check rule in the preset data model;
and modifying the preset data model according to the user operation instruction.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a flowchart of a data transmission method provided by an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of a data transmission device according to an embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Example one
An embodiment of the present disclosure provides a data transmission method, as shown in fig. 1, the data transmission method includes the following steps:
101. target data is acquired.
The target data is obtained according to the application system, and further the application system can process the data according to a preset structure and then transmit the processed data to the data processing system. The application data can be divided into several categories, including application content data, application cache data, application configuration data, application data exhaustion, application platform data, system level application data, and the like.
102. Verifying the target data according to a preset rule;
in an optional embodiment, the method provided by the present disclosure further includes creating a preset data model, which may specifically include:
obtaining at least one database, the at least one data comprising a target database;
analyzing the database, and determining field constraint information and a check rule corresponding to the database;
and generating a preset data model according to the field constraint rule and the check rule.
In a specific application, the creation of the preset data model may be performed by: and after the connection of the shared database is established, acquiring a data table of the shared database. After the data table is analyzed, acquiring relevant information of metadata in the data table, and extracting identification information and field constraint information corresponding to the fields according to the relevant information of the metadata, wherein if the identification information of the fields is as follows: and the A field has field constraint information that the value range of the A field is between 0 and 9. And generating an initialization model according to the field information, the field constraint information and the mapping relation between the field information and the field constraint information, wherein the initialization model can be an XML template file. And analyzing the initialization model and displaying the analyzed initialization model on an operation interface, wherein a user can generate a preset data model on the operation interface through terminal equipment according to the initialization model and editable model parameters. The preset data model may be an XSD template file.
In an optional embodiment, in the method provided by the present disclosure, the target data is verified according to a preset rule, and the steps may include:
acquiring a preset data model;
analyzing the target data according to the preset data model to obtain a target data model corresponding to the target data;
and according to a preset rule, obtaining a comparison result of the target data model and the preset data model, and generating a target data verification result.
In an optional embodiment, when the method provided by the disclosure receives the target data, the target data can be converted into the target data model in the XML format defined by the method through the data converter, and a format error is returned when the data conversion fails; and generating a verification result by judging whether the preset data model is matched with the target data model.
For example: in the target data, in the order of,
firstly, extracting field information matched with a data model according to a preset data model in target data so as to convert the target data into the target data model, wherein the target data model comprises the following steps: a first field, a type of the first field, and a value of the first field; and then, checking the target data model according to a preset data model:
whether the first field is allowed to exist is checked, if the first field is allowed, whether the type of the first field meets the type in the target data model is further judged, and when the type of the first field meets the requirement, whether the numerical value of the first field meets the numerical value interval in the target data model is further judged.
Specific examples are listed here to illustrate the data verification process:
step one, acquiring database information:
when the preset model is generated, the method provided by the disclosure includes generating a target interface, wherein the target interface is used for indicating to input database information, and the database information includes address information and identification information of a shared database, such as an IP (Internet protocol), a port and a database name of the shared database;
the user can acquire the display information through the terminal equipment, so that the IP, the port and the database name of the shared database are filled in through the input interface information.
Step two, initializing a data model:
according to the method, after the information of the target database is obtained, the initialized data model is generated according to the structure and the preset rule of the target database.
Furthermore, an XML template of the initialization model is generated at the same time, the data model is displayed on an operation interface, and a user can obtain the display content of the operation interface through terminal equipment.
And step three, setting a preset data model.
According to the method, a data model is initialized, a data model is displayed on an operation interface, constraint and check rules (regular expressions: including presetting and self-defining) of fields in the model are set, and meanwhile, a standardized model is generated in a background. The constraint information of the field may include information such as whether the field may be empty, whether the field is unique, a length of the field, and a type of the field, and the check rule may include a system preset rule, a database preset rule, and a custom rule generated according to a user setting.
And step four, mapping the configuration field.
Further, in order to further optimize the preset data model, the default standardized model of the method provided by the present disclosure is consistent with the data field in the application system, and when the default standardized model and the data field are not matched and need to be modified, the method provided by the present disclosure can display the model mapping on the operation interface, so that the user can obtain the model mapping through the terminal device: namely, the field mapping relation, so that the field mapping relation between the preset data model and the data can be configured in the 'model mapping' of the operation interface.
And fifthly, carrying out data verification.
According to the method, after the target data of the application system are obtained, the target data are converted into the target data model according to the preset data model, analysis is carried out through an algorithm, and the verification result is generated according to the matching degree of the target data model and the preset data model.
And step six, outputting a checking result.
When the verification result shows that the verification fails, the method provided by the disclosure generates prompt information, wherein the prompt information is used for prompting specific information in the target data which does not conform to the preset data model, and if the value of a certain field in the data exceeds the value range of the preset data model.
103. And when the target data passes the verification, sending the target data to a target database.
The target database may be a shared database.
After the target data are sent to the target database, the method provided by the disclosure can also generate success information and send the success information to the application system, wherein the success information is used for including the verification result of the target data.
And when the target data fails to pass the verification, generating failure information, and sending the failure information to an application system, wherein the failure information is used for including a verification result of the target data, and the verification result includes which information in the information of the field corresponding to the target data does not accord with the field constraint rule in the preset data model and corresponding prompt information.
The method provided by the present disclosure further includes modifying the preset data model, specifically including:
sending the preset data model and the database corresponding to the preset data model to the terminal equipment;
and acquiring a user operation instruction through the terminal equipment, and modifying the preset data model according to the user operation instruction.
The method provided by the disclosure can also be used for issuing the unified standard by formulating the unified data interface rule and the data structure standard, coordinating the application system data manufacturer to provide data according to the interface rule programming, and developing the data interface for the shared database to finish the synchronous data storage.
According to the data transmission method provided by the embodiment of the disclosure, after the target data is acquired, the target data is verified through the target data model, and after the target data is verified, the target data is sent to the shared database, and the storage result is fed back to the application system.
The method adopts a flow mode to be connected between the application system and the shared database in a butt joint mode, and avoids the pollution of invalid data to the shared database by verifying the validity and integrity of data uploaded by the application system; meanwhile, the method can be used as plug-in system docking to reduce the coupling degree between application systems, can provide personalized function expansion to improve flexibility, and improves the compatibility between the database and the application systems.
Example two
Based on the data transmission method described in the embodiment corresponding to fig. 1, the following is an embodiment of the apparatus of the present disclosure, which may be used to execute the embodiment of the method of the present disclosure.
The embodiment of the present disclosure provides a data transmission apparatus, as shown in fig. 2, the data transmission apparatus 50 includes:
a data transmission apparatus, comprising: a receiver 201, a processor 202 and a transmitter 203,
the processor 202 is connected to the receiver 201 and the transmitter 203 respectively;
the receiver 201 is configured to obtain target data, where the target data is obtained according to an application system;
the processor 202 is configured to verify the target data according to a preset rule;
the transmitter 203 is configured to transmit the target data to the target database after the target data passes the verification.
In one embodiment, the processor 201 in the apparatus 20 is further configured to,
when the target data is not verified, generating failure information,
the transmitter 203 is further configured to transmit, to the application system, the failure information including a verification result of the target data.
In one embodiment, the processor 201 in the apparatus 20 is further configured to,
acquiring a preset data model;
analyzing the target data according to the preset data model to obtain a target data model corresponding to the target data;
and according to a preset rule, obtaining a comparison result of the target data model and the preset data model, and generating a target data verification result.
In one embodiment, the processor 201 in the apparatus 20 is further configured to,
obtaining at least one database, the at least one data comprising a target database;
analyzing the database, and determining field constraint information and a check rule corresponding to the database;
and generating a preset data model according to the field constraint rule and the check rule.
In one embodiment, the processor 201 in the apparatus 20 is further configured to,
sending the preset data model and the database corresponding to the preset data model to the terminal equipment;
acquiring a user operation instruction through the terminal equipment, wherein the user operation instruction is used for indicating modification of field constraint information and a check rule in the preset data model;
and modifying the preset data model according to the user operation instruction.
According to the data transmission device provided by the embodiment of the disclosure, after the target data is acquired, the target data is verified through the target data model, and after the target data is verified, the target data is sent to the shared database, and the storage result is fed back to the application system.
The device is in butt joint between the application system and the shared database in a flow mode, and by verifying the validity and integrity of data uploaded by the application system, the pollution of invalid data to the shared database is avoided; meanwhile, the device can also be used as a plug-in device for butt joint to reduce the coupling degree between application systems, can provide personalized function expansion to improve flexibility, and improves the compatibility between the database and the application systems.
Based on the data transmission method described in the embodiment corresponding to fig. 1, an embodiment of the present disclosure further provides a computer-readable storage medium, for example, the non-transitory computer-readable storage medium may be a Read Only Memory (ROM), a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like. The storage medium stores computer instructions for executing the data transmission method described in the embodiment corresponding to fig. 1, which is not described herein again.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (10)

1. A method of data transmission, the method comprising:
acquiring target data, wherein the target data is data acquired according to an application system;
according to a preset rule, verifying the target data;
and when the target data passes the verification, sending the target data to a target database.
2. The method of claim 1, further comprising:
and when the target data is not verified, generating failure information and sending the failure information to an application system, wherein the failure information is used for including a verification result of the target data.
3. The method according to claim 1, wherein the verifying the target data according to a preset rule comprises:
acquiring a preset data model;
analyzing the target data according to the preset data model to obtain a target data model corresponding to the target data;
and according to a preset rule, obtaining a comparison result of the target data model and the preset data model, and generating a target data verification result.
4. The method of claim 3, wherein the obtaining the predetermined data model comprises:
obtaining at least one database, the at least one data comprising the target database;
analyzing the database, and determining field constraint information and a check rule corresponding to the database;
and generating a preset data model according to the field constraint rule and the check rule.
5. The method of claim 4, further comprising:
sending the preset data model and a database corresponding to the preset data model to terminal equipment;
acquiring a user operation instruction through the terminal equipment, wherein the user operation instruction is used for indicating modification of field constraint information and a check rule in the preset data model;
and modifying the preset data model according to the user operation instruction.
6. A data transmission apparatus, comprising: a receiver, a processor and a transmitter,
the processor is respectively connected with the receiver and the transmitter;
the receiver is used for acquiring target data, and the target data is data acquired according to an application system;
the processor is used for verifying the target data according to a preset rule;
and the transmitter is used for transmitting the target data to a target database after the target data passes the verification.
7. The apparatus of claim 6, wherein the processor is further configured to,
generating failure information when the target data is not verified,
the transmitter is further configured to transmit the failure information to an application system, where the failure information is used to include a verification result of the target data.
8. The apparatus of claim 6, wherein the processor is further configured to,
acquiring a preset data model;
analyzing the target data according to the preset data model to obtain a target data model corresponding to the target data;
and according to a preset rule, obtaining a comparison result of the target data model and the preset data model, and generating a target data verification result.
9. The apparatus of claim 8, wherein the processor is further configured to,
obtaining at least one database, the at least one data comprising a target database;
analyzing the database, and determining field constraint information and a check rule corresponding to the database;
and generating a preset data model according to the field constraint rule and the check rule.
10. The apparatus of claim 6, wherein the processor is further configured to,
sending the preset data model and the database corresponding to the preset data model to a terminal device;
acquiring a user operation instruction through the terminal equipment, wherein the user operation instruction is used for indicating modification of field constraint information and a check rule in the preset data model;
and modifying the preset data model according to the user operation instruction.
CN201911191690.2A 2019-11-28 2019-11-28 Data transmission method and device Pending CN112860773A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911191690.2A CN112860773A (en) 2019-11-28 2019-11-28 Data transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911191690.2A CN112860773A (en) 2019-11-28 2019-11-28 Data transmission method and device

Publications (1)

Publication Number Publication Date
CN112860773A true CN112860773A (en) 2021-05-28

Family

ID=75995589

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911191690.2A Pending CN112860773A (en) 2019-11-28 2019-11-28 Data transmission method and device

Country Status (1)

Country Link
CN (1) CN112860773A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130232106A1 (en) * 2012-03-01 2013-09-05 Cover-All Technologies, Inc. System and Method For Applying An Update To A Database
CN106559189A (en) * 2017-01-16 2017-04-05 北京邮电大学 It is a kind of based on the data transmission method of HARQ, apparatus and system
CN108829888A (en) * 2018-06-28 2018-11-16 郑州悉知信息科技股份有限公司 A kind of non-relational database document management method and device
CN109918403A (en) * 2019-02-02 2019-06-21 中国银行股份有限公司 Data verification method, device, computer equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130232106A1 (en) * 2012-03-01 2013-09-05 Cover-All Technologies, Inc. System and Method For Applying An Update To A Database
CN106559189A (en) * 2017-01-16 2017-04-05 北京邮电大学 It is a kind of based on the data transmission method of HARQ, apparatus and system
CN108829888A (en) * 2018-06-28 2018-11-16 郑州悉知信息科技股份有限公司 A kind of non-relational database document management method and device
CN109918403A (en) * 2019-02-02 2019-06-21 中国银行股份有限公司 Data verification method, device, computer equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
邝苏鹏: "国网业务与财务协同平台数据交换系统设计与实现", 《中国优秀硕士学位论文全文数据库》 *

Similar Documents

Publication Publication Date Title
CN106776349B (en) Method and system for setting interface detection flow
CN109726108B (en) Front-end code testing method, device, system and medium based on analog data
CN107145784B (en) Vulnerability scanning method and device and computer readable medium
WO2022111036A1 (en) System and method for acquiring vehicle information, and vehicle
CN112396419A (en) Method, device and equipment for generating check rule and storage medium
CN107291608A (en) The generation method of test script, subscription/register method of interface and device
CN109658542B (en) Diagnostic parameter data verification method, diagnostic parameter data verification device, vehicle diagnostic equipment and storage medium
CN112860773A (en) Data transmission method and device
CN111726260B (en) Method, device and system for testing format conversion of network request reply information
CN116996601A (en) Message format conversion method and device, electronic equipment and storage medium
KR101748615B1 (en) Mobile simple payment support device based on the connection information and operating method thereof
CN106933763A (en) Data processing method and device
WO2022246753A1 (en) Device registration method and apparatus, electronic device, and storage medium
CN114996539B (en) Information processing method, device and equipment
CN110377463A (en) Interface test method, device, terminal and computer readable storage medium
CN102109818B (en) Adaptive command processing method and system based on XCP (universal measurement and calibration protocol)
CN105530288A (en) Data interaction method
CN110597712A (en) Component attribute checking method and device, terminal and storage medium
KR101656416B1 (en) Apparatus and method of generating message automatically in real-time data transmission processing system
CN113589700B (en) Method and system for checking intelligent household zigbee request
CN110874361A (en) Data processing method, data processing device, storage medium and computer equipment
KR101927519B1 (en) Apparatus for verifying circuit of vehicle and method thereof, computer program
CN115086436B (en) inter-API parameter verification method and device, computer equipment and storage medium
CN113704320B (en) Data processing method, device, electronic equipment and storage medium
CN108388546B (en) Online signing method, device and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210528