CN111314230A - Data reporting and receiving method, electronic device, computer equipment and storage medium - Google Patents

Data reporting and receiving method, electronic device, computer equipment and storage medium Download PDF

Info

Publication number
CN111314230A
CN111314230A CN202010045520.XA CN202010045520A CN111314230A CN 111314230 A CN111314230 A CN 111314230A CN 202010045520 A CN202010045520 A CN 202010045520A CN 111314230 A CN111314230 A CN 111314230A
Authority
CN
China
Prior art keywords
data
sub
packet
transaction
data packet
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
CN202010045520.XA
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.)
OneConnect Smart Technology Co Ltd
OneConnect Financial Technology Co Ltd Shanghai
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
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 OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN202010045520.XA priority Critical patent/CN111314230A/en
Publication of CN111314230A publication Critical patent/CN111314230A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0006Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission format
    • H04L1/0007Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission format by modifying the frame length
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0033Systems modifying transmission characteristics according to link quality, e.g. power backoff arrangements specific to the transmitter

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Quality & Reliability (AREA)
  • Technology Law (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Development Economics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a data reporting method, which comprises the following steps: storing transaction data generated by transaction behaviors of transaction parties, and setting a mark code for each transaction data; determining a plurality of transaction data as data to be sent, and judging whether the size of the data to be sent is larger than a first preset value; if so, performing packet processing on the data packet to be sent to obtain a plurality of sub data packets, wherein the size of any sub data packet is smaller than a second preset value; assigning a decoding label to each data packet in the plurality of sub-data packets; determining a thread for sending the sub data packet; the sub-packet, the decoding tag, and the flag code are transmitted based on the determined thread. By limiting the size of each data packet, the data receiving method is convenient for network transmission, and after sub-packaging, the data is reported by multiple threads, so that time is greatly saved compared with the previous single thread, and the monitoring timeliness requirement is met.

Description

Data reporting and receiving method, electronic device, computer equipment and storage medium
Technical Field
The present invention relates to the field of supervisory data uploading technologies, and in particular, to a supervisory data reporting and receiving method, an electronic device, a computer device, and a storage medium.
Background
The amount of data acquired by financial institutions is increasing, and particularly, due to the need to maintain the order of financial markets, the financial institutions need to send the supervision data generated by corresponding transactions and the like to the supervision department for recording, especially for a large amount of high-frequency unstructured data.
Because there are many financial institutions, there are many financial institutions reporting the supervision data to the supervision department at the same time, and the existing supervision data reporting supervision institution reports the supervision data in a large amount of data, and if the amount of data is large, the report message corresponding to the supervision data is large, and if the network is unstable, the transmission of the supervision data is interrupted. Because the supervision department has higher timeliness for uploading the supervision data, once the terminal is generated by uploading the supervision data, the requirement of supervision timeliness is difficult to meet.
Therefore, it is an urgent technical problem to provide an effective data reporting method.
Disclosure of Invention
In view of the above, the present invention provides a supervision data reporting and receiving method, an electronic apparatus, a computer device, and a storage medium, which are used for solving the problem that the timeliness cannot be met in the supervision data uploading in the prior art.
Firstly, in order to achieve the above object, the present invention provides a data reporting method, which comprises the steps of:
storing transaction data generated by transaction behaviors of transaction parties, and setting a mark code for each transaction data;
determining a plurality of transaction data as data to be sent, and judging whether the size of the data to be sent is larger than a first preset value;
if so, performing packet processing on the data packet to be sent to obtain a plurality of sub data packets, wherein the size of any sub data packet is smaller than a second preset value;
allocating a decoding label to each sub data packet;
determining a thread for sending the sub data packet;
and sending the sub data packet, the decoding label and the mark code based on the determined thread.
Further, the step of performing packet processing on the data packet to be sent to obtain a plurality of sub data packets includes:
calculating a multiple value of the size of the data packet to be sent and the first preset value;
determining the number of data packets corresponding to the calculated multiple according to the relation between the preset multiple value and the data packet value;
dividing the data packets to be sent according to the determined number of the data packets;
judging whether the size of the divided sub data packet is not smaller than the second preset value or not;
if so, the sub-packet is divided again.
Further, the step of determining the thread for sending the sub-packet includes:
determining a current idle thread;
and determining the number of threads for sending the sub data packet based on the current idle thread and the multiple value.
Further, the step of determining the number of threads for sending the sub data packet based on the current idle thread and the multiplier value includes:
acquiring the number of current idle threads;
judging whether the number of the idle threads is not greater than the multiple value or not;
and if so, determining the current idle thread as the thread for sending the sub data packet.
Further, the method further comprises:
when the number of the idle threads is larger than the multiple value, determining an integer closest to the multiple;
determining the determined integer number of threads as sending threads.
Further, the step of sending the sub-packet based on the determined thread includes:
the sub data packets are subjected to priority sequencing;
storing the sub data packets into a data sending queue according to the priority;
and sequentially taking out and sending the sub-data packets in the data sending queue through the determined thread.
Further, based on the data reporting method provided by the embodiment of the present invention, the present invention also discloses a data receiving method, which includes the following steps:
receiving a data packet to be decoded, a decoding label and a mark code;
decoding at least one sub data packet in the data packet to be decoded according to the decoding label to obtain transaction data;
acquiring a mark code in the transaction data;
comparing whether the obtained mark code is consistent with the received mark code;
if yes, determining the transaction data to be legal data, and storing the transaction data.
Further, to achieve the above object, the present invention also provides an electronic apparatus, comprising: a data reporting end and/or a data receiving end;
wherein, the data report end includes:
the setting module is used for storing transaction data generated by transaction behaviors of transaction parties and setting a mark code for each transaction data;
the judging module is used for determining a plurality of transaction data as data to be sent and judging whether the size of the data to be sent is larger than a first preset value or not;
the sub-packaging module is used for sub-packaging the data packet to be sent to obtain a plurality of sub-data packets under the condition that the judgment result of the judgment module is yes, wherein the size of any one sub-data packet is smaller than a second preset value;
the decoding module is used for distributing a decoding label for each sub-data packet;
the determining module is used for determining the thread for sending the sub data packet;
a sending module, configured to send the sub data packet based on the determined number of threads;
wherein, the data receiving end includes:
the receiving module is used for receiving a data packet to be decoded, a decoding label and a mark code;
the decoding module is used for decoding at least one sub-data packet in the data packet to be decoded according to the decoding label to obtain transaction data;
the acquisition module is used for acquiring the mark code in the transaction data;
the comparison module is used for comparing whether the obtained mark code is consistent with the received mark code or not;
and the storage module is used for determining the transaction data as legal data and storing the transaction data under the condition that the comparison result of the comparison module is consistent.
Further, the packetization module includes:
the calculation submodule is used for calculating a multiple value of the size of the data packet to be sent and the first preset value;
the first determining submodule is used for determining the number of the data packets corresponding to the calculated multiple according to the relation between the preset multiple value and the data packet value;
the first dividing module is used for dividing the data packets to be sent according to the determined number of the data packets;
the judgment submodule is used for judging whether the size of the divided sub-data packet is not smaller than the second preset value or not;
and the dividing submodule is used for dividing the sub-data packet again under the condition that the judgment result of the judging submodule is yes.
Further, the determining module includes:
the second determining submodule is used for determining the current idle thread;
and the third determining submodule is used for determining the number of threads for sending the sub data packet based on the current idle thread and the multiple value.
Further, the second determination submodule includes:
the first determining unit is used for acquiring the number of current idle threads;
the judging unit is used for judging whether the number of the idle threads is not greater than the multiple value or not;
and the second determining unit is used for determining the current idle thread as a sending thread under the condition that the judgment result of the judging unit is yes.
Further, the determining module further includes:
a third determining unit, configured to determine, when the number of idle threads is greater than the multiple value, an integer closest to the multiple;
a fourth determining unit configured to determine the determined integer number of threads as the sending thread.
Further, the sending module further includes:
the sequencing submodule is used for carrying out priority sequencing on the sub data packets;
the first sending submodule is used for storing the sub data packet into a data sending queue according to the priority;
and the second sending submodule is used for sequentially taking out and sending the sub data packets in the data sending queue through the determined thread.
In addition, in order to achieve the above object, the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of any one of the data reporting method and the data receiving method when executing the computer program.
In addition, to achieve the above object, the present invention further provides a storage medium having a computer program stored thereon, where the computer program is executed by a processor to implement the steps of any one of the data reporting method and the data receiving method.
Compared with the prior art, the data reporting method, the data reporting device, the computer equipment and the storage medium provided by the invention have the advantages that after the transaction data stored with the transaction behavior of each transaction party is acquired, the mark code is set for each transaction data, then the transaction data are determined to be the data to be sent, and in the case that the size of the data to be sent is judged to be larger than the first preset value, the data packet to be sent needs to be subjected to sub-packet processing to obtain a plurality of sub-packets after sub-packet, the size of each sub-packet is smaller than the second preset value, and a decoding label is allocated to each data packet; and then sending the sub data packet, the decoding label and the mark code through the determined sending thread. The data packets to be sent are subjected to sub-packet processing, so that the sizes of the sub-data packets are smaller than the second preset value, the small data packets can still be normally transmitted under the condition of poor transmission rate, the problem that transmission failure is caused under the condition of poor network transmission conditions by directly sending supervision data in the prior art is avoided, the problem that supervision data uploading cannot meet timeliness in the prior art is solved, therefore, time is greatly saved compared with the prior single thread, the supervision timeliness requirement is met, corresponding sub-data packets can be quickly found and decoded when the supervision data is received by distributing decoding labels for the sub-data packets, each transaction data can be confirmed through a mark code after decoding, and data loss is avoided.
Drawings
Fig. 1 is a schematic flow chart illustrating a data reporting method according to a first embodiment of the present invention;
fig. 2 is a flowchart illustrating a data reporting method according to a second embodiment of the present invention;
fig. 3 is a flowchart illustrating a data reporting method according to a third embodiment of the present invention;
fig. 4 is a flow chart of a data receiving method according to a first embodiment of the present invention;
FIG. 5 is a diagram of an alternative application environment of the electronic device according to the embodiment of the invention;
FIG. 6 is a diagram of a hardware architecture of an electronic device according to a first embodiment of the invention;
FIG. 7 is a block diagram of a first embodiment of an electronic device;
FIG. 8 is a block diagram of an electronic device according to a second embodiment of the present invention;
FIG. 9 is a schematic diagram of a program module of an electronic device according to a third embodiment of the invention;
FIG. 10 is a schematic diagram of a program module of an electronic device according to a fourth embodiment of the invention;
fig. 11 is a schematic diagram of a program module of an electronic device according to a fifth embodiment of the invention.
Reference numerals:
Figure BDA0002369252180000061
Figure BDA0002369252180000071
Figure BDA0002369252180000081
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
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the description relating to "first", "second", etc. in the present invention is for descriptive purposes only and is not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present invention.
To solve the problem in the prior art, as shown in fig. 1, an embodiment of the present invention provides a data reporting method, including the following steps:
s101, transaction data generated by transaction behaviors of transaction parties are stored, and a mark code is set for each transaction data.
It should be noted that, taking a transaction platform as an example, when the transaction platform generates transactions, each transaction generates data information with the payment mechanism, and then the information of each participant is generated for the payment mechanism for the transaction, so that there is transaction data for the sequential transactions generated for one transaction party.
For each transaction, there is generally a transaction number, such as an order number, which is a unique mark and may be used as a mark code, or a new number is additionally set for each transaction as a mark code, and each mark code is non-repeating, so that each transaction can be identified conveniently.
S102, determining a plurality of transaction data as data to be sent, and judging whether the size of the data to be sent is larger than a first preset value; if so, step 103 is performed.
It will be appreciated that transaction data is increasing and that multiple transaction data may be presented at the same time and then processed against the transaction data.
In one implementation of the present invention, the generated transaction data is used as data to be sent in a time period for the transaction data of each type of article.
In another embodiment of the invention, a shorter time range is set in which all transaction information is used as data to be sent.
It should be noted that the data generated by the financial institution is sent to the supervising entity periodically, and the specific sending time may be set periodically or according to the size of the generated data. Therefore, in the embodiment of the present invention, the data to be sent may be determined according to a preset data sending period or a generated data size, and data generated by the target folder.
In one specific implementation, a target area is set, data generated for the financial institution is stored in the target area, and then the data newly generated in the target area is determined as data to be transmitted.
In another specific implementation manner, data generated in a fixed time unit is determined as data to be transmitted, for example, data generated in 1s is determined as data to be transmitted in 1 s.
As can be understood by those skilled in the art, in the embodiment of the present invention, a comparison object regarding the size of the data to be sent, that is, a first preset value, is preset, the data to be sent is compared with the first preset value, and step S302 is executed when the data to be sent is greater than the first preset value, otherwise, the data packet is directly sent. Illustratively, if the first preset value is 500M and the data to be transmitted is 600M, step S302 needs to be executed, and if the data to be transmitted is 450M, the data packet to be transmitted is directly transmitted.
It can be understood that, by comparing the data to be sent with the first preset value, it can be determined whether the data to be sent is too large, so as to avoid the problem of data sending failure caused by direct sending.
S103, performing packet processing on the data packet to be sent to obtain a plurality of sub data packets, wherein the size of any sub data packet is smaller than a second preset value.
The second preset value and the first preset value in the embodiment of the present invention may be equal or unequal.
For example, the first preset value is equal to the second preset value, which are both 500M, and the data to be sent is 600M, so that the sub-packets of the data packet to be sent need to be divided, specifically, the divided sub-packets are limited by the second preset value, and each divided sub-packet cannot be greater than the second preset value, that is, not greater than 500M.
Then, a 600M data packet to be sent may be divided into 2 data packets to be sent, for example, the data packet to be sent is divided into 2 data packets, one is 400M, and the other is 200M; or one is 300M and one is 300M; or one 250M and one 350M; or one 150M and one 450M. For example, the data is divided into 3 data packets, one is 200M, and one is 200M; or one is 300M, one is 200M, one is 100M; or one 250M, one 150M, one 200M; or one is 250M, and one is 100M, and may also be divided into 3 data packets, 4 data packets, 10 data packets, and the like, which is not specifically limited herein in the embodiments of the present invention.
In another embodiment of the present invention, the first preset value is not equal to the second preset value, and it is assumed that the first preset value is 500M, and the second preset value may be 400M, 450M, or 300M, and so on.
In an embodiment of the present invention, the step of sending the sub data packet based on the determined thread includes: the sub data packets are subjected to priority sequencing; storing the sub data packets into a data sending queue according to the priority; and sequentially taking out and sending the sub-data packets in the data sending queue through the determined thread. By setting the priority of the sub-data packets, the data packets with high priority can be guaranteed to be sent preferentially, and the sending efficiency of data to be sent is improved.
And S104, allocating a decoding label to each sub-packet.
It should be noted that all the sub-packets form a complete whole of the data to be transmitted, so in order to facilitate the data to be transmitted to form a whole for storage at the receiving end, a decoding tag is assigned to each sub-packet. It is understood that data is required to be encoded and compressed before being transmitted, for example, by using compressed packets, each sub-packet may be a sub-compressed packet, and all sub-compressed packets are put together and decompressed to form a complete data packet. Therefore, after the corresponding decoding labels are distributed, the corresponding sub-data packets are convenient to find, and the decoding efficiency is improved.
S105, determining the thread for sending the sub data packet.
It is understood that a thread is also called a Lightweight Process (LWP), which is the smallest unit of a program execution flow. A thread is an entity in a process and is the basic unit that is independently scheduled and dispatched by the system.
In the embodiment of the invention, the sending thread can be determined according to the size of the data to be sent. It can be understood that if the data to be sent is large, more threads are needed to send the sub-packets, and therefore, the number of sending threads can be determined according to the size of the data packet to be sent in the embodiment of the present invention.
In another implementation manner of the present invention, the method may further include: determining a current idle thread; the number of sending threads is determined based on the current idle threads. The idle line may be a line which is not currently in an operating state, or may be a line whose load is lower than a threshold value. Specifically, the load threshold of the line may obtain a transmission data amount of each of the plurality of timing units, obtain a total data transmission amount of the plurality of timing units, and determine that the line is an idle thread if the total data transmission amount is lower than a total data transmission amount value.
And S106, sending the sub data packet, the decoding label and the mark code based on the determined thread.
It can be understood that the thread is a relatively independent and schedulable execution unit, and the execution unit directly sends the sub-packets to implement the data sending process.
It should be noted that, the decoding tag corresponding to each sub-packet is communicated with the flag code corresponding to each transaction data, so that the receiving end can perform fast decoding through the decoding tag and the sub-packet to obtain the corresponding data packet, and then check each transaction data in the data packet through the flag code to determine whether a data error or loss occurs, thereby improving the accuracy of data transmission.
Compared with the prior art, the data reporting method provided by the invention sets a mark code for each transaction data after acquiring the transaction data stored with the transaction behavior of each transaction party, then determines a plurality of transaction data as data to be sent, and needs to perform sub-packet processing on the data packet to be sent under the condition that the size of the data to be sent is judged to be larger than a first preset value, so as to obtain a plurality of sub-packets after sub-packet processing, wherein the size of each sub-packet is smaller than a second preset value, and a decoding label is allocated to each data packet; and then sending the sub data packet, the decoding label and the mark code through the determined sending thread. The data packets to be sent are subjected to sub-packet processing, so that the sizes of the sub-data packets are smaller than the second preset value, the small data packets can still be normally transmitted under the condition of poor transmission rate, the problem that transmission failure is caused under the condition of poor network transmission conditions by directly sending supervision data in the prior art is avoided, and the problem that supervision data uploading cannot meet timeliness in the prior art is solved.
As shown in fig. 2, the step of performing packet processing on the data packet to be sent to obtain a plurality of sub data packets includes:
s201, calculating a multiple value of the size of the data packet to be sent and the first preset value.
If the data packet to be transmitted is 600M and the first preset value is 500M, the ratio of the data packet to be transmitted to the first preset value is 1.2.
S202, determining the number of the data packets corresponding to the calculated multiple according to the preset relationship between the multiple value and the data packet value.
The embodiment of the present invention provides a preset relationship table between the multiple value and the data packet value, that is, each data packet value has a corresponding relationship with the multiple value, and it is assumed that the multiple value is 1.2 and the number of the corresponding data packets is 3 to 5, so that the number of the data packets may be 3, 4 or 5.
S203, dividing the data packets to be sent according to the determined number of the data packets.
Dividing the data packets to be sent according to the determined data packets, for example, the data packets to be sent are 600M, the first preset value is 500M, the ratio of the data packets to be sent to the first preset value is 1.2, and the corresponding data packets are 3 to 5, so that the number of the data packets can be 3, 4, or 5, and thus the divided sub data packets can be 3, 4, or 5.
S204, judging whether the size of the divided sub-data packet is not smaller than a second preset value or not; if so, S205 is performed.
Specifically, the size of each sub-packet may be the same or different, and if the size of each sub-packet is not equal, it must be ensured that the size of each sub-packet cannot exceed the second preset value, otherwise, the step of continuing the partitioning step of step S205 is performed.
S205, the sub-packets are divided again.
As shown in fig. 3, in another implementation manner of the present invention, the step of determining the number of threads for sending the sub-packet includes:
s301, determining the number of the current idle threads.
The determination of the number of idle threads in the embodiment of the present invention may be the same as the above process of determining the current idle thread, and is not described herein again in the embodiment of the present invention.
S302, judging whether the number of the idle threads is not more than the multiple value or not; if so, step S303 is performed.
The embodiment of the invention provides a scheme which is the most thread resource saving scheme by corresponding one thread to one sub data packet in order to save data threads when the current data transmission is tense.
S303, determining the current idle thread as the thread for sending the sub data packet.
In the embodiment of the invention, if the number of the current idle threads is not more than a multiple value, all the idle threads are used for data transmission, otherwise, when the number of the idle threads is more than the multiple value, an integer which is closest to the multiple is determined; determining the determined integer number of threads as sending threads.
In addition, as shown in fig. 4, an embodiment of the present invention further provides a data receiving method, where the method includes:
s401, receiving a data packet to be decoded, a decoding label and a mark code.
It can be understood that the datagram to be decoded received in the embodiment of the present invention is the data transmitted in the embodiment shown in fig. 1 to fig. 3, and is received at the receiving end after being transmitted through the network at the transmitting end.
S402, decoding at least one sub data packet in the data packet to be decoded according to the decoding label to obtain transaction data.
It is understood that one sub-packet corresponds to one decoding tag, and the sub-packet is decoded after all sub-packets are received, and the decoding tag is used as a decoding reference. Illustratively, the decoding tag is shown as 10 sub-packets, and the corresponding number of each sub-packet in the 10 sub-packets, and the 10 sub-packets are automatically searched and decoded after receiving the sub-packets. If the packet loss occurs in the data transmission process, the retransmission request is automatically sent to the sender through the decoding tag, so that the data retransmission efficiency after the packet loss can be improved.
S403, acquiring the mark code in the transaction data.
At the transmitting end, the flag codes corresponding to all transactions in the currently transmitted data packet are transmitted, and then the flag codes are obtained after decoding.
S404, comparing whether the obtained mark code is consistent with the received mark code; if so, step S405 is performed.
If the decoded mark codes are in one-to-one correspondence with the received mark codes, all transaction data exist and are not lost, otherwise, the data are considered to be incomplete. In the prior art, the judgment is often performed according to the size of data, when the sizes of data packets are the same, it is judged that no packet is lost, otherwise, the packet is lost. If the mark codes are not in one-to-one correspondence, the data are indicated to be in error, in the specific implementation process, the data which are not in correspondence with the mark codes can be found out, the mark codes are used for sending data requests to the sending end, the sending end only needs to send the data which are in correspondence with the mark codes, and the reissue efficiency after the data are in error is improved.
S405, determining the transaction data to be legal data, and storing the transaction data.
It can be understood that when the batch of data is decoded completely and confirmed by the flag code to indicate that the data is correct, the data is stored at the receiving end, and the data can be processed or analyzed after the data is stored.
Referring to fig. 5 and 6, an alternative application environment of the electronic device 50 of the present invention is shown.
In this embodiment, the electronic device 50 can communicate with the data reporting terminal 10 and the data receiving terminal 40 in a wired or wireless manner. In the electronic device 50, the data of the data reporting terminal 10 is sent to the data receiving terminal 40 through the network interface 53, and the data information can also be sent to the display interface of the supervision data receiving terminal module 40 through the network interface 53, so that the transmission of the data after the supervision data is reported is realized.
Fig. 5 is a schematic diagram of an alternative hardware architecture of the electronic device 50 according to the present invention. Electronic device 50 includes, but is not limited to, a memory 51, a processor 52, and a network interface 53 communicatively coupled to each other via a system bus, and FIG. 5 illustrates only electronic device 50 having components 51-53, although it is to be understood that not all of the illustrated components are required and that more or fewer components may alternatively be implemented.
The memory 51 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the storage 51 may be an internal storage unit of the electronic device 50, such as a hard disk or a memory of the electronic device 50. In other embodiments, the memory may also be an external storage device of the electronic apparatus 50, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, provided on the electronic apparatus 50. Of course, the memory 51 may also include both an internal storage unit and an external storage device of the electronic apparatus 50. In this embodiment, the memory 51 is generally used for storing an operating system installed in the electronic device 50 and various types of application software, such as program codes of the data reporting terminal 10. Further, the memory 51 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 52 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 52 is generally used to control the overall operation of the electronic device 50. In this embodiment, the processor 52 is configured to execute the program codes stored in the memory 51 or process data, for example, execute the data reporting terminal 10.
The network interface 53 may include a wireless network interface or a wired network interface, and the network interface 53 is generally used for establishing a communication connection between the electronic apparatus 50 and other electronic devices.
The hardware structure and functions of the related devices of the present invention have been described in detail so far. Various embodiments of the present invention will be presented based on the above description.
First, the present invention provides an electronic device 50.
Fig. 5 is a schematic diagram showing program modules of an electronic device 50 according to a first embodiment of the invention.
In this embodiment, the electronic device 50 includes a series of computer program instructions stored in the memory 51, and when the computer program instructions are executed by the processor 52, the supervision data reporting operation according to the embodiments of the present invention can be implemented. In some embodiments, electronic device 50 may be divided into one or more modules based on the particular operations implemented by the portions of the computer program instructions. For example, in fig. 7, the data reporting terminal 10 in the electronic device may be divided into: a setting module 501, a judging module 502, a sub-packaging module 503, an allocating module 504, a determining module 505 and a sending module 506. Wherein:
a setting module 501, configured to store transaction data generated by a transaction behavior of a transaction party, and set a flag code for each transaction data;
a determining module 502, configured to determine data to be sent, and determine whether the size of the data to be sent is greater than a first preset value;
a sub-packet module 503, configured to perform sub-packet processing on the data packet to be sent to obtain multiple sub-packets, where a determination result of the determination module is yes, and a size of any sub-packet is smaller than a second preset value;
an allocating module 504, configured to allocate a decoding tag to each of the sub-packets;
a determining module 505, configured to determine a thread for sending the sub data packet;
a sending module 506, configured to send the sub data packet based on the determined number of threads;
and, as shown in fig. 8, the data receiving end 40 includes:
a receiving module 601, configured to receive a data packet to be decoded, a decoding tag, and a tag code;
a decoding module 602, configured to decode at least one sub data packet in the to-be-decoded data packet according to the decoding tag, so as to obtain transaction data;
an obtaining module 603, configured to obtain a tag code in the transaction data;
a comparing module 604, configured to compare whether the obtained flag code is consistent with the received flag code;
a storage module 605, configured to determine that the transaction data is legal data and store the transaction data when the comparison result of the comparison module is consistent.
Further, as shown in fig. 9, the packetizing module 503 includes:
a calculating submodule 701, configured to calculate a multiple value between the size of the data packet to be sent and the first preset value;
a first determining submodule 702, configured to determine, according to a relationship between a preset multiple value and a data packet value, the number of data packets corresponding to the calculated multiple;
a first dividing module 703, configured to divide the data packets to be sent according to the determined number of the data packets;
the judging submodule 704 is used for judging whether the size of the divided sub-data packet is not smaller than a second preset value;
the second partitioning submodule 705 is configured to, if the determination result of the determining submodule is yes, partition the sub data packet again.
Further, as shown in fig. 10, the determining module 505 includes:
a second determining submodule 801, configured to determine a current idle thread;
a third determining sub-module 802, configured to determine, based on the current idle thread and the multiplier, the number of threads to send the sub-data packet.
Further, as shown in fig. 11, the second determining sub-module 802 includes:
a first determining unit 901, configured to obtain the number of current idle threads;
a judging unit 902, configured to judge whether the number of idle threads is not greater than the multiplier value;
a second determining unit 903, configured to determine the current idle thread as a sending thread when a determination result of the determining unit is yes.
Further, the determining module 802 further includes:
a third determining unit 904, configured to determine, when the number of idle threads is greater than the multiple value, an integer closest to the multiple;
a fourth determining unit 905 configured to determine the determined integer number of threads as the sending thread.
Further, the sending module 506 further includes:
the sequencing submodule is used for carrying out priority sequencing on the sub data packets;
the first sending submodule is used for storing the sub data packet into a data sending queue according to the priority;
and the second sending submodule is used for sequentially taking out and sending the sub data packets in the data sending queue through the determined thread.
Compared with the prior art, in the electronic device provided by the embodiment of the invention, after the transaction data stored with the transaction behavior of each transaction party is acquired, the flag code is set for each transaction data, then the transaction data are determined to be data to be sent, and in the case that the size of the data to be sent is judged to be larger than a first preset value, the data packet to be sent needs to be subjected to sub-packet processing to obtain a plurality of sub-packets after sub-packet processing, the size of each sub-packet is smaller than a second preset value, and a decoding label is allocated to each data packet; and then sending the sub data packet, the decoding tag and the mark through the determined sending thread. The data packets to be sent are subjected to sub-packet processing, so that the sizes of the sub-data packets are smaller than the second preset value, the small data packets can still be normally transmitted under the condition of poor transmission rate, the problem that transmission failure is caused under the condition of poor network transmission conditions by directly sending supervision data in the prior art is avoided, and the problem that supervision data uploading cannot meet timeliness in the prior art is solved.
The present invention also provides a computer device, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server or a rack server (including an independent server or a server cluster composed of a plurality of servers) capable of executing programs, and the like. The computer device of the embodiment at least includes but is not limited to: memory, processor, etc. communicatively coupled to each other via a system bus.
The present embodiment also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application mall, etc., on which a computer program is stored, which when executed by a processor implements corresponding functions. The computer-readable storage medium of this embodiment is used for storing the electronic device 20, and when being executed by the processor, the computer-readable storage medium implements the data reporting method of the present invention.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A data reporting method is characterized in that the method comprises the following steps:
storing transaction data generated by transaction behaviors of transaction parties, and setting a mark code for each transaction data;
determining a plurality of transaction data as data to be sent, and judging whether the size of the data to be sent is larger than a first preset value;
if so, performing packet processing on the data packet to be sent to obtain a plurality of sub data packets, wherein the size of any sub data packet is smaller than a second preset value;
allocating a decoding label to each sub data packet;
determining a thread for sending the sub data packet;
and sending the sub data packet, the decoding label and the mark code based on the determined thread.
2. The data reporting method of claim 1, wherein the step of performing packet-wise processing on the data packet to be sent to obtain a plurality of subpackets comprises:
calculating a multiple value of the size of the data packet to be sent and the first preset value;
determining the number of data packets corresponding to the calculated multiple according to the relation between the preset multiple value and the data packet value;
dividing the data packets to be sent according to the determined number of the data packets;
judging whether the size of the divided sub data packet is not smaller than the second preset value or not;
if so, the sub-packet is divided again.
3. The data reporting method of claim 2, wherein the step of determining the thread for sending the sub-packet comprises:
determining a current idle thread;
and determining the number of threads for sending the sub data packet based on the current idle thread and the multiple value.
4. The data reporting method of claim 3, wherein the step of determining the number of threads for sending the sub data packet based on the current idle thread and the multiplier value comprises:
acquiring the number of current idle threads;
judging whether the number of the idle threads is not greater than the multiple value or not;
and if so, determining the current idle thread as the thread for sending the sub data packet.
5. The method for reporting data as claimed in claim 4, wherein the method further comprises:
when the number of the idle threads is larger than the multiple value, determining an integer closest to the multiple;
determining the determined integer number of threads as sending threads.
6. The method of claim 1, wherein the step of sending the sub-packets based on the determined threads comprises:
the sub data packets are subjected to priority sequencing;
storing the sub data packets into a data sending queue according to the priority;
and sequentially taking out and sending the sub-data packets in the data sending queue through the determined thread.
7. A method of receiving data, the method comprising the steps of:
receiving a data packet to be decoded, a decoding label and a mark code;
decoding at least one sub data packet in the data packet to be decoded according to the decoding label to obtain transaction data;
acquiring a mark code in the transaction data;
comparing whether the obtained mark code is consistent with the received mark code;
if yes, determining the transaction data to be legal data, and storing the transaction data.
8. An electronic device, the device comprising: a data reporting end and/or a data receiving end;
wherein, the data report end includes:
the setting module is used for storing transaction data generated by transaction behaviors of transaction parties and setting a mark code for each transaction data;
the judging module is used for determining a plurality of transaction data as data to be sent and judging whether the size of the data to be sent is larger than a first preset value or not;
the sub-packaging module is used for sub-packaging the data packet to be sent to obtain a plurality of sub-data packets under the condition that the judgment result of the judgment module is yes, wherein the size of any one sub-data packet is smaller than a second preset value;
the decoding module is used for distributing a decoding label for each sub-data packet;
the determining module is used for determining the thread for sending the sub data packet;
a sending module, configured to send the sub data packet based on the determined number of threads;
the data receiving end comprises:
the receiving module is used for receiving a data packet to be decoded, a decoding label and a mark code;
the decoding module is used for decoding at least one sub-data packet in the data packet to be decoded according to the decoding label to obtain transaction data;
the acquisition module is used for acquiring the mark code in the transaction data;
the comparison module is used for comparing whether the obtained mark code is consistent with the received mark code or not;
and the storage module is used for determining the transaction data as legal data and storing the transaction data under the condition that the comparison result of the comparison module is consistent.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the data reporting method and/or the data receiving method according to any one of claims 1 to 7 when executing the computer program.
10. A storage medium having a computer program stored thereon, characterized in that: the computer program, when being executed by a processor, implements the steps of the data reporting method and/or the data receiving method of any one of claims 1 to 7.
CN202010045520.XA 2020-01-16 2020-01-16 Data reporting and receiving method, electronic device, computer equipment and storage medium Pending CN111314230A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010045520.XA CN111314230A (en) 2020-01-16 2020-01-16 Data reporting and receiving method, electronic device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010045520.XA CN111314230A (en) 2020-01-16 2020-01-16 Data reporting and receiving method, electronic device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111314230A true CN111314230A (en) 2020-06-19

Family

ID=71150898

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010045520.XA Pending CN111314230A (en) 2020-01-16 2020-01-16 Data reporting and receiving method, electronic device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111314230A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107481140A (en) * 2017-07-24 2017-12-15 湖南搜云网络科技股份有限公司 Voucher identification code processing method and system, server and storage medium
CN110519217A (en) * 2019-07-05 2019-11-29 中国平安人寿保险股份有限公司 Across company-data transmission method, device, computer equipment and storage medium
CN110602004A (en) * 2019-08-30 2019-12-20 深圳壹账通智能科技有限公司 Supervision data reporting, electronic device, equipment and computer readable storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107481140A (en) * 2017-07-24 2017-12-15 湖南搜云网络科技股份有限公司 Voucher identification code processing method and system, server and storage medium
CN110519217A (en) * 2019-07-05 2019-11-29 中国平安人寿保险股份有限公司 Across company-data transmission method, device, computer equipment and storage medium
CN110602004A (en) * 2019-08-30 2019-12-20 深圳壹账通智能科技有限公司 Supervision data reporting, electronic device, equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN110602004A (en) Supervision data reporting, electronic device, equipment and computer readable storage medium
WO2019205371A1 (en) Server, message allocation method, and storage medium
CN108717379B (en) Electronic device, distributed task scheduling method and storage medium
CN111818136B (en) Data processing method, device, electronic equipment and computer readable medium
CN108491301B (en) Electronic device, abnormality early warning method based on redis and storage medium
CN108833126B (en) Electronic device, data link risk early warning method and storage medium
CN108415925B (en) Electronic device, data call log generation and query method and storage medium
CN109152061B (en) Channel allocation method, device, server and storage medium
CN108491304B (en) electronic device, business system risk control method and storage medium
CN110620681B (en) Network connection timeout time setting method, device, equipment and medium
WO2017177778A1 (en) Information transmission management method and apparatus, server, and storage medium
CN115277566B (en) Load balancing method and device for data access, computer equipment and medium
CN111490947B (en) Data packet sending method, data packet receiving method, system, equipment and medium
CN110333916B (en) Request message processing method, device, computer system and readable storage medium
CN110807050B (en) Performance analysis method, device, computer equipment and storage medium
CN113672284B (en) Instruction execution method, system, electronic equipment and storage medium
CN112422450A (en) Computer equipment, and flow control method and device for service request
CN112437001B (en) Method and device for guaranteeing reliable delivery and consumption of messages
CN112969198A (en) Data transmission method, terminal and storage medium
CN112910987A (en) Message pushing method, system, device, equipment and storage medium
CN111314230A (en) Data reporting and receiving method, electronic device, computer equipment and storage medium
CN111652681A (en) Receipt processing method, server and computer readable storage medium
CN112818204B (en) Service processing method, device, equipment and storage medium
CN111586841B (en) Terminal paging optimization method, system, device and readable storage medium
CN110912717B (en) Broadcasting method and server of centerless multi-channel concurrent transmission system

Legal Events

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

Application publication date: 20200619

RJ01 Rejection of invention patent application after publication