Electronic invoice data generation method and system, medium, equipment and product
Through the factory model, it provides common and customized processing objects for different business systems in the electronic invoice platform, solving the interface and process complexity problems when accessing multiple business systems, and achieving high reusability and low-cost electronic invoices Data generation and management.
Patent Information
- Application Number
- CN202411389408.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2024-12-31
AI Technical Summary
When an electronic invoice platform is connected to multiple business systems, it is necessary to provide each system with a separate access interface and a customized invoice process, resulting in an increase in management and operation and maintenance costs.
Using the factory model, the parameter conversion processing object is obtained through the first factory class for parameter filling and verification, the second factory class obtains the invoice process for further verification and parameter conversion, generates electronic invoice data, and processes it through the third factory class. Invoice status notification to achieve universal and customized compatibility of various business systems.
It reduces the difficulty of development and access, improves reusability, and realizes that various business systems are connected to the electronic invoice platform through a unified interface, supports general and customized invoice processing, significantly reducing management and operation and maintenance costs.
Smart Images

Figure CN119228461A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing and application technology, and in particular to a method, system, medium, device and product for generating electronic invoice data. Background Art
[0002] The electronic invoice platform can provide services such as issuance, management, query and reimbursement of electronic invoices for various business systems of the enterprise. In related technologies, the electronic invoice platform provides customized access interfaces and access processes for various business systems. For example, it provides access interface / v1 / link / apply for the second-hand direct business system and access interface / v1 / api / apply for the new house brokerage agency service. It also provides customized invoicing processes for each business system through customized access interfaces for docking and invoicing. As more business systems are to be served, the number of access interfaces and customized invoicing processes also increases, and management costs and operation and maintenance costs increase accordingly. Summary of the invention
[0003] In order to solve the above technical problems, the embodiments of the present disclosure provide a method, system, medium, device and product for generating electronic invoice data.
[0004] According to a first aspect of an embodiment of the present disclosure, a method for generating electronic invoice data is provided, comprising:
[0005] In response to receiving an invoicing request from a business system, based on a target business type in the invoicing request, obtaining a first processing object corresponding to the target business type in a first factory class, wherein the first factory class includes parameter conversion processing objects corresponding to each business type;
[0006] Using the first processing object, perform parameter filling and first verification processing on the original invoicing parameters of the order to be invoiced carried in the invoicing request to obtain filled parameters and a first verification result;
[0007] In response to the first verification result indicating that the verification is passed, obtaining a second processing object corresponding to the target business type in a second factory class, wherein the second factory class includes an invoicing process processing object corresponding to each business type;
[0008] Using the second processing object, performing a second verification process on the filled parameter to obtain a second verification result;
[0009] In response to the second verification result indicating that the verification is passed, the second processing object is used to perform parameter conversion on the filled parameters to obtain electronic invoice data.
[0010] In some embodiments of the present disclosure, after the second processing object is used to perform parameter conversion on the filled parameters to obtain the electronic invoice data, the method further includes:
[0011] Execute an invoicing operation, wherein the invoicing operation includes at least one of the following: storing the electronic invoice data in a database, an approval operation, and an asynchronous invoicing operation.
[0012] In some other embodiments of the present disclosure, after executing the invoicing operation, the process further includes:
[0013] Obtaining a third processing object corresponding to the target business type in a third factory class, wherein the third factory class includes an invoicing status notification processing object corresponding to each business type;
[0014] The third processing object is used to send a billing status notification message to the business system.
[0015] In some other embodiments of the present disclosure, it also includes:
[0016] Pre-generate the invoicing status notification processor interface and the invoicing status notification public methods for each business type;
[0017] By using the factory pattern, based on the public and private methods of invoicing status notification of each business type, the invoicing status notification processing object corresponding to each business type is generated.
[0018] In some further implementations of the present disclosure, the sending of the invoicing status notification message to the business system includes:
[0019] Insert the billing status notification message into a message queue, and the business system obtains the billing status by consuming the messages in the message queue; or
[0020] Sending the invoicing status notification message to the business system by calling the interface of the business system; or,
[0021] The invoicing status notification message is broadcast to the business system via the event bus.
[0022] In some further embodiments of the present disclosure, in response to the first verification result indicating that the verification has not passed, or the second verification result indicating that the verification has not passed, the method further includes:
[0023] An error message is returned to the business system, wherein the error message contains the reason why the verification failed.
[0024] In some other embodiments of the present disclosure, it also includes:
[0025] Pre-generate the invoicing process processor interface and the public invoicing process methods for each business type;
[0026] By using the factory pattern, based on the public and private methods of the invoicing process of each business type, the invoicing process processing objects corresponding to each business type are generated.
[0027] According to a second aspect of an embodiment of the present disclosure, there is provided a device for generating electronic invoice data, comprising:
[0028] A first acquisition module is configured to, in response to receiving an invoicing request from a business system, acquire, based on a target business type in the invoicing request, a first processing object corresponding to the target business type in a first factory class, wherein the first factory class includes a parameter conversion processing object corresponding to each business type;
[0029] A first processing module, configured to perform parameter filling and first verification processing on the original invoicing parameters of the order to be invoiced carried in the invoicing request using the first processing object, to obtain filled parameters and a first verification result;
[0030] A second acquisition module, configured to acquire, in response to the first verification result indicating that the verification is passed, a second processing object corresponding to the target business type in a second factory class, wherein the second factory class includes an invoicing process processing object corresponding to each business type;
[0031] A second processing module, used to perform a second verification process on the filled parameter using the second processing object to obtain a second verification result;
[0032] A third processing module is used to, in response to the second verification result indicating that the verification is passed, use the second processing object to perform parameter conversion on the filled parameters to obtain electronic invoice data.
[0033] In some embodiments of the present disclosure, the device further comprises:
[0034] The invoicing module is used to perform invoicing operations, and the invoicing operations include at least one of the following: storing the electronic invoice data in a database, approval operations, and asynchronous invoicing operations.
[0035] In some further embodiments of the present disclosure, the device further comprises:
[0036] A third acquisition module, used to acquire a third processing object corresponding to the target business type in a third factory class, wherein the third factory class contains an invoicing status notification processing object corresponding to each business type;
[0037] The notification module is used to send a billing status notification message to the business system using the third processing object.
[0038] In some other embodiments of the present disclosure, it also includes:
[0039] The first generation module is used to pre-generate an invoicing status notification processor interface and a public method for invoicing status notification of each business type;
[0040] The second generation module is used to generate the invoicing status notification processing object corresponding to each business type based on the invoicing status notification public method and private method of each business type by using the factory mode.
[0041] In some further embodiments of the present disclosure, the notification module is specifically used to:
[0042] Insert the billing status notification message into a message queue, and the business system obtains the billing status by consuming the messages in the message queue; or
[0043] Sending the invoicing status notification message to the business system by calling the interface of the business system; or,
[0044] The invoicing status notification message is broadcast to the business system via the event bus.
[0045] In some further embodiments of the present disclosure, the device further comprises:
[0046] An error prompt module is used to return an error prompt message to the business system in response to the first verification result indicating that the verification failed, or the second verification result indicating that the verification failed, wherein the error prompt message carries the reason why the verification failed.
[0047] In some other embodiments of the present disclosure, it also includes:
[0048] The third generation module is used to pre-generate the invoicing process processor interface and the public methods of the invoicing process of each business type;
[0049] The fourth generation module is used to generate the invoicing process processing object corresponding to each business type based on the public and private methods of the invoicing process of each business type by using the factory mode.
[0050] According to a third aspect of an embodiment of the present disclosure, there is provided a system for generating electronic invoice data, including: an invoicing interface, a processing unit, and a storage unit;
[0051] The storage unit stores a first factory class, a second factory class, and a third factory class;
[0052] The invoicing interface is used to receive invoicing requests sent by various business systems;
[0053] The processing unit obtains a first processing object corresponding to the target business type in a first factory class based on the target business type in the invoicing request, and the first factory class contains parameter conversion processing objects corresponding to each business type; and uses the first processing object to perform parameter filling and a first verification process on the original invoicing parameters of the order to be invoiced carried in the invoicing request to obtain the filled parameters and a first verification result; in response to the first verification result indicating that the verification is passed, obtains a second processing object corresponding to the target business type in a second factory class, and the second factory class contains invoicing process processing objects corresponding to each business type; uses the second processing object to perform a second verification process on the filled parameters to obtain a second verification result; in response to the second verification result indicating that the verification is passed, uses the second processing object to perform parameter conversion on the filled parameters to obtain electronic invoice data.
[0054] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, wherein the storage medium stores computer program instructions, and when the computer program instructions are executed, the above-mentioned method for generating electronic invoice data is implemented.
[0055] According to a fifth aspect of an embodiment of the present disclosure, an electronic device is provided, the electronic device comprising:
[0056] A memory for storing a computer program product;
[0057] The processor is used to execute the computer program product stored in the memory, and when the computer program product is executed, the above-mentioned method for generating electronic invoice data is implemented.
[0058] According to a sixth aspect of an embodiment of the present disclosure, a computer program product is provided, comprising computer program instructions, which implement the above-mentioned method for generating electronic invoice data when executed by a processor.
[0059] Based on the above embodiments of the present disclosure, when receiving an invoicing request from a business system, based on the target business type in the invoicing request, a first processing object corresponding to the target business type is obtained in the first factory class, and the first factory class contains parameter conversion processing objects corresponding to each business type; and the first processing object is used to perform parameter filling and first verification processing on the original invoicing parameters of the order to be invoiced carried in the invoicing request, and the filled parameters and the first verification result are obtained; in response to the first verification result indicating that the verification is passed, a second processing object corresponding to the target business type is obtained in the second factory class; the second processing object is used to perform a second verification processing on the filled parameters, and the second verification result is obtained; in response to the second verification result indicating that the verification is passed, the second processing object is used to perform parameter conversion on the filled parameters, and the electronic invoice data is obtained. Therefore, the technical solution of the present disclosure can realize the corresponding business processing objects for different business types through the factory mode, decouple the creation of objects from specific implementations, provide a more flexible object creation method, help realize the access of each business system to the electronic invoice platform through a unified interface, realize the compatibility of the general invoicing processing method and the customized invoicing processing method of each business system, and have extremely high reusability, which greatly reduces the difficulty of development and access.
[0060] The technical solution of the present disclosure is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] By describing the embodiments of the present disclosure in more detail in conjunction with the accompanying drawings, the above and other purposes, features and advantages of the present disclosure will become more apparent. The accompanying drawings are used to provide a further understanding of the embodiments of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. In the drawings, the same reference numerals generally represent the same components or steps.
[0062] Figure 1 A flowchart of a method for generating electronic invoice data provided by an exemplary embodiment of the present disclosure;
[0063] Figure 2 The framework diagram of the invoicing process of the electronic invoice platform disclosed in the present invention;
[0064] Figure 3 A flowchart of a method for generating electronic invoice data provided by another exemplary embodiment of the present disclosure;
[0065] Figure 4 This is a schematic diagram of the structure of an embodiment of a device for generating electronic invoice data disclosed in the present invention;
[0066] Figure 5 A schematic diagram of the structure of another embodiment of the device for generating electronic invoice data disclosed in the present invention;
[0067] Figure 6 It is a structural diagram of an electronic device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0068] The exemplary embodiments according to the present disclosure will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all the embodiments of the present disclosure, and it should be understood that the present disclosure is not limited to the exemplary embodiments described here.
[0069] It should be noted that the relative arrangement of components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.
[0070] Those skilled in the art can understand that the terms "first" and "second" in the embodiments of the present disclosure are only used to distinguish different steps, devices or modules, etc., and neither represent any specific technical meaning nor indicate the necessary logical order between them.
[0071] It should also be understood that in the embodiments of the present disclosure, “plurality” may refer to two or more than two, and “at least one” may refer to one, two, or more than two.
[0072] It should also be understood that any component, data or structure mentioned in the embodiments of the present disclosure can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.
[0073] In addition, the term "and / or" in this disclosure is only a description of the association relationship of associated objects, indicating that there may be three relationships, such as A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this disclosure generally indicates that the associated objects before and after are in an "or" relationship.
[0074] It should also be understood that the description of the various embodiments in the present disclosure focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.
[0075] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0076] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.
[0077] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.
[0078] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0079] The embodiments of the present disclosure can be applied to electronic devices such as terminal devices, computer systems, servers, etc., which can operate with many other general or special computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments and / or configurations suitable for use with electronic devices such as terminal devices, computer systems or servers include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, large computer systems, and distributed cloud computing technology environments including any of the above systems, etc.
[0080] Electronic devices such as terminal devices, computer systems, servers, etc. can be described in the general context of computer system executable instructions (such as program modules) executed by computer systems. Generally, program modules can include routines, programs, target programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in a distributed cloud computing environment. In a distributed cloud computing environment, tasks can be performed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.
[0081] SUMMARY OF THE DISCLOSURE
[0082] In the process of implementing the present disclosure, the inventors discovered that when the electronic invoice platform is connected to various business systems for invoicing, it is necessary to provide a separate access interface and a customized invoicing process for each business system. As the number of business systems to be served increases, the number of access interfaces and customized invoicing processes also increases, resulting in a corresponding increase in management costs and operation and maintenance costs.
[0083] In the method for generating electronic invoice data provided by the present invention, each business system can be connected to the electronic invoice platform through a unified interface. The electronic invoice platform can use the factory model to provide a separate business processing object for each business system, thereby achieving compatibility between the general invoicing processing and customized invoicing processing of each business system, and reducing the difficulty of development and access.
[0084] Exemplary Methods
[0085] Figure 1A flowchart of a method for generating electronic invoice data provided by an exemplary embodiment of the present disclosure. The method can be applied on an electronic invoice platform, such as Figure 1 The method shown includes step 101 to step 105. Each step is described below.
[0086] In step 101, in response to receiving an invoicing request from a business system, based on a target business type in the invoicing request, a first processing object corresponding to the target business type is acquired in a first factory class.
[0087] Among them, the first factory class contains parameter conversion processing objects corresponding to each business type. The first factory class is used to indicate the invoicing parameter conversion factory, which contains parameter conversion processing objects corresponding to each business type. The parameter conversion processing object is an instantiated object used to fill in parameters and perform basic verification on the original invoicing parameters. The original invoicing parameters are the parameters for invoicing carried in the invoicing request sent by the business system, such as order information, detailed items, unit price, quantity of goods, etc., buyer identification information, seller identification information, etc.
[0088] Among them, the invoicing request can be a request message sent by the business system to the electronic invoice platform to request the issuance of an invoice. The invoicing request can carry the original invoicing parameters used for invoicing of the order to be invoiced, such as business order number, contract number, amount, invoice amount, quantity of goods, etc.
[0089] In some implementations, since the parameters and requirements for issuing invoices for orders of different business types may be different, the parameter conversion processing methods corresponding to each business type are also different. Each business type may correspond to a parameter conversion processing object to complete and basically verify the parameters. For example, for orders of second-hand housing business type, the invoicing parameters used for issuing invoices include buyer information, seller information, project name, specification model, unit, quantity, unit price, amount, etc.; and for orders of leasing business type, the invoicing parameters used for issuing invoices include information of the lessor and lessee, detailed description of the leased property (such as house address, area, etc.), lease term, rent and payment method, etc.
[0090] In some implementations, the business system may carry invoicing parameters and target business types in the invoicing request, so that the electronic invoice platform may match the first processing object corresponding to the target business type in the first factory class according to the business type. The target business type may be the business type to which the order to be invoiced belongs, such as second-hand housing business, rental business, new housing business, etc.
[0091] In step 102, the first processing object is used to perform parameter filling and first verification processing on the original invoicing parameters of the order to be invoiced carried in the invoicing request to obtain filled parameters and a first verification result.
[0092] Among them, the original invoicing parameters are used to indicate the parameters carried in the invoicing request. The parameters contained in the original invoicing parameters may not include all the parameters required for invoicing, or the parameters contained in the original invoicing parameters may not be completely correct. Therefore, the original invoicing parameters need to be filled and verified through the first processing object. The first verification process is a basic verification of the invoicing parameters, for example, verifying whether the seller code and the seller tax number are both empty (if both are empty, the verification fails); or verifying whether the company information of the current sales company entity is missing (if it is, the verification fails), the invoice type or the receipt method cannot be empty; electronic invoices can only be sent to email and mobile phones, and non-electronic invoices cannot be sent to email and mobile phones; or whether the detailed items are repeated; or whether the quantity and unit price of the service detailed items are both empty; or whether the unit price and quantity of the commodity detailed items are less than 0, etc. The above verification is a basic verification of the invoicing parameters when issuing an invoice.
[0093] In some implementations, if the original invoicing parameter content is incomplete, the parameters may be filled in and completed through a third-party system such as a business system or an order system.
[0094] In some implementations, the electronic invoice platform may match the corresponding first processing object in the first factory class according to the business type corresponding to each invoicing request, and complete the corresponding parameter filling and first verification processing.
[0095] In step 103, in response to the first verification result indicating that the verification is passed, a second processing object corresponding to the target business type is obtained in the second factory class.
[0096] The second factory class contains the invoicing process processing objects corresponding to each business type. The second factory class is used to indicate the invoicing process processing factory, which contains the invoicing process processing objects corresponding to each business type. The invoicing process processing object is an instantiated object used to perform business legality verification, parameter conversion, bill splitting, etc. on the filled parameters.
[0097] In some implementations, there are public methods for the invoicing process in the invoicing process processing flow corresponding to different business types, such as the bill splitting method, the service provider invoicing parameter conversion method, etc. In order to avoid repeatedly writing the code corresponding to the public methods for different business types, the template method pattern can be used in advance to generate the invoicing process processor interface and the public methods for the invoicing process of each business type, and then the factory pattern is used to generate the invoicing process processing objects corresponding to each business type according to the public methods and the private methods corresponding to each business type (the customized part of the invoicing process processing corresponding to each business system). In specific implementation, the public method can be used as the parent class, and the invoicing process processing object corresponding to each business type can be used as the subclass. By calling the parent class, the functions defined by the parent class are implemented to meet the business needs.
[0098] In step 104, a second verification process is performed on the filled parameters using a second processing object to obtain a second verification result.
[0099] Among them, the second verification process is a customized verification of the filled parameters, which is mainly a business verification of the parameters, such as tax disk verification, invoicing point verification, invoicing item configuration verification, invoice type verification, and standby pool invoice verification.
[0100] In some implementations, a second verification process is performed on the filled parameters, and when the second verification result is a passed verification, it can be indicated that the invoicing data corresponding to the current invoicing request is legal and an invoice can be issued. Step 105 can be executed to perform parameter conversion on the filled parameters and convert them into service provider invoicing parameters.
[0101] In step 105, in response to the second verification result indicating that the verification is passed, the filled parameters are transformed using the second processing object to obtain electronic invoice data.
[0102] In some implementations, parameter conversion of filled parameters mainly refers to the process of splitting the data, converting the data into service provider parameters, etc., to obtain electronic invoice data.
[0103] Among them, electronic invoice data is the data for generating electronic invoices, including but not limited to the following items: seller's taxpayer identification number, seller's name, seller's address, seller's telephone number, seller's account number, buyer's taxpayer identification number, buyer's name, buyer's address, buyer's telephone number, buyer's account number, invoice number, invoice date, total amount, total tax amount, total price and tax (uppercase or lowercase), invoice issuer, project name, specification model, unit, unit price, amount, tax rate / collection rate, tax amount, tax-inclusive amount, tax classification of goods and services, etc.
[0104] In some optional implementations, an electronic invoice can be generated based on the electronic invoice data.
[0105] Through the above steps 101-105, when receiving the invoicing request of the business system, based on the target business type in the invoicing request, the first processing object corresponding to the target business type is obtained in the first factory class, and the first factory class contains parameter conversion processing objects corresponding to each business type; and the first processing object is used to fill in the parameters and perform the first verification processing on the original invoicing parameters of the order to be invoiced carried in the invoicing request, and the filled parameters and the first verification result are obtained; in response to the first verification result indicating that the verification is passed, the second processing object corresponding to the target business type is obtained in the second factory class; the second processing object is used to perform the second verification processing on the filled parameters to obtain the second verification result; in response to the second verification result indicating that the verification is passed, the second processing object is used to perform parameter conversion on the filled parameters to obtain the electronic invoice data. Therefore, the technical solution disclosed in the present invention can realize the corresponding business processing objects for different business types through the factory mode, decouple the creation of objects from the specific implementation, provide a more flexible object creation method, help realize the access of each business system to the electronic invoice platform through a unified interface, realize the compatibility of the general invoicing processing method and the customized invoicing processing method of each business system, and have high reusability, which greatly reduces the difficulty of development and access.
[0106] See also Figure 2 , which illustrates the process framework of issuing invoices through the technical solution disclosed in this disclosure. Figure 2As shown, the electronic invoice platform can receive the invoicing request sent by each business system through the invoicing interface (such as / api / v2 / apply), obtain the first processing object corresponding to the target business type from the first factory class OutputApplyConverterFactory according to the target business type in the invoicing request, and perform simple verification and filling on the original invoicing parameters in the invoicing request. For example, the invoicing parameters submitted by the business system are verified through the validate() method, the parameters are completed (filled) through the fillRequest() method, the order data of the business system is obtained through getOrders(), the order data of the business system is merged through mergeOrders(), the invoicing items are merged through mergeItems(), and the invoicing item configuration information is filled through fillItemsConfig(); after the simple verification and completion of the original invoicing request parameters using the first processing object, the second processing object corresponding to the target business type can be obtained from the second factory class OutputApplyProcessorFactory, and the filled parameters are further verified and parameter conversion processed. For example, customized verification (such as tax disk verification) is implemented using validate() Verification, invoicing point verification, invoicing item configuration verification, invoice type verification), use validSpareInfo() to implement standby pool invoice verification, use prepare() to implement invoicing parameter conversion and processing, budget() invoicing budget control, and use convert() to convert invoicing parameters into service provider invoicing parameters; after completing further verification and parameter conversion of invoicing parameters through the second processing object, the application data can be stored in the database, including bill splitting (splitting bills), standby pool invoice processing and order data preservation. If the corresponding business system still needs to approve the invoice, the approval process can be initiated, and when the approval is not passed, the invoicing status notification message can be returned to the business system to notify the business system that the approval has not passed. After the approval is passed, the asynchronous invoicing operation is performed. If the corresponding business system does not need to approve the invoice, the asynchronous invoicing operation can be directly performed after the data is stored in the database; after completing the asynchronous invoicing operation, the third processing object corresponding to the target business type can be obtained from the third factory class OutputApplyStateProcessorFactory through the target business type, and the business system is notified of the invoicing status (invoicing status), thereby completing the invoice issuance process.
[0107] In this implementation, each business system can access the electronic invoice platform through a unified interface, and use the factory model to design corresponding processing objects for parameter conversion processing, invoicing process processing, and invoicing status notification processing in the invoicing business processing flow. This helps to achieve universal invoicing processing and customized invoicing processing for multiple business systems, with high reusability, which greatly reduces the difficulty of developing and accessing the invoicing platform.
[0108] Figure 3 A flowchart of a method for generating electronic invoice data provided by another exemplary embodiment of the present disclosure. The present disclosure embodiment takes the generation of electronic invoices as an example for exemplary description. Figure 3 The method shown includes step 301 to step 308. Each step is described below.
[0109] In step 301, in response to receiving an invoicing request from a business system, based on a target business type in the invoicing request, a first processing object corresponding to the target business type is acquired in a first factory class.
[0110] The first factory class includes parameter conversion processing objects corresponding to each business type.
[0111] In step 302, the first processing object is used to perform parameter filling and first verification processing on the original invoicing parameters of the order to be invoiced carried in the invoicing request to obtain filled parameters and a first verification result.
[0112] In step 303, in response to the first verification result indicating that the verification is passed, a second processing object corresponding to the target business type is obtained in the second factory class, and the second factory class includes an invoicing process processing object corresponding to each business type.
[0113] In step 304, a second verification process is performed on the filled parameters using a second processing object to obtain a second verification result.
[0114] In step 305, in response to the second verification result indicating that the verification is passed, the filled parameters are converted using the second processing object to obtain electronic invoice data.
[0115] In some implementations, the implementation of steps 301 to 305 can be seen in Figure 1 The description of steps 101 to 105 of the illustrated embodiment will not be repeated in detail here.
[0116] In step 306, the invoicing operation is performed, and the invoicing operation includes at least one of the following: storing the electronic invoice data in a database, an approval operation, and an asynchronous invoicing operation.
[0117] In some implementations, the invoicing operation may include storing the electronic invoice data in a database and performing an asynchronous invoicing operation; in other optional implementations, the invoicing operation may also include storing the electronic invoice data in a database, performing an approval operation, and performing an asynchronous invoicing operation.
[0118] Among them, storing the obtained electronic invoice data in the database helps to manage and query electronic invoices and improve work efficiency. Approving electronic invoice data is an operation performed by the business system to further ensure the correctness of electronic invoice data. Each business system can determine whether to approve electronic invoice data according to needs; asynchronous invoicing operation refers to an invoicing method in which the invoice request and result query are performed asynchronously.
[0119] In step 307, a third processing object corresponding to the target business type is obtained in the third factory class.
[0120] The third factory class includes the invoicing status notification processing object corresponding to each business type. The third factory class is used to indicate the invoicing application status notification factory, which includes the invoicing status notification processing object corresponding to each business type. The invoicing status notification processing object is an instantiated object used to notify the business system of the invoicing status.
[0121] In some implementations, there are public methods for the invoicing process in the invoicing status notification processing flow corresponding to different business types, such as sending electronic invoices to mobile phones and emails, etc. In order to avoid repeated writing of codes corresponding to public methods for different business types, the template method mode can be used in advance to generate the invoicing status notification processor interface and the public methods for invoicing status notification of each business type, and then the factory mode is used to generate the invoicing status notification processing object corresponding to each business type according to the public methods and the private methods corresponding to each business type (the customized part of the invoicing process processing corresponding to each business system, such as the method of sending invoicing status notification). In specific implementation, the public method can be used as the parent class, and the invoicing status notification processing object corresponding to each business type can be used as the subclass. By calling the parent class, the functions defined by the parent class are implemented to meet the business needs.
[0122] In step 308, a billing status notification message is sent to the business system using the third processing object.
[0123] In some embodiments, the method of sending the invoicing status notification message to the business system can be: inserting the invoicing status notification message into a message queue, and the business system obtains the invoicing status by consuming the messages in the message queue; or, sending the invoicing status notification message to the business system by calling the interface of the business system; or, broadcasting the invoicing status notification message to the business system through an event bus.
[0124] Among them, the invoicing status notification message is inserted into the message queue, so that the business system can obtain the invoicing status carried in the invoicing status notification message by consuming the message queue. The business system does not need to wait for the completion of the invoicing operation and can continue to perform other tasks, which helps to reduce the complexity of the electronic invoice platform, reduce the direct dependency between the business system, and improve the scalability and flexibility of the electronic invoice platform. Sending the invoicing status notification message by calling the interface of the business system helps to return the message to the business system in a timely manner; and broadcasting the invoicing status notification message through the event bus realizes the publish / subscribe mode, broadcasting the notification message to all business systems, and each business system can receive the message by monitoring the event.
[0125] The electronic invoice data generation method disclosed in the present invention discloses the complete process of obtaining electronic invoices. Through the unified invoicing access interface / v2 / api / apply, three factory class methods are used to obtain the corresponding business processing objects according to the target business type to process the invoicing process, thereby achieving the unification and high reusability of the invoicing access interface, and also solving the problems of too many business access interfaces, inconsistent business logic and unclear invoicing process.
[0126] Exemplary Devices
[0127] Figure 4 FIG. 1 is a schematic diagram of the structure of an embodiment of the electronic invoice data generation device disclosed in the present invention. Figure 4 As shown, the device comprises:
[0128] A first acquisition module 41 is used for, in response to receiving an invoicing request from a business system, acquiring a first processing object corresponding to the target business type in a first factory class based on the target business type in the invoicing request, wherein the first factory class includes parameter conversion processing objects corresponding to each business type;
[0129] The first processing module 42 is used to perform parameter filling and first verification processing on the original invoicing parameters of the order to be invoiced carried in the invoicing request using the first processing object, and obtain the filled parameters and the first verification result;
[0130] A second acquisition module 43 is used for acquiring a second processing object corresponding to the target business type in a second factory class in response to the first verification result indicating that the verification is passed, wherein the second factory class includes an invoicing process processing object corresponding to each business type;
[0131] The second processing module 44 is used to perform a second verification process on the filled parameters using a second processing object to obtain a second verification result;
[0132] The third processing module 45 is used to perform parameter conversion on the filled parameters using the second processing object in response to the second verification result indicating that the verification is passed, so as to obtain electronic invoice data.
[0133] Figure 5 A schematic diagram of the structure of another embodiment of the electronic invoice data generation device disclosed in the present invention. Figure 5 As shown, in Figure 4 Based on the illustrated embodiment, in some embodiments of the present disclosure, the device further includes:
[0134] The invoicing module 46 is used to perform invoicing operations, which include at least one of the following: storing electronic invoice data in a database, approval operations, and asynchronous invoicing operations.
[0135] In some further embodiments of the present disclosure, the device further comprises:
[0136] A third acquisition module 47 is used to acquire a third processing object corresponding to the target business type in a third factory class, wherein the third factory class contains an invoicing status notification processing object corresponding to each business type;
[0137] The notification module 48 is used to send a billing status notification message to the business system using the third processing object.
[0138] In some other embodiments of the present disclosure, it also includes:
[0139] The first generation module 49 is used to pre-generate an invoicing status notification processor interface and an invoicing status notification public method for each business type;
[0140] The second generating module 50 is used to generate the invoicing status notification processing object corresponding to each business type based on the invoicing status notification public method and private method of each business type by using the factory mode.
[0141] In some further embodiments of the present disclosure, the notification module 48 is specifically used to:
[0142] Insert the billing status notification message into the message queue, and the business system obtains the billing status by consuming the messages in the message queue; or
[0143] By calling the interface of the business system, a billing status notification message is sent to the business system; or,
[0144] Broadcast invoicing status notification messages to the business system via the event bus;
[0145] In some further embodiments of the present disclosure, the device further comprises:
[0146] The error prompt module 51 is used to return an error prompt message to the business system in response to the first verification result indicating that the verification failed, or the second verification result indicating that the verification failed, wherein the error prompt message carries the reason why the verification failed.
[0147] In some other embodiments of the present disclosure, it also includes:
[0148] The third generation module 52 is used to pre-generate an invoicing process processor interface and public methods of the invoicing process for each business type;
[0149] The fourth generation module 53 is used to generate the invoicing process processing object corresponding to each business type based on the public and private methods of the invoicing process of each business type by using the factory mode.
[0150] The device of the embodiment of the present disclosure can be used to implement the methods of the above-mentioned embodiments of the present disclosure. The two correspond to each other in specific implementation, and the specific implementations of related parts are referenced to each other, which will not be repeated here.
[0151] Exemplary electronic devices, computer program products, and computer-readable storage media
[0152] An embodiment of the present disclosure further provides an electronic device, comprising: a memory for storing a computer program; a processor for executing the computer program stored in the memory, and when the computer program is executed, the method for generating electronic invoice data of any of the above embodiments of the present disclosure is implemented.
[0153] Below, reference Figure 6 An electronic device according to an embodiment of the present disclosure is described, in which a device for implementing the method according to an embodiment of the present disclosure may be integrated. Figure 6 A structural diagram of an electronic device provided in an exemplary embodiment of the present disclosure, such as Figure 6 As shown, the electronic device includes one or more processors 61, one or more computer-readable storage media memory 62, and a computer program stored in the memory and executable on the processor. When executing the program in the memory 62, the above-mentioned method for generating electronic invoice data can be implemented.
[0154] Specifically, in practical applications, the electronic device may further include components such as an input device 63 and an output device 64, and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown). Those skilled in the art will appreciate that Figure 6 The structure of the electronic device shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or certain components, or different component arrangements.
[0155] The processor 61 can be a central processing unit (CPU) or other forms of processing units with the ability to generate electronic invoice data and / or execute instructions. It performs various functions and processes data by running or executing software programs and / or modules stored in the memory 62, and calling data stored in the memory 62, thereby monitoring the electronic device as a whole.
[0156] The memory 62 may store one or more computer program products, and the memory may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The above-mentioned volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. The above-mentioned non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program products may be stored on the computer-readable storage medium, and the processor 61 may run the computer program products to implement the above-mentioned method for generating electronic invoice data of various embodiments of the present disclosure and / or other desired functions.
[0157] The input device 63 can be used to receive input digital or character information. The input device 63 can include a keyboard, a mouse, a joystick, etc. related to user settings and function control.
[0158] The output device 64 can output various information to the outside, including the determined distance information, direction information, etc. The output device 64 can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.
[0159] The electronic device may also include a power supply for supplying power to various components, which may be logically connected to the processor 61 through a power management system, so as to manage charging, discharging, power consumption and other functions through the power management system. The power supply may also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.
[0160] Of course, to simplify, Figure 6 Only some of the components related to the present disclosure in the electronic device are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device may further include any other appropriate components.
[0161] The disclosed embodiment also provides a system for generating electronic invoice data, characterized in that it includes: an invoicing interface, a processing unit, and a storage unit; the storage unit stores a first factory class, a second factory class, and a third factory class; the invoicing interface is used to receive invoicing requests sent by various business systems; the processing unit obtains a first processing object corresponding to the target business type in the first factory class based on the target business type in the invoicing request, and the first factory class contains parameter conversion processing objects corresponding to each business type; and uses the first processing object to fill in parameters and perform a first verification process on the original invoicing parameters of the order to be invoiced carried in the invoicing request to obtain the filled parameters and a first verification result; in response to the first verification result indicating that the verification is passed, obtain a second processing object corresponding to the target business type in the second factory class, and the second factory class contains invoicing process processing objects corresponding to each business type; use the second processing object to perform a second verification process on the filled parameters to obtain a second verification result; in response to the second verification result indicating that the verification is passed, use the second processing object to perform parameter conversion on the filled parameters to obtain electronic invoice data.
[0162] In addition to the above-mentioned methods and devices, an embodiment of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the method for generating electronic invoice data according to various embodiments of the present disclosure described in the above-mentioned "Exemplary Method" section of this specification.
[0163] The computer program product may be written in any combination of one or more programming languages to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0164] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium having computer program instructions stored thereon. When the computer program instructions are executed by a processor, the processor executes the steps of the method for generating electronic invoice data according to various embodiments of the present disclosure described in the above “Exemplary Method” section of this specification.
[0165] Computer readable storage media can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0166] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.
[0167] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0168] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk, etc., various media that can store program codes.
[0169] The method and apparatus of the present disclosure may be implemented in many ways. For example, the method and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
[0170] The description of the present disclosure is given for the purpose of illustration and description, and is not intended to be exhaustive or to limit the present disclosure to the disclosed form. Many modifications and variations will be apparent to those of ordinary skill in the art. The embodiments are selected and described in order to better illustrate the principles and practical applications of the present disclosure, and to enable those of ordinary skill in the art to understand the present disclosure and thereby design various embodiments with various modifications suitable for specific uses.
Claims
1. A method for generating electronic invoice data, characterized in that: include: In response to receiving an invoicing request from a business system, based on a target business type in the invoicing request, obtaining a first processing object corresponding to the target business type in a first factory class, wherein the first factory class includes parameter conversion processing objects corresponding to each business type; Using the first processing object, perform parameter filling and first verification processing on the original invoicing parameters of the order to be invoiced carried in the invoicing request to obtain filled parameters and a first verification result; In response to the first verification result indicating that the verification is passed, obtaining a second processing object corresponding to the target business type in a second factory class, wherein the second factory class includes an invoicing process processing object corresponding to each business type; Using the second processing object, performing a second verification process on the filled parameter to obtain a second verification result; In response to the second verification result indicating that the verification is passed, the second processing object is used to perform parameter conversion on the filled parameters to obtain electronic invoice data.
2. The method according to claim 1, characterized in that After the second processing object is used to transform the filled parameters to obtain the electronic invoice data, the method further includes: Execute an invoicing operation, wherein the invoicing operation includes at least one of the following: storing the electronic invoice data in a database, an approval operation, and an asynchronous invoicing operation.
3. The method according to claim 2, characterized in that After the invoicing operation is executed, the following steps are also included: Obtaining a third processing object corresponding to the target business type in a third factory class, wherein the third factory class includes an invoicing status notification processing object corresponding to each business type; The third processing object is used to send a billing status notification message to the business system.
4. The method according to claim 3, characterized in that Also includes: Pre-generate the invoicing status notification processor interface and the public invoicing status notification methods for each business type; By using the factory pattern, based on the public and private methods of invoicing status notification of each business type, the invoicing status notification processing object corresponding to each business type is generated.
5. The method according to claim 3, characterized in that: The sending of the invoicing status notification message to the business system includes: Insert the billing status notification message into a message queue, and the business system obtains the billing status by consuming the messages in the message queue; or Sending the invoicing status notification message to the business system by calling the interface of the business system; or, The invoicing status notification message is broadcast to the business system via the event bus.
6. The method according to any one of claims 1 to 5, characterized in that: In response to the first verification result indicating that the verification failed, or the second verification result indicating that the verification failed, the method further includes: An error message is returned to the business system, wherein the error message contains the reason why the verification failed.
7. The method according to any one of claims 1 to 6, characterized in that: Also includes: Pre-generate the invoicing process processor interface and the public invoicing process methods for each business type; By using the factory pattern, based on the public and private methods of the invoicing process of each business type, the invoicing process processing objects corresponding to each business type are generated.
8. A system for generating electronic invoice data, characterized in that: include: Invoicing interface, processing unit, storage unit; The storage unit stores a first factory class, a second factory class, and a third factory class; The invoicing interface is used to receive invoicing requests sent by various business systems; The processing unit obtains a first processing object corresponding to the target business type in a first factory class based on the target business type in the invoicing request, wherein the first factory class includes parameter conversion processing objects corresponding to each business type; and uses the first processing object to perform parameter filling and first verification processing on original invoicing parameters of the order to be invoiced carried in the invoicing request, to obtain filled parameters and a first verification result; In response to the first verification result indicating that the verification is passed, a second processing object corresponding to the target business type is obtained in the second factory class, and the second factory class contains invoicing process processing objects corresponding to each business type; using the second processing object, a second verification process is performed on the filled parameters to obtain a second verification result; in response to the second verification result indicating that the verification is passed, the second processing object is used to perform parameter conversion on the filled parameters to obtain electronic invoice data.
9. A computer-readable storage medium, wherein the storage medium stores computer program instructions, and when the computer program instructions are executed, the method according to any one of claims 1 to 7 is implemented.
10. An electronic device, comprising: a memory for storing a computer program product; A processor is used to execute the computer program product stored in the memory, and when the computer program product is executed, it implements the method described in any one of claims 1 to 7.
11. A computer program product comprising computer program instructions, characterized in that When the computer program instructions are executed by a processor, the method described in any one of claims 1 to 7 is implemented.