A test method in the field of consumption tax
By constructing simulation rules and using a proxy server to handle test requests, the problem of high testing costs for barcode scanners was solved, enabling efficient and realistic system testing and preventing cross-selling.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- AISINO CORPORATION
- Filing Date
- 2024-12-27
- Publication Date
- 2026-06-30
AI Technical Summary
Existing barcode scanner testing methods cannot accurately reproduce the scanning process and time intervals, resulting in high testing costs and instability, and failing to effectively prevent cross-selling.
Construct simulation rules, bind the number of executions and data sources through the first or second rule, or bind user information and data sources, simulate geographically relevant test data, use a proxy server to process test requests, and replace latitude and longitude to simulate QR code scanning operations at different locations.
It improves the coverage and efficiency of system testing, can realistically simulate user QR code scanning operations, ensures test quality without affecting backend business logic, and reduces resource consumption.
Smart Images

Figure CN122309334A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of testing technology, and more specifically, to a testing method in the field of consumption tax. Background Technology
[0002] Globally, numerous trade organizations have signed free trade agreements to further open their markets to each other, eliminate tariffs and non-tariff barriers on most goods, improve market access conditions in the service sector, open up investment, and promote the free flow of factors of production such as goods, services, capital, technology, and personnel, thereby achieving trade and investment liberalization.
[0003] When goods produced in member countries flow between different countries, such as products produced in country A being transported to country B for sale, it is necessary to prevent cross-border sales to avoid tax revenue losses because different countries levy different consumption tax rates on goods from different places of origin and of different categories.
[0004] Existing methods for preventing cross-selling generally involve printing QR codes containing product origin information on the product packaging. The QR code also includes information such as product value and category. Tax invoice producers, tax invoice regulators, invoice buyers, freight forwarders, and consumers can all use a barcode scanner to scan the product's QR code to obtain the product's origin information. At the same time, the barcode scanner internally records its own geographical location information. By comparing the product's origin information with the scanner's geographical information, it can be determined whether cross-selling has occurred.
[0005] When testing barcode scanners, testers cannot physically move them between different locations for testing, as this would significantly increase testing costs. The slap test is a commonly used testing technique in software development that tests software functionality and stability by simulating the behavior of external resources. Its principle is to replace real resources with virtual slaps, thereby making the testing environment more stable and controllable. However, when used for barcode scanner testing, the slap test cannot accurately reproduce the scanning process and time intervals, which is detrimental to the testing process. Summary of the Invention
[0006] This invention provides a testing method in the field of consumption tax to solve the technical problems existing in the prior art.
[0007] To achieve the above objectives, the present invention provides a testing method in the field of consumption tax, comprising:
[0008] S1: Construct simulation rules, which can be either the first rule or the second rule. The first rule is a rule based on the number of executions, and the second rule is a rule based on user information. The first rule binds the number of executions to the corresponding data source, and the second rule binds the user to the corresponding data source. The data source includes multiple test data sets, each of which includes the invoice number, manufacturer, current date, barcode scanner device number, and latitude and longitude.
[0009] S2: Verify the simulation rules. If the verification is successful, proceed to step S3; otherwise, return to S1 to reconstruct the simulation rules.
[0010] S3: Start the mounting service and connect the test request initiator to the proxy server;
[0011] S4: The test request initiator sends a request to the proxy server, which includes the simulation rules;
[0012] S5: The proxy server parses the request and determines whether the simulation rules contain the first rule. If yes, it obtains the number of executions and the corresponding data source, and then executes step S7. If no, it further determines whether the simulation rules contain the second rule. If yes, it extracts the corresponding user information and obtains the corresponding data source, and then executes step S7. If no, it executes step S6.
[0013] S6: Construct a user information request and send it to the test request initiator. The test request initiator receives the user information request and sends the user information to the proxy server.
[0014] S7: The proxy server executes each test data in the data source according to the user information matcher. Before executing each test data, the latitude and longitude in the test data are replaced with preset latitude and longitude.
[0015] S8: The proxy server outputs the execution results and passes them through to the test request initiator.
[0016] In one embodiment of the present invention, the test request end is a barcode scanner.
[0017] In one embodiment of the present invention, the user is the tax invoice producer, tax invoice supervisor, invoice purchaser, freight forwarder, or consumer.
[0018] In one embodiment of the present invention, the first rule and the second rule are stored in the form of key-value pairs.
[0019] In one embodiment of the present invention, the data source is a fixed value or a value stored in a data dictionary.
[0020] The testing method for consumption tax provided by this invention has the following advantages:
[0021] (1) By constructing rules, the geographically relevant test data in the system testing process of the consumption tax field was simulated, which improved the capability boundary of the system test. This made the system test take into account both the simulated experience of real customers and the requirements of test coverage. At the same time, the test rules are easy to edit and manage, which ensures the test quality and improves the test efficiency.
[0022] (2) During testing, it can not only simulate the scanning operation of real users in the operation segment, but also does not affect the backend's test judgment of abnormal business logic, thereby ensuring the smooth progress of the test. This invention does not require the establishment of a real service environment, the test environment is created more quickly, and it consumes fewer resources. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a flowchart illustrating a testing method in the field of consumption tax according to an embodiment of the present invention. Detailed Implementation
[0025] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0026] Figure 1 This is a flowchart illustrating a testing method in the field of consumption tax according to an embodiment of the present invention, as shown below. Figure 1 As shown, the testing method in the field of consumption tax provided by the present invention includes:
[0027] S1: Construct simulation rules, which can be either the first rule or the second rule. The first rule is a rule based on the number of executions, and the second rule is a rule based on user information. The first rule binds the number of executions to the corresponding data source, and the second rule binds the user to the corresponding data source. The data source includes multiple test data sets, each of which includes the invoice number, manufacturer, current date, barcode scanner device number, and latitude and longitude.
[0028] Example of the first rule: Use data A for executions 1-10, and use data B for executions 10-20.
[0029] Example of the second rule: User 1 uses data A, and User 2 uses data B.
[0030] In this embodiment, the data source is a fixed value or a value stored in a data dictionary. When using it, if the data source is a fixed value, it can be directly referenced; if it is a value in a data dictionary, the value in the data dictionary is retrieved and the corresponding data is dynamically returned. All of the above involve program implementation, which are conventional technical means for those skilled in the art, and will not be described in detail here.
[0031] The first and second rules described above satisfy two real-world requirements during actual testing. In this embodiment, the first and second rules are stored in key-value pairs. In other embodiments, they can also be stored in other forms.
[0032] In this embodiment, the number of executions is represented by RTIMES within the program.
[0033] In this embodiment, the user is the tax invoice producer, tax invoice supervisor, invoice purchaser, freight forwarder, or consumer. All of these parties can obtain the tax invoice status and the circulation status of the goods by scanning the QR code of the goods.
[0034] S2: Verify the simulation rules. If the verification is successful, proceed to step S3; otherwise, return to S1 to reconstruct the simulation rules.
[0035] S3: Start the mounting service and connect the test request initiator to the proxy server;
[0036] In this embodiment, the test request end is a barcode scanner. In other embodiments, the test request end can be other ports. The barcode scanners used by different users are all registered in the background. The product's place of origin is obtained by scanning the barcode, and combined with the geographical location of the barcode scanner, it is determined whether cross-selling has occurred.
[0037] S4: The test request initiator sends a request to the proxy server, which includes the simulation rules;
[0038] S5: The proxy server parses the request and determines whether the simulation rules contain the first rule. If yes, it obtains the number of executions and the corresponding data source, and then executes step S7. If no, it further determines whether the simulation rules contain the second rule. If yes, it extracts the corresponding user information and obtains the corresponding data source, and then executes step S7. If no, it executes step S6.
[0039] S6: Construct a user information request and send it to the test request initiator. The test request initiator receives the user information request and sends the user information to the proxy server.
[0040] S7: The proxy server executes each test data in the data source according to the user information matcher. Before executing each test data, the latitude and longitude in the test data are replaced with preset latitude and longitude.
[0041] By replacing the latitude and longitude in the test data, it is possible to simulate different users' experiences with goods delivery, receipt, and terminal sales, and to circumvent the system's anti-automation detection. This simplifies the technical implementation and better simulates the actual usage of users, without affecting the front-end or back-end.
[0042] S8: The proxy server outputs the execution results and passes them through to the test request initiator.
[0043] The testing method for consumption tax provided by this invention has the following advantages:
[0044] (1) By constructing rules, the geographically relevant test data in the system testing process of the consumption tax field was simulated, which improved the capability boundary of the system test. This made the system test take into account both the simulated experience of real customers and the requirements of test coverage. At the same time, the test rules are easy to edit and manage, which ensures the test quality and improves the test efficiency.
[0045] (2) During testing, it can not only simulate the scanning operation of real users in the operation segment, but also does not affect the backend's test judgment of abnormal business logic, thereby ensuring the smooth progress of the test. This invention does not require the establishment of a real service environment, the test environment is created more quickly, and it consumes fewer resources.
[0046] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of one embodiment, and the modules or processes shown in the drawings are not necessarily essential for implementing the present invention.
[0047] Those skilled in the art will understand that the modules in the apparatus of the embodiments can be distributed in the apparatus of the embodiments as described in the embodiments, or they can be located in one or more devices different from this embodiment with corresponding changes. The modules of the above embodiments can be combined into one module, or they can be further divided into multiple sub-modules.
[0048] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A test method in the field of consumption tax, characterized in that, include: S1: Construct simulation rules, which can be either the first rule or the second rule. The first rule is a rule based on the number of executions, and the second rule is a rule based on user information. The first rule binds the number of executions to the corresponding data source, and the second rule binds the user to the corresponding data source. The data source includes multiple test data sets, each of which includes the invoice number, manufacturer, current date, barcode scanner device number, and latitude and longitude. S2: Verify the simulation rules. If the verification is successful, proceed to step S3; otherwise, return to S1 to reconstruct the simulation rules. S3: Start the mounting service and connect the test request initiator to the proxy server; S4: The test request initiator sends a request to the proxy server, which includes the simulation rules; S5: The proxy server parses the request and determines whether the simulation rules contain the first rule. If yes, it obtains the number of executions and the corresponding data source, and then executes step S7. If no, it further determines whether the simulation rules contain the second rule. If yes, it extracts the corresponding user information and obtains the corresponding data source, and then executes step S7. If no, it executes step S6. S6: Construct a user information request and send it to the test request initiator. The test request initiator receives the user information request and sends the user information to the proxy server. S7: The proxy server executes each test data in the data source according to the user information matcher. Before executing each test data, the latitude and longitude in the test data are replaced with preset latitude and longitude. S8: The proxy server outputs the execution results and passes them through to the test request initiator.
2. The test method in the field of consumption tax according to claim 1, characterized in that, The test request is made by a barcode scanner.
3. The test method in the field of consumption tax according to claim 1, characterized in that, Users can be tax invoice producers, tax invoice regulators, invoice purchasers, freight forwarders, or consumers.
4. The testing method in the field of consumption tax according to claim 1, wherein the first rule and the second rule are stored in key-value pair form.
5. The testing method for the consumption tax field according to claim 1, wherein the data source is a fixed value or a value stored in a data dictionary.