WO2021189826A1 - 报文生成方法、装置、电子设备及计算机可读存储介质 - Google Patents

报文生成方法、装置、电子设备及计算机可读存储介质 Download PDF

Info

Publication number
WO2021189826A1
WO2021189826A1 PCT/CN2020/121529 CN2020121529W WO2021189826A1 WO 2021189826 A1 WO2021189826 A1 WO 2021189826A1 CN 2020121529 W CN2020121529 W CN 2020121529W WO 2021189826 A1 WO2021189826 A1 WO 2021189826A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
data
field
configuration
configuration data
Prior art date
Application number
PCT/CN2020/121529
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 WO2021189826A1 publication Critical patent/WO2021189826A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/951Indexing; Web crawling techniques
    • 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/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/24Negotiation of communication capabilities

Definitions

  • This application relates to the field of data processing technology, and in particular to a method, device, electronic device, and computer-readable storage medium for generating a message.
  • the inventor realizes that when reporting business data, it is customized and developed according to the requirements of each financial office. For different products, different business systems need to query business data to generate messages. For example, using oracle to store data, through pkg storage process Querying and processing business data results in low efficiency in obtaining business data, thereby reducing the efficiency of generating business messages. Furthermore, in the process of generating business messages, the regulatory agencies in different regions have different reporting content, reporting scope, message format, message encoding, reporting frequency, reporting method, and message size limitation. Personnel configuring the acquired business data one by one also greatly reduces the efficiency of business message generation. Therefore, how to improve the efficiency of personalized business message generation has become an urgent problem to be solved.
  • This application provides a message generation method, including:
  • Acquiring demand data extracting message configuration data from the demand data using a configuration data extraction model, the message configuration data including message field name configuration data and message rule configuration data;
  • the field to be reported is written into the message data configuration table to obtain a service message.
  • the present application also provides a message generating device, which includes:
  • the message configuration data extraction module is used to obtain demand data, and extract message configuration data from the demand data using a configuration data extraction model, where the message configuration data includes message field name configuration data and message rule configuration data;
  • a message data configuration table generating module which is used to serialize the message configuration data to generate a message data configuration table
  • a message field generating module is used to obtain service data to be released from a pre-built blockchain node, and divide the service data to be released into several message fields according to the configuration data of the message field name;
  • a message field configuration module configured to configure the several message fields according to the message rule configuration data to obtain the fields to be reported;
  • a business message generating module is used to write the fields to be reported into the message data configuration table to obtain a business message.
  • This application also provides an electronic device, which includes:
  • Memory storing at least one instruction
  • the processor executes the instructions stored in the memory to implement the following steps:
  • Acquiring demand data extracting message configuration data from the demand data using a configuration data extraction model, the message configuration data including message field name configuration data and message rule configuration data;
  • the field to be reported is written into the message data configuration table to obtain a service message.
  • This application also provides a computer-readable storage medium, including a storage data area and a storage program area, the storage data area stores created data, and the storage program area stores a computer program; wherein the computer program is executed by a processor to achieve the following step:
  • Acquiring demand data extracting message configuration data from the demand data using a configuration data extraction model, the message configuration data including message field name configuration data and message rule configuration data;
  • the field to be reported is written into the message data configuration table to obtain a service message.
  • FIG. 1 is a schematic flowchart of a message generation method provided by an embodiment of this application.
  • FIG. 2 is a schematic diagram of modules of a message generating device provided by an embodiment of the application.
  • FIG. 3 is a schematic diagram of the internal structure of an electronic device for implementing a message generation method provided by an embodiment of the application;
  • the execution subject of the message generation method provided in the embodiment of the present application includes, but is not limited to, at least one of the electronic devices that can be configured to execute the method provided in the embodiment of the present application, such as a server and a terminal.
  • the message generation method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform.
  • the server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc.
  • This application provides a message generation method.
  • FIG. 1 it is a schematic flowchart of a message generation method provided by an embodiment of this application.
  • the method can be executed by a device, and the device can be implemented by software and/or hardware.
  • the message generation method includes:
  • the message configuration data includes message field name configuration data and message rule configuration data.
  • a python sentence with a data capture function may be used to obtain required data from the user terminal.
  • the demand data is personalized demand information on the format, formula form, and data type of the finally generated message.
  • the personalized demand information of one or more financial regulatory agencies on the message format, formula form, and data type is the demand data.
  • the extraction of message configuration data from the demand data by using the configuration data extraction model includes:
  • the embodiment of the present application uses the following loss function to calculate the error value of the training configuration data and the standard configuration data
  • Y represents the standard configuration data
  • N represents the number of training configuration data
  • is the preset error coefficient
  • the message configuration data includes message field name configuration data and message rule configuration data, wherein the message field name configuration data indicates the field name to be reported, and the message rule configuration data indicates different field names.
  • Corresponding data ie field value
  • the embodiment of the present application extracts the message configuration data from the demand data, which is beneficial to reduce invalid data, and then accurately obtain the data related to the message content.
  • the message configuration data is serialized by constructing a serialization interface, using the constructed serialization interface to sort the message configuration data, and saving the sorting result in the form of a data table. Obtain the message data configuration table.
  • performing serialization processing on the message configuration data to generate a message data configuration table includes: extracting sequence characteristics of reported fields from the demand data; performing processing on the message configuration data according to the sequence characteristics Sort, save the result of the sort to a newly created data table, and generate a message data configuration table.
  • serialization processing of the message configuration data includes:
  • serialization interface to serialize the message configuration data.
  • the serialization processing function includes but is not limited to the writeExternal() function and the randomExternal() function.
  • writeExternal() function and randomExternal() function are java functions used to sort the message configuration data.
  • linear combination includes addition or subtraction.
  • the embodiment of the present application linearly combines the multiple serialization processing functions into a constructor, and then uses the Externalible method in java to construct the constructor as a serialization interface .
  • the Externalible method is used to aggregate java functions to obtain a serialized interface.
  • different java functions can be used in combination at the same time through the serialization interface, so that one interface can use multiple functions at the same time, and the efficiency of serialization processing is improved.
  • the message configuration data is serialized to generate a message data configuration table, which can improve the efficiency of reading and writing data into the message data configuration table.
  • the obtaining the business data to be released from the pre-built blockchain nodes includes:
  • the execution of the call statement obtains the business data to be released from the pre-built blockchain node.
  • the storage environment of the business data to be released can be determined according to the environment where the pre-built blockchain node is located.
  • the service data to be released is divided into several message fields according to the configuration data of the message field names, and the fields required to generate the message are directly and quickly obtained, without the need to search for the corresponding fields in the service data to be released one by one before proceeding. Configuration to improve the efficiency of message generation.
  • the configuration of the several message fields according to the message rule configuration data to obtain the fields to be reported includes:
  • the several message fields are configured according to the field configuration rule to obtain the fields to be reported.
  • the determining the field types of the several message fields includes:
  • the difference value is less than a preset difference threshold, it is determined that the field type of the target message field is a preset standard type.
  • the calculating the difference value between the field category of the target message field and the preset standard category includes:
  • L(A, B) is the difference value
  • A is the field type of the target message field
  • B is the standard type.
  • the configuring the several message fields according to the field configuration rule includes: according to the data format rule, the field length rule, the date format rule, the desensitization rule, the reserved decimal place rule, and the carry bit included in the field configuration rule.
  • Configuration rules such as rules, calculation formula rules, and value method rules, process the several message fields so that the several message fields conform to the field configuration rules.
  • the data format rule is HTML format
  • a number of message fields will be processed as HTML format data
  • the rule for keeping decimal places is to keep three digits after the decimal point
  • the message fields with decimals in several message fields will be processed To retain three digits after the decimal point.
  • the fileinputstream class of java is used to write the fields to be reported into the message data configuration table.
  • the fields to be reported in different field categories are written into the message data configuration table and the fields are In the corresponding field of the category.
  • the writing the field to be reported into the message data configuration table includes:
  • This embodiment of the application converts the field to be reported into the target report data in json format. Since the data in json format can be read and written quickly, by converting the field to be reported into the target report data in json format, the writing of the target report data in the json format can be improved. The efficiency of the table, thereby improving the efficiency of message generation.
  • the method further includes:
  • a python statement with a data capture function can be used to obtain the push queue task from a database for storing the push queue task.
  • the push queue tasks stored in the specific database may be preset, and the push queue may include push trigger conditions.
  • the embodiment of the application determines the push sequence according to the push queue task, and pushes the business message to the user according to the push sequence, which can ensure the orderliness of the push of business messages and avoid data congestion during the push of business messages. There is a problem of reducing the efficiency of the push.
  • the embodiment of the application obtains the service data to be released from the pre-built blockchain nodes, and does not need to separately query the service data in different service systems, which improves the efficiency of service data acquisition and helps shorten the time for message generation; at the same time, it will obtain
  • the received business data to be published extracts the message field name configuration data from the demand data for data division, and configures several message fields obtained after division according to the message rule configuration data, so that the fields to be reported that meet the requirements can be quickly obtained. Further, the fields to be reported that meet the requirements are written into the message data configuration table, which achieves the purpose of quickly and efficiently generating messages that meet individual requirements. Therefore, the message generation method proposed in this application can improve the efficiency of personalized message generation.
  • FIG. 2 it is a schematic diagram of the modules of the message generating device of the present application.
  • the message generating apparatus 100 described in this application can be installed in an electronic device.
  • the message generating device may include a message configuration data extraction module 101, a message data configuration table generation module 102, a message field generation module 103, a message field configuration module 104, and a business message generation module 105 .
  • the module described in the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can complete fixed functions, and are stored in the memory of the electronic device.
  • each module/unit is as follows:
  • the message configuration data extraction module 101 is configured to obtain demand data, and extract message configuration data from the demand data using a configuration data extraction model.
  • the message configuration data includes message field name configuration data and message rules Configuration Data;
  • the message data configuration table generating module 102 is configured to serialize the message configuration data to generate a message data configuration table
  • the message field generation module 103 is configured to obtain service data to be published from a pre-built blockchain node, and divide the service data to be published into several message fields according to the configuration data of the message field names;
  • the message field configuration module 104 is configured to configure the several message fields according to the message rule configuration data to obtain the fields to be reported; the service message generation module 105 is configured to send the messages to be reported The fields are written into the message data configuration table to obtain a service message.
  • each module of the apparatus for extracting and generating text content in the image is as follows:
  • the message configuration data extraction module 101 is configured to obtain demand data, and extract message configuration data from the demand data using a configuration data extraction model.
  • the message configuration data includes message field name configuration data and message rules Configuration Data.
  • a python sentence with a data capture function may be used to obtain required data from the user terminal.
  • the demand data is personalized demand information on the format, formula form, and data type of the finally generated message.
  • the personalized demand information of one or more financial regulatory agencies on the message format, formula form, and data type is the demand data.
  • the message configuration data extraction module 101 is specifically configured to:
  • the embodiment of the present application uses the following loss function to calculate the error value of the training configuration data and the standard configuration data
  • Y represents the standard configuration data
  • N represents the number of training configuration data
  • is the preset error coefficient
  • the message configuration data includes message field name configuration data and message rule configuration data, wherein the message field name configuration data indicates the field name to be reported, and the message rule configuration data indicates different field names.
  • Corresponding data ie field value
  • the embodiment of the present application extracts the message configuration data from the demand data, which is beneficial to reduce invalid data and accurately obtain data related to the message content.
  • the message data configuration table generating module 102 is configured to serialize the message configuration data to generate a message data configuration table.
  • the message configuration data is serialized by constructing a serialization interface, using the constructed serialization interface to sort the message configuration data, and saving the sorting result in the form of a data table. Obtain the message data configuration table.
  • the message data configuration table generation module 102 is specifically configured to: extract the sequence characteristics of the reported fields from the demand data; configure the message according to the sequence characteristics The data is sorted, and the sorting result is saved in the newly created data table, and the message data configuration table is generated.
  • the message data configuration table generating module 102 is specifically configured to:
  • serialization interface to serialize the message configuration data to generate a message data configuration table.
  • the serialization processing function includes but is not limited to the writeExternal() function and the randomExternal() function.
  • writeExternal() function and randomExternal() function are java functions used to sort the message configuration data.
  • linear combination includes addition or subtraction.
  • the embodiment of the present application linearly combines the multiple serialization processing functions into a constructor, and then uses the Externalible method in java to construct the constructor as a serialization interface .
  • the Externalible method is used to aggregate java functions to obtain a serialized interface.
  • different java functions can be used in combination at the same time through the serialization interface, so that one interface can use multiple functions at the same time, and the efficiency of serialization processing is improved.
  • the message configuration data is serialized to generate a message data configuration table, which can improve the efficiency of reading and writing data into the message data configuration table.
  • the message field generating module 103 is configured to obtain service data to be published from a pre-built blockchain node, and divide the service data to be published into several message fields according to the configuration data of the message field names.
  • the message field generating module 103 obtains service data to be published from a pre-built blockchain node, including:
  • the execution of the call statement obtains the business data to be released from the pre-built blockchain node.
  • the storage environment of the business data to be released can be determined according to the environment where the pre-built blockchain node is located.
  • the service data to be released is divided into several message fields according to the configuration data of the message field names, so as to directly and quickly obtain the fields required to generate the message, without having to search for the corresponding fields in the service data to be released one by one. Configure to improve the efficiency of message generation.
  • the message field configuration module 104 is configured to configure the several message fields according to the message rule configuration data to obtain the fields to be reported.
  • the message field configuration module 104 is specifically configured to:
  • the several message fields are configured according to the field configuration rule to obtain the fields to be reported.
  • the determining the field types of the several message fields includes:
  • the difference value is less than a preset difference threshold, it is determined that the field type of the target message field is a preset standard type.
  • the calculating the difference value between the field category of the target message field and the preset standard category includes:
  • L(A, B) is the difference value
  • A is the field type of the target message field
  • B is the standard type.
  • the configuring the several message fields according to the field configuration rule includes: according to the data format rule, the field length rule, the date format rule, the desensitization rule, the reserved decimal place rule, and the carry bit included in the field configuration rule.
  • Configuration rules such as rules, calculation formula rules, and value method rules, process the several message fields so that the several message fields conform to the field configuration rules.
  • the data format rule is HTML format
  • a number of message fields will be processed as HTML format data
  • the rule for keeping decimal places is to keep three digits after the decimal point
  • the message fields with decimals in several message fields will be processed To retain three digits after the decimal point.
  • the service message generating module 105 is configured to write the field to be reported into the message data configuration table to obtain a service message.
  • the fileinputstream class of java is used to write the fields to be reported into the message data configuration table.
  • the fields to be reported in different field categories are written into the message data configuration table and the fields are In the corresponding field of the category.
  • the service message generating module 105 is specifically configured to:
  • This embodiment of the application converts the field to be reported into the target report data in json format. Since the data in json format can be read and written quickly, by converting the field to be reported into the target report data in json format, the writing of the target report data in the json format can be improved. The efficiency of the table, thereby improving the efficiency of message generation.
  • the device further includes: a push module, and the push module is further configured to:
  • a python statement with a data capture function can be used to obtain the push queue task from a database for storing the push queue task.
  • the push queue tasks stored in the specific database may be preset, and the push queue may include push trigger conditions.
  • the embodiment of the application determines the push sequence according to the push queue task, and pushes the business message to the user according to the push sequence, which can ensure the orderliness of the push of business messages and avoid data congestion during the push of business messages. There is a problem of reducing the efficiency of the push.
  • the embodiment of the application obtains the service data to be released from the pre-built blockchain nodes, and does not need to separately query the service data in different service systems, which improves the efficiency of service data acquisition and helps shorten the time for message generation; at the same time, it will obtain
  • the received business data to be published extracts the message field name configuration data from the demand data for data division, and configures several message fields obtained after division according to the message rule configuration data, so that the fields to be reported that meet the requirements can be quickly obtained. Further, the fields to be reported that meet the requirements are written into the message data configuration table, which achieves the purpose of quickly and efficiently generating messages that meet individual requirements. Therefore, the message generation device proposed in this application can improve the efficiency of personalized message generation.
  • FIG. 3 it is a schematic structural diagram of an electronic device for implementing the message generation method of the present application.
  • the electronic device 1 may include a processor 10, a memory 11, and a bus, and may also include a computer program stored in the memory 11 and running on the processor 10, such as a message generating program 12.
  • the memory 11 may be volatile or non-volatile.
  • the memory 11 includes at least one type of readable storage medium.
  • the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, and a card.
  • Type memory for example: SD or DX memory, etc.
  • magnetic memory magnetic disk, optical disk, etc.
  • the memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, for example, a mobile hard disk of the electronic device 1. In other embodiments, the memory 11 may also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart media card (SMC), and a secure digital (Secure Digital) equipped on the electronic device 1. , SD) card, flash card (Flash Card), etc.
  • the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device.
  • the memory 11 can be used not only to store application software and various data installed in the electronic device 1, such as the code of the message generating program 12, etc., but also to temporarily store data that has been output or will be output.
  • the processor 10 may be composed of integrated circuits in some embodiments, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits with the same function or different functions, including one or more Combinations of central processing unit (CPU), microprocessor, digital processing chip, graphics processor, and various control chips, etc.
  • the processor 10 is the control unit of the electronic device, which uses various interfaces and lines to connect the various components of the entire electronic device, and runs or executes programs or modules stored in the memory 11 (such as executing Message generation programs, etc.), and call data stored in the memory 11 to execute various functions of the electronic device 1 and process data.
  • the bus may be a peripheral component interconnect standard (PCI) bus or an extended industry standard architecture (EISA) bus, etc.
  • PCI peripheral component interconnect standard
  • EISA extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus and so on.
  • the bus is configured to realize connection and communication between the memory 11 and at least one processor 10 and the like.
  • FIG. 3 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 3 does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure. Components, or a combination of certain components, or different component arrangements.
  • the electronic device 1 may also include a power source (such as a battery) for supplying power to various components.
  • the power source may be logically connected to the at least one processor 10 through a power management device, thereby controlling power
  • the device implements functions such as charge management, discharge management, and power consumption management.
  • the power supply may also include any components such as one or more DC or AC power supplies, recharging devices, power failure detection circuits, power converters or inverters, and power status indicators.
  • the electronic device 1 may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
  • the electronic device 1 may also include a network interface.
  • the network interface may include a wired interface and/or a wireless interface (such as a Wi-Fi interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
  • the electronic device 1 may also include a user interface.
  • the user interface may be a display (Display) and an input unit (such as a keyboard (Keyboard)).
  • the user interface may also be a standard wired interface or a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc.
  • the display can also be appropriately called a display screen or a display unit, which is used to display the information processed in the electronic device 1 and to display a visualized user interface.
  • the message generation program 12 stored in the memory 11 in the electronic device 1 is a combination of multiple instructions, and when running in the processor 10, it can realize:
  • Acquiring demand data extracting message configuration data from the demand data using a configuration data extraction model, the message configuration data including message field name configuration data and message rule configuration data;
  • the field to be reported is written into the message data configuration table to obtain a service message.
  • the integrated module/unit of the electronic device 1 may be stored in a computer readable storage medium, which may be Volatile or non-volatile.
  • the computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory) .
  • the computer usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function, etc.; the storage data area may store a block chain node Use the created data, etc.
  • modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional modules in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be realized in the form of hardware, or in the form of hardware plus software functional modules.
  • the blockchain referred to in this application is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information for verification. The validity of the information (anti-counterfeiting) and the generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.

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)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本申请涉及数据处理技术,揭露了一种报文生成方法,包括:利用配置数据提取模型从需求数据中提取报文配置数据,报文配置数据包括报文字段名配置数据和报文规则配置数据;将报文配置数据进行序列化处理,生成报文数据配置表;从区块链节点中获取待发布业务数据,按照报文字段名配置数据将待发布业务数据划分为若干报文字段;按照报文规则配置数据对若干报文字段进行配置,得到待上报字段;将待上报字段写入报文数据配置表,得到业务报文。本申请提出一种报文生成方法、装置、电子设备及计算机可读存储介质。此外,本申请还涉及区块链技术,待发布业务数据可存储于区块链节点中。本申请可以提高个性化报文生成的效率。

