Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is capable of implementation in many different ways than those herein set forth and of similar import by those skilled in the art without departing from the spirit of this application and is therefore not limited to the specific implementations disclosed below.
The terminology used in the description of the one or more embodiments is for the purpose of describing the particular embodiments only and is not intended to be limiting of the description of the one or more embodiments. As used in one or more embodiments of the present specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in one or more embodiments of the present specification refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It will be understood that, although the terms first, second, etc. may be used herein in one or more embodiments to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first can also be referred to as a second and, similarly, a second can also be referred to as a first without departing from the scope of one or more embodiments of the present description. The word "if" as used herein may be interpreted as "at" \8230; "or" when 8230; \8230; "or" in response to a determination ", depending on the context.
First, the noun terms to which one or more embodiments of the present invention relate are explained.
And (4) accounting: accounting, which is used herein to reflect and express economic activities according to specific rules by using currency as a measurement scale, is to register and reflect the results of product business by using accounting language and method, and aims to provide valuable information for stakeholders;
accounting: the method is characterized in that the accounting process carries out specific matters of the accounting process such as collection, recording and calculation of original documents, and the requirements are standard and accurate, so that the effective implementation of accounting is ensured;
accounting and accounting: and carrying out accounting processing on the corresponding account according to a certain accounting rule.
First, a framework of an accounting component involved in the accounting method of one or more embodiments of the present specification is schematically described. Referring to fig. 1, to support billing for multiple billing periods for multiple accounting products for multiple accounting subjects, one or more embodiments of the specification disclose an accounting component comprising a billing period configuration component 101, an accounting message grounding component 102, an accounting aggregation component 103, and an accounting billing component 104.
The accounting period configuration component 101 is configured to configure an accounting period of an accounting product corresponding to an accounting subject;
the accounting message landing component 102 is used for acquiring an accounting message generated by the service and generating an accounting message table;
the accounting summary component 103 is used for generating an accounting task which is not accounted and corresponds to an accounting main body according to an accounting message table;
accounting billing component 104 is configured to bill for the unsettled accounting tasks and mark the state of the billed accounting tasks as billed.
In the present application, a billing method and apparatus, a computing device and a computer storage medium are provided, which are described in detail in the following embodiments one by one.
Fig. 2 is a block diagram illustrating a configuration of a computing device 200 according to an embodiment of the present description. The components of the computing device 200 include, but are not limited to, a memory 210 and a processor 220. The processor 220 is coupled to the memory 210 via a bus 230 and the database 250 is used to store data.
Computing device 200 also includes access device 240, access device 240 enabling computing device 200 to communicate via one or more networks 260. Examples of such networks include the Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the internet. Access device 240 may include one or more of any type of network interface (e.g., a Network Interface Card (NIC)) whether wired or wireless, such as an IEEE802.11 Wireless Local Area Network (WLAN) wireless interface, a worldwide interoperability for microwave access (Wi-MAX) interface, an ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a bluetooth interface, a Near Field Communication (NFC) interface, and so forth.
In one embodiment of the present description, the other components of the computing device 200 described above and not shown in FIG. 2 may also be connected to each other, such as by a bus. It should be understood that the block diagram of the computing device structure shown in FIG. 2 is for purposes of example only and is not limiting as to the scope of the description. Those skilled in the art may add or replace other components as desired.
Computing device 200 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), a mobile phone (e.g., smartphone), a wearable computing device (e.g., smartwatch, smartglasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or PC. Computing device 200 may also be a mobile or stationary server.
Wherein processor 220 may perform the steps of the method of fig. 3. Fig. 3 is a schematic flow chart diagram illustrating a billing method according to one or more embodiments of the present specification, including steps 302 to 306:
302. acquiring an accounting message generated by a service, obtaining a corresponding accounting parameter according to the accounting message, and generating an accounting message table according to the accounting parameter, wherein the accounting parameter comprises an accounting main body corresponding to the accounting message.
In particular, this step can be performed by an accounting message landing component of the accounting component.
In more detail, referring to fig. 4, obtaining the corresponding accounting parameter according to the accounting message includes:
402. and acquiring an accounting main body, an accounting product, an accounting billing period, a billing amount, a billing time and accounting message landing time carried in the accounting message.
404. And searching an account corresponding to the accounting message.
406. And calculating the batch number of the accounting message according to the accounting time and the accounting message landing time carried in the accounting message.
It should be noted that the execution flow shown in fig. 3 is a schematic illustration of one or more embodiments of the present specification. As for the execution sequence of steps 404 and 406, steps 404 and 406 may be executed in parallel, or step 406 may be executed first and then step 404 is executed.
The method for calculating the lot number in step 406 includes:
1) judging whether the floor time of the accounting message is greater than the accounting time, if so, executing the step 2), and if not, executing the step 3).
2) The batch number of the accounting message is obtained by adding a time difference value to the accounting time; wherein the time difference is obtained by rounding the ratio of the number of minutes of a day to the accounting period corresponding to the accounting message and then adding 1.
Specifically, the batch number of the accounting message = billing time + [ (24 × 60/billing period for this subject change product) rounded up +1].
For example: the accounting time is 20181001, the accounting period is 30, the prefix of the calculated batch number is filled with zero to four bits, and the batch number of the finally generated accounting message is 201810010049.
It should be noted that, because backlog delivery may exist in the accounting message, there is a concept of accounting a message bottom lot, all the delayed backlog accounting messages are classified into the accounting message bottom lot, and the above-mentioned batch number of the accounting message obtained by calculation is actually the accounting message bottom lot number.
3) And the batch number of the accounting message is obtained by comparing the number of minutes from the zero point of the day to the accounting time with the number of minutes from the zero point of the day to the accounting message landing time to obtain a larger value, and then rounding the ratio of the larger value to the accounting period of the accounting message.
Specifically, the lot number of the accounting message = [ max (number of minutes from zero point of the day to accounting time, number of minutes from zero point of the day to accounting message landing time)/accounting period of the accounting message ] is rounded up, and the prefix is padded to 4 bits.
Specifically, in one example, the format of the accounting message table is shown in table 1.
TABLE 1
304. Acquiring an accounting main body in a pre-stored accounting period configuration table, acquiring accounting parameters of accounting messages corresponding to the acquired accounting main body in an accounting message table, and generating corresponding accounting tasks according to the accounting parameters of the accounting messages; wherein the generated status of the accounting task is marked as not billed.
The accounting period configuration table may be pre-generated by the accounting period configuration component. The accounting period configuration component is mainly used for configuring different accounting periods for different accounting main bodies and different products according to different accounting demands. Different accounting periods can be configured for different accounting subjects, so that accounting can be processed at different accounting frequencies in the accounting stage.
The billing period configuration table is shown in table 2.
TABLE 2
Accounting main body
|
Accounting product
|
Accounting period
|
3008
|
P1
|
5 minutes
|
3009
|
P2
|
30 minutes
|
SPV
|
P3
|
60 minutes |
Wherein step 304 is accomplished by the accounting summarization component in a three-tier scheduling multi-threaded concurrency manner. A three-layer schedule architecture diagram for the accounting summary component is shown in figure 5. As can be seen from fig. 5, after the summary task is generated, the first layer splits the summary task to obtain first sub summary tasks, which are respectively sent to the second layer, and then the second layer splits the first sub summary tasks to obtain second sub summary tasks, which are then distributed to the third layer for execution. Action execution at each level may be achieved through distribution to clustered machines.
Referring to fig. 6, step 304 includes:
602. and generating a summary task.
Alternatively, the rollup task may be the EC-accumulator-sliceSummaryTask task. The summary task is generated by a first timed task timed trigger.
604. And acquiring an accounting main body in an accounting period configuration table, and splitting the summary task based on the accounting main body to obtain a first sub summary task.
Wherein this step may be performed by the first thread. For example, the accounting main bodies in the accounting period configuration table are 3, the first thread splits the summary task to obtain 3 first sub summary tasks, and each first sub summary task corresponds to one accounting main body.
606. And splitting the first sub-summary task based on the accounting period to obtain a second sub-summary task.
This step may be performed by a second thread. For example, corresponding to 3 first sub-summary tasks, the number of the second threads is 3, and each second thread splits the first sub-summary task based on the accounting period to obtain a second sub-summary task.
For example, each accounting main body corresponds to 5 accounting periods, and the first sub-summary task is split based on the accounting periods, so as to obtain 5 second sub-summary tasks, as shown in fig. 5. The accounting main body and the accounting period corresponding to each second sub-summary task are shown in table 3.
TABLE 3
608. And executing the second sub-summary task, acquiring the accounting parameters of the accounting message corresponding to the accounting main body and the accounting period of the second sub-summary task in the accounting message table, generating the corresponding accounting task according to the accounting parameters of the accounting message, and storing the corresponding accounting task in the accounting task table.
This step may be performed by a third thread. From table 3, five second sub-summary tasks may generate 15 accounting tasks. Referring to table 4, table 4 is a generated accounting task table. The accounting task table in one or more embodiments of the present specification may be an ac _ tally _ task _ detail table. For the purpose of schematically illustrating the structure of the accounting tasks, not all 15 accounting tasks are listed in table 4, but 3 accounting tasks are exemplarily listed, each accounting task corresponding to an accounting main body and an accounting period.
TABLE 4
In table 4, state S indicates that the state of the accounting task is not accounted.
306. And acquiring at least one accounting task which is not accounted, executing accounting processing, and marking the state of the accounting task after the accounting processing as accounted.
Wherein step 306 is accomplished by the accounting component in a three-tier scheduling multi-threaded concurrency manner. A three-layer scheduling architecture diagram for the accounting billing component is shown in fig. 7. As can be seen from fig. 7, after the accounting task is generated, the first layer splits the accounting task to obtain the first sub-accounting tasks, and sends the first sub-accounting tasks to the second layer, and then the second layer splits the first sub-accounting tasks to obtain the second sub-accounting tasks, and sends the second sub-accounting tasks to the third layer for execution. Action execution at each level may be achieved through distribution to clustered machines.
Referring to fig. 8, step 306 includes:
802. and generating a billing task.
Specifically, the accounting task may be an EC-center-sliceTallyTask task. The accounting task is generated by the timing trigger of the second timing task.
804. And acquiring an accounting main body in an accounting period configuration table, and splitting the accounting task based on the accounting main body to obtain a first sub-accounting task.
Wherein this step may be performed by a fourth thread. For example, the accounting main bodies in the accounting period configuration table are 3, the first thread splits the accounting task into 3 first sub-accounting tasks, and each first sub-accounting task corresponds to one accounting main body.
806. And splitting the first sub-accounting task based on the account number to obtain a second sub-accounting task.
This step may be performed by a fifth thread. For example, corresponding to 3 first sub-accounting tasks, the number of the second threads is 3, and each fifth thread splits the first sub-accounting task based on the account number to obtain a second sub-accounting task.
For example, each accounting main body corresponds to 5 account numbers, and the first sub-accounting task is split based on the account numbers, so as to finally obtain 5 second sub-accounting tasks, as shown in fig. 7. The accounting main body and the accounting period corresponding to each second sub-accounting task are shown in table 5.
TABLE 5
808. And executing the second sub-accounting task, acquiring an accounting task with a non-accounting state corresponding to an accounting main body and an account number of the second sub-accounting task in a pre-stored accounting task table, executing accounting processing on the non-accounting task, and marking the accounting task with the accounting state after the accounting processing in the accounting task table as an accounted state.
This step may be performed by a sixth thread. According to table 5, the five second sub-accounting tasks may acquire 15 unsettled accounting tasks, and then perform the status marking of the accounting tasks after accounting processing in the accounting task table of accounting processing as accounted.
Table 6 shows a table of accounting tasks that mark accounting tasks as billed. It should be noted that, in table 6, not all 15 accounting tasks marked as accounted are listed, but 3 accounting tasks marked as accounted are exemplarily listed, and each accounting task corresponds to an accounting subject and an account.
TABLE 6
In table 6, state F indicates that the state of the accounting task is billed.
The accounting method disclosed in one or more embodiments of the present specification can acquire an accounting message generated by a service, generate an accounting message table according to an accounting parameter of the accounting message, then acquire an accounting main body in a pre-stored accounting period configuration table, acquire an accounting parameter of the accounting message corresponding to the acquired accounting main body in the accounting message table, and generate an accounting task that is not accounted according to the accounting parameter of the accounting message; and then, performing accounting processing on at least one unsettled accounting task, and marking the state of the accounting task after the accounting processing as accounted, so that independent accounting completion of a plurality of accounting main bodies can be realized without mutual influence, and accounting requirements of the plurality of accounting main bodies can be efficiently completed.
In addition, through the accounting method, the accounting is not needed to be carried out every other day like the traditional financial institution, so that the accounting frequency is improved.
Moreover, different accounting periods can be configured for accounting messages generated by different products of the same accounting main body, so that differential accounting processing is realized.
One or more embodiments of the present specification further disclose an accounting apparatus, referring to fig. 9, including:
an accounting message obtaining module 902, configured to obtain an accounting message generated by a service, obtain a corresponding accounting parameter according to the accounting message, and generate an accounting message table according to the accounting parameter, where the accounting parameter includes an accounting main body corresponding to the accounting message;
an accounting task summarizing module 904, configured to obtain an accounting main body in a pre-stored accounting period configuration table, obtain an accounting parameter of an accounting message corresponding to the obtained accounting main body in an accounting message table, and generate a corresponding accounting task according to the accounting parameter of the accounting message; wherein the generated status of the accounting task is marked as not billed;
and the accounting task processing module 906 is configured to acquire at least one unsettled accounting task, perform accounting processing, and mark the state of the accounting task after the accounting processing as accounted.
In one or more embodiments of the present specification, referring to fig. 9, the accounting message acquiring module 902 further includes:
a carried parameter acquiring module 9022, configured to acquire an accounting main body, an accounting product, an accounting billing period, a billing amount, a billing time and accounting message landing time carried in the accounting message;
the account determining module 9024 is configured to search for an account corresponding to the accounting message;
the batch number determining module 9026 is configured to calculate the batch number of the accounting message according to the accounting time and the accounting message landing time carried in the accounting message.
In one or more embodiments of the present disclosure, the lot number determination module 9026 includes:
the judging module is configured to judge whether the accounting message landing time is greater than the accounting time, if so, the first calculating module is executed, and if not, the second calculating module is executed;
a first calculation module configured to acquire a batch number of the accounting message by adding a time difference value by a billing time; the time difference is obtained by rounding the ratio of the number of minutes of a day to the accounting period corresponding to the accounting message and then adding 1 to the value;
and the second calculation module is configured to obtain a larger value by comparing the number of minutes from the zero point of the day to the accounting time with the number of minutes from the zero point of the day to the accounting message landing time, and then rounding the ratio of the larger value to the accounting period of the accounting message to obtain the batch number of the accounting message.
In one or more embodiments of the present description, the accounting period configuration table includes: accounting main bodies and corresponding accounting periods;
referring to fig. 9, the accounting task summarization module 904 comprises:
a summary task generation module 9042 configured to generate a summary task;
the first scheduling module 9044 is configured to acquire an accounting main body in an accounting period configuration table, and split the summary task based on the accounting main body to obtain a first sub summary task;
a second scheduling module 9046, configured to split the first sub-summary task based on the accounting period to obtain a second sub-summary task;
and the third scheduling module 9048 is configured to execute the second sub-summary task, acquire an accounting parameter of the accounting message corresponding to the accounting main body and the accounting period of the second sub-summary task in the accounting message table, generate a corresponding accounting task according to the accounting parameter of the accounting message, and store the corresponding accounting task in the accounting task table.
The summary task is generated by the timing trigger of the first timing task.
In one or more embodiments of the present description, the accounting tasks include: accounting main body, accounting product, accounting period, account number, batch number, accounting amount and state;
referring to fig. 9, the accounting task processing module 906 includes:
an accounting task generation module 9062 configured to generate an accounting task;
the fourth scheduling module 9064 is configured to acquire an accounting main body in an accounting period configuration table, and split the accounting task based on the accounting main body to obtain a first sub-accounting task;
the fifth scheduling module 9066 is configured to split the first sub-accounting task based on the account number to obtain a second sub-accounting task;
a sixth scheduling module 9068, configured to execute the second sub-accounting task, acquire an accounting task whose state corresponding to the accounting main body and the account number in the pre-stored accounting task table is an un-accounted accounting task, then perform accounting processing on the un-accounted accounting task, and mark the state of the accounting task after accounting processing in the accounting task table as accounted.
Optionally, the accounting task is generated by a second timed task timed trigger.
The accounting device provided by the application can acquire the accounting message generated by the service, generate an accounting message table according to the accounting parameters of the accounting message, acquire the accounting main body in the pre-stored accounting period configuration table, acquire the accounting parameters of the accounting message corresponding to the acquired accounting main body in the accounting message table, and generate the non-accounted accounting task according to the accounting parameters of the accounting message; and then, performing accounting processing on at least one unsettled accounting task, and marking the state of the accounting task after the accounting processing as accounted, so that independent accounting completion of a plurality of accounting main bodies can be realized without mutual influence, and accounting requirements of the plurality of accounting main bodies can be efficiently completed.
The above is an illustrative scheme of a billing device of one or more embodiments of the present specification. It should be noted that the technical solution of the accounting device belongs to the same concept as the technical solution of the accounting method described above, and for details that are not described in detail in the technical solution of the accounting device, reference may be made to the description of the technical solution of the accounting method described above.
One or more embodiments of the present specification also provide a computing device comprising a memory, a processor, and computer instructions stored on the memory and executable on the processor, the processor implementing the steps of the billing method described above when executing the instructions.
One or more embodiments of the present specification also provide a computer readable storage medium storing computer instructions which, when executed by a processor, implement the steps of the billing method as described above.
The above is an illustrative version of a computer-readable storage medium of one or more embodiments of the present description. It should be noted that the technical solution of the storage medium belongs to the same concept as the technical solution of the aforementioned accounting method, and for details that are not described in detail in the technical solution of the storage medium, reference may be made to the description of the technical solution of the aforementioned accounting method.
The computer instructions comprise computer program code which may be in the form of source code, object code, an executable file or some intermediate form, or the like. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U.S. disk, removable hard disk, magnetic diskette, optical disk, computer Memory, read-Only Memory (ROM), random Access Memory (RAM), electrical carrier wave signal, telecommunications signal, and software distribution medium, etc. It should be noted that the computer-readable medium may contain suitable additions or subtractions depending on the requirements of legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer-readable media may not include electrical carrier signals or telecommunication signals in accordance with legislation and patent practice.
It should be noted that for simplicity and convenience of description, the above-described method embodiments are described as a series of combinations of acts, but those skilled in the art will appreciate that the present application is not limited by the order of acts, as some steps may, in accordance with the present application, occur in other orders and/or concurrently. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The preferred embodiments of the present application disclosed above are intended only to aid in the explanation of the application. Alternative embodiments are not exhaustive and do not limit the invention to the precise embodiments described. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the application and its practical application, to thereby enable others skilled in the art to best understand and utilize the application. The application is limited only by the claims and their full scope and equivalents.