CN112052370A - Message generation method and device, electronic equipment and computer readable storage medium - Google Patents

Message generation method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN112052370A
CN112052370A CN202010911999.0A CN202010911999A CN112052370A CN 112052370 A CN112052370 A CN 112052370A CN 202010911999 A CN202010911999 A CN 202010911999A CN 112052370 A CN112052370 A CN 112052370A
Authority
CN
China
Prior art keywords
message
data
configuration
configuration data
field
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
CN202010911999.0A
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202010911999.0A priority Critical patent/CN112052370A/en
Priority to PCT/CN2020/121529 priority patent/WO2021189826A1/en
Publication of CN112052370A publication Critical patent/CN112052370A/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/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

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

The invention relates to a data processing technology, and discloses a message generation method, which comprises the following steps: extracting message configuration data from the demand data by using a configuration data extraction model, wherein the message configuration data comprises message field name configuration data and message rule configuration data; carrying out serialization processing on the message configuration data to generate a message data configuration table; acquiring service data to be issued from the block link points, and dividing the service data to be issued into a plurality of message fields according to message field name configuration data; configuring a plurality of message fields according to message rule configuration data to obtain fields to be reported; and writing the field to be reported into a message data configuration table to obtain a service message. The invention provides a message generation method, a message generation device, electronic equipment and a computer readable storage medium. In addition, the invention also relates to a block chain technology, and the service data to be issued can be stored in the block chain nodes. The invention can improve the efficiency of generating the personalized message.

Description