Description

报文生成方法、装置、电子设备及计算机可读存储介质
本申请要求于2020年09月02日提交中国专利局、申请号为CN202010911999.0、名称为“报文生成方法、装置、电子设备及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及数据处理技术领域,尤其涉及一种报文生成方法、装置、电子设备及计算机可读存储介质。
背景技术
随着市场的多元化,出现越来越多的产品,尤其在金融行业,各种产品所产生的业务数据数量庞大,且有些产品可能产生非法的业务数据,因此,国家对于市场上各式各样产品所产生的业务数据的监控力度也越来越大,这要求各产品的供应商定期将业务数据上传给监管机构。
发明人意识到,在上报业务数据时是根据每个金融办的要求进行定制化开发,对不同产品需要到不同的业务***分别查询业务数据生成报文,例如采用oracle存储数据,通过pkg存储过程查询处理业务数据,导致获取业务数据的效率不高,进而降低了生成业务报文的效率。进一步地,生成业务报文的过程中,由于各地的监管机构对上报的内容、上报范围、报文格式、报文编码、上报频率、上报方式、报文大小限制等都各不相同,由业务人员逐条对获取的业务数据进行配置也大大降低了业务报文生成的效率,因此,如何提高个性化业务报文生成的效率,成为了亟待解决的问题。
发明内容
本申请提供一种报文生成方法,包括:
获取需求数据,利用配置数据提取模型从所述需求数据中提取报文配置数据,所述报文配置数据包括报文字段名配置数据和报文规则配置数据;
将所述报文配置数据进行序列化处理,生成报文数据配置表;
从预构建的区块链节点中获取待发布业务数据,按照所述报文字段名配置数据将所述待发布业务数据划分为若干报文字段;
按照所述报文规则配置数据对所述若干报文字段进行配置,得到待上报字段;
将所述待上报字段写入所述报文数据配置表,得到业务报文。
本申请还提供一种报文生成装置,所述装置包括:
报文配置数据提取模块,用于获取需求数据,利用配置数据提取模型从所述需求数据中提取报文配置数据,所述报文配置数据包括报文字段名配置数据和报文规则配置数据;
报文数据配置表生成模块,用于将所述报文配置数据进行序列化处理,生成报文数据配置表;
报文字段生成模块,用于从预构建的区块链节点中获取待发布业务数据,按照所述报文字段名配置数据将所述待发布业务数据划分为若干报文字段;
报文字段配置模块,用于按照所述报文规则配置数据对所述若干报文字段进行配置,得到待上报字段;
业务报文生成模块,用于将所述待上报字段写入所述报文数据配置表,得到业务报文。
本申请还提供一种电子设备,所述电子设备包括:
存储器,存储至少一个指令;及
处理器,执行所述存储器中存储的指令以实现以下步骤:
获取需求数据,利用配置数据提取模型从所述需求数据中提取报文配置数据,所述报文配置数据包括报文字段名配置数据和报文规则配置数据;
将所述报文配置数据进行序列化处理,生成报文数据配置表;
从预构建的区块链节点中获取待发布业务数据,按照所述报文字段名配置数据将所述待发布业务数据划分为若干报文字段;
按照所述报文规则配置数据对所述若干报文字段进行配置,得到待上报字段;
将所述待上报字段写入所述报文数据配置表,得到业务报文。
本申请还提供一种计算机可读存储介质,包括存储数据区和存储程序区,存储数据区存储创建的数据,存储程序区存储有计算机程序;其中,所述计算机程序被处理器执行时实现以下步骤:
获取需求数据,利用配置数据提取模型从所述需求数据中提取报文配置数据,所述报文配置数据包括报文字段名配置数据和报文规则配置数据;
将所述报文配置数据进行序列化处理,生成报文数据配置表;
从预构建的区块链节点中获取待发布业务数据,按照所述报文字段名配置数据将所述待发布业务数据划分为若干报文字段;
按照所述报文规则配置数据对所述若干报文字段进行配置,得到待上报字段;
将所述待上报字段写入所述报文数据配置表,得到业务报文。
附图说明
图1为本申请一实施例提供的报文生成方法的流程示意图;
图2为本申请一实施例提供的报文生成装置的模块示意图;
图3为本申请一实施例提供的实现报文生成方法的电子设备的内部结构示意图;
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请实施例提供的报文生成方法的执行主体包括但不限于服务端、终端等能够被配置为执行本申请实施例提供的该方法的电子设备中的至少一种。换言之,所述报文生成方法可以由安装在终端设备或服务端设备的软件或硬件来执行,所述软件可以是区块链平台。所述服务端包括但不限于:单台服务器、服务器集群、云端服务器或云端服务器集群等。
本申请提供一种报文生成方法。参照图1所示,为本申请一实施例提供的报文生成方法的流程示意图。该方法可以由一个装置执行,该装置可以由软件和/或硬件实现。
在本实施例中,报文生成方法包括:
S1、获取需求数据,利用配置数据提取模型从所述需求数据中提取报文配置数据,所述报文配置数据包括报文字段名配置数据和报文规则配置数据。
本申请实施例中,可利用具有数据抓取功能的python语句从用户端获取需求数据。
本申请实施例中,所述需求数据为对最终生成报文的格式、公式形式,数据类型等的个性化需求信息。例如,当金融机构需要生成报文上报给不同的金融监管机构时,某一个或多个金融监管机构对报文的格式、公式形式,数据类型等的个性化需求信息即为需求数据。
本申请实施例中,所述利用配置数据提取模型从所述需求数据中提取报文配置数据,包括:
获取训练需求数据,以及所述训练需求数据对应的标准配置数据;
利用配置数据提取模型对所述训练需求数据进行配置数据提取,得到训练配置数据;
计算所述训练配置数据和所述标准配置数据的误差值;
若所述训练配置数据与所述标准配置数据的误差值大于预设误差,则调整所述配置数据提取模型的参数后,再次进行特征提取;
若所述训练配置数据与所述标准配置数据的误差值小于所述预设误差,则确认训练完成,获取训练完成的配置数据提取模型;
利用所述训练完成的配置数据提取模型从所述需求数据中提取报文配置数据。
详细地,本申请实施例利用如下损失函数计算所述训练配置数据和所述标准配置数据的误差值
Figure PCTCN2020121529-appb-000001
Figure PCTCN2020121529-appb-000002
其中,
Figure PCTCN2020121529-appb-000003
表示所述训练配置数据,Y表示所述标准配置数据,N表示训练配置数据的个数,α为预设误差系数。
具体地,所述报文配置数据包括报文字段名配置数据和报文规则配置数据,其中所述报文字段名配置数据表示待上报的字段名,所述报文规则配置数据表示不同字段名对应的数据(即字段值)的配置规则。
由于需求数据中可能存在着大量无用的数据,因此,本申请实施例从需求数据中提取报文配置数据,有利于减少无效数据,进而精准的获取与报文内容相关的数据。
S2、将所述报文配置数据进行序列化处理,生成报文数据配置表。
本申请实施例中,将所述报文配置数据进行序列化处理是通过构造序列化接口,利用构造的序列化接口将报文配置数据进行排序,并将排序结果保存以数据表的形式保存,得到报文数据配置表。
可选地,将所述报文配置数据进行序列化处理,生成报文数据配置表包括:从所述需求数据中提取上报字段的顺序特征;根据所述顺序特征对所述报文配置数据进行排序,将排序的结果保存至新建的数据表中,生成报文数据配置表。
详细地,所述将所述报文配置数据进行序列化处理,包括:
获取多个序列化处理函数;
将所述多个序列化处理函数线性组合为构造函数;
利用所述构造函数构造序列化接口;
利用所述序列化接口对所述报文配置数据进行序列化处理。
本申请实施例中,所述序列化处理函数包括但不限于writeExternal()函数和randomExternal()函数。
详细地,所述writeExternal()函数和randomExternal()函数是用于将报文配置数据进行排序的java函数。
进一步的,所述线性组合包括相加或相减,本申请实施例将所述多个序列化处理函数线性组合为构造函数,进而利用java中的Externalible方法将所述构造函数构造为序列化接口。所述Externalible方法用于聚合java函数,得到序列化接口。
本申请实施例中,通过序列化接口使得不同的java函数可以同时组合使用,从而实现一个接口同时使用多个函数,提高序列化处理的效率。
本申请实施例中,将报文配置数据进行序列化处理,生成报文数据配置表,可提高将数据读取与写入报文数据配置表效率。
S3、从预构建的区块链节点中获取待发布业务数据,按照所述报文字段名配置数据将所述待发布业务数据划分为若干报文字段。
具体地,所述从预构建的区块链节点中获取待发布业务数据,包括:
确定所述待发布业务数据的存储环境;
选择与所述存储环境对应的编译器;
利用所述编译器生成调用所述待发布业务数据的调用语句;
执行所述调用语句从预构建的区块链节点获取待发布业务数据。
本申请实施例中,可以根据预构建的区块链节点所在的环境确定待发布业务数据的存储环境。
本申请实施例中,按照报文字段名配置数据将待发布业务数据划分为若干报文字段时,不同的报文字段名对应不同的报文字段。
本申请实施例中,将待发布业务数据根据报文字段名配置数据划分为若干报文字段,直接快速获取生成报文所需的字段,无需在待发布业务数据中一一查找相应字段再进行配置,提高生成报文的效率。
S4、按照所述报文规则配置数据对所述若干报文字段进行配置,得到待上报字段。
本申请实施例中,所述按照所述报文规则配置数据对所述若干报文字段进行配置,得到待上报字段,包括:
确定所述若干报文字段的字段类别;
从所述报文规则配置数据中提取所述字段类别对应的字段配置规则;
将所述若干报文字段根据所述字段配置规则进行配置,得到待上报字段。
详细地,所述确定所述若干报文字段的字段类别,包括:
随机从所述若干报文字段中选取目标报文字段;
计算所述目标报文字段的字段类别与预设标准类别的差异值;
当所述差异值小于预设差异阈值时,确定所述目标报文字段的字段类别为预设标准类别。
具体地,所述计算所述目标报文字段的字段类别与预设标准类别的差异值,包括:
利用如下差异值算法计算所述目标报文字段的字段类别与预设标准类别的差异值:
Figure PCTCN2020121529-appb-000004
其中,L(A,B)为所述差异值,A为所述目标报文字段的字段类别,B为所述标准类别。
进一步地,所述将所述若干报文字段根据所述字段配置规则进行配置包括:根据字段配置规则包含的数据格式规则、字段长度规则、日期格式规则、脱敏规则、保留小数位规则、进位规则、计算公式规则、取值方式规则等配置规则处理所述若干报文字段,以使所述若干报文字段符合所述字段配置规则。
例如,若数据格式规则为HTML格式,则将若干报文字段处理为HTML格式的数据;若保留小数位规则为保留小数点后三位,则将若干报文字段中带有小数的报文字段处理为保留小数点后三位数字。
本申请实施例将划分后得到的若干报文字段按照报文规则配置数据进行配置,能够快速得到符合需求的待上报字段,实现快速生成符合个性化需求的报文的目的。
S5、将所述待上报字段写入所述报文数据配置表,得到业务报文。
本申请实施例中,通过java的fileinputstream类实现将待上报字段写入所述报文数据配置表,写入时将不同字段类别的待上报字段写入到报文数据配置表中与所述字段类别相应的栏位中。
详细地,所述将所述待上报字段写入所述报文数据配置表,包括:
将所述待上报字段转化为json格式的目标上报数据;
将所述目标上报数据写入所述报文数据配置表。
本申请实施例将待上报字段转化为json格式的目标上报数据,由于json格式的数据可以快速读写,因此,通过将待上报字段转化为json格式的目标上报数据可提高将写入待上报数据表的效率,进而提高报文生成的效率。
进一步地,所述将所述待上报字段写入所述报文数据配置表,得到业务报文之后,所述方法还包括:
获取推送队列任务;
根据所述推送队列任务确定推送顺序;
根据所述推送顺序向用户推送所述业务报文。
详细地,可利用具有数据抓取功能的python语句从用于存储推送队列任务的数据库中获取所述推送队列任务。具体的数据库中存储的推送队列任务可以为预先设定的,所述推送队列可包括推送触发条件。
本申请实施例根据所述推送队列任务确定推送顺序,根据所述推送顺序向用户推送所述业务报文,可确保业务报文推送时的有序性,避免业务报文推送时因数据堵塞而产生降低推送效率的问题。
本申请实施例从预构建的区块链节点中获取待发布业务数据,无需到不同的业务***分别查询业务数据,提高业务数据获取的效率,有利于缩短报文生成的时间;同时,将获取到的待发布业务数据根据需求数据中提取报文字段名配置数据进行数据划分,以及将划分后得到的若干报文字段按照报文规则配置数据进行配置,能够快速得到符合需求的待上报字段,进一步地,将符合需求的待上报字段写入报文数据配置表,实现了快速高效地生成符合个性化需求的报文的目的。因此本申请提出的报文生成方法,可以提高个性化报文生成的效率。
如图2所示,是本申请报文生成装置的模块示意图。
本申请所述报文生成装置100可以安装于电子设备中。根据实现的功能,所述报文生成装置可以包括报文配置数据提取模块101、报文数据配置表生成模块102、报文字段生成模块103、报文字段配置模块104和业务报文生成模块105。本发所述模块也可以称之为单元,是指一种能够被电子设备处理器所执行,并且能够完成固定功能的一系列计算机程序段,其存储在电子设备的存储器中。
在本实施例中,关于各模块/单元的功能如下:
所述报文配置数据提取模块101,用于获取需求数据,利用配置数据提取模型从所述需求数据中提取报文配置数据,所述报文配置数据包括报文字段名配置数据和报文规则配置数据;
所述报文数据配置表生成模块102,用于将所述报文配置数据进行序列化处理,生成报文数据配置表;
所述报文字段生成模块103,用于从预构建的区块链节点中获取待发布业务数据,按照所述报文字段名配置数据将所述待发布业务数据划分为若干报文字段;
所述报文字段配置模块104,用于按照所述报文规则配置数据对所述若干报文字段进行配置,得到待上报字段;所述业务报文生成模块105,用于将所述待上报字段写入所述报文数据配置表,得到业务报文。
详细地,所述图像中文本内容提取生成装置各模块的具体实施方式如下:
所述报文配置数据提取模块101,用于获取需求数据,利用配置数据提取模型从所述需求数据中提取报文配置数据,所述报文配置数据包括报文字段名配置数据和报文规则配置数据。
本申请实施例中,可利用具有数据抓取功能的python语句从用户端获取需求数据。
本申请实施例中,所述需求数据为对最终生成报文的格式、公式形式,数据类型等的个性化需求信息。例如,当金融机构需要生成报文上报给不同的金融监管机构时,某一个或多个金融监管机构对报文的格式、公式形式,数据类型等的个性化需求信息即为需求数据。
本申请实施例中,所述报文配置数据提取模块101具体用于:
获取需求数据;
获取训练需求数据,以及所述训练需求数据对应的标准配置数据;
利用配置数据提取模型对所述训练需求数据进行配置数据提取,得到训练配置数据;
计算所述训练配置数据和所述标准配置数据的误差值;
若所述训练配置数据与所述标准配置数据的误差值大于预设误差,则调整所述配置数据提取模型的参数后,再次进行特征提取;
若所述训练配置数据与所述标准配置数据的误差值小于所述预设误差,则确认训练完成,获取训练完成的配置数据提取模型;
利用所述训练完成的配置数据提取模型从所述需求数据中提取报文配置数据。
详细地,本申请实施例利用如下损失函数计算所述训练配置数据和所述标准配置数据的误差值
Figure PCTCN2020121529-appb-000005
Figure PCTCN2020121529-appb-000006
其中,
Figure PCTCN2020121529-appb-000007
表示所述训练配置数据,Y表示所述标准配置数据,N表示训练配置数据的个数,α为预设误差系数。
具体地,所述报文配置数据包括报文字段名配置数据和报文规则配置数据,其中所述报文字段名配置数据表示待上报的字段名,所述报文规则配置数据表示不同字段名对应的数据(即字段值)的配置规则。
由于需求数据中可能存在着大量无用的数据,因此,本申请实施例从需求数据中提取报文配置数据,有利于减少无效数据,精准的获取与报文内容相关的数据。
所述报文数据配置表生成模块102,用于将所述报文配置数据进行序列化处理,生成报文数据配置表。
本申请实施例中,将所述报文配置数据进行序列化处理是通过构造序列化接口,利用构造的序列化接口将报文配置数据进行排序,并将排序结果保存以数据表的形式保存,得到报文数据配置表。
可选地,在本申请一实施例中,所述报文数据配置表生成模块102具体用于:从所述需求数据中提取上报字段的顺序特征;根据所述顺序特征对所述报文配置数据进行排序,将排序的结果保存至新建的数据表中,生成报文数据配置表。
可选地,在本申请另一实施例中,所述报文数据配置表生成模块102具体用于:
获取多个序列化处理函数;
将所述多个序列化处理函数线性组合为构造函数;
利用所述构造函数构造序列化接口;
利用所述序列化接口对所述报文配置数据进行序列化处理,生成报文数据配置表。
本申请实施例中,所述序列化处理函数包括但不限于writeExternal()函数和randomExternal()函数。
详细地,所述writeExternal()函数和randomExternal()函数是用于将报文配置数据进行排序的java函数。
进一步的,所述线性组合包括相加或相减,本申请实施例将所述多个序列化处理函数线性组合为构造函数,进而利用java中的Externalible方法将所述构造函数构造为序列化接口。所述Externalible方法用于聚合java函数,得到序列化接口。
本申请实施例中,通过序列化接口使得不同的java函数可以同时组合使用,从而实现一个接口同时使用多个函数,提高序列化处理的效率。
本申请实施例中,将报文配置数据进行序列化处理,生成报文数据配置表,可提高将数据读取与写入报文数据配置表效率。
所述报文字段生成模块103,用于从预构建的区块链节点中获取待发布业务数据,按照所述报文字段名配置数据将所述待发布业务数据划分为若干报文字段。
具体地,所述报文字段生成模块103从预构建的区块链节点中获取待发布业务数据,包括:
确定所述待发布业务数据的存储环境;
选择与所述存储环境对应的编译器;
利用所述编译器生成调用所述待发布业务数据的调用语句;
执行所述调用语句从预构建的区块链节点获取待发布业务数据。
本申请实施例中,可以根据预构建的区块链节点所在的环境确定待发布业务数据的存储环境。
本申请实施例中,按照报文字段名配置数据将待发布业务数据划分为若干报文字段时,不同的报文字段名对应不同的报文字段。
本申请实施例中,将待发布业务数据根据报文字段名配置数据划分为若干报文字段,,直接快速获取生成报文所需的字段,无需在待发布业务数据中一一查找相应字段再进行配置,提高生成报文的效率。
所述报文字段配置模块104,用于按照所述报文规则配置数据对所述若干报文字段进行配置,得到待上报字段。
本申请实施例中,所述报文字段配置模块104具体用于:
确定所述若干报文字段的字段类别;
从所述报文规则配置数据中提取所述字段类别对应的字段配置规则;
将所述若干报文字段根据所述字段配置规则进行配置,得到待上报字段。
详细地,所述确定所述若干报文字段的字段类别,包括:
随机从所述若干报文字段中选取目标报文字段;
计算所述目标报文字段的字段类别与预设标准类别的差异值;
当所述差异值小于预设差异阈值时,确定所述目标报文字段的字段类别为预设标准类别。
具体地,所述计算所述目标报文字段的字段类别与预设标准类别的差异值,包括:
利用如下差异值算法计算所述目标报文字段的字段类别与预设标准类别的差异值:
Figure PCTCN2020121529-appb-000008
其中,L(A,B)为所述差异值,A为所述目标报文字段的字段类别,B为所述标准类别。
进一步地,所述将所述若干报文字段根据所述字段配置规则进行配置包括:根据字段配置规则包含的数据格式规则、字段长度规则、日期格式规则、脱敏规则、保留小数位规则、进位规则、计算公式规则、取值方式规则等配置规则处理所述若干报文字段,以使所述若干报文字段符合所述字段配置规则。
例如,若数据格式规则为HTML格式,则将若干报文字段处理为HTML格式的数据;若保留小数位规则为保留小数点后三位,则将若干报文字段中带有小数的报文字段处理为保留小数点后三位数字。
本申请实施例将划分后得到的若干报文字段按照报文规则配置数据进行配置,能够快速得到符合需求的待上报字段,实现快速生成符合个性化需求的报文的目的。
所述业务报文生成模块105,用于将所述待上报字段写入所述报文数据配置表,得到业务报文。
本申请实施例中,通过java的fileinputstream类实现将待上报字段写入所述报文数据配置表,写入时将不同字段类别的待上报字段写入到报文数据配置表中与所述字段类别相应的栏位中。
详细地,所述业务报文生成模块105具体用于:
将所述待上报字段转化为json格式的目标上报数据;
将所述目标上报数据写入所述报文数据配置表。
本申请实施例将待上报字段转化为json格式的目标上报数据,由于json格式的数据可以快速读写,因此,通过将待上报字段转化为json格式的目标上报数据可提高将写入待上报数据表的效率,进而提高报文生成的效率。
进一步地,所述装置还包括:推送模块,所述推送模块还用于:
将所述待上报字段写入所述报文数据配置表,得到业务报文之后;获取推送队列任务;
根据所述推送队列任务确定推送顺序;
根据所述推送顺序向用户推送所述业务报文。
详细地,可利用具有数据抓取功能的python语句从用于存储推送队列任务的数据库中获取所述推送队列任务。具体的数据库中存储的推送队列任务可以为预先设定的,所述推送队列可包括推送触发条件。
本申请实施例根据所述推送队列任务确定推送顺序,根据所述推送顺序向用户推送所述业务报文,可确保业务报文推送时的有序性,避免业务报文推送时因数据堵塞而产生降低推送效率的问题。
本申请实施例从预构建的区块链节点中获取待发布业务数据,无需到不同的业务***分别查询业务数据,提高业务数据获取的效率,有利于缩短报文生成的时间;同时,将获取到的待发布业务数据根据需求数据中提取报文字段名配置数据进行数据划分,以及将划分后得到的若干报文字段按照报文规则配置数据进行配置,能够快速得到符合需求的待上报字段,进一步地,将符合需求的待上报字段写入报文数据配置表,实现了快速高效地生成符合个性化需求的报文的目的。因此本申请提出的报文生成装置,可以提高个性化报文生成的效率。
如图3所示,是本申请实现报文生成方法的电子设备的结构示意图。
所述电子设备1可以包括处理器10、存储器11和总线,还可以包括存储在所述存储器11中并可在所述处理器10上运行的计算机程序,如报文生成程序12。
其中,存储器11可以是易失性的,也可以是非易失性的,所述存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、移动硬盘、多媒体卡、卡型存储器(例如:SD或DX存储器等)、磁性存储器、磁盘、光盘等。所述存储器11在一些实施例中可以是电子设备1的内部存储单元,例如该电子设备1的移动硬盘。所述存储器11在另一些实施例中也可以是电子设备1的外部存储设备,例如电子设备1上配备的插接式移动硬盘、智能存储卡(Smart Media Card,SMC)、安全数字(Secure Digital,SD)卡、闪存卡(Flash Card)等。进一步地,所述存储器11还可以既包括电子设备1的内部存储单元也包括外部存储设备。所述存储器11不仅可以用于存储安装于电子设备1的应用软件及各类数据,例如报文生成程序12的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。
所述处理器10在一些实施例中可以由集成电路组成,例如可以由单个封装的集成电路所组成,也可以是由多个相同功能或不同功能封装的集成电路所组成,包括一个或者多个中央处理器(Central Processing unit,CPU)、微处理器、数字处理芯片、图形处理器及各种控制芯片的组合等。所述处理器10是所述电子设备的控制核心(Control Unit),利用各种接口和线路连接整个电子设备的各个部件,通过运行或执行存储在所述存储器11内的程序或者模块(例如执行报文生成程序等),以及调用存储在所述存储器11内的数据,以执行电子设备1的各种功能和处理数据。
所述总线可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。所述总线被设置为实现所述存 储器11以及至少一个处理器10等之间的连接通信。
图3仅示出了具有部件的电子设备,本领域技术人员可以理解的是,图3示出的结构并不构成对所述电子设备1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。
例如,尽管未示出,所述电子设备1还可以包括给各个部件供电的电源(比如电池),优选地,电源可以通过电源管理装置与所述至少一个处理器10逻辑相连,从而通过电源管理装置实现充电管理、放电管理、以及功耗管理等功能。电源还可以包括一个或一个以上的直流或交流电源、再充电装置、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。所述电子设备1还可以包括多种传感器、蓝牙模块、Wi-Fi模块等,在此不再赘述。
进一步地,所述电子设备1还可以包括网络接口,可选地,所述网络接口可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该电子设备1与其他电子设备之间建立通信连接。
可选地,该电子设备1还可以包括用户接口,用户接口可以是显示器(Display)、输入单元(比如键盘(Keyboard)),可选地,用户接口还可以是标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在电子设备1中处理的信息以及用于显示可视化的用户界面。
应该了解,所述实施例仅为说明之用,在专利申请范围上并不受此结构的限制。
所述电子设备1中的所述存储器11存储的报文生成程序12是多个指令的组合,在所述处理器10中运行时,可以实现:
获取需求数据,利用配置数据提取模型从所述需求数据中提取报文配置数据,所述报文配置数据包括报文字段名配置数据和报文规则配置数据;
将所述报文配置数据进行序列化处理,生成报文数据配置表;
从预构建的区块链节点中获取待发布业务数据,按照所述报文字段名配置数据将所述待发布业务数据划分为若干报文字段;
按照所述报文规则配置数据对所述若干报文字段进行配置,得到待上报字段;
将所述待上报字段写入所述报文数据配置表,得到业务报文。
进一步地,所述电子设备1集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中,计算机可读存储介质可以是易失性的,也可以是非易失性的。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)。
进一步地,所述计算机可用存储介质可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作***、至少一个功能所需的应用程序等;存储数据区可存储根据区块链节点的使用所创建的数据等。
在本申请所提供的几个实施例中,应该理解到,所揭露的设备,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既 可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。
因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附关联图表记视为限制所涉及的权利要求。
本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。
此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。***权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第二等词语用来表示名称,而并不表示任何特定的顺序。
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。

