Quotation matching method, device, equipment and medium
Patent Information
- Application Number
- CN202611211204.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-11
- Publication Date
- 2026-10-27
AI Technical Summary
[0009]本发明实施例提供了一种报价匹配方法、装置、设备及介质,所述方法包括响应于报价匹配指令,获取对应的初始报价数据集和初始链列表;对所述初始报价数据集进行数据封装处理得到目标报价数据集;利用所述目标报价数据集对所述初始链列表进行数据组装处理得到目标链列表;基于责任链匹配策略和所述目标链列表对所述目标报价数据集中候选报价列表进行列表校验与匹配处理得到匹配结果。因此,本发明实施例利用数据封装后的所述目标报价数据集对所述初始链列表进行数据组装得到所述目标链列表,以基于责任链匹配策略和所述目标链列表对所述目标报价数据集中候选报价列表进行列表校验与匹配处理得到匹配结果,实现匹配机制的差异化、通用化和智能化,确保匹配的准确性,从而提高处理效率。
Smart Images

Figure CN122989261A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method, apparatus, device, and medium for matching quotes. Background Technology
[0002] In supply chain finance platforms, matching financing quotes is one of the core business processes. When a supplier initiates a financing application, the system needs to match an applicable financing quote from the funder's pre-set quote database. Different projects (product lines) have significantly different rules for quote matching: some projects use exact matching, while others use generalized matching.
[0003] In existing price matching technologies, a fixed strategy is used at startup, but different projects require different price matching strategies. As the number of projects increases, the demand for differentiated price matching continues to grow, making it impossible to serve multiple projects simultaneously, resulting in low processing efficiency. Summary of the Invention
[0004] This invention provides a price matching method, apparatus, device, and medium, aiming to solve the problem that existing price matching technologies cannot serve multiple projects simultaneously, resulting in low processing efficiency.
[0005] To address the aforementioned problems, in a first aspect, embodiments of the present invention provide a price matching method, the price matching method comprising: In response to the quote matching command, obtain the corresponding initial quote dataset and initial chain list; The initial quote dataset is encapsulated to obtain the target quote dataset; The target chain list is obtained by assembling the initial chain list using the target quote dataset. Based on the chain of responsibility matching strategy and the target chain list, the candidate quote list in the target quote dataset is validated and matched to obtain the matching result.
[0006] Secondly, embodiments of the present invention provide a price matching device, the price matching device comprising: The acquisition unit is used to acquire the corresponding initial quote dataset and initial chain list in response to the quote matching instruction; A data encapsulation unit is used to encapsulate the initial quotation dataset to obtain a target quotation dataset. A data assembly unit is used to perform data assembly processing on the initial chain list using the target quote dataset to obtain a target chain list; The verification and matching unit is used to perform list verification and matching processing on the candidate quotation list in the target quotation dataset based on the chain of responsibility matching strategy and the target chain list to obtain the matching result.
[0007] Thirdly, embodiments of the present invention provide a computer device, the computer device including a memory and a processor connected to the memory; the memory is used to store a computer program, and the processor is used to run the computer program stored in the memory to perform the method described in the first aspect above.
[0008] Fourthly, embodiments of the present invention provide a storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, implement the method described in the first aspect.
[0009] This invention provides a price matching method, apparatus, device, and medium. The method includes, in response to a price matching instruction, acquiring a corresponding initial price dataset and an initial chain list; encapsulating the initial price dataset to obtain a target price dataset; assembling the initial chain list using the target price dataset to obtain a target chain list; and performing list validation and matching on the candidate price list in the target price dataset based on a chain of responsibility matching strategy and the target chain list to obtain a matching result. Therefore, this invention utilizes the encapsulated target price dataset to assemble the initial chain list into the target chain list, and then performs list validation and matching on the candidate price list in the target price dataset based on a chain of responsibility matching strategy and the target chain list to obtain a matching result. This achieves a differentiated, universal, and intelligent matching mechanism, ensuring matching accuracy and thus improving processing efficiency. Attached Figure Description
[0010] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 A schematic flowchart of the quotation matching method provided in an embodiment of the present invention; Figure 2 A schematic block diagram of a price matching device provided in an embodiment of the present invention; Figure 3 A schematic block diagram of a computer device provided for an embodiment of the present invention. Detailed Implementation
[0012] 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, not all, of the embodiments of the present invention. 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.
[0013] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0014] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0015] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0016] It should be noted that if any AI models, software tools, or components not belonging to the inventors appear in the embodiments of this invention, they are merely illustrative examples and do not represent actual use. All user personal information involved in the embodiments of this invention is obtained by entities authorized (knowing and consenting) or fully authorized by all parties through various legal and compliant means. The collection, storage, use, processing, transmission, provision, and disclosure of the information, data, and signals involved all comply with relevant laws and regulations and do not violate public order and good morals.
[0017] Please see Figure 1 , Figure 1 This is a flowchart illustrating the price matching method provided in an embodiment of the present invention. Figure 1 As shown, an embodiment of the present invention provides a price matching method, which includes the following steps S110-S140.
[0018] S110. In response to the quote matching instruction, obtain the corresponding initial quote dataset and initial chain list.
[0019] In this embodiment, the application scenario of this solution can be in the data interaction scenario in the financial field. For example, when the caller's financing application arrives, the quotation matching instruction will be automatically generated.
[0020] In response to a quote matching instruction, the system obtains the corresponding initial quote dataset and initial chain list. Specifically, upon receiving the quote matching instruction, the `CashBiddingService.filterCashBiddingVos` algorithm is invoked to initiate quote matching to obtain the initial quote dataset and the initial chain list. The initial quote dataset includes a candidate quote list and quote parameters. The candidate quote list consists of all potentially matching quotes pre-searched from the database. The quote parameters include information about the asset to be financed (including project identifier, asset level range, etc.), asset package identifier, financing amount, current operating company identifier, and optional project identifier specified by the caller. The initial chain list consists of all filter instances and selector instances injected by the Spring container, including a first initial instance list and a second initial instance list. The first initial instance list contains initial filter instances, and the second initial instance list contains initial selector instances.
[0021] S120. Perform data encapsulation processing on the initial quotation dataset to obtain the target quotation dataset.
[0022] In this embodiment, after obtaining the initial quote dataset, the initial quote dataset can be encapsulated to obtain the target quote dataset. The target quote dataset includes a matching context object and a project configuration object.
[0023] In one embodiment, the step of performing data encapsulation processing on the initial quote dataset to obtain the target quote dataset includes: The initial quotation dataset is initialized to obtain the intermediate quotation dataset; Construct a matching context object and encapsulate the intermediate quote dataset into the matching context object; The project configuration object is obtained by querying the project identifier in the initial quotation dataset. The matching context object and the project configuration object are used as the target quote dataset.
[0024] In this embodiment, the initialization process of the initial quote dataset to obtain the intermediate quote dataset specifically involves initializing the financeability flag of each candidate quote in the candidate quote list of the initial quote dataset to Y, representing initial default availability, as the intermediate quote dataset.
[0025] The process involves constructing a matching context object and encapsulating the intermediate quote dataset into the matching context object. Specifically, a matching context object, CashBiddingFilterContext, is constructed, and the candidate quote list and quote parameters from the intermediate quote data are all encapsulated into the matching context object, serving as the data carrier for the entire matching process.
[0026] The process of querying the project identifier in the initial quote dataset to obtain the project configuration object involves, specifically, calling the preset customer center service `platformCustProjectProvider.getProjectById` to retrieve the corresponding project configuration object `CustProject` based on the project identifier `projectId` carried in the asset information to be financed in the quote parameters. The project configuration object may include the project identifier, a set of matching rules, etc.
[0027] After obtaining the matching context object and the project configuration object, the matching context object and the project configuration object are used as the target quote dataset.
[0028] As can be seen from the above embodiments, the target price dataset is obtained by encapsulating the initial price dataset. The target price dataset serves as the data carrier for the entire matching process, ensuring the accuracy of subsequent processing and thus improving processing efficiency.
[0029] S130. The target chain list is obtained by performing data assembly processing on the initial chain list using the target quote dataset.
[0030] In this embodiment, after obtaining the target quote dataset, the initial chain list can be assembled using the target quote dataset to obtain a target chain list. The target chain list includes a first target chain list and a second target chain list. The first target chain list is a filter list, and the second target chain list is a selector list. Specifically, after the request entry point obtains CustProject, it calls two assembly algorithms from FilterFactory: generateCashBiddingFilter for assembling the filter chain and generateCashBiddingFinisher for assembling the selector chain. Both algorithms internally delegate to the same generic algorithm generateFilter. After two assembly steps, a filter list and a selector list specific to the current request are obtained, serving as input for constructing the chain of responsibility.
[0031] Simultaneously, a custom annotation named `@PrepareFor` is defined as a declarative tag for runtime strategy assembly. This annotation applies to types (i.e., the implementation class of filters or selectors), and its metadata constraints are as follows: the target is a class (`@Target` is set to `TYPE`), and it cannot be used for algorithms or fields; the retention strategy is runtime (`@Retention` is set to `RUNTIME`), ensuring that the Spring container can obtain the annotation information during reflection; it is marked as writable in JavaDoc documentation (`@Documented`); and it is marked as inheritable (`@Inherited`), so subclasses automatically inherit the annotation declaration of their parent class. The annotation declaration has two key attributes: the first attribute is `projectIdAcceptor`, which is of type `ProjectIdAcceptor` enumeration, with a default value of `ProjectIdAcceptor.DEFAULT`. This attribute is used to identify the project identifier to which the current implementation class applies. For example, a value of `DEFAULT` indicates that the implementation is a general default implementation, effective for all projects (unless replaced by a custom implementation); a value of `CW` indicates that the implementation is only effective in the first project scenario; and a value of `LLS_REFACTOR` indicates that the implementation is only effective in the second project scenario. The second property is `replaceClass`, of type `Class`, with a default value of `Object.class`. This property declares the default implementation class that the current implementation class will replace. When the framework performs strategy assembly at runtime, it reads this property value of the custom implementation and removes default implementations of the same type from the default implementation list, thus achieving the semantics of the custom implementation replacing the default implementation. The default value `Object.class` indicates that this implementation does not replace any class; that is, it exists as an independently added implementation.
[0032] The ProjectIdAcceptor enumeration value is an enumeration class that defines the project-level identifiers available in the system. The current enumeration contains three values: CW for the first project (associated with the string cw), LLS_REFACTOR for the second project (associated with the string lls_refactor), and DEFAULT for the default / general mode (associated with the string default). The enumeration defines a static algorithm, choose, used to determine the project identifier to use based on the request context.
[0033] In one embodiment, the step of using the target quote dataset to perform data assembly processing on the initial linked list to obtain the target linked list includes: Obtain the pricing parameters from the target pricing dataset; The preset identifier inference algorithm is invoked to perform identifier inference processing on the quotation parameters to obtain the project identifier enumeration value; Read the first annotation of each first initial instance in the first initial instance list of the initial linked list, and extract the first item attribute value of the first annotation; A first intermediate instance list is obtained by performing a first filtering process on the first initial instance list using the first project attribute value and the first preset identifier. The first comparison result is obtained by comparing the enumerated value of the project identifier with the second preset identifier; The first target chain list is obtained by replacing and assembling the first comparison result and the first intermediate instance list.
[0034] In this embodiment, obtaining the pricing parameters from the target pricing dataset specifically involves the request entry point, after obtaining the target pricing dataset, calling the assembly algorithm generateCashBiddingFilter to obtain the pricing parameters. These pricing parameters may include four parameters: a project identifier parameter (which can be null), a project configuration object CustProject, a lower limit of the asset level fromLevel, and an upper limit of the asset level toLevel.
[0035] The preset identifier inference algorithm is invoked to perform identifier inference processing on the quotation parameters to obtain project identifier enumeration values. Specifically, the ProjectIdAcceptor.choose algorithm is invoked, and the quotation parameters specified by the caller are passed in, so as to return a clear project identifier enumeration value perfectAcceptor (which can be one of DEFAULT, CW, or LLS_REFACTOR), indicating which project's strategy should be used for this request.
[0036] Further, the step of calling a preset identifier inference algorithm to perform identifier inference processing on the quotation parameters to obtain the project identifier enumeration value includes: judging whether the project identifier parameter in the quotation parameters is not empty; if it is not empty, the value is returned directly, skipping subsequent inference logic; if it is empty, i.e., not explicitly specified, the automatic inference branch is entered, first verifying the asset level range parameter: if the upper limit is less than the lower limit, a runtime exception is thrown: the level parameter is incorrect, preventing illegal input; the project identifier parameter is initialized to DEFAULT; the project judgment algorithm is called to obtain the remark field corresponding to the project identifier parameter from the first initial instance list, and the remark field and the third preset identifier are judged using the project judgment algorithm; if the remark field is equal to the third preset identifier, the project identifier parameter is rewritten to the third preset identifier; if the remark field is not equal to the third preset identifier, the project identifier parameter remains DEFAULT. The third preset identifier can be the identifier of a specific project, for example, it can be CW, etc.
[0037] The process involves reading the first annotation of each first initial instance in the first initial instance list of the initial linked list and extracting the first project attribute value of the first annotation; specifically, the projectIdAcceptor attribute value of the first annotation @PrepareFor of each first initial instance is read and used as the first project attribute value. The first initial instance list is a filter list.
[0038] The first intermediate instance list is obtained by performing a first filtering process on the first initial instance list using the first item attribute value and the first preset identifier. Specifically, in the first initial instance list, instances whose first item attribute value is equal to the first preset identifier are filtered out, and the corresponding instances are used as the first intermediate instance list. The first preset identifier can be DEFAULT.
[0039] The comparison process of the project identifier enumeration value with the second preset identifier to obtain a first comparison result specifically includes two results: one is that the project identifier enumeration value is not equal to the second preset identifier, and the other is that the project identifier enumeration value is equal to the second preset identifier. The second preset identifier can be DEFAULT.
[0040] In one embodiment, the step of obtaining the first target chain list by replacing and assembling based on the first comparison result and the first intermediate instance list includes: When the first comparison result is that the project identifier enumeration value is not equal to the second preset identifier, the first initial instance list is subjected to a second filtering process using the first project attribute value and the project identifier enumeration value to obtain a second intermediate instance list. Obtain several first-type attribute values of all first intermediate instances in the first intermediate instance list, and obtain several second-type attribute values of all second intermediate instances in the second intermediate instance list; For each of the several second-class attribute values, if the second-class attribute value is equal to the first-class attribute value, then the first intermediate instance corresponding to the first-class attribute value is removed from the first intermediate instance list to obtain the updated first intermediate instance list. The updated first intermediate instance list is assembled into the second intermediate instance list to obtain the first target chain list.
[0041] In this embodiment, when the first comparison result is that the project identifier enumeration value is not equal to the second preset identifier, the first initial instance list is subjected to a second filtering process using the first project attribute value and the project identifier enumeration value to obtain a second intermediate instance list; specifically, in the first initial instance list, instances whose first project attribute value is equal to the project identifier enumeration value are filtered out, and the corresponding instances are used as the second intermediate instance list.
[0042] When the first comparison result is equal to the project identifier enumeration value, the first intermediate instance list defaultFilters is returned directly without further processing.
[0043] Obtain several first-class attribute values of all first intermediate instances in the first intermediate instance list, and obtain several second-class attribute values of all second intermediate instances in the second intermediate instance list.
[0044] For each of the plurality of second-class attribute values, if the second-class attribute value is equal to the first-class attribute value, then the first intermediate instance corresponding to the first-class attribute value is removed from the first intermediate instance list to obtain an updated first intermediate instance list; specifically, for each of the plurality of second-class attribute values, if the second-class attribute value is equal to the first-class attribute value, then the first intermediate instance corresponding to the first-class attribute value is removed from the first intermediate instance list to obtain an updated first intermediate instance list.
[0045] The updated first intermediate instance list is assembled into the second intermediate instance list to obtain the first target chain list; specifically, the remaining updated first intermediate instance list is appended to the end of the second intermediate instance list to form the first target chain list.
[0046] In one embodiment, the step of using the target quote dataset to perform data assembly processing on the initial linked list to obtain the target linked list further includes: Read the second annotation of each second initial instance in the second initial instance list of the initial linked list, and extract the second item attribute value of the second annotation; A third intermediate instance list is obtained by performing a first filtering process on the second initial instance list using the second project attribute value and the first preset identifier. The second comparison result is obtained by comparing the enumerated value of the project identifier with the second preset identifier. The second target chain list is obtained by replacing and assembling the second comparison result and the third intermediate instance list.
[0047] In this embodiment, the second annotation of each second initial instance in the second initial instance list of the initial linked list is read, and the second project attribute value of the second annotation is extracted; specifically, the projectIdAcceptor attribute value of the @PrepareFor annotation of each second initial instance is read as the second project attribute value. The second initial instance list is a selector list.
[0048] The process of using the second item attribute value and the first preset identifier to perform a first filtering process on the second initial instance list to obtain a third intermediate instance list specifically involves filtering out instances in the second initial instance list whose second item attribute value is equal to the first preset identifier, and using the corresponding instances as the third intermediate instance list.
[0049] The comparison process of the project identifier enumeration value with the second preset identifier to obtain a second comparison result specifically includes two results: one is that the project identifier enumeration value is not equal to the second preset identifier, and the other is that the project identifier enumeration value is equal to the second preset identifier.
[0050] In one embodiment, the step of obtaining the second target chain list by replacing and assembling based on the second comparison result and the third intermediate instance list includes: When the second comparison result is that the project identifier enumeration value is not equal to the second preset identifier, the second initial instance list is subjected to a second filtering process using the second project attribute value and the project identifier enumeration value to obtain a fourth intermediate instance list. Obtain several third-class attribute values of all third intermediate instances in the third intermediate instance list, and obtain several fourth-class attribute values of all fourth intermediate instances in the fourth intermediate instance list; For each of the fourth attribute values, if the fourth attribute value is equal to the third attribute value, then the third intermediate instance corresponding to the third attribute value is removed from the third intermediate instance list to obtain an updated third intermediate instance list. The updated third intermediate instance list is assembled into the fourth intermediate instance list to obtain the second target chain list.
[0051] In this embodiment, when the second comparison result is that the project identifier enumeration value is not equal to the second preset identifier, the second initial instance list is subjected to a second filtering process using the second project attribute value and the project identifier enumeration value to obtain a fourth intermediate instance list; specifically, in the second initial instance list, instances whose second project attribute value is equal to the project identifier enumeration value are filtered out, and the corresponding instances are used as the fourth intermediate instance list.
[0052] When the second comparison result is equal to the project identifier enumeration value, the third intermediate instance list defaultFilters is returned directly without further processing.
[0053] Obtain several third-class attribute values of all third intermediate instances in the third intermediate instance list, and obtain several fourth-class attribute values of all fourth intermediate instances in the fourth intermediate instance list.
[0054] For each of the plurality of fourth-category attribute values, if the fourth-category attribute value is equal to the third-category attribute value, then the third intermediate instance corresponding to the third-category attribute value is removed from the third intermediate instance list to obtain an updated third intermediate instance list; specifically, for each of the plurality of fourth-category attribute values, if the fourth-category attribute value is equal to the third-category attribute value, then the third intermediate instance corresponding to the third-category attribute value is removed from the third intermediate instance list to obtain an updated third intermediate instance list.
[0055] The updated third intermediate instance list is assembled into the fourth intermediate instance list to obtain the second target chain list; specifically, the remaining updated third intermediate instance list is appended to the end of the fourth intermediate instance list to form the second target chain list.
[0056] As can be seen from the above embodiments, the target chain list is obtained by assembling the initial chain list using the target quote dataset. The differentiated matching rules for new projects can be implemented by creating a new implementation class and the @PrepareFor annotation, without modifying any line of the core code. This fully complies with the open / closed principle, and the logic of existing projects is not affected in any way. The regression test scope is limited to the newly added implementation class, thereby improving processing efficiency.
[0057] S140. Based on the chain of responsibility matching strategy and the target chain list, perform list verification and matching processing on the candidate quotation list in the target quotation dataset to obtain the matching result.
[0058] In this embodiment, after determining the target quote dataset and the target chain list, a matching result can be obtained by performing list validation and matching processing on the candidate quote list in the target quote dataset based on the chain of responsibility matching strategy and the target chain list.
[0059] In one embodiment, the step of performing list validation and matching processing on the candidate quote list in the target quote dataset based on the chain of responsibility matching strategy and the target chain list to obtain the matching result includes: Obtain the first target chain list and the second target chain list of the target chain list, and construct a responsibility chain object using a preset request entry point, and pass the first target chain list and the second target chain list into the responsibility chain object; In the chain of responsibility object, a preset execution chain algorithm is invoked to obtain the instance field index value, the current index value, and the length of the first list; Assign the instance field index value to the current index value, and compare the instance field index value with the length of the first list; If the instance field index value is less than the length of the first list, then the first list instance at the corresponding position in the first target linked list is obtained using the instance field index value, and the instance field index value is incremented by 1. A preset verification algorithm is triggered, and a candidate quotation list in the target quotation dataset is obtained. The verification algorithm and the first list instance are used to verify each quotation element in the candidate quotation list to obtain a verification result. If the verification result is that the price does not match, the corresponding price element is removed from the candidate price list to obtain an updated candidate price list. The instance field index value is then assigned to the current index value, and the instance field index value is compared with the length of the first list. If the instance field index value is equal to the length of the first list, then the current index value is backflowed to obtain the previous index value, and the difference between the length of the first list and the preset value is obtained as the comparison value. The previous index value is compared with the comparison value. If the previous index value is equal to the comparison value, a preset final matching algorithm is triggered. The updated candidate bid list is matched using the aforementioned final matching algorithm to obtain the matching result.
[0060] In this embodiment, the first target chain list and the second target chain list are obtained from the target chain list, and a responsibility chain object is constructed using a preset request entry point. The first target chain list and the second target chain list are then passed into the responsibility chain object. Specifically, the first target chain list and the second target chain list are obtained, and a responsibility chain object is constructed using the builder pattern CashbiddingFilterChain.builder() with the request entry point. The first target chain list and the second target chain list are then passed into the responsibility chain object.
[0061] Within the chain of responsibility object, a preset execution chain algorithm is invoked to obtain the instance field index value, the current index value, and the first list length. Specifically, within the chain of responsibility object, the execution chain algorithm `filterChain.doChain(cashBiddingContext)` is invoked to initiate execution, first obtaining the instance field index value, the current index value, and the first list length. Here, the instance field index value is a variable, initially set to 0; the current index value is a variable; and the first list length refers to the length of the first target chain list.
[0062] The step involves assigning the instance field index value to the current index value and comparing the instance field index value with the length of the first list. Specifically, the instance field index value is assigned to the current index value, that is, the instance field index value is saved to the current index value, at which point the instance field index value is equal to the current index value. After that, the instance field index value is compared with the length of the first list.
[0063] If the instance field index value is less than the length of the first list, then the first list instance at the corresponding position in the first target linked list is obtained using the instance field index value, and the instance field index value is incremented by 1; specifically, when the instance field index value is less than the length of the first list, the first list instance at the corresponding position in the first target linked list is obtained using the instance field index value, and the value of the instance field index value is incremented by 1.
[0064] The process involves triggering a preset verification algorithm and obtaining a candidate quote list from the target quote dataset. The verification algorithm and the first list instance are then used to verify each quote element in the candidate quote list to obtain a verification result. Specifically, the verification algorithm may include amount verification, interest rate verification, etc. The verification algorithm and the first list instance are used to verify each quote element in the candidate quote list to obtain the verification result.
[0065] If the verification result is a mismatch with the quote, the corresponding quote element is removed from the candidate quote list to obtain an updated candidate quote list. The instance field index value is then assigned to the current index value, and the instance field index value is compared with the length of the first list. Specifically, when the verification result is a mismatch with the quote, meaning the data in the quote element is not equal to or outside the corresponding range of the amount or interest rate verification data in the verification algorithm, the corresponding list element is removed from the first list instance to obtain the updated first list instance. Then, a recursive loop is entered, again assigning the instance field index value to the current index value and comparing the instance field index value with the length of the first list, and performing the steps following this comparison step.
[0066] If the instance field index value is equal to the length of the first list, then the current index value is backflowed to obtain the previous index value, and the difference between the length of the first list and a preset value is obtained as a comparison value. Specifically, the instance field index value and the length of the first list are compared until the instance field index value equals the length of the first list. Then, the current index value is backflowed to obtain the previous index value, and the difference between the length of the first list and a preset value is obtained as a comparison value. The preset value is 1.
[0067] The previous index value is compared with the comparison value. If the previous index value is equal to the comparison value, a preset final matching algorithm is triggered. Specifically, the previous index value is compared with the comparison value. When the previous index value is equal to the comparison value, that is, the last filter instance is being processed, the final matching algorithm is triggered.
[0068] The process of matching the updated candidate bid list using the final matching algorithm to obtain the matching result involves, specifically, traversing each instance of the second list in the second target linked list and implementing degeneralization logic for the updated candidate bid list using the final matching algorithm. For example, the final matching algorithm can group the updated candidate bid list into several groups according to the core enterprise identifier, funding party identifier, and bid type. Within each group, it checks whether there is a precise bid for a specific supplier (spyId not null). If a precise bid exists, the generalized bid for all suppliers (spyId not null) is automatically removed. Simultaneously, data matching is performed according to priority matching rules to obtain the matching result. The matching results can be categorized as follows: Priority 1 (highest): both supplier identifier (spyId) and core enterprise identifier (ceId) match; Priority 2: only supplier identifier (spyId) matches; Priority 3: only core enterprise identifier (ceId) matches; Priority 4 (lowest): none of the above match, returning all filtered results. Matching rules: 1. Start matching from Priority 1; if a result is found, use that level's result; 2. If no result is found in Priority 1, downgrade to Priority 2, and so on; 3. The number of matching results at any level must be 1 (uniqueness constraint); 4. If multiple quotes are matched at the same level, log the results and throw a business exception, forcing a data problem investigation. The matching result is the final quote returned. After the chain of responsibility returns, the request entry retrieves the final remaining quote list from the context and returns it to the caller as the return value; this list is the final result of this matching.
[0069] The recursive call relationship of the chain of responsibility is illustrated as follows: Let the filter list be [F1, F2, F3] and the selector list be [Fn1, Fn2]. The call stack of the entire chain of responsibility unfolds as follows: The caller `filterChain.doChain` enters; index=0, currentIndex=0, triggering `F1.doFilter`; F1 executes the verification logic; F1 calls `filterChain.doChain`; index=1, currentIndex=1, triggering `F2.doFilter`; F2 executes the verification logic; F2 calls `filterChain.doChain`; index=2 ... When Index=2, F3.doFilter is triggered; F3 executes the validation logic; F3 calls filterChain.doChain, index=3 (already equal to the filter length), and no new filters are triggered; at this point, the judgment that currentIndex=3 equals the number of filters minus 1 (i.e., 2) is false, and no final selection is triggered; the control flow back layer by layer to the previous doChain (i.e., the layer triggered by F3), at which point currentIndex=2 equals 3-1=2, triggering the final selection phase, and Fn1.chooseResult and Fn2.chooseResult are called sequentially, finally obtaining the matching result and writing it back to the context. Here, the filter list is the first target chain list, the final selector list is the second target chain list, filterChain.doChain executes the chain algorithm, index is the instance field index value, currentIndex is the current index value, doFilter is the validation algorithm, and Fn1.chooseResult and Fn2.chooseResult are the final selection matching algorithms.
[0070] Example of annotation usage on implementation classes: Taking the customization of the default selector in the first project as an example, a class named CWExactCashbiddingFinisher is provided in the system as the specific implementation of the selection logic for the first project. This class implements the ICashBiddingFinisher interface (used in the selection phase) and is annotated with @PrepareFor. The two properties of the annotation are configured as follows: projectIdAcceptor is set to ProjectIdAcceptor.CW, declaring that this class is only enabled in the Skyworth project scenario; replaceClass is set to ExactCashbiddingFinisher.class, declaring that this class is used to replace the default ExactCashbiddingFinisher selector. At the same time, this class is also annotated with Spring component annotations (such as @Component), so that the Spring container automatically manages its lifecycle and is automatically discovered and included in the candidate instance list by FilterFactory.
[0071] As demonstrated by the above embodiments, the matching results are obtained by performing list validation and matching on the candidate quote list in the target quote dataset based on the responsibility chain matching strategy and the target chain list. The condition validation (Filter) and the final selection (Finisher) are completely separated in architecture, allowing for independent addition, deletion, and replacement. Adding new validation conditions only requires implementing the ICashBiddingFilter interface, and changing the final selection matching rules only requires implementing the ICashBiddingFinisher interface, without interference, thereby improving processing efficiency. Simultaneously, the four-level priority matching mechanism ensures that when multiple dimension combinations yield quotes, the most accurate match is always selected. That is, uniqueness constraints force a single result under the same priority, exposing configuration conflicts at the matching stage rather than in the subsequent financing execution stage, thus identifying data problems early.
[0072] When the candidate quote list is empty or the first target chain list is empty, a message indicating that a quote cannot be matched is returned directly to the caller.
[0073] In summary, in response to a quote matching instruction, this embodiment of the invention obtains a corresponding initial quote dataset; encapsulates the initial quote dataset to obtain a target quote dataset; assembles the initial chain list using the target quote dataset to obtain a target chain list; and performs list validation and matching on the candidate quote list in the target quote dataset based on the chain of responsibility matching strategy and the target chain list to obtain a matching result. Therefore, this embodiment of the invention utilizes the encapsulated target quote dataset to assemble the initial chain list to obtain the target chain list, and then performs list validation and matching on the candidate quote list in the target quote dataset based on the chain of responsibility matching strategy and the target chain list to obtain a matching result. This achieves a differentiated, universal, and intelligent matching mechanism, ensuring matching accuracy and thus improving processing efficiency.
[0074] Figure 2 This is a schematic block diagram of a price matching device provided in an embodiment of the present invention. Figure 2 As shown, this embodiment of the invention provides a price matching device 700 for implementing the method described above. The price matching device 700 includes: The acquisition unit 701 is used to acquire the corresponding initial quote dataset and initial chain list in response to the quote matching instruction; Data encapsulation unit 702 is used to encapsulate the initial quotation dataset to obtain the target quotation dataset; The data assembly unit 703 is used to perform data assembly processing on the initial chain list using the target quote dataset to obtain the target chain list; The verification and matching unit 704 is used to perform list verification and matching processing on the candidate quotation list in the target quotation dataset based on the chain of responsibility matching strategy and the target chain list to obtain the matching result.
[0075] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned device can be referred to the corresponding description in the foregoing method embodiments. For the sake of convenience and brevity, it will not be repeated here.
[0076] The above-described device can be implemented as a computer program, and the computer program can be implemented in, for example... Figure 3 It runs on the computer device shown.
[0077] Please see Figure 3 , Figure 3 This is a schematic block diagram of an electronic device provided in an embodiment of the present invention. The electronic device 800 can be a terminal or a server. The terminal can be an electronic device with communication functions. The server can be a standalone server or a server cluster composed of multiple servers.
[0078] See Figure 3 The electronic device 800 includes a processor 802, a memory, and a network interface 805 connected via a system bus 801. The memory may include a non-volatile storage medium 803 and internal memory 804.
[0079] The non-volatile storage medium 803 may store an operating system 8031 and a computer program 8032. The computer program 8032 includes program instructions that, when executed, cause the processor 802 to perform a quotation matching method.
[0080] The processor 802 provides computing and control capabilities to support the operation of the entire electronic device 800.
[0081] The internal memory 804 provides an environment for the execution of the computer program 8032 in the non-volatile storage medium 803. When the computer program 8032 is executed by the processor 802, the processor 802 can perform a quotation matching method.
[0082] This network interface 805 is used for network communication with other devices. Those skilled in the art will understand that... Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present invention and does not constitute a limitation on the electronic device 800 to which the present invention is applied. The specific electronic device 800 may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0083] The processor 802 is used to run a computer program 8032 stored in the memory to perform the following steps: In response to the quote matching command, obtain the corresponding initial quote dataset and initial chain list; The initial quote dataset is encapsulated to obtain the target quote dataset; The target chain list is obtained by assembling the initial chain list using the target quote dataset. Based on the chain of responsibility matching strategy and the target chain list, the candidate quote list in the target quote dataset is validated and matched to obtain the matching result.
[0084] It should be understood that, in this embodiment of the invention, the processor 802 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0085] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program includes program instructions and can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.
[0086] Therefore, the present invention also provides a storage medium. This storage medium can be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. When executed by a processor, the program instructions cause the processor to perform the following steps: In response to the quote matching command, obtain the corresponding initial quote dataset and initial chain list; The initial quote dataset is encapsulated to obtain the target quote dataset; The target chain list is obtained by assembling the initial chain list using the target quote dataset. Based on the chain of responsibility matching strategy and the target chain list, the candidate quote list in the target quote dataset is validated and matched to obtain the matching result.
[0087] The storage medium can be any computer-readable storage medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.
[0088] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0089] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0090] The steps in the method of this invention can be adjusted, merged, or reduced in order according to actual needs. The units in the device of this invention can be merged, divided, or reduced according to actual needs. Furthermore, the functional units in the various embodiments of this invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0091] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.
[0092] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims. The software tools, models, or components appearing in the embodiments of the present invention are merely illustrative examples and do not represent actual use.
Claims
1. A price matching method, characterized in that, The quotation matching method includes: In response to the quote matching command, obtain the corresponding initial quote dataset and initial chain list; The initial quote dataset is encapsulated to obtain the target quote dataset; The target chain list is obtained by assembling the initial chain list using the target quote dataset. Based on the chain of responsibility matching strategy and the target chain list, the candidate quote list in the target quote dataset is validated and matched to obtain the matching result.
2. The method according to claim 1, characterized in that, The process of performing list validation and matching on the candidate quote list in the target quote dataset based on the chain of responsibility matching strategy and the target chain list to obtain the matching result includes: Obtain the first target chain list and the second target chain list of the target chain list, and construct a responsibility chain object using a preset request entry point, and pass the first target chain list and the second target chain list into the responsibility chain object; In the chain of responsibility object, a preset execution chain algorithm is invoked to obtain the instance field index value, the current index value, and the length of the first list; Assign the instance field index value to the current index value, and compare the instance field index value with the length of the first list; If the instance field index value is less than the length of the first list, then the first list instance at the corresponding position in the first target linked list is obtained using the instance field index value, and the instance field index value is incremented by 1. A preset verification algorithm is triggered, and a candidate quotation list in the target quotation dataset is obtained. The verification algorithm and the first list instance are used to verify each quotation element in the candidate quotation list to obtain a verification result. If the verification result is that the price does not match, the corresponding price element is removed from the candidate price list to obtain an updated candidate price list. The instance field index value is then assigned to the current index value, and the instance field index value is compared with the length of the first list. If the instance field index value is equal to the length of the first list, then the current index value is backflowed to obtain the previous index value, and the difference between the length of the first list and the preset value is obtained as the comparison value. The previous index value is compared with the comparison value. If the previous index value is equal to the comparison value, a preset final matching algorithm is triggered. The updated candidate bid list is matched using the aforementioned final matching algorithm to obtain the matching result.
3. The method according to claim 2, characterized in that, The step of assembling the initial linked list using the target quote dataset to obtain the target linked list includes: Obtain the pricing parameters from the target pricing dataset; The preset identifier inference algorithm is invoked to perform identifier inference processing on the quotation parameters to obtain the project identifier enumeration value; Read the first annotation of each first initial instance in the first initial instance list of the initial linked list, and extract the first item attribute value of the first annotation; A first intermediate instance list is obtained by performing a first filtering process on the first initial instance list using the first project attribute value and the first preset identifier. The first comparison result is obtained by comparing the enumerated value of the project identifier with the second preset identifier; The first target chain list is obtained by replacing and assembling the first comparison result and the first intermediate instance list.
4. The method according to claim 3, characterized in that, The step of replacing and assembling the first target chain list based on the first comparison result and the first intermediate instance list to obtain the first target chain list includes: When the first comparison result is that the project identifier enumeration value is not equal to the second preset identifier, the first initial instance list is subjected to a second filtering process using the first project attribute value and the project identifier enumeration value to obtain a second intermediate instance list. Obtain several first-type attribute values of all first intermediate instances in the first intermediate instance list, and obtain several second-type attribute values of all second intermediate instances in the second intermediate instance list; For each of the several second-class attribute values, if the second-class attribute value is equal to the first-class attribute value, then the first intermediate instance corresponding to the first-class attribute value is removed from the first intermediate instance list to obtain the updated first intermediate instance list. The updated first intermediate instance list is assembled into the second intermediate instance list to obtain the first target chain list.
5. The method according to claim 3, characterized in that, The step of assembling the initial linked list using the target quote dataset to obtain the target linked list further includes: Read the second annotation of each second initial instance in the second initial instance list of the initial linked list, and extract the second item attribute value of the second annotation; A third intermediate instance list is obtained by performing a first filtering process on the second initial instance list using the second project attribute value and the first preset identifier. The second comparison result is obtained by comparing the enumerated value of the project identifier with the second preset identifier. The second target chain list is obtained by replacing and assembling the second comparison result and the third intermediate instance list.
6. The method according to claim 5, characterized in that, The step of replacing and assembling the second target chain list based on the second comparison result and the third intermediate instance list to obtain the second target chain list includes: When the second comparison result is that the project identifier enumeration value is not equal to the second preset identifier, the second initial instance list is subjected to a second filtering process using the second project attribute value and the project identifier enumeration value to obtain a fourth intermediate instance list. Obtain several third-class attribute values of all third intermediate instances in the third intermediate instance list, and obtain several fourth-class attribute values of all fourth intermediate instances in the fourth intermediate instance list; For each of the fourth attribute values, if the fourth attribute value is equal to the third attribute value, then the third intermediate instance corresponding to the third attribute value is removed from the third intermediate instance list to obtain an updated third intermediate instance list. The updated third intermediate instance list is assembled into the fourth intermediate instance list to obtain the second target chain list.
7. The method according to claim 1, characterized in that, The process of encapsulating the initial quote dataset to obtain the target quote dataset includes: The initial quotation dataset is initialized to obtain the intermediate quotation dataset; Construct a matching context object and encapsulate the intermediate quote dataset into the matching context object; The project configuration object is obtained by querying the project identifier in the initial quotation dataset. The matching context object and the project configuration object are used as the target quote dataset.
8. A price matching device, characterized in that, The price matching device includes: The acquisition unit is used to acquire the corresponding initial quote dataset and initial chain list in response to the quote matching instruction; A data encapsulation unit is used to encapsulate the initial quotation dataset to obtain a target quotation dataset. A data assembly unit is used to perform data assembly processing on the initial chain list using the target quote dataset to obtain a target chain list; The verification and matching unit is used to perform list verification and matching processing on the candidate quotation list in the target quotation dataset based on the chain of responsibility matching strategy and the target chain list to obtain the matching result.
9. A computer device, characterized in that, The computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method as described in any one of claims 1-7.
10. A storage medium, characterized in that, The storage medium stores a computer program, which includes program instructions that, when executed by a processor, can implement the method as described in any one of claims 1-7.