Disclosure of Invention
An object of the embodiments of the present disclosure is to provide a charging service data processing method, an apparatus, an electronic device, and a storage medium, so as to at least solve the problem that the communication pressure of an existing single link is getting larger and larger.
The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, a charging service data processing method is provided, which is applied to a single-link communication support system, and the method may include:
splitting the use data of a plurality of services of the same user in a single request message to obtain a plurality of single service data blocks;
packaging a plurality of single service data blocks to obtain a data packet, and establishing an out-of-order data transmission protocol according to a splitting processing rule;
and establishing point-to-point data connection according to the out-of-order data transmission protocol, and transmitting a data packet.
Further, splitting the usage data of multiple services of the same user in the single request message to obtain multiple single service data blocks, including:
extracting each data block in a plurality of services of the same user in a single request message to obtain a plurality of data blocks;
and performing information identification on each data block in the plurality of data blocks to obtain a plurality of single service data blocks.
Further, the information identification includes:
identifying a data range;
identifying a service sequence number; and
a first parity segment is identified.
Further, packing the plurality of single service data blocks to obtain a data packet, including:
packing a plurality of single service data blocks to obtain packed data;
and identifying the service sequence number and the second check segment of the packed data to obtain a data packet.
Further, the second check-up section includes: the total number of the single service data blocks after the data packet is split and a service data block list.
Further, the sending the data packet specifically includes:
the data packet is sent using a token bucket algorithm.
Further, the method further comprises:
obtaining tokens from the token distribution place, and obtaining data packets in the corresponding buckets of the tokens according to the tokens;
when the data in the bucket is acquired, the token is released to return to the token pool.
According to a second aspect of the embodiments of the present disclosure, there is provided a charging service data processing apparatus, which is applied to a single-link communication support system, and the apparatus may include:
the splitting module is used for splitting the use data of a plurality of services of the same user in a single request message to obtain a plurality of single service data blocks;
the packaging module is used for packaging the plurality of single service data blocks to obtain a data packet;
the disorder rule establishing module is used for establishing a disorder data transmission protocol according to the splitting processing rule;
and the sending module is used for establishing point-to-point data connection according to the out-of-order data transfer protocol and sending the data packet.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus, which may include:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the charging service data processing method according to the first aspect of the embodiment.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a storage medium, when instructions in the storage medium are executed by a processor of an information processing apparatus or a server, to cause the information processing apparatus or the server to implement the charging service data processing method according to the first aspect of the embodiments.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
the method comprises the steps that the use data of a plurality of services of the same user in a single request message are split to obtain a plurality of single service data blocks; packaging a plurality of single service data blocks to obtain a data packet, and establishing an out-of-order data transmission protocol according to a splitting processing rule; and establishing point-to-point data connection according to the out-of-order data transmission protocol, and transmitting a data packet. The method solves various limitations of the existing communication mode, fully utilizes the high concurrent computing capacity of the X86 cluster, and realizes low-delay and high-reliability communication guarantee of online charging under 4G conditions of large flow, large bandwidth and high throughput.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The separation method of the common communication and processing has certain limitation, the performance of the X86 equipment cannot be fully exerted, and the following defects exist:
1. data communication handle access has a blocking characteristic, only one operation of reading and writing can be performed at the same time, and certain influence is caused on data throughput capacity;
2. event notification of data throughput is still processed by a single core, and performance bottleneck exists during high-frequency, mass and small-packet communication to influence overall throughput efficiency
3. The service processing time is far longer than the I/O read-write time, and the service processing thread still has a processing bottleneck and cannot fully utilize the computing power of the X86 cluster.
As shown in fig. 1, in a first aspect of the embodiments of the present disclosure, a charging service data processing method is provided, which is applied to a single-link communication support system, and includes:
step 100: splitting the use data of a plurality of services of the same user in a single request message to obtain a plurality of single service data blocks;
step 200: packaging a plurality of single service data blocks to obtain a data packet, and establishing an out-of-order data transmission protocol according to a splitting processing rule;
step 300: and establishing point-to-point data connection according to the out-of-order data transmission protocol, and transmitting a data packet.
The method of the embodiment obtains a plurality of single service data blocks by splitting the use data of a plurality of services of the same user in a single request message; packaging a plurality of single service data blocks to obtain a data packet, and establishing an out-of-order data transmission protocol according to a splitting processing rule; and establishing point-to-point data connection according to the out-of-order data transmission protocol, and transmitting a data packet. The method solves various limitations of the existing communication mode, fully utilizes the high concurrent computing capacity of the X86 cluster, and realizes low-delay and high-reliability communication guarantee of online charging under 4G conditions of large flow, large bandwidth and high throughput.
In some optional embodiments of the present disclosure, in step 100, splitting the usage data of multiple services of the same user in a single request message to obtain multiple single service data blocks, including:
step 110: extracting each data block in a plurality of services of the same user in a single request message to obtain a plurality of data blocks;
step 120: and performing information identification on each data block in the plurality of data blocks to obtain a plurality of single service data blocks.
In some optional embodiments of the disclosure, the information identification comprises:
identifying a data range;
identifying a service sequence number; and
a first parity segment is identified.
In a specific implementation scenario of the present disclosure, based on the service message characteristics of the online charging request, a single request message includes usage data of multiple services of one user. The charging processing of single user data has no strict sequence requirement, and the disorder processing has no influence on the final accuracy. As shown in fig. 2, the communication data model is converted into data blocks of several individual services. Each data block contains information of its own data range, sequence number, check segment, etc., and the independence, verifiability, and out-of-order transmission characteristics of a single service data block are realized, as shown in fig. 3.
In the embodiment, the out-of-order continuous two-way communication protocol based on the charging request service data block is adopted, so that the problem of low communication efficiency of blocking type read-write access is solved.
In some optional embodiments of the present disclosure, step 200, packing a plurality of single service data blocks to obtain a data packet, includes:
step 210: packing a plurality of single service data blocks to obtain packed data;
step 220: and identifying the service sequence number and the second check segment of the packed data to obtain a data packet.
In some optional embodiments of the disclosure, the second check-up section comprises: the total number of the single service data blocks after the data packet is split and a service data block list.
In this embodiment, integrity check is added, the integrity check is mainly implemented by a service serial number + check segment information in the data header, the service serial number corresponds to a unique data request in the original data content, and the check segment includes the total number of sub data blocks obtained by splitting the data packet and the unique serial number of the service data block. For example, the original packet is the unique sequence number of the original packet + the total number of the service data blocks + the list of the service data blocks.
In a specific embodiment of the present disclosure, as shown in fig. 4, a direct data access technology is adopted, which reduces the conversion consumption of the network card, the protocol, and the data in the memory, and improves the throughput performance; the virtual queue of the method is a data transmission mode based on a charging request data block out-of-order bidirectional communication protocol, as shown in fig. 5, a point-to-point data connection is formed in an IP network through a client and a server, the connection state is controlled through the cooperation of the client and the server, and the out-of-order data transmission protocol is adopted in a path for point-to-point data communication. The protocol substitution strategy provides a transmission basis of a data model for direct memory access.
In the above embodiment, the network card driver layer is modified:
1. establishing, maintaining and state managing a point-to-point link supporting an IP layer;
2. realizing the direct copy of the network data to the memory buffer area under the communication mode;
3. and providing an application API to directly access the memory cache region to acquire data.
In some optional embodiments of the present disclosure, step 300, sending a data packet specifically includes:
the data packet is sent using a token bucket algorithm.
In some optional embodiments of the present disclosure, the method further comprises:
step 400: obtaining tokens from the token distribution place, and obtaining data packets in the corresponding buckets of the tokens according to the tokens;
step 500: when the data in the bucket is acquired, the token is released to return to the token pool.
In a specific embodiment of the present disclosure, a charging task asynchronous decomposition technology based on online charging communication protocol features is adopted, thereby implementing parallelization of multi-service request processing and multi-thread high-concurrency data processing. The multi-core and multi-thread parallel processing characteristics of the physical equipment are fully utilized, and the data processing and throughput efficiency is greatly improved. As shown in fig. 6, token allocation performs concurrency control based on the number of buckets, which obtains tokens when the buckets are released and allocates tokens when the threads are idle; the consumption thread acquires the token from the token distribution place, and the acquisition speed is high due to the fact that the token is light in weight; the thread acquires data in the corresponding bucket for processing based on the token, and releases the token after the acquisition is finished; the token is returned to the token pool for use in subsequent allocations; the token pool method can realize the high concurrent data acquisition and processing of n x n of a multi-thread multi-bucket, and meanwhile, the current limitation can be realized by controlling the token issuing speed, so that the resource control capability is improved, and the concurrent processing capability and the management and control capability are synchronously improved.
The method of the embodiment is a mixed out-of-order data transmission protocol for online charging service requests, and the protocol is the basis for realizing high-efficiency single-link data transmission and provides protocol support for direct memory access. The direct memory access technology realizes the direct copy from the network cache to the system memory by combining the special communication protocol facing the online charging service and the drive level optimization, and improves the data access efficiency. Based on the concurrent processing technology of the task bucket, the characteristic of out-of-order processing of the online charging service is oriented, and efficient task distribution and parallel processing are realized by utilizing the task bucket and the token pool.
Compared with the prior art, the method relates to the design of a data structure, adopts a disordered two-way communication protocol constructed based on business characteristics, and has higher data transmission efficiency; by adopting the virtual queue and utilizing the direct memory copy technology, the problem of low access efficiency caused by communication handle blocking is solved; more efficient concurrent task processing is realized through a task bucket and token pool mechanism, and the computing resources of a multi-kernel X86 architecture server are fully utilized.
As shown in fig. 7, in a second aspect of the embodiments of the present disclosure, there is provided a charging service data processing apparatus applied to a single-link communication support system, including:
the splitting module is used for splitting the use data of a plurality of services of the same user in a single request message to obtain a plurality of single service data blocks;
the packaging module is used for packaging the plurality of single service data blocks to obtain a data packet;
the disorder rule establishing module is used for establishing a disorder data transmission protocol according to the splitting processing rule;
and the sending module is used for establishing point-to-point data connection according to the out-of-order data transfer protocol and sending the data packet.
The device of the embodiment splits the service data of a plurality of services of the same user in a single request message through the splitting module to obtain a plurality of single service data blocks, packs the plurality of single service data blocks through the packing module to obtain a data packet, establishes the out-of-order data transmission protocol according to the splitting processing rule, and establishes the point-to-point data connection according to the out-of-order data transmission protocol through the out-of-order rule establishing module and sends the data packet through the sending module. The method solves various limitations of the existing communication mode, fully utilizes the high concurrent computing capacity of the X86 cluster, and realizes low-delay and high-reliability communication guarantee of online charging under 4G conditions of large flow, large bandwidth and high throughput.
The charging service data processing device in the embodiment of the present application may be a device, or may also be a component, an integrated circuit, or a chip in a terminal. The device can be mobile electronic equipment or non-mobile electronic equipment. By way of example, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and the non-mobile electronic device may be a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (TV), a teller machine or a self-service machine, and the like, and the embodiments of the present application are not particularly limited.
The charging service data processing device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present application are not limited specifically.
The charging service data processing apparatus provided in this embodiment of the present application can implement each process implemented by the method embodiments in fig. 1 to fig. 6, and is not described here again to avoid repetition.
Optionally, as shown in fig. 8, an electronic device 800 is further provided in this embodiment of the present application, and includes a processor 801, a memory 802, and a program or an instruction that is stored in the memory 802 and is executable on the processor 801, and when the program or the instruction is executed by the processor 801, the process of the charging service data processing method embodiment is implemented, and the same technical effect can be achieved, and in order to avoid repetition, details are not repeated here.
It should be noted that the electronic device in the embodiment of the present application includes the mobile electronic device and the non-mobile electronic device described above.
Fig. 9 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
The electronic device 900 includes, but is not limited to: a radio frequency unit 901, a network module 902, an audio output unit 903, an input unit 904, a sensor 905, a display unit 906, a user input unit 907, an interface unit 908, a memory 909, and a processor 910.
Those skilled in the art will appreciate that the electronic device 900 may further include a power source (e.g., a battery) for supplying power to various components, and the power source may be logically connected to the processor 910 through a power management system, so as to manage charging, discharging, and power consumption management functions through the power management system. The electronic device structure shown in fig. 9 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components, and thus, the description is not repeated here.
It should be understood that, in the embodiment of the present application, the input Unit 904 may include a Graphics Processing Unit (GPU) 9041 and a microphone 9042, and the Graphics Processing Unit 9041 processes image data of a still picture or a video obtained by an image capturing device (such as a camera) in a video capturing mode or an image capturing mode. The display unit 906 may include a display panel 9061, and the display panel 9061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 907 includes a touch panel 9071 and other input devices 9072. A touch panel 9071 also referred to as a touch screen. The touch panel 9071 may include two parts, a touch detection device and a touch controller. Other input devices 9072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein. Memory 909 can be used to store software programs as well as various data including, but not limited to, application programs and operating systems. The processor 910 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It is to be appreciated that the modem processor described above may not be integrated into processor 910.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements each process of the charging service data processing method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and so on.
The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to execute a program or an instruction to implement each process of the charging service data processing method embodiment, and can achieve the same technical effect, and in order to avoid repetition, the description is omitted here.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as system-on-chip, system-on-chip or system-on-chip, etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
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 application 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 (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 application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.