Claims (20)

  1. 一种报文生成方法,其中,所述方法包括:
    获取需求数据,利用配置数据提取模型从所述需求数据中提取报文配置数据,所述报文配置数据包括报文字段名配置数据和报文规则配置数据;
    将所述报文配置数据进行序列化处理,生成报文数据配置表;
    从预构建的区块链节点中获取待发布业务数据,按照所述报文字段名配置数据将所述待发布业务数据划分为若干报文字段;
    按照所述报文规则配置数据对所述若干报文字段进行配置,得到待上报字段;
    将所述待上报字段写入所述报文数据配置表,得到业务报文。
  2. 如权利要求1所述的报文生成方法,其中,所述将所述报文配置数据进行序列化处理,包括:
    获取多个序列化处理函数;
    将所述多个序列化处理函数线性组合为构造函数;
    利用所述构造函数构造序列化接口;
    利用所述序列化接口对所述报文配置数据进行序列化处理。
  3. 如权利要求1所述的报文生成方法,其中,所述从预构建的区块链节点中获取待发布业务数据,包括:
    确定所述待发布业务数据的存储环境;
    选择与所述存储环境对应的编译器;
    利用所述编译器生成调用所述待发布业务数据的调用语句;
    执行所述调用语句从预构建的区块链节点中获取所述待发布业务数据。
  4. 如权利要求1所述的报文生成方法,所述按照所述报文规则配置数据对所述若干报文字段进行配置,得到待上报字段,包括:
    确定所述若干报文字段的字段类别;
    从所述报文规则配置数据中提取所述字段类别对应的字段配置规则;
    将所述若干报文字段根据所述字段配置规则进行配置,得到待上报字段。
  5. 如权利要求4所述的报文生成方法,其中,所述确定所述若干报文字段的字段类别,包括:
    随机从所述若干报文字段中选取目标报文字段;
    计算所述目标报文字段的字段类别与预设标准类别的差异值;
    当所述差异值小于预设差异阈值时,确定所述目标报文字段的字段类别为预设标准类别。
  6. 如权利要求1至5中任一项所述的报文生成方法,其中,所述将所述待上报字段写入所述报文数据配置表,包括:
    将所述待上报字段转化为json格式的目标上报数据;
    将所述目标上报数据写入所述报文数据配置表。
  7. 如权利要求1至5中任一项所述的报文生成方法,其中,所述将所述待上报字段写入所述报文数据表,得到业务报文之后,所述方法还包括:
    获取推送队列任务;
    根据所述推送队列任务确定推送顺序;
    根据所述推送顺序向用户推送所述业务报文。
  8. 一种报文生成装置,其中,所述装置包括:
    报文配置数据提取模块,用于获取需求数据,利用配置数据提取模型从所述需求数据中提取报文配置数据,所述报文配置数据包括报文字段名配置数据和报文规则配置数据;
    报文数据配置表生成模块,用于将所述报文配置数据进行序列化处理,生成报文数据 配置表;
    报文字段生成模块,用于从预构建的区块链节点中获取待发布业务数据,按照所述报文字段名配置数据将所述待发布业务数据划分为若干报文字段;
    报文字段配置模块,用于按照所述报文规则配置数据对所述若干报文字段进行配置,得到待上报字段;
    业务报文生成模块,用于将所述待上报字段写入所述报文数据配置表,得到业务报文。
  9. 一种电子设备,其中,所述电子设备包括:
    至少一个处理器;以及,
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行以下步骤:
    获取需求数据,利用配置数据提取模型从所述需求数据中提取报文配置数据,所述报文配置数据包括报文字段名配置数据和报文规则配置数据;
    将所述报文配置数据进行序列化处理,生成报文数据配置表;
    从预构建的区块链节点中获取待发布业务数据,按照所述报文字段名配置数据将所述待发布业务数据划分为若干报文字段;
    按照所述报文规则配置数据对所述若干报文字段进行配置,得到待上报字段;
    将所述待上报字段写入所述报文数据配置表,得到业务报文。
  10. 如权利要求9所述的电子设备,其中,所述将所述报文配置数据进行序列化处理,包括:
    获取多个序列化处理函数;
    将所述多个序列化处理函数线性组合为构造函数;
    利用所述构造函数构造序列化接口;
    利用所述序列化接口对所述报文配置数据进行序列化处理。
  11. 如权利要求9所述的电子设备,其中,所述从预构建的区块链节点中获取待发布业务数据,包括:
    确定所述待发布业务数据的存储环境;
    选择与所述存储环境对应的编译器;
    利用所述编译器生成调用所述待发布业务数据的调用语句;
    执行所述调用语句从预构建的区块链节点中获取所述待发布业务数据。
  12. 如权利要求9所述的电子设备,所述按照所述报文规则配置数据对所述若干报文字段进行配置,得到待上报字段,包括:
    确定所述若干报文字段的字段类别;
    从所述报文规则配置数据中提取所述字段类别对应的字段配置规则;
    将所述若干报文字段根据所述字段配置规则进行配置,得到待上报字段。
  13. 如权利要求12所述的电子设备,其中,所述确定所述若干报文字段的字段类别,包括:
    随机从所述若干报文字段中选取目标报文字段;
    计算所述目标报文字段的字段类别与预设标准类别的差异值;
    当所述差异值小于预设差异阈值时,确定所述目标报文字段的字段类别为预设标准类别。
  14. 如权利要求9至13中任一项所述的电子设备,其中,所述将所述待上报字段写入所述报文数据配置表,包括:
    将所述待上报字段转化为json格式的目标上报数据;
    将所述目标上报数据写入所述报文数据配置表。
  15. 如权利要求9至13中任一项所述的电子设备,其中,所述将所述待上报字段写入所述报文数据表,得到业务报文之后,所述电子设备还实现以下步骤:
    获取推送队列任务;
    根据所述推送队列任务确定推送顺序;
    根据所述推送顺序向用户推送所述业务报文。
  16. 一种计算机可读存储介质,包括存储数据区和存储程序区,其中,所述存储数据区存储创建的数据,所述存储程序区存储有计算机程序;其中,所述计算机程序被处理器执行时实现以下步骤:
    获取需求数据,利用配置数据提取模型从所述需求数据中提取报文配置数据,所述报文配置数据包括报文字段名配置数据和报文规则配置数据;
    将所述报文配置数据进行序列化处理,生成报文数据配置表;
    从预构建的区块链节点中获取待发布业务数据,按照所述报文字段名配置数据将所述待发布业务数据划分为若干报文字段;
    按照所述报文规则配置数据对所述若干报文字段进行配置,得到待上报字段;
    将所述待上报字段写入所述报文数据配置表,得到业务报文。
  17. 如权利要求16所述的计算机可读存储介质,其中,所述将所述报文配置数据进行序列化处理,包括:
    获取多个序列化处理函数;
    将所述多个序列化处理函数线性组合为构造函数;
    利用所述构造函数构造序列化接口;
    利用所述序列化接口对所述报文配置数据进行序列化处理。
  18. 如权利要求16所述的计算机可读存储介质,其中,所述从预构建的区块链节点中获取待发布业务数据,包括:
    确定所述待发布业务数据的存储环境;
    选择与所述存储环境对应的编译器;
    利用所述编译器生成调用所述待发布业务数据的调用语句;
    执行所述调用语句从预构建的区块链节点中获取所述待发布业务数据。
  19. 如权利要求16所述的计算机可读存储介质,所述按照所述报文规则配置数据对所述若干报文字段进行配置,得到待上报字段,包括:
    确定所述若干报文字段的字段类别;
    从所述报文规则配置数据中提取所述字段类别对应的字段配置规则;
    将所述若干报文字段根据所述字段配置规则进行配置,得到待上报字段。
  20. 如权利要求19所述的计算机可读存储介质,其中,所述确定所述若干报文字段的字段类别,包括:
    随机从所述若干报文字段中选取目标报文字段;
    计算所述目标报文字段的字段类别与预设标准类别的差异值;
    当所述差异值小于预设差异阈值时,确定所述目标报文字段的字段类别为预设标准类别。