Message generation method and device, electronic equipment and computer readable storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method and an apparatus for generating a packet, an electronic device, and a computer-readable storage medium.
Background
With diversification of markets, more and more products appear, particularly in the financial industry, the amount of service data generated by various products is huge, and some products may generate illegal service data, so that the national monitoring of the service data generated by various products in the market is more and more intensive, which requires suppliers of various products to upload the service data to a monitoring organization regularly.
At present, when business data is reported, customized development is performed according to the requirements of each financial office, and business data is respectively inquired to different business systems for different products to generate messages, for example, oracle is adopted to store data, and business data is inquired and processed through pkg storage process, so that the efficiency of acquiring business data is not high, and further the efficiency of generating business messages is reduced. Further, in the process of generating the service packet, since the monitoring authorities in various places are different in reporting content, reporting range, packet format, packet coding, reporting frequency, reporting mode, packet size limitation, and the like, configuring the acquired service data item by the service personnel also greatly reduces the efficiency of generating the service packet, and thus how to improve the efficiency of generating the personalized service packet becomes a problem to be solved urgently.
Disclosure of Invention
The invention provides a message generation method, a message generation device, electronic equipment and a computer readable storage medium, and mainly aims to improve the efficiency of personalized message generation.
In order to achieve the above object, a method for generating a packet provided by the present invention includes:
acquiring demand data, and extracting message configuration data from the demand data by using a configuration data extraction model, wherein the message configuration data comprises message field name configuration data and message rule configuration data;
carrying out serialization processing on the message configuration data to generate a message data configuration table;
acquiring service data to be published from a pre-constructed block chain node, and dividing the service data to be published into a plurality of message fields according to the message field name configuration data;
configuring the message fields according to the message rule configuration data to obtain fields to be reported;
and writing the field to be reported into the message data configuration table to obtain a service message.
Optionally, the performing serialization processing on the packet configuration data includes:
acquiring a plurality of serialization processing functions;
linearly combining the plurality of serialized processing functions into a constructor;
constructing a serialization interface by using the constructor;
and utilizing the serialization interface to carry out serialization processing on the message configuration data.
Optionally, the acquiring service data to be published from a pre-constructed blockchain node includes:
determining a storage environment of the service data to be issued;
selecting a compiler corresponding to the storage environment;
generating a calling statement for calling the service data to be issued by utilizing the compiler;
and executing the calling statement to acquire the service data to be issued from the pre-constructed block chain node.
Optionally, the configuring, according to the message rule configuration data, the plurality of message fields to obtain fields to be reported includes:
determining field types of the message fields;
extracting a field configuration rule corresponding to the field type from the message rule configuration data;
and configuring the message fields according to the field configuration rule to obtain the fields to be reported.
Optionally, the determining the field types of the message fields includes:
randomly selecting a target message field from the plurality of message fields;
calculating a difference value between the field type of the target message field and a preset standard type;
and when the difference value is smaller than a preset difference threshold value, determining the field type of the target message field as a preset standard type.
Optionally, the writing the field to be reported into the message data configuration table includes:
converting the field to be reported into target reporting data in a json format;
and writing the target reporting data into the message data configuration table.
Optionally, after the field to be reported is written into the message data table to obtain a service message, the method further includes:
acquiring a push queue task;
determining a pushing sequence according to the pushing queue task;
and pushing the service message to a user according to the pushing sequence.
In order to solve the above problem, the present invention further provides a packet generating apparatus, including:
the message configuration data extraction module is used for acquiring demand data and extracting message configuration data from the demand data by using a configuration data extraction model, wherein the message configuration data comprises message field name configuration data and message rule configuration data;
the message data configuration table generating module is used for carrying out serialization processing on the message configuration data to generate a message data configuration table;
the message field generation module is used for acquiring service data to be issued from a pre-constructed block chain node and dividing the service data to be issued into a plurality of message fields according to the message field name configuration data;
a message field configuration module, configured to configure the plurality of message fields according to the message rule configuration data to obtain fields to be reported;
and the service message generating module is used for writing the field to be reported into the message data configuration table to obtain a service message.
In order to solve the above problem, the present invention also provides an electronic device, including:
a memory storing at least one instruction; and
and the processor executes the instructions stored in the memory to realize the message generation method.
In order to solve the above problem, the present invention further provides a computer-readable storage medium including a storage data area and a storage program area, the storage data area storing created data, the storage program area storing a computer program; wherein the computer program, when executed by a processor, implements a message generation method as described above.
The embodiment of the invention acquires the service data to be issued from the pre-constructed block chain node without respectively inquiring the service data from different service systems, thereby improving the efficiency of acquiring the service data and being beneficial to shortening the time of message generation; meanwhile, the acquired service data to be issued is subjected to data division according to message field name configuration data extracted from the demand data, and a plurality of message fields obtained after division are configured according to message rule configuration data, so that fields to be reported which meet the demand can be quickly obtained, and further, the fields to be reported which meet the demand are written into a message data configuration table, and the purpose of quickly and efficiently generating messages which meet the personalized demand is achieved. Therefore, the message generation method, the message generation device and the computer readable storage medium can improve the efficiency of personalized message generation.
Drawings
Fig. 1 is a schematic flow chart of a message generation method according to an embodiment of the present invention;
fig. 2 is a schematic block diagram of a message generation apparatus according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an internal structure of an electronic device implementing a message generation method according to an embodiment of the present invention;
the implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The execution subject of the message generation method provided by the embodiment of the present application includes, but is not limited to, at least one of electronic devices that can be configured to execute the method provided by the embodiment of the present application, such as a server and a terminal. In other words, the message generation method may be executed by software or hardware installed in the terminal device or the server device, and the software may be a block chain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
The invention provides a message generation method. Fig. 1 is a schematic flow chart of a message generation method according to an embodiment of the present invention. The method may be performed by an apparatus, which may be implemented by software and/or hardware.
In this embodiment, the message generating method includes:
s1, acquiring demand data, and extracting message configuration data from the demand data by using a configuration data extraction model, wherein the message configuration data comprises message field name configuration data and message rule configuration data.
In the embodiment of the invention, the required data can be acquired from the user side by using the python statement with the data grabbing function.
In the embodiment of the invention, the requirement data is individualized requirement information of the format, formula form, data type and the like of the finally generated message. For example, when a financial institution needs to generate a message and report the message to different financial regulatory agencies, the personalized demand information of one or more financial regulatory agencies on the format, formula form, data type, and the like of the message is demand data.
In this embodiment of the present invention, the extracting, by using the configuration data extraction model, the packet configuration data from the demand data includes:
acquiring training requirement data and standard configuration data corresponding to the training requirement data;
performing configuration data extraction on the training requirement data by using a configuration data extraction model to obtain training configuration data;
calculating an error value of the training configuration data and the standard configuration data;
if the error value of the training configuration data and the standard configuration data is larger than the preset error, adjusting the parameters of the configuration data extraction model, and then extracting the features again;
if the error value of the training configuration data and the standard configuration data is smaller than the preset error, confirming that the training is finished, and acquiring a configuration data extraction model after the training is finished;
and extracting message configuration data from the demand data by using the trained configuration data extraction model.
In detail, the embodiment of the present invention calculates the error value of the training configuration data and the standard configuration data by using the following loss function
Figure BDA0002663643160000051
Figure BDA0002663643160000052
Wherein,
Figure BDA0002663643160000053
and representing the training configuration data, Y representing the standard configuration data, N representing the number of the training configuration data, and alpha being a preset error coefficient.
Specifically, the message configuration data includes message field name configuration data and message rule configuration data, where the message field name configuration data represents a field name to be reported, and the message rule configuration data represents a configuration rule of data (i.e., a field value) corresponding to different field names.
Because a large amount of useless data may exist in the demand data, the embodiment of the invention extracts the message configuration data from the demand data, which is beneficial to reducing invalid data, and further accurately obtains the data related to the message content.
S2, the message configuration data is serialized to generate a message data configuration table.
In the embodiment of the invention, the message configuration data is serialized through constructing a serialization interface, the message configuration data is sequenced by utilizing the constructed serialization interface, and the sequencing result is stored in a data table form to obtain a message data configuration table.
Optionally, the performing serialization processing on the message configuration data, and generating a message data configuration table includes: extracting the sequence characteristics of the reported fields from the demand data; and sequencing the message configuration data according to the sequence characteristics, storing a sequencing result into a newly-built data table, and generating a message data configuration table.
In detail, the serializing the packet configuration data includes:
acquiring a plurality of serialization processing functions;
linearly combining the plurality of serialized processing functions into a constructor;
constructing a serialization interface by using the constructor;
and utilizing the serialization interface to carry out serialization processing on the message configuration data.
In the embodiment of the present invention, the serialization processing function includes, but is not limited to, a writeExternal () function and a randomExternal () function.
In detail, the writeExternal () function and the randomExternal () function are java functions for ordering message configuration data.
Further, the linear combination includes addition or subtraction, and the embodiment of the present invention linearly combines the plurality of serialization processing functions into a constructor, and further constructs the constructor into a serialization interface by using an explicit method in java. The Externable method is used for aggregating java functions to obtain a serialized interface.
In the embodiment of the invention, different java functions can be simultaneously combined and used through the serialization interface, so that one interface simultaneously uses a plurality of functions, and the efficiency of serialization processing is improved.
In the embodiment of the invention, the message configuration data is serialized to generate the message data configuration table, so that the efficiency of reading and writing the data into the message data configuration table can be improved.
S3, obtaining service data to be issued from the pre-constructed block chain node, and dividing the service data to be issued into a plurality of message fields according to the message field name configuration data.
Specifically, the acquiring service data to be published from a pre-constructed blockchain node includes:
determining a storage environment of the service data to be issued;
selecting a compiler corresponding to the storage environment;
generating a calling statement for calling the service data to be issued by utilizing the compiler;
and executing the calling statement to acquire the service data to be issued from the pre-constructed block link points.
In the embodiment of the invention, the storage environment of the service data to be issued can be determined according to the environment of the pre-constructed block link point.
In the embodiment of the invention, when the service data to be issued is divided into a plurality of message fields according to the message field name configuration data, different message field names correspond to different message fields.
In the embodiment of the invention, the service data to be issued is divided into a plurality of message fields according to the message field name configuration data, the fields required by the generated message are directly and quickly acquired, and the configuration is carried out without searching corresponding fields in the service data to be issued one by one, so that the message generating efficiency is improved.
S4, configuring the message fields according to the message rule configuration data to obtain the fields to be reported.
In this embodiment of the present invention, configuring the plurality of message fields according to the message rule configuration data to obtain fields to be reported includes:
determining field types of the message fields;
extracting a field configuration rule corresponding to the field type from the message rule configuration data;
and configuring the message fields according to the field configuration rule to obtain the fields to be reported.
In detail, the determining the field types of the message fields includes:
randomly selecting a target message field from the plurality of message fields;
calculating a difference value between the field type of the target message field and a preset standard type;
and when the difference value is smaller than a preset difference threshold value, determining the field type of the target message field as a preset standard type.
Specifically, the calculating a difference value between the field type of the target packet field and a preset standard type includes:
calculating the difference value between the field type of the target message field and the preset standard type by using the following difference value algorithm:
Figure BDA0002663643160000071
wherein, L (A, B) is the difference value, A is the field type of the target message field, and B is the standard type.
Further, the configuring the plurality of packet fields according to the field configuration rule includes: and processing the message fields according to configuration rules such as a data format rule, a field length rule, a date format rule, a desensitization rule, a reserved decimal place rule, a carry rule, a calculation formula rule, a value mode rule and the like contained in the field configuration rule so that the message fields conform to the field configuration rule.
For example, if the data format rule is in an HTML format, processing a plurality of message fields into data in the HTML format; if the rule of reserving decimal places is to reserve three digits after the decimal point, the message fields with decimal places are processed into three digits after the decimal point is reserved.
The embodiment of the invention configures the plurality of message fields obtained after division according to the message rule configuration data, can quickly obtain the fields to be reported which meet the requirements, and realizes the purpose of quickly generating the messages which meet the personalized requirements.
And S5, writing the field to be reported into the message data configuration table to obtain a service message.
In the embodiment of the invention, the fields to be reported are written into the message data configuration table through the filarinputstream types of java, and the fields to be reported of different field types are written into the fields corresponding to the field types in the message data configuration table during writing.
In detail, the writing the field to be reported into the message data configuration table includes:
converting the field to be reported into target reporting data in a json format;
and writing the target reporting data into the message data configuration table.
According to the embodiment of the invention, the field to be reported is converted into the target reporting data in the json format, and the data in the json format can be read and written quickly, so that the efficiency of writing the field to be reported into the data table to be reported can be improved by converting the field to be reported into the target reporting data in the json format, and the efficiency of message generation is further improved.
Further, after the field to be reported is written into the message data configuration table to obtain a service message, the method further includes:
acquiring a push queue task;
determining a pushing sequence according to the pushing queue task;
and pushing the service message to a user according to the pushing sequence.
In detail, the push queue task may be retrieved from a database for storing the push queue task using a python statement with data fetching functionality. The push queue task stored in the specific database may be preset, and the push queue may include a push trigger condition.
The embodiment of the invention determines the pushing sequence according to the pushing queue task, and pushes the service message to the user according to the pushing sequence, so that the orderliness of the service message during pushing can be ensured, and the problem of reducing the pushing efficiency caused by data blockage during pushing the service message is avoided.
The embodiment of the invention acquires the service data to be issued from the pre-constructed block chain node without respectively inquiring the service data from different service systems, thereby improving the efficiency of acquiring the service data and being beneficial to shortening the time of message generation; meanwhile, the acquired service data to be issued is subjected to data division according to message field name configuration data extracted from the demand data, and a plurality of message fields obtained after division are configured according to message rule configuration data, so that fields to be reported which meet the demand can be quickly obtained, and further, the fields to be reported which meet the demand are written into a message data configuration table, and the purpose of quickly and efficiently generating messages which meet the personalized demand is achieved. Therefore, the message generation method provided by the invention can improve the efficiency of generating the personalized message.
Fig. 2 is a schematic block diagram of a message generation apparatus according to the present invention.
The message generating apparatus 100 of the present invention may be installed in an electronic device. According to the implemented functions, the message generating apparatus 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 service message generation module 105. A module according to the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the message configuration data extraction module 101 is configured to obtain demand data, and extract message configuration data from the demand data by using a configuration data extraction model, where the message configuration data includes message field name configuration data and message rule configuration data;
the message data configuration table generating module 102 is configured to perform serialization processing on the message configuration data to generate a message data configuration table;
the message field generation module 103 is configured to acquire service data to be published from a pre-constructed block chain node, and divide the service data to be published into a plurality of message fields according to the message field name configuration data;
the message field configuration module 104 is configured to configure the plurality of message fields according to the message rule configuration data to obtain fields to be reported; the service packet generating module 105 is configured to write the field to be reported into the packet data configuration table, so as to obtain a service packet.
In detail, the specific implementation of each module of the device for extracting and generating the 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 by using a configuration data extraction model, where the message configuration data includes message field name configuration data and message rule configuration data.
In the embodiment of the invention, the required data can be acquired from the user side by using the python statement with the data grabbing function.
In the embodiment of the invention, the requirement data is individualized requirement information of the format, formula form, data type and the like of the finally generated message. For example, when a financial institution needs to generate a message and report the message to different financial regulatory agencies, the personalized demand information of one or more financial regulatory agencies on the format, formula form, data type, and the like of the message is demand data.
In this embodiment of the present invention, the packet configuration data extraction module 101 is specifically configured to:
acquiring demand data;
acquiring training requirement data and standard configuration data corresponding to the training requirement data;
performing configuration data extraction on the training requirement data by using a configuration data extraction model to obtain training configuration data;
calculating an error value of the training configuration data and the standard configuration data;
if the error value of the training configuration data and the standard configuration data is larger than the preset error, adjusting the parameters of the configuration data extraction model, and then extracting the features again;
if the error value of the training configuration data and the standard configuration data is smaller than the preset error, confirming that the training is finished, and acquiring a configuration data extraction model after the training is finished;
and extracting message configuration data from the demand data by using the trained configuration data extraction model.
In detail, the embodiment of the present invention calculates the error value of the training configuration data and the standard configuration data by using the following loss function
Figure BDA0002663643160000101
Figure BDA0002663643160000102
Wherein,
Figure BDA0002663643160000103
and representing the training configuration data, Y representing the standard configuration data, N representing the number of the training configuration data, and alpha being a preset error coefficient.
Specifically, the message configuration data includes message field name configuration data and message rule configuration data, where the message field name configuration data represents a field name to be reported, and the message rule configuration data represents a configuration rule of data (i.e., a field value) corresponding to different field names.
Because a large amount of useless data may exist in the demand data, the embodiment of the invention extracts the message configuration data from the demand data, which is beneficial to reducing invalid data and accurately acquiring data related to message content.
The message data configuration table generating module 102 is configured to perform serialization processing on the message configuration data to generate a message data configuration table.
In the embodiment of the invention, the message configuration data is serialized through constructing a serialization interface, the message configuration data is sequenced by utilizing the constructed serialization interface, and the sequencing result is stored in a data table form to obtain a message data configuration table.
Optionally, in an embodiment of the present invention, the message data configuration table generating module 102 is specifically configured to: extracting the sequence characteristics of the reported fields from the demand data; and sequencing the message configuration data according to the sequence characteristics, storing a sequencing result into a newly-built data table, and generating a message data configuration table.
Optionally, in another embodiment of the present invention, the message data configuration table generating module 102 is specifically configured to:
acquiring a plurality of serialization processing functions;
linearly combining the plurality of serialized processing functions into a constructor;
constructing a serialization interface by using the constructor;
and utilizing the serialization interface to carry out serialization processing on the message configuration data to generate a message data configuration table.
In the embodiment of the present invention, the serialization processing function includes, but is not limited to, a writeExternal () function and a randomExternal () function.
In detail, the writeExternal () function and the randomExternal () function are java functions for ordering message configuration data.
Further, the linear combination includes addition or subtraction, and the embodiment of the present invention linearly combines the plurality of serialization processing functions into a constructor, and further constructs the constructor into a serialization interface by using an explicit method in java. The Externable method is used for aggregating java functions to obtain a serialized interface.
In the embodiment of the invention, different java functions can be simultaneously combined and used through the serialization interface, so that one interface simultaneously uses a plurality of functions, and the efficiency of serialization processing is improved.
In the embodiment of the invention, the message configuration data is serialized to generate the message data configuration table, so that the efficiency of reading and writing the data into the message data configuration table can be improved.
The message field generation module 103 is configured to acquire service data to be published from a pre-constructed block chain node, and divide the service data to be published into a plurality of message fields according to the message field name configuration data.
Specifically, the message field generating module 103 obtains service data to be published from a pre-constructed block chain node, including:
determining a storage environment of the service data to be issued;
selecting a compiler corresponding to the storage environment;
generating a calling statement for calling the service data to be issued by utilizing the compiler;
and executing the calling statement to acquire the service data to be issued from the pre-constructed block link points.
In the embodiment of the invention, the storage environment of the service data to be issued can be determined according to the environment of the pre-constructed block link point.
In the embodiment of the invention, when the service data to be issued is divided into a plurality of message fields according to the message field name configuration data, different message field names correspond to different message fields.
In the embodiment of the invention, the service data to be issued is divided into a plurality of message fields according to the message field name configuration data, the fields required by the message generation are directly and quickly acquired, and the corresponding fields in the service data to be issued do not need to be searched one by one and then configured, so that the message generation efficiency is improved.
The message field configuration module 104 is configured to configure the plurality of message fields according to the message rule configuration data to obtain fields to be reported.
In this embodiment of the present invention, the message field configuration module 104 is specifically configured to:
determining field types of the message fields;
extracting a field configuration rule corresponding to the field type from the message rule configuration data;
and configuring the message fields according to the field configuration rule to obtain the fields to be reported.
In detail, the determining the field types of the message fields includes:
randomly selecting a target message field from the plurality of message fields;
calculating a difference value between the field type of the target message field and a preset standard type;
and when the difference value is smaller than a preset difference threshold value, determining the field type of the target message field as a preset standard type.
Specifically, the calculating a difference value between the field type of the target packet field and a preset standard type includes:
calculating the difference value between the field type of the target message field and the preset standard type by using the following difference value algorithm:
Figure BDA0002663643160000121
wherein, L (A, B) is the difference value, A is the field type of the target message field, and B is the standard type.
Further, the configuring the plurality of packet fields according to the field configuration rule includes: and processing the message fields according to configuration rules such as a data format rule, a field length rule, a date format rule, a desensitization rule, a reserved decimal place rule, a carry rule, a calculation formula rule, a value mode rule and the like contained in the field configuration rule so that the message fields conform to the field configuration rule.
For example, if the data format rule is in an HTML format, processing a plurality of message fields into data in the HTML format; if the rule of reserving decimal places is to reserve three digits after the decimal point, the message fields with decimal places are processed into three digits after the decimal point is reserved.
The embodiment of the invention configures the plurality of message fields obtained after division according to the message rule configuration data, can quickly obtain the fields to be reported which meet the requirements, and realizes the purpose of quickly generating the messages which meet the personalized requirements.
The service packet generating module 105 is configured to write the field to be reported into the packet data configuration table, so as to obtain a service packet.
In the embodiment of the invention, the fields to be reported are written into the message data configuration table through the filarinputstream types of java, and the fields to be reported of different field types are written into the fields corresponding to the field types in the message data configuration table during writing.
In detail, the service packet generating module 105 is specifically configured to:
converting the field to be reported into target reporting data in a json format;
and writing the target reporting data into the message data configuration table.
According to the embodiment of the invention, the field to be reported is converted into the target reporting data in the json format, and the data in the json format can be read and written quickly, so that the efficiency of writing the field to be reported into the data table to be reported can be improved by converting the field to be reported into the target reporting data in the json format, and the efficiency of message generation is further improved.
Further, the apparatus further comprises: a push module, the push module further configured to:
writing the field to be reported into the message data configuration table to obtain a service message; acquiring a push queue task;
determining a pushing sequence according to the pushing queue task;
and pushing the service message to a user according to the pushing sequence.
In detail, the push queue task may be retrieved from a database for storing the push queue task using a python statement with data fetching functionality. The push queue task stored in the specific database may be preset, and the push queue may include a push trigger condition.
The embodiment of the invention determines the pushing sequence according to the pushing queue task, and pushes the service message to the user according to the pushing sequence, so that the orderliness of the service message during pushing can be ensured, and the problem of reducing the pushing efficiency caused by data blockage during pushing the service message is avoided.
The embodiment of the invention acquires the service data to be issued from the pre-constructed block chain node without respectively inquiring the service data from different service systems, thereby improving the efficiency of acquiring the service data and being beneficial to shortening the time of message generation; meanwhile, the acquired service data to be issued is subjected to data division according to message field name configuration data extracted from the demand data, and a plurality of message fields obtained after division are configured according to message rule configuration data, so that fields to be reported which meet the demand can be quickly obtained, and further, the fields to be reported which meet the demand are written into a message data configuration table, and the purpose of quickly and efficiently generating messages which meet the personalized demand is achieved. Therefore, the message generation device provided by the invention can improve the efficiency of generating the personalized message.
Fig. 3 is a schematic structural diagram of an electronic device implementing the message generation method according to the present invention.
The electronic device 1 may comprise a processor 10, a memory 11 and a bus, and may further comprise a computer program, such as a message generating program 12, stored in the memory 11 and executable on the processor 10.
The memory 11 includes at least one type of readable storage medium, which includes flash memory, removable hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device 1, such as a removable hard disk of the electronic device 1. The memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 11 may be used not only to store application software installed in the electronic device 1 and various types of data, such as codes of the message generator 12, but also to temporarily store data that has been output or is to be output.
The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device 1 by running or executing programs or modules (e.g., executing a message generating program, etc.) stored in the memory 11 and calling data stored in the memory 11.
The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
Fig. 3 shows only an electronic device with components, and it will be understood by those skilled in the art that the structure shown in fig. 3 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
For example, although not shown, the electronic device 1 may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so as to implement functions of charge management, discharge management, power consumption management, and the like through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device 1 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the electronic device 1 may further include a network interface, and optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used for establishing a communication connection between the electronic device 1 and other electronic devices.
Optionally, the electronic device 1 may further comprise a user interface, which may be a Display (Display), an input unit (such as a Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the electronic device 1 and for displaying a visualized user interface, among other things.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The message generating program 12 stored in the memory 11 of the electronic device 1 is a combination of instructions, and when running in the processor 10, can realize:
acquiring demand data, and extracting message configuration data from the demand data by using a configuration data extraction model, wherein the message configuration data comprises message field name configuration data and message rule configuration data;
carrying out serialization processing on the message configuration data to generate a message data configuration table;
acquiring service data to be published from a pre-constructed block chain node, and dividing the service data to be published into a plurality of message fields according to the message field name configuration data;
configuring the message fields according to the message rule configuration data to obtain fields to be reported;
and writing the field to be reported into the message data configuration table to obtain a service message.
Further, the integrated modules/units of the electronic device 1, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. The computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
Further, 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 for at least one function, and the like; the storage data area may store data created according to the use of the blockchain node, and the like.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any accompanying claims should not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A message generation method is characterized by comprising the following steps:
acquiring demand data, and extracting message configuration data from the demand data by using a configuration data extraction model, wherein the message configuration data comprises message field name configuration data and message rule configuration data;
carrying out serialization processing on the message configuration data to generate a message data configuration table;
acquiring service data to be published from a pre-constructed block chain node, and dividing the service data to be published into a plurality of message fields according to the message field name configuration data;
configuring the message fields according to the message rule configuration data to obtain fields to be reported;
and writing the field to be reported into the message data configuration table to obtain a service message.
2. The message generation method according to claim 1, wherein the serializing the message configuration data includes:
acquiring a plurality of serialization processing functions;
linearly combining the plurality of serialized processing functions into a constructor;
constructing a serialization interface by using the constructor;
and utilizing the serialization interface to carry out serialization processing on the message configuration data.
3. The message generation method according to claim 1, wherein the acquiring the service data to be published from the pre-constructed blockchain node includes:
determining a storage environment of the service data to be issued;
selecting a compiler corresponding to the storage environment;
generating a calling statement for calling the service data to be issued by utilizing the compiler;
and executing the calling statement to acquire the service data to be issued from the pre-constructed block chain node.
4. The message generating method according to claim 1, wherein the configuring the message fields according to the message rule configuration data to obtain fields to be reported includes:
determining field types of the message fields;
extracting a field configuration rule corresponding to the field type from the message rule configuration data;
and configuring the message fields according to the field configuration rule to obtain the fields to be reported.
5. The message generation method of claim 4, wherein said determining field categories for the plurality of message fields comprises:
randomly selecting a target message field from the plurality of message fields;
calculating a difference value between the field type of the target message field and a preset standard type;
and when the difference value is smaller than a preset difference threshold value, determining the field type of the target message field as a preset standard type.
6. The message generation method according to any one of claims 1 to 5, wherein writing the field to be reported into the message data configuration table includes:
converting the field to be reported into target reporting data in a json format;
and writing the target reporting data into the message data configuration table.
7. The message generation method according to any one of claims 1 to 5, wherein after writing the field to be reported into the message data table to obtain a service message, the method further comprises:
acquiring a push queue task;
determining a pushing sequence according to the pushing queue task;
and pushing the service message to a user according to the pushing sequence.
8. A message generation apparatus, the apparatus comprising:
the message configuration data extraction module is used for acquiring demand data and extracting message configuration data from the demand data by using a configuration data extraction model, wherein the message configuration data comprises message field name configuration data and message rule configuration data;
the message data configuration table generating module is used for carrying out serialization processing on the message configuration data to generate a message data configuration table;
the message field generation module is used for acquiring service data to be issued from a pre-constructed block chain node and dividing the service data to be issued into a plurality of message fields according to the message field name configuration data;
a message field configuration module, configured to configure the plurality of message fields according to the message rule configuration data to obtain fields to be reported;
and the service message generating module is used for writing the field to be reported into the message data configuration table to obtain a service message.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the message generation method of any of claims 1 to 7.
10. A computer-readable storage medium comprising a storage data area and a storage program area, wherein the storage data area stores created data, and the storage program area stores a computer program; wherein the computer program, when executed by a processor, implements the message generation method of any of claims 1 to 7.
CN202010911999.0A 2020-09-02 2020-09-02 Message generation method and device, electronic equipment and computer readable storage medium Pending CN112052370A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010911999.0A CN112052370A (en) 2020-09-02 2020-09-02 Message generation method and device, electronic equipment and computer readable storage medium
PCT/CN2020/121529 WO2021189826A1 (en) 2020-09-02 2020-10-16 Message generation method and apparatus, electronic device, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010911999.0A CN112052370A (en) 2020-09-02 2020-09-02 Message generation method and device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN112052370A true CN112052370A (en) 2020-12-08

Family

ID=73607870

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010911999.0A Pending CN112052370A (en) 2020-09-02 2020-09-02 Message generation method and device, electronic equipment and computer readable storage medium

Country Status (2)

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

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112508707A (en) * 2021-02-03 2021-03-16 国网电子商务有限公司 New energy data aggregation method and transaction system based on identification and block chain
CN112596717A (en) * 2020-12-21 2021-04-02 平安银行股份有限公司 Multi-data packaging method and device, electronic equipment and computer readable storage medium
CN112700188A (en) * 2020-12-29 2021-04-23 安徽运通达物流科技有限公司 Transport platform waybill task generation method
CN112765280A (en) * 2021-02-03 2021-05-07 腾讯科技(深圳)有限公司 Block data storage method and device, computer readable medium and electronic equipment
CN115052054A (en) * 2022-08-15 2022-09-13 江西联创精密机电有限公司 Communication message configuration method, device, readable storage medium and equipment

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114189479A (en) * 2021-12-08 2022-03-15 全球能源互联网研究院有限公司 5G MEC power service data transmission method and device
CN114363412B (en) * 2022-01-07 2024-06-11 中国工商银行股份有限公司 Message data processing method, device, computer equipment and storage medium
CN114422592A (en) * 2022-01-21 2022-04-29 深圳壹账通智能科技有限公司 Message conversion method and device, computer equipment and computer readable storage medium
CN114416661A (en) * 2022-01-21 2022-04-29 平安消费金融有限公司 Data reporting method, device, equipment and storage medium
CN114866628A (en) * 2022-05-17 2022-08-05 中国银行股份有限公司 Message processing method, device, equipment and storage medium
CN114978991B (en) * 2022-05-17 2024-03-12 平安科技(深圳)有限公司 Route distribution method, route distribution device, electronic equipment and computer readable storage medium
CN114896069A (en) * 2022-05-30 2022-08-12 平安普惠企业管理有限公司 Distributed data processing method, device, equipment and storage medium
CN115174375A (en) * 2022-07-08 2022-10-11 中国银行股份有限公司 Message unpacking method, device, equipment and medium
CN115314573B (en) * 2022-08-05 2024-02-23 中国银行股份有限公司 Dynamic loading method and device for message body, electronic equipment and storage medium
CN115571072B (en) * 2022-10-24 2024-06-14 中国第一汽车股份有限公司 Head-up display mode conversion method and device, electronic equipment and storage medium
CN116208373A (en) * 2022-12-30 2023-06-02 北京天融信网络安全技术有限公司 Message filtering configuration method, device, electronic equipment and medium
CN117422557B (en) * 2023-12-19 2024-02-23 凯美瑞德(苏州)信息科技股份有限公司 Transaction message generation method, electronic equipment and storage medium
CN118573755A (en) * 2024-07-30 2024-08-30 北京慧图科技(集团)股份有限公司 Data analysis method compatible with various internet of things transmission protocols

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7421442B2 (en) * 2002-07-02 2008-09-02 American Express Travel Related Services Company, Inc. System and method for data capture and reporting
CN109361628B (en) * 2018-10-16 2022-04-12 深圳壹账通智能科技有限公司 Message assembling method and device, computer equipment and storage medium
CN110222336A (en) * 2019-05-22 2019-09-10 深圳壹账通智能科技有限公司 Analysis of financial statement method, apparatus, computer equipment and storage medium
CN110351359A (en) * 2019-07-09 2019-10-18 泰康保险集团股份有限公司 Message data processing method, device, electronic equipment and computer-readable medium
CN110806973A (en) * 2019-10-11 2020-02-18 苏宁云计算有限公司 Automatic generation method and device of interface message

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112596717A (en) * 2020-12-21 2021-04-02 平安银行股份有限公司 Multi-data packaging method and device, electronic equipment and computer readable storage medium
CN112596717B (en) * 2020-12-21 2023-11-21 平安银行股份有限公司 Multi-data packing method, device, electronic equipment and computer readable storage medium
CN112700188A (en) * 2020-12-29 2021-04-23 安徽运通达物流科技有限公司 Transport platform waybill task generation method
CN112508707A (en) * 2021-02-03 2021-03-16 国网电子商务有限公司 New energy data aggregation method and transaction system based on identification and block chain
CN112508707B (en) * 2021-02-03 2021-05-07 国网电子商务有限公司 New energy data aggregation method and transaction system based on identification and block chain
CN112765280A (en) * 2021-02-03 2021-05-07 腾讯科技(深圳)有限公司 Block data storage method and device, computer readable medium and electronic equipment
CN115052054A (en) * 2022-08-15 2022-09-13 江西联创精密机电有限公司 Communication message configuration method, device, readable storage medium and equipment

Also Published As

Publication number Publication date
WO2021189826A1 (en) 2021-09-30

Similar Documents

Publication Publication Date Title
CN112052370A (en) Message generation method and device, electronic equipment and computer readable storage medium
CN111814962A (en) Method and device for acquiring parameters of recognition model, electronic equipment and storage medium
CN112052242A (en) Data query method and device, electronic equipment and storage medium
CN114979120B (en) Data uploading method, device, equipment and storage medium
CN112115145A (en) Data acquisition method and device, electronic equipment and storage medium
CN112464619B (en) Big data processing method, device and equipment and computer readable storage medium
CN114491047A (en) Multi-label text classification method and device, electronic equipment and storage medium
CN113868528A (en) Information recommendation method and device, electronic equipment and readable storage medium
CN112949278A (en) Data checking method and device, electronic equipment and readable storage medium
CN113868529A (en) Knowledge recommendation method and device, electronic equipment and readable storage medium
CN111985194A (en) Data storage method and device, electronic equipment and storage medium
CN114185895A (en) Data import and export method and device, electronic equipment and storage medium
CN114386509A (en) Data fusion method and device, electronic equipment and storage medium
CN115600644A (en) Multitasking method and device, electronic equipment and storage medium
CN113468175B (en) Data compression method, device, electronic equipment and storage medium
CN114625712A (en) Data synchronization method and device, electronic equipment and storage medium
CN114398346A (en) Data migration method, device, equipment and storage medium
CN113722533A (en) Information pushing method and device, electronic equipment and readable storage medium
CN112948380A (en) Data storage method and device based on big data, electronic equipment and storage medium
CN113434542A (en) Data relation identification method and device, electronic equipment and storage medium
CN112256472A (en) Distributed data calling method and device, electronic equipment and storage medium
CN115496166A (en) Multitasking method and device, electronic equipment and storage medium
CN115033605A (en) Data query method and device, electronic equipment and storage medium
CN115145870A (en) Method and device for positioning reason of failed task, electronic equipment and storage medium
CN114185588A (en) Incremental package generation method, device, equipment and storage medium

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