CN114547023A - Flow data processing method and device, computer equipment and storage medium - Google Patents

Flow data processing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN114547023A
CN114547023A CN202210118873.7A CN202210118873A CN114547023A CN 114547023 A CN114547023 A CN 114547023A CN 202210118873 A CN202210118873 A CN 202210118873A CN 114547023 A CN114547023 A CN 114547023A
Authority
CN
China
Prior art keywords
traffic
data
processing
flow
compensation
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
CN202210118873.7A
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.)
Jingdong Technology Information Technology Co Ltd
Original Assignee
Jingdong Technology Information Technology 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 Jingdong Technology Information Technology Co Ltd filed Critical Jingdong Technology Information Technology Co Ltd
Priority to CN202210118873.7A priority Critical patent/CN114547023A/en
Publication of CN114547023A publication Critical patent/CN114547023A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • 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
    • G06Q30/00Commerce
    • G06Q30/01Customer relationship services
    • G06Q30/015Providing customer assistance, e.g. assisting a customer within a business location or via helpdesk
    • G06Q30/016After-sales

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • General Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Finance (AREA)
  • Economics (AREA)
  • Development Economics (AREA)
  • Accounting & Taxation (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present disclosure provides a method, an apparatus, a computer device and a storage medium for processing traffic data, wherein the method comprises: receiving a processing request, the processing request comprising: processing type and subject information; acquiring initial flow data corresponding to the subject information, the initial flow data including: an existing traffic field and a compensating traffic field; when the processing type is a deduction type, carrying out deduction processing on the existing flow data corresponding to the existing flow field; when the processing type is the compensation type, compensation traffic data is acquired and configured as a field value corresponding to the compensation traffic field. By the method and the device, the traffic data processing method can be effectively adapted to the individualized processing types, conflicts in reading of the traffic data caused by processing requests of different processing types are effectively avoided, processing failure events caused by traffic data processing are avoided, accuracy of traffic data processing can be effectively improved, and traffic data processing effect is effectively improved.

Description

Flow data processing method and device, computer equipment and storage medium
Technical Field
The present disclosure relates to the field of intelligent response technologies, and in particular, to a method and an apparatus for processing traffic data, a computer device, and a storage medium.
Background
In the technical field of intelligent response, a consultation/short message flow commodity is a core commodity of an online customer service robot, flow deduction is a core element of a response system of the online customer service robot, and generally, a condition of sending failure possibly occurs in a consultation/short message flow scene, so that flow compensation is a key of the response system of the robot.
In the related art, the robot traffic data is usually stored in a database, when a compensation process starts, a most recently expired traffic packet whose data volume is smaller than an initial value is searched for updating, and when a deduction process starts, a corresponding traffic packet is searched for deduction of the traffic data.
In this way, under high concurrency requests, due to the limitations of the number of connections of the database and the database itself, a conflict may be generated between the compensation processing flow and the deduction processing flow, which may cause a processing failure event, affect the accuracy of the traffic data processing, and result in a poor traffic data processing effect.
Disclosure of Invention
The present disclosure is directed to solving, at least to some extent, one of the technical problems in the related art.
Therefore, an object of the present disclosure is to provide a method, an apparatus, a computer device, and a storage medium for processing traffic data, so that the method for processing traffic data can be effectively adapted to an individualized processing type, and conflicts generated by processing requests of different processing types on reading the traffic data are effectively avoided, thereby avoiding a processing failure event generated in processing the traffic data, and effectively improving accuracy of processing the traffic data and effectively improving a processing effect of the traffic data.
The traffic data processing method provided in the embodiment of the first aspect of the present disclosure includes: receiving a processing request, the processing request comprising: processing type and subject information; acquiring initial flow data corresponding to the main body information, wherein the initial flow data comprises: the existing flow field and the compensation flow field; when the processing type is a deduction type, carrying out deduction processing on the existing flow data corresponding to the existing flow field; when the processing type is a compensation type, obtaining compensation traffic data, and configuring the compensation traffic data as a field value corresponding to the compensation traffic field.
In a traffic data processing method provided in an embodiment of the first aspect of the present disclosure, by receiving a processing request, the processing request includes: processing the type and the main body information, and acquiring initial flow data corresponding to the main body information, wherein the initial flow data comprises: the method comprises the steps of obtaining the compensation flow data when the processing type is the compensation type, configuring the compensation flow data into a field value corresponding to the compensation flow field, enabling the flow data processing method to be effectively adapted to the individualized processing type, effectively avoiding conflict of processing requests of different processing types on reading of the flow data, avoiding processing failure events generated in the flow data processing, effectively improving accuracy of the flow data processing, and effectively improving the flow data processing effect.
The traffic data processing device provided by the embodiment of the second aspect of the present disclosure includes: a receiving module, configured to receive a processing request, where the processing request includes: processing type and subject information; an obtaining module, configured to obtain initial traffic data corresponding to the main body information, where the initial traffic data includes: the existing flow field and the compensation flow field; a deduction module, configured to, when the processing type is a deduction type, perform deduction processing on existing traffic data corresponding to the existing traffic field; and the compensation module is used for acquiring compensation traffic data when the processing type is the compensation type, and configuring the compensation traffic data into a field value corresponding to the compensation traffic field.
The apparatus provided by the embodiment of the second aspect of the present disclosure is configured to, by receiving a processing request, process the request including: processing the type and the main body information, and acquiring initial flow data corresponding to the main body information, wherein the initial flow data comprises: the method comprises the steps of obtaining the compensation flow data when the processing type is the compensation type, configuring the compensation flow data into a field value corresponding to the compensation flow field, enabling the flow data processing method to be effectively adapted to the individualized processing type, effectively avoiding conflict of processing requests of different processing types on reading of the flow data, avoiding processing failure events generated in the flow data processing, effectively improving accuracy of the flow data processing, and effectively improving the flow data processing effect.
An embodiment of a third aspect of the present disclosure provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the program, the method for processing traffic data as set forth in the embodiment of the first aspect of the present disclosure is implemented.
A fourth aspect of the present disclosure provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the traffic data processing method as set forth in the first aspect of the present disclosure.
An embodiment of a fifth aspect of the present disclosure provides a computer program product, where when being executed by an instruction processor, a method for processing traffic data as set forth in an embodiment of the first aspect of the present disclosure is performed.
Additional aspects and advantages of the disclosure will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the disclosure.
Drawings
The foregoing and/or additional aspects and advantages of the present disclosure will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic flow chart of a traffic data processing method according to an embodiment of the present disclosure;
FIG. 2 is a schematic view of a flow deduction process in an embodiment of the disclosure;
FIG. 3 is a schematic diagram of a storage structure of initial traffic data in an embodiment of the present disclosure;
fig. 4 is a schematic flow chart of a traffic data processing method according to another embodiment of the present disclosure;
fig. 5 is a flow chart diagram of a traffic packet processing method in an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of a flow deduction record processing flow in an embodiment of the disclosure;
FIG. 7 is a flow data synchronization process schematic in an embodiment of the disclosure;
fig. 8 is a schematic structural diagram of a traffic data processing apparatus according to an embodiment of the present disclosure;
FIG. 9 illustrates a block diagram of an exemplary computer device suitable for use in implementing embodiments of the present disclosure.
Detailed Description
Reference will now be made in detail to the embodiments of the present disclosure, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of illustrating the present disclosure and should not be construed as limiting the same. On the contrary, the embodiments of the disclosure include all changes, modifications and equivalents coming within the spirit and terms of the claims appended hereto.
In the related art, under a high concurrency request, due to the limitation of the number of connections of the database and the database itself, a conflict may be generated between the compensation processing flow and the reduction processing flow, a processing failure event may be generated, the accuracy of the flow data processing may be affected, and the flow data processing effect is not good.
In the embodiment of the present disclosure, in order to solve the above technical problem, a traffic data processing method is provided, so that the traffic data processing method can be effectively adapted to an individualized processing type, and conflicts generated by processing requests of different processing types for reading traffic data are effectively avoided, thereby avoiding a processing failure event generated by processing the traffic data, effectively improving accuracy of processing the traffic data, and effectively improving a traffic data processing effect.
Fig. 1 is a schematic flow chart of a traffic data processing method according to an embodiment of the present disclosure.
It should be noted that the main execution body of the traffic data processing method of this embodiment is a traffic data processing apparatus, the apparatus may be implemented by software and/or hardware, the apparatus may be configured in a computer device, and the computer device may include, but is not limited to, a terminal, a server, and the like.
As shown in fig. 1, the traffic data processing method includes:
s101: receiving a processing request, the processing request comprising: process type and subject information.
The request for processing the traffic data may be referred to as a processing request, and the traffic data may be used to describe the remaining traffic, the traffic being used, the traffic requiring compensation, and so on.
In an online intelligent question-answering application scenario, a user may enter consultation information in a chat dialog box, and a response to the consultation information is realized through a customer service robot, the customer service robot generally belongs to a merchant, and a flow packet is purchased in advance by the merchant to complete the response to the consultation information based on support of flow data provided by the flow packet.
In this disclosure, an example may be performed in the application scenario, and the processing request may be generated by the computer device according to the received consulting information, where the processing request is used to perform corresponding processing on the traffic data of the merchant corresponding to the consulting information, and based on diversification of content of the consulting information, a type that needs to be processed may be determined as a processing type, and the processing type may be, for example, a deduction type or a compensation type.
The information of the client robot of the merchant corresponding to the consultation information may be referred to as main body information, and the main body information is, for example, a customer service robot identifier and/or a type of a traffic packet purchased by the merchant to which the customer service robot belongs, which is not limited to this.
The following steps may be triggered after receiving the processing request and parsing the processing type and the subject information from the processing request.
S102: acquiring initial flow data corresponding to the subject information, the initial flow data including: an existing traffic field and a compensating traffic field.
In the embodiment of the present disclosure, before obtaining the initial traffic data corresponding to the main body information, a computer device may generate a corresponding Key-Value pair (Key-Value) by using a customer service robot identifier and a traffic type, and then map traffic data related to an effective traffic packet corresponding to the customer service robot into a field under the Key-Value pair, and store the mapped traffic data into a Redis database (the Redis database is a database that can cache the Key-Value pair).
In this embodiment of the present disclosure, a default field may also be generated in the Key-Value pair (Key-Value), and the default field is used to store and store the corresponding compensation traffic to complete initialization of the traffic data storage structure, where the default field may be referred to as the compensation traffic field.
Therefore, in the embodiment of the disclosure, the existing traffic data corresponding to the existing traffic field and the compensation traffic data corresponding to the compensation traffic field can be stored respectively, and when the traffic data is processed in a targeted manner, the adaptive traffic data is read from the corresponding field (the existing traffic field or the compensation traffic field) according to the processing type, so that the traffic data is effectively adapted to the personalized processing type.
In the embodiment of the present disclosure, after receiving the processing request, the obtaining of the initial data traffic data corresponding to the subject information may be triggered, for example, the traffic data related to the traffic packet corresponding to the customer service robot identifier may be obtained and used as the initial traffic data.
It should be noted that, if the corresponding traffic data has not been compensated for the traffic packet, the field value corresponding to the compensated traffic field may be initialized to null.
Alternatively, in some embodiments, when the initial traffic data corresponding to the body information is obtained, it may be that when a key corresponding to the body information exists, the first traffic data corresponding to the key is used as the initial traffic data, and the key and the first traffic data form a key-value pair, and when the key corresponding to the body information does not exist in the traffic data processing apparatus, the traffic packet information corresponding to the body information may be obtained, and the initial traffic data may be generated according to the traffic packet information, so that while the efficiency of obtaining the traffic data is greatly improved, the timeliness and flexibility of obtaining the traffic data may be effectively improved, and the consecutive execution of traffic data processing tasks is assisted.
The traffic data that is generated in advance and constitutes a key value pair with the body information may be referred to as first traffic data, and when a key corresponding to the body information exists, it is indicated that the corresponding key value pair is generated in advance, and the key in the key value pair corresponds to the body information, and the value corresponds to the first traffic data corresponding to the body information, and when the key corresponding to the body information does not exist, it is indicated that the first traffic data corresponding to the body information has not been generated, which is not limited.
For example, when the initial traffic data corresponding to the body information is obtained, it may be determined whether a key corresponding to the body information is stored in the Redis database, if so, the first traffic data corresponding to the key is used as the initial traffic data, and the key and the first traffic data form a key value pair, if not, the traffic packet information may be obtained from a designated database (the designated database may be a database configured in advance for storing the traffic packet information, which is not limited), and then the traffic data purchased by the customer is obtained by parsing according to the traffic packet information, which is used as the initial traffic data, without limitation.
In other embodiments, the obtaining of the initial traffic data corresponding to the body information may also be implemented in any other possible manner, for example, a model matching manner, a rule convention manner, and the like, which is not limited herein.
The receiving of the processing request, the parsing of the processing request to obtain the processing type and the main information, and the obtaining of the initial traffic data corresponding to the main information, where the initial traffic data includes: after the traffic field and the compensation traffic field are available, a subsequent step of personalized traffic data processing can be triggered.
S103: and when the processing type is a deduction type, carrying out deduction processing on the existing traffic data corresponding to the existing traffic field.
When the processing type is a deduction type and indicates that the processing request is used for consuming a part of the existing traffic data, the existing traffic data corresponding to the existing traffic field can be deducted according to the data quantity needing to be deducted and described by the processing request.
For example, when a processing request is received, if the processing type carried by the processing request is a deduction type, it may be determined whether the balance of existing traffic data in the initial traffic data in the key value pair is greater than zero, and if the balance of existing traffic data in the key value pair is greater than zero, it indicates that there is a traffic data balance, and then, corresponding deduction processing may be performed on the existing traffic data, so that when traffic deduction processing is performed, the existing traffic data corresponding to the existing traffic field may be directly operated, and an influence on data corresponding to the compensation traffic field is avoided.
For example, during the deduction process, as shown in fig. 2, fig. 2 is a schematic diagram of the traffic deduction process of the embodiment of the present disclosure, it may be first determined whether there is a key value pair corresponding to the customer service robot (the customer service robot is determined based on the customer service robot identifier, i.e. the main body information), where a plurality of keys may be stored in a Redis database in a form of hash keys (hash keys), if there is no key corresponding to the customer service robot in the Redis database, an effective traffic packet may be obtained from a relational database, and the traffic packet information (the traffic packet information is used to specifically describe a corresponding traffic packet, e.g. a traffic packet identifier, and effective traffic data related to the traffic packet) is initialized into the Redis database, if there is a key corresponding to the customer service robot in the Redis database, an existing traffic field corresponding to the key (the existing traffic has corresponding existing traffic data) and a compensation traffic field may be extracted, then, filtering invalid flow data (invalid flow data, which may be flow data whose existing flow data do not satisfy the data amount to be subtracted, without limitation) whose flow balance of the existing flow data is less than or equal to zero, if existing flow data (existing flow data whose existing flow data satisfy the data amount to be subtracted) with valid balance exists, triggering to subtract the flow through a hicrby command (where hicrby is a command applied to the hash table and used for adding an increment to a field in a key of the hash table).
S104: when the processing type is the compensation type, compensation traffic data is acquired and configured as a field value corresponding to the compensation traffic field.
When the processing type is the compensation type, the processing request is indicated to perform corresponding compensation on the existing traffic data, and then the compensation traffic data can be configured to be the field value corresponding to the compensation traffic field according to the compensation traffic data (the compensation traffic data, that is, the data volume of the traffic data that needs to be compensated) described in the processing request, so that the existing traffic data and the compensation traffic data can be stored separately.
For example, when a processing request is received, if the processing type carried by the processing request is a compensation type, the compensation traffic data may be configured as a field value corresponding to a compensation traffic field in the initial traffic data, so that when the traffic compensation processing is performed, the field value of the compensation traffic field may be directly operated, thereby avoiding introducing an influence on data corresponding to an existing traffic field.
Optionally, in some embodiments, in order to effectively ensure consistency of execution of the flow data processing step, so that the flow data processing logic better meets requirements of an actual application scenario, and is adapted to multiple possible flow data processing situations, the existing flow data corresponding to the existing flow field is subtracted, or the existing flow data is subtracted when the existing flow field has the corresponding existing flow data, and if the existing flow field does not have the corresponding existing flow data, the compensated flow data is subtracted when the compensated flow field has the corresponding compensated flow data, and if the existing flow field does not have the corresponding existing flow data, and the compensated flow field does not have the corresponding compensated flow data, a response message is generated, and the response message indicates that the flow subtraction fails.
That is to say, in the embodiment of the present disclosure, the traffic data described in the traffic data field (that is, the existing traffic data field or the compensated traffic data field) corresponding to the processing type is operated according to the processing request, so that the traffic data processing method can be effectively adapted to the personalized processing type, conflicts generated by the processing requests of different processing types on reading the traffic data are effectively avoided, and a processing failure event generated by processing the traffic data is avoided.
For example, in an online intelligent question answering application scenario, before compensation is performed on flow data, when a merchant purchases a flow packet, data including a customer service robot identifier (botId), a flow expiration time (end-time), a flow type (traffic-type), a balance of flow (balance) and a rights identifier (traffic-Id) is generated in a flow packet information table of a database, and a key value pair in the form of a hash key may also be generated in a Redis database, as shown in fig. 3, fig. 3 is a schematic storage structure diagram of initial flow data in the embodiment of the present disclosure, where the hash key value is cluster: traffic-type: bodId, and a field of key mapping includes: the fields corresponding to the keys can be represented by end-time traffic-id, the value is the corresponding existing traffic data, the traffic compensation fields are represented by defaults (defaults), after the above traffic compensation initialization operation flow is completed, when the processing type is the compensation type, the compensation processing flow can be triggered to be executed, and no limitation is imposed on the execution.
For example, if a key corresponding to the customer service robot identifier exists in the Redis database, a compensation flow field may be directly read from initial flow data corresponding to the key, and then, the compensation flow data is configured to a field value corresponding to the compensation flow field by triggering, so as to implement compensation processing of the flow data.
In this embodiment, by receiving a processing request, the processing request includes: processing the type and the main body information, and acquiring initial flow data corresponding to the main body information, wherein the initial flow data comprises: the method comprises the steps of obtaining the compensation flow data when the processing type is the compensation type, configuring the compensation flow data into a field value corresponding to the compensation flow field, enabling the flow data processing method to be effectively adapted to the individualized processing type, effectively avoiding conflict of processing requests of different processing types on reading of the flow data, avoiding processing failure events generated in the flow data processing, effectively improving accuracy of the flow data processing, and effectively improving the flow data processing effect.
Fig. 4 is a schematic flow chart of a traffic data processing method according to another embodiment of the present disclosure.
As shown in fig. 4, the traffic data processing method includes:
s401: receiving a processing request, the processing request comprising: process type and subject information.
For the description of S401, reference may be made to the foregoing embodiments, which are not described herein again.
S402: if there is a key corresponding to the body information, the first traffic data corresponding to the key is taken as the initial traffic data, and the key and the first traffic data form a key-value pair.
In this embodiment, after receiving the processing request, it may be found whether a key corresponding to the main information exists in a Redis database (which may be referred to as a key-value database, or the key-value database may be any other type of database, which is not limited to this), which corresponds to the traffic data processing apparatus, and if the key exists, a value corresponding to the key is directly read: first flow data, and using the first flow data as initial flow data.
The first traffic data may be constructed by previously parsing traffic packet information corresponding to the body information, and the corresponding traffic packet information may be previously stored in a relational database.
S403: and if the key corresponding to the main body information does not exist, acquiring the traffic packet information corresponding to the main body information from a relational database, wherein the key and the first traffic data are stored in a key value database.
In this embodiment, after receiving the processing request, the Redis database corresponding to the traffic data processing apparatus may be searched for whether a key corresponding to the body information exists, and if not, the traffic packet information corresponding to the body information may be acquired from the relational database, where the key and the first traffic data are stored in the key value database.
That is, communication links between the traffic data processing apparatus and the key value database and between the traffic data processing apparatus and the relational database may be established in advance, if the key value database stores a corresponding key value pair, direct reading is supported, and if the key value pair does not exist, acquiring traffic packet information from the relational database is triggered to initialize the traffic packet information to obtain the key value pair, which is not limited.
S404: and generating initial flow data according to the flow packet information.
Optionally, in some embodiments, the initial traffic data is generated according to the traffic packet information, where existing traffic data is obtained by parsing the traffic packet information, the main information is configured as a key, the existing traffic data is configured as a field value of an existing traffic field, the existing traffic data, and the compensation traffic field are used as the initial traffic data, and the key and the initial traffic data form a key-value pair, which can effectively improve the initialization efficiency of the traffic data, and enable the initialized initial traffic data to effectively support personalized traffic data processing operations.
The existing flow data obtained by analyzing the flow packet information may be the existing flow data obtained by analyzing the flow packet information, may be the existing flow data obtained by calling a preconfigured script file and executing the script file to process the flow packet information to obtain the existing flow data, or may be the existing flow data obtained by disassembling a data structure corresponding to the flow packet information and obtaining a flow data field from the data structure, and the flow data corresponding to the flow data field is used as the existing flow data, or may be the existing flow data obtained by acquiring a flow purchase request corresponding to the flow packet information and analyzing the flow purchase request, without limitation.
And then, triggering a step of forming key value pairs, namely forming corresponding key value pairs according to the main body information, the existing flow field, the existing flow data and the compensation flow field.
Of course, any other possible ways to generate the initial traffic data according to the traffic packet information may be adopted, for example, a way of template matching, a way of artificial intelligence model, and the like, which is not limited herein.
S405: and when the processing type is a deduction type, carrying out deduction processing on the existing traffic data corresponding to the existing traffic field.
For the description of S405, reference may be made to the above embodiments, which are not described herein again.
S406: generating subtracted record data, the subtracted record data comprising: the key value pair comprises main information and deduction information, wherein the main information and the deduction information form the key value pair.
When the processing type is a deduction type, after deduction processing is performed on existing traffic data corresponding to an existing traffic field, deduction record data may be generated, where the deduction record data includes: the main body information and the deduction information form key value pairs, so that the backtracking of data related to deduction processing is assisted, and the management operation of subsequent flow data is facilitated.
The deduction information may be used to describe data related to deduction processing, and the deduction information may be, for example, information such as deduction time, deduction data amount, whether deduction is successful, and the like, without limitation.
For example, after the flow rate data deduction processing flow is completed, deduction record data may be generated, where the deduction record data includes main information and deduction information, the main information includes a robot identifier and flow rate packet information purchased by the robot, and the deduction information is information of the deduction time, the deduction data amount, whether deduction is successful, and the like, and then, the deduction record data may be generated by combining data related to deduction processing according to the robot identifier and the flow rate packet information purchased by the robot, which is not limited thereto.
As shown in fig. 5, fig. 5 is a schematic flow chart of a traffic packet processing method in the embodiment of the present disclosure, and a flow related to the traffic data processing method may be divided into five flow modules, including: the flow compensation initialization module, the flow deduction recording module, the flow compensation module and the flow synchronization module may execute the step of generating the deduction recording data through the flow deduction recording module, and execute corresponding flow actions through other modules, which is not limited to this.
For example, as shown in fig. 6, fig. 6 is a schematic diagram of a flow deduction record processing flow in an embodiment of the present disclosure, and may utilize an ordered set (zset) data structure in a Redis database (the ordered set (zset) data structure may be used to store the above-mentioned multiple key value pairs generated in advance, the ordered set (zset) is a data structure of the Redis database and is used to store key value pairs, a key of the ordered set is called a member (member), a value of the ordered set is called a score (score), and the key value pairs include, without limitation, a structure that accesses elements according to the member and the arrangement order of the score and the score, and the key value pairs include: the two parts, Key (Key) and Value (Value), are keyed by the traffic type (traffic-type), the deducted time is the score (score) Value, and the deducted time-robot identification is the member Value, which is not limited.
S407: and synchronously updating the traffic packet information corresponding to the main body information in the relational database according to the deduction record data.
That is, when the corresponding deduction record data is stored in the Redis database, the traffic packet information corresponding to the main body information in the relational database can be synchronously updated according to the deduction record data, so that the consistency of the traffic data in the relational database and the key value database is effectively ensured, and the processing accuracy of the traffic data is ensured.
After the generation of the deduction record data is completed, the traffic packet information corresponding to the main information in the relational database may be updated synchronously according to the deduction record data, for example, the timing synchronization data may be stored in the relational database for persistence by setting a timing data synchronizer.
For example, as shown in fig. 7, fig. 7 is a schematic diagram of a flow data synchronization process in the embodiment of the present disclosure, a timing data synchronizer is provided, since data stored in an ordered set is ordered, the data in the ordered set is sorted by deducting time, a robot identifier having a flow deduction record in the last 10 minutes is searched, then, balance data corresponding to a processing type is obtained from the deduction record data, a hash key is generated according to the robot identifier and the processing type, and the hash key is updated to a relational database by the identifier of the processing type.
S408: when the processing type is the compensation type, compensation traffic data is acquired and configured as a field value corresponding to the compensation traffic field.
For the description of S408, reference may be made to the above embodiments, which are not described herein again.
Optionally, in some embodiments, the present disclosure further supports corresponding management on the first traffic data in the key-value database, so as to avoid that the invalid traffic data consumes a storage resource of the key-value database, guarantee read-write performance of the key-value database, assist in improving execution efficiency of the traffic data processing method, and further obtain traffic usage information corresponding to the first traffic data, and delete a key corresponding to the first traffic information in the key-value database when the traffic usage information meets a set condition.
The setting condition may be pre-configured, specifically, may be configured adaptively according to a demand of a flow data processing scenario, and the setting condition may be, for example, that the duration of the first flow data that is not used is greater than a duration threshold, or may also be any other setting condition in any possible form, which is not limited to this.
The traffic usage information may be used to describe a usage situation of the first traffic data, and the traffic usage information is not limited, for example, a duration of the first traffic data that is not used.
For example, an expired and used traffic packet may be determined in a relational database, then a key value pair corresponding to the traffic packet is determined (that is, a key value pair mapping the traffic packet to a key value database is determined), when the key value pair corresponding to the expired and used traffic packet can be mapped in the key value database, it may be determined that first traffic data in the key value pair satisfies a set condition, then a key mapped by the expired and used traffic packet may be deleted in the key value database (Redis database), and a corresponding field may be deleted, which is not limited thereto.
In this embodiment, the traffic data processing method can be effectively adapted to the personalized processing types, and conflicts caused by the processing requests of different processing types for reading the traffic data are effectively avoided, so that a processing failure event caused by the traffic data processing is avoided, the accuracy of the traffic data processing can be effectively improved, and the traffic data processing effect is effectively improved. The method can effectively improve the initialization efficiency of the flow data, and the initialized initial flow data can effectively support individualized flow data processing operation. Generating subtracted record data, the subtracted record data comprising: the main body information and the deduction information form key value pairs, so that the backtracking of data related to deduction processing is assisted, and the management operation of subsequent flow data is facilitated. When the corresponding deduction record data is stored in the Redis database, the traffic packet information corresponding to the main body information in the relational database can be synchronously updated according to the deduction record data, so that the consistency of the traffic data in the relational database and the key value database is effectively guaranteed, and the processing accuracy of the traffic data is guaranteed.
In the embodiment of the disclosure, when the method is applied to an online intelligent question-answering application scene, the mapping of the flow packet information of the customer service robot to the key value pair in the key value database can be realized, the flow deduction and the flow compensation field separation can be effectively supported under a high concurrent large-flow scene, the faster response speed is realized, meanwhile, the technical problem of failure of flow packet compensation can be effectively solved, and the reliability of robot response is greatly improved.
Fig. 8 is a schematic structural diagram of a traffic data processing apparatus according to an embodiment of the present disclosure.
As shown in fig. 8, the flow data processing apparatus 80 includes:
a receiving module 801, configured to receive a processing request, where the processing request includes: processing type and subject information;
an obtaining module 802, configured to obtain initial traffic data corresponding to the main body information, where the initial traffic data includes: an existing traffic field and a compensating traffic field.
And a deduction module 803, configured to, when the processing type is a deduction type, perform deduction processing on existing traffic data corresponding to the existing traffic field.
And the compensation module 804 is configured to, when the processing type is the compensation type, obtain the compensation traffic data and configure the compensation traffic data as a field value corresponding to the compensation traffic field.
Corresponding to the traffic data processing method provided in the embodiments of fig. 1 to 7, the present disclosure also provides a traffic data processing apparatus, and since the traffic data processing apparatus provided in the embodiments of the present disclosure corresponds to the traffic data processing method provided in the embodiments of fig. 1 to 7, the implementation of the traffic data processing method is also applicable to the traffic data processing apparatus provided in the embodiments of the present disclosure, and will not be described in detail in the embodiments of the present disclosure.
In this embodiment, by receiving a processing request, the processing request includes: processing the type and the main body information, and acquiring initial flow data corresponding to the main body information, wherein the initial flow data comprises: the method comprises the steps of obtaining the compensation flow data when the processing type is the compensation type, configuring the compensation flow data into a field value corresponding to the compensation flow field, enabling the flow data processing method to be effectively adapted to the individualized processing type, effectively avoiding conflict of processing requests of different processing types on reading of the flow data, avoiding processing failure events generated in the flow data processing, effectively improving the accuracy of the flow data processing, and effectively improving the flow data processing effect.
In order to implement the foregoing embodiments, the present disclosure also provides a computer device, including: the system comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein when the processor executes the program, the flow data processing method provided by the previous embodiment of the disclosure is realized.
In order to achieve the above embodiments, the present disclosure also proposes a non-transitory computer-readable storage medium on which a computer program is stored, which when executed by a processor implements the traffic data processing method as proposed by the foregoing embodiments of the present disclosure.
In order to implement the foregoing embodiments, the present disclosure further provides a computer program product, which when executed by an instruction processor in the computer program product, performs the traffic data processing method as set forth in the foregoing embodiments of the present disclosure.
FIG. 9 illustrates a block diagram of an exemplary computer device suitable for use in implementing embodiments of the present disclosure. The computer device 12 shown in fig. 9 is only an example and should not bring any limitations to the functionality or scope of use of the embodiments of the present disclosure.
As shown in FIG. 9, computer device 12 is in the form of a general purpose computing device. The components of computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. These architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus, to name a few.
Computer device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by computer device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 28 may include computer system readable media in the form of volatile Memory, such as Random Access Memory (RAM) 30 and/or cache Memory 32. Computer device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 9, and commonly referred to as a "hard drive").
Although not shown in FIG. 9, a disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a Compact disk Read Only Memory (CD-ROM), a Digital versatile disk Read Only Memory (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the disclosure.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally perform the functions and/or methodologies of the embodiments described in this disclosure.
Computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with computer device 12, and/or with any devices (e.g., network card, modem, etc.) that enable computer device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Moreover, computer device 12 may also communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public Network such as the Internet) via Network adapter 20. As shown, network adapter 20 communicates with the other modules of computer device 12 via bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with computer device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing by executing programs stored in the system memory 28, for example, implementing the flow data processing method mentioned in the foregoing embodiments.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
It should be noted that, in the description of the present disclosure, the terms "first", "second", etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In addition, in the description of the present disclosure, the meaning of "a plurality" is two or more unless otherwise specified.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and the scope of the preferred embodiments of the present disclosure includes other implementations in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the embodiments of the present disclosure.
It should be understood that portions of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried out in the method of implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and the program, when executed, includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present disclosure may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present disclosure. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present disclosure have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present disclosure, and that changes, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present disclosure.

Claims (11)

1. A method for processing traffic data, the method comprising:
receiving a processing request, the processing request comprising: processing type and subject information;
acquiring initial flow data corresponding to the main body information, wherein the initial flow data comprises: the existing flow field and the compensation flow field;
when the processing type is a deduction type, carrying out deduction processing on the existing flow data corresponding to the existing flow field;
when the processing type is a compensation type, obtaining compensation traffic data, and configuring the compensation traffic data as a field value corresponding to the compensation traffic field.
2. The method of claim 1, wherein the obtaining initial traffic data corresponding to the subject information comprises:
if a key corresponding to the body information exists, taking first traffic data corresponding to the key as the initial traffic data, the key and the first traffic data forming a key-value pair;
and if the key corresponding to the main body information does not exist, acquiring the traffic packet information corresponding to the main body information, and generating the initial traffic data according to the traffic packet information.
3. The method of claim 2, wherein said generating the initial traffic data based on the traffic packet information comprises:
analyzing the flow packet information to obtain the existing flow data;
configuring the body information as the key and configuring the existing traffic data as a field value of the existing traffic field;
and taking the existing flow field, the existing flow data and the compensation flow field as the initial flow data, wherein the key and the initial flow data form a key value pair.
4. The method according to claim 1, wherein said deducting existing traffic data corresponding to said existing traffic field comprises:
if the existing flow field has corresponding existing flow data, the existing flow data is deducted;
if the existing flow field does not have the corresponding existing flow data, the compensation flow data is deducted when the compensation flow field has the corresponding compensation flow data;
and if the existing flow field does not have the corresponding existing flow data and the compensation flow field does not have the corresponding compensation flow data, generating a response message, wherein the response message indicates that the flow deduction fails.
5. The method of claim 2, wherein the obtaining traffic packet information corresponding to the body information comprises:
and acquiring traffic packet information corresponding to the main information from a relational database, wherein the key and the first traffic data are stored in a key value database.
6. The method of claim 5, wherein after the deduction processing of the existing traffic data corresponding to the existing traffic field, further comprising:
generating subtracted record data, the subtracted record data comprising: the main body information and the deduction information form a key value pair.
7. The method of claim 6, after the generating the deductive log data, further comprising:
and synchronously updating the traffic packet information corresponding to the main body information in the relational database according to the deduction record data.
8. The method of claim 5, further comprising:
acquiring flow use information corresponding to the first flow data;
and if the flow use information meets the set condition, deleting the key corresponding to the first flow information in the key value database.
9. A traffic data processing apparatus, characterized in that the apparatus comprises:
a receiving module, configured to receive a processing request, where the processing request includes: processing type and subject information;
an obtaining module, configured to obtain initial traffic data corresponding to the main body information, where the initial traffic data includes: the existing flow field and the compensation flow field;
a deduction module, configured to, when the processing type is a deduction type, perform deduction processing on existing traffic data corresponding to the existing traffic field;
and the compensation module is used for acquiring compensation traffic data when the processing type is the compensation type, and configuring the compensation traffic data into a field value corresponding to the compensation traffic field.
10. A computer device, comprising:
at least one processor; and
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 method of any one of claims 1-8.
11. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-8.
CN202210118873.7A 2022-02-08 2022-02-08 Flow data processing method and device, computer equipment and storage medium Pending CN114547023A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210118873.7A CN114547023A (en) 2022-02-08 2022-02-08 Flow data processing method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210118873.7A CN114547023A (en) 2022-02-08 2022-02-08 Flow data processing method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114547023A true CN114547023A (en) 2022-05-27

Family

ID=81673373

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210118873.7A Pending CN114547023A (en) 2022-02-08 2022-02-08 Flow data processing method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114547023A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102025563A (en) * 2010-11-30 2011-04-20 东南大学 Network flow identification method based on Hash collision compensation
CN107707596A (en) * 2017-04-06 2018-02-16 邹霞 Flow accumulation cloud service center system
CN109150764A (en) * 2017-06-16 2019-01-04 中兴通讯股份有限公司 Flow managing method, device, equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102025563A (en) * 2010-11-30 2011-04-20 东南大学 Network flow identification method based on Hash collision compensation
CN107707596A (en) * 2017-04-06 2018-02-16 邹霞 Flow accumulation cloud service center system
CN109150764A (en) * 2017-06-16 2019-01-04 中兴通讯股份有限公司 Flow managing method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN111625452B (en) Flow playback method and system
US9037555B2 (en) Asynchronous collection and correlation of trace and communications event data
CN113360519B (en) Data processing method, device, equipment and storage medium
CN111125106B (en) Batch running task execution method, device, server and storage medium
WO2024041022A1 (en) Database table alteration method and apparatus, device and storage medium
CN111610979A (en) API gateway subjected to persistence and coupling degree optimization and method thereof
CN110413413A (en) A kind of method for writing data, device, equipment and storage medium
CN109241128B (en) Automatic triggering method and system for overdue event
CN111259066A (en) Server cluster data synchronization method and device
CN114461691A (en) Control method and device of state machine, electronic equipment and storage medium
CN111049913B (en) Data file transmission method and device, storage medium and electronic equipment
CN109347899B (en) Method for writing log data in distributed storage system
CN111046245A (en) Multi-source heterogeneous data source fusion calculation method, system, equipment and storage medium
CN114547199A (en) Database increment synchronous response method and device and computer readable storage medium
CN113760242B (en) Data processing method, device, server and medium
WO2021147773A1 (en) Data processing method and apparatus, electronic device and computer-readable storage medium
CN112925796A (en) Write consistency control method, device, equipment and storage medium
CN113204376A (en) File analysis method and device, computer equipment and storage medium
CN110096543B (en) Data operation method, device, server and medium of application program
CN109067649B (en) Node processing method and device, storage medium and electronic equipment
CN114547023A (en) Flow data processing method and device, computer equipment and storage medium
CN110046172A (en) In line computation data processing method and system
CN110327626B (en) Virtual server creation method and device
CN114036218A (en) Data model switching method and device, server and storage medium
WO2023230797A1 (en) Cross-system test method and apparatus

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