PCT/CN2020/121529 2020-09-02 2020-10-16 报文生成方法、装置、电子设备及计算机可读存储介质 WO2021189826A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010911999.0A CN112052370A (zh) 2020-09-02 2020-09-02 报文生成方法、装置、电子设备及计算机可读存储介质
CN202010911999.0 2020-09-02

Publications (1)

Publication Number Publication Date
WO2021189826A1 true WO2021189826A1 (zh) 2021-09-30

Family

ID=73607870

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/121529 WO2021189826A1 (zh) 2020-09-02 2020-10-16 报文生成方法、装置、电子设备及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN112052370A (zh)
WO (1) WO2021189826A1 (zh)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114189479A (zh) * 2021-12-08 2022-03-15 全球能源互联网研究院有限公司 一种5g mec电力业务数据传输方法及装置
CN114363412A (zh) * 2022-01-07 2022-04-15 中国工商银行股份有限公司 报文数据处理方法、装置、计算机设备和存储介质
CN114422592A (zh) * 2022-01-21 2022-04-29 深圳壹账通智能科技有限公司 报文转换方法、装置、计算机设备及计算机可读存储介质
CN114866628A (zh) * 2022-05-17 2022-08-05 中国银行股份有限公司 一种报文处理的方法、装置、设备及存储介质
CN114896069A (zh) * 2022-05-30 2022-08-12 平安普惠企业管理有限公司 分布式数据处理方法、装置、设备及存储介质
CN114978991A (zh) * 2022-05-17 2022-08-30 平安科技(深圳)有限公司 路由分发方法、装置、电子设备及计算机可读存储介质
CN115052054A (zh) * 2022-08-15 2022-09-13 江西联创精密机电有限公司 通信报文配置方法、装置、可读存储介质及设备
CN115174375A (zh) * 2022-07-08 2022-10-11 中国银行股份有限公司 报文解包方法、装置、设备及介质
CN115314573A (zh) * 2022-08-05 2022-11-08 中国银行股份有限公司 一种报文体的动态加载方法及装置、电子设备、存储介质
CN115571072A (zh) * 2022-10-24 2023-01-06 中国第一汽车股份有限公司 抬头显示器模式转换方法、装置、电子设备及存储介质
CN116208373A (zh) * 2022-12-30 2023-06-02 北京天融信网络安全技术有限公司 报文过滤配置的方法、装置、电子设备及介质
CN117422557A (zh) * 2023-12-19 2024-01-19 凯美瑞德(苏州)信息科技股份有限公司 一种交易报文的生成方法、电子设备及存储介质

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112596717B (zh) * 2020-12-21 2023-11-21 平安银行股份有限公司 多数据打包方法、装置、电子设备及计算机可读存储介质
CN112700188A (zh) * 2020-12-29 2021-04-23 安徽运通达物流科技有限公司 一种运输平台运单任务生成方法
CN112508707B (zh) * 2021-02-03 2021-05-07 国网电子商务有限公司 一种基于标识和区块链的新能源数据汇聚方法及交易***
CN112765280B (zh) * 2021-02-03 2021-09-24 腾讯科技(深圳)有限公司 区块数据存储方法、装置、计算机可读介质及电子设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140019485A1 (en) * 2002-07-02 2014-01-16 American Express Travel Related Services Company, Inc. System and method for data capture and reporting
CN109361628A (zh) * 2018-10-16 2019-02-19 深圳壹账通智能科技有限公司 报文组装方法、装置、计算机设备和存储介质
CN110222336A (zh) * 2019-05-22 2019-09-10 深圳壹账通智能科技有限公司 财务报告分析方法、装置、计算机设备和存储介质
CN110351359A (zh) * 2019-07-09 2019-10-18 泰康保险集团股份有限公司 报文数据处理方法、装置、电子设备及计算机可读介质
CN110806973A (zh) * 2019-10-11 2020-02-18 苏宁云计算有限公司 一种接口报文的自动生成方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140019485A1 (en) * 2002-07-02 2014-01-16 American Express Travel Related Services Company, Inc. System and method for data capture and reporting
CN109361628A (zh) * 2018-10-16 2019-02-19 深圳壹账通智能科技有限公司 报文组装方法、装置、计算机设备和存储介质
CN110222336A (zh) * 2019-05-22 2019-09-10 深圳壹账通智能科技有限公司 财务报告分析方法、装置、计算机设备和存储介质
CN110351359A (zh) * 2019-07-09 2019-10-18 泰康保险集团股份有限公司 报文数据处理方法、装置、电子设备及计算机可读介质
CN110806973A (zh) * 2019-10-11 2020-02-18 苏宁云计算有限公司 一种接口报文的自动生成方法及装置

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114189479A (zh) * 2021-12-08 2022-03-15 全球能源互联网研究院有限公司 一种5g mec电力业务数据传输方法及装置
CN114363412A (zh) * 2022-01-07 2022-04-15 中国工商银行股份有限公司 报文数据处理方法、装置、计算机设备和存储介质
CN114363412B (zh) * 2022-01-07 2024-06-11 中国工商银行股份有限公司 报文数据处理方法、装置、计算机设备和存储介质
CN114422592A (zh) * 2022-01-21 2022-04-29 深圳壹账通智能科技有限公司 报文转换方法、装置、计算机设备及计算机可读存储介质
CN114978991B (zh) * 2022-05-17 2024-03-12 平安科技(深圳)有限公司 路由分发方法、装置、电子设备及计算机可读存储介质
CN114866628A (zh) * 2022-05-17 2022-08-05 中国银行股份有限公司 一种报文处理的方法、装置、设备及存储介质
CN114978991A (zh) * 2022-05-17 2022-08-30 平安科技(深圳)有限公司 路由分发方法、装置、电子设备及计算机可读存储介质
CN114896069A (zh) * 2022-05-30 2022-08-12 平安普惠企业管理有限公司 分布式数据处理方法、装置、设备及存储介质
CN115174375A (zh) * 2022-07-08 2022-10-11 中国银行股份有限公司 报文解包方法、装置、设备及介质
CN115314573A (zh) * 2022-08-05 2022-11-08 中国银行股份有限公司 一种报文体的动态加载方法及装置、电子设备、存储介质
CN115314573B (zh) * 2022-08-05 2024-02-23 中国银行股份有限公司 一种报文体的动态加载方法及装置、电子设备、存储介质
CN115052054A (zh) * 2022-08-15 2022-09-13 江西联创精密机电有限公司 通信报文配置方法、装置、可读存储介质及设备
CN115571072A (zh) * 2022-10-24 2023-01-06 中国第一汽车股份有限公司 抬头显示器模式转换方法、装置、电子设备及存储介质
CN116208373A (zh) * 2022-12-30 2023-06-02 北京天融信网络安全技术有限公司 报文过滤配置的方法、装置、电子设备及介质
CN117422557A (zh) * 2023-12-19 2024-01-19 凯美瑞德(苏州)信息科技股份有限公司 一种交易报文的生成方法、电子设备及存储介质
CN117422557B (zh) * 2023-12-19 2024-02-23 凯美瑞德(苏州)信息科技股份有限公司 一种交易报文的生成方法、电子设备及存储介质

Also Published As

Publication number Publication date
CN112052370A (zh) 2020-12-08

Similar Documents

Publication Publication Date Title
WO2021189826A1 (zh) 报文生成方法、装置、电子设备及计算机可读存储介质
WO2021189899A1 (zh) 链路状态的追踪方法、装置、电子设备及计算机存储介质
CN112052242A (zh) 数据查询方法、装置、电子设备及存储介质
CN114979120B (zh) 数据上传方法、装置、设备及存储介质
CN112115145A (zh) 数据采集方法、装置、电子设备及存储介质
CN112115152A (zh) 数据增量更新及查询方法、装置、电子设备及存储介质
CN114185895A (zh) 数据导入导出方法、装置、电子设备及存储介质
CN112949278A (zh) 数据核对方法、装置、电子设备及可读存储介质
CN113868528A (zh) 资讯推荐方法、装置、电子设备及可读存储介质
CN114491047A (zh) 多标签文本分类方法、装置、电子设备及存储介质
CN112231417A (zh) 数据分类方法、装置、电子设备及存储介质
CN113868529A (zh) 知识推荐方法、装置、电子设备及可读存储介质
WO2022179122A1 (zh) 基于大数据的数据存储方法、装置、电子设备及存储介质
CN113468175B (zh) 数据压缩方法、装置、电子设备及存储介质
WO2022048362A1 (zh) 数据存储方法、装置、电子设备及存储介质
CN112464619B (zh) 大数据处理方法、装置、设备及计算机可读存储介质
CN112560416B (zh) 页面图表生成方法、装置、电子设备及存储介质
CN113434542A (zh) 数据关系识别方法、装置、电子设备及存储介质
CN113722533A (zh) 信息推送方法、装置、电子设备及可读存储介质
WO2021189905A1 (zh) 分布式数据调取方法、装置、电子设备及存储介质
CN112506931B (zh) 数据查询方法、装置、电子设备及存储介质
CN115496166A (zh) 多任务处理方法、装置、电子设备及存储介质
CN115033605A (zh) 数据查询方法、装置、电子设备及存储介质
CN113419718A (zh) 数据报送方法、装置、设备及介质
CN114547011A (zh) 数据抽取方法、装置、电子设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20927891

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20927891

Country of ref document: EP

Kind code of ref document: A1