Single-polling quotation real-time sending method and device based on long connection, equipment and medium
Through the real-time sending method of single-query quotation based on long connections, the problem of inefficient data transmission during insurance insurance is solved, real-time updates to all online users are achieved, and efficiency and correctness are improved.
Patent Information
- Application Number
- CN202411478135.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-02-07
AI Technical Summary
The existing data transmission technology has shortcomings in real-time and efficiency, especially in the insurance insurance process, the repeated flow of salesmen and underwriters due to inconsistent information, resulting in inefficiency and frequent errors.
Using a real-time sending method of single-query quotation based on long connections, real-time updates to all online users by obtaining the page data of the single-query quotation page, monitoring the update fields in real time, and synchronously updating and sending the demand quotation page according to preset interactive needs, real-time updates to all online users .
It improves the real-time and efficiency of data transmission, reduces the back and forth between salespersons and underwriting personnel, reduces the possibility of errors, and improves the efficiency and correctness of operations.
Smart Images

Figure CN119396928A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of data transmission technology and financial technology, and in particular to a method, device, equipment and medium for real-time transmission of single-inquiry quotations based on a long connection. Background Art
[0002] Insurance underwriting is a series of procedural actions involving a lot of upstream and downstream interactions. For example, during the quotation inquiry process, the salesperson and the underwriter often have to circulate the inquiry form back and forth several times to reach consistency in the page information due to problems with the inquiry form information. If a certain page needs to be filled out by the salesperson and then submitted, but only the underwriter knows how to fill in certain fields, the previous method is often to take screenshots or send emails, which are not timely and often cause errors, and slightly longer fields also often cause errors.
[0003] Existing data transmission technologies often require the application layer to actively pull data. If a state value does not reach a certain node, it is often necessary to repeatedly obtain the field until the value reaches the desired state value. In actual applications, it is not enough to send only database changes to the application layer, because users often need to obtain real-time changing data. However, sending data based on database changes results in low real-time performance when sending data, which in turn reduces the efficiency of data transmission. Summary of the invention
[0004] The present invention provides a method, device, equipment and medium for sending single inquiry quotation in real time based on long connection, the main purpose of which is to solve the problem of low efficiency when sending data.
[0005] In a first aspect, a method for sending a single inquiry quotation in real time based on a long connection is provided, comprising:
[0006] Obtaining a single inquiry quotation page, extracting page data of the single inquiry quotation page, and synchronously updating the page data according to preset customer needs;
[0007] Monitor the update fields corresponding to the synchronously updated page data in real time, and extract the update data corresponding to the update fields;
[0008] Determine the interactive customer corresponding to the single inquiry quotation page according to the preset interactive demand, and extract the demand quotation page corresponding to the interactive customer;
[0009] Synchronously updating the demand quotation page according to the updated data;
[0010] The synchronously updated demand quotation page is sent in real time to the client corresponding to the interactive customer.
[0011] In a second aspect, a device for sending a single inquiry quotation in real time based on a long connection is provided, comprising:
[0012] A page data update module is used to obtain a single inquiry quotation page, extract page data of the single inquiry quotation page, and synchronously update the page data according to preset customer needs;
[0013] A field update monitoring module is used to monitor the update fields corresponding to the synchronously updated page data in real time, and extract the update data corresponding to the update fields;
[0014] An interactive customer determination module is used to determine the interactive customer corresponding to the single inquiry quotation page according to the preset interactive demand, and extract the demand quotation page corresponding to the interactive customer;
[0015] A demand quotation page update module, used to synchronously update the demand quotation page according to the update data;
[0016] The demand quotation page sending module is used to send the synchronously updated demand quotation page to the client corresponding to the interactive customer in real time.
[0017] In a third aspect, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above-mentioned method for real-time sending of single-inquiry quotations based on long connections are implemented.
[0018] In a fourth aspect, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the steps of the above-mentioned method for real-time sending of single-inquiry quotations based on long connections are implemented.
[0019] In the embodiment of the present invention, the underwriter directly modifies the data in the browser, stores the data in the database, triggers the monitoring program, and then sends it to all online users. It can save all users who open the same inquiry and quotation page, and then send the changed content in the database to the client that opens the page, so as to achieve real-time update of all user pages that pay attention to the changed data. In addition, if the salesperson is also browsing the same page, he will pay attention to the real-time changes of a certain write value, and he does not need to copy it manually. This can prevent errors, is quick and convenient, and improves work efficiency and accuracy. Therefore, the method, device, equipment and medium for real-time sending of single inquiry and quotation based on long connection proposed by the present invention can solve the problem of low efficiency when sending data. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0021] Figure 1 This is a schematic diagram of an application environment of a method for sending a single inquiry quotation in real time based on a long connection in one embodiment of the present invention;
[0022] Figure 2 It is a flow chart of a method for sending a single inquiry quotation in real time based on a long connection in one embodiment of the present invention;
[0023] Figure 3 yes Figure 1 A schematic flow chart of a specific implementation of step S1;
[0024] Figure 4 yes Figure 1 A schematic flow chart of a specific implementation of step S5;
[0025] Figure 5 It is a structural schematic diagram of a device for sending a single inquiry quotation in real time based on a long connection in one embodiment of the present invention;
[0026] Figure 6 is a schematic diagram of a structure of a computer device in one embodiment of the present invention;
[0027] Figure 7 It is another structural schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION
[0028] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0029] The method for sending a single inquiry quotation in real time based on artificial intelligence and long connection provided by the embodiment of the present invention can be applied in the following aspects: Figure 1In the application environment, the client communicates with the server through the network. The server can obtain the single inquiry quotation page through the client, extract the page data of the single inquiry quotation page, and synchronously update the page data according to the preset customer needs; monitor the update field corresponding to the synchronously updated page data in real time, and extract the update data corresponding to the update field; determine the interactive customer corresponding to the single inquiry quotation page according to the preset interactive needs, and extract the demand quotation page corresponding to the interactive customer; synchronously update the demand quotation page according to the updated data; send the synchronously updated demand quotation page to the client corresponding to the interactive customer in real time. In the present invention, the underwriter directly modifies the data in the browser, stores the data in the database, triggers the monitoring program, and then sends it to all online users. All users who open the same inquiry quotation page can be saved, and then the changed content in the database is sent to the client that opens the page, so as to achieve real-time update of all user pages that pay attention to the changed data. In addition, if the salesperson is also browsing the same page, he will pay attention to the real-time changes of a certain write value, and he does not need to copy it manually, which can prevent errors, and is fast and convenient, thereby improving work efficiency and correctness. Among them, the client can be but not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices. The server side can be implemented by an independent server or a server cluster composed of multiple servers. The present invention is described in detail below through specific embodiments.
[0030] See also Figure 2 As shown, Figure 2 A flowchart of a method for sending a single inquiry quotation in real time based on artificial intelligence and long connection provided in an embodiment of the present invention includes the following steps:
[0031] S1. Obtain a single inquiry quotation page, extract page data of the single inquiry quotation page, and synchronously update the page data according to preset customer requirements.
[0032] In one of the practical application scenarios of the present invention, insurance underwriting is a series of procedural actions involving a lot of upstream and downstream interactions. For example, in the process of asking for quotes, salesmen and underwriters often have to circulate the inquiry form back and forth several times to achieve consistency in page information filling. If a certain page needs to be filled in by the salesman and then submitted, but only the underwriter knows how to fill in certain fields, the previous method is often screenshots or emails, which are not timely and often make mistakes, and slightly longer fields also often make mistakes. If the underwriter modifies it directly in the browser, the data is stored in the database, the listening program is triggered, and then it is sent to all online users, if the salesman is also browsing the same page, he will pay attention to some things that are worth changing in real time, and there is no need to copy them manually. This can not only prevent errors, but also be quick and convenient, thereby improving work efficiency and accuracy.
[0033] In an embodiment of the present invention, the single inquiry quotation page refers to a page where a user displays inquiry information for a specific product or service, including quotation, specifications, delivery time and other information. The page data includes but is not limited to the product name product_name, quotation amount price, specification parameters specifications, delivery time delivery_time, supplier information supplier_info, and discount information discount_info in the single inquiry quotation page.
[0034] In detail, the single inquiry quotation page and the page data of the single inquiry quotation page can be obtained from a pre-stored storage area through a computer statement with a data crawling function (such as a Java statement, a Python statement, etc.), where the storage area includes but is not limited to a database and a blockchain.
[0035] Specifically, use a browser or tool to open the demand quotation page, ensure that the page is loaded, use the browser's developer tools to view the HTML structure of the page, determine the location of the data to be extracted, find specific quotation information, such as product name, price, description, etc., understand their tags and class names in the page, and use web crawlers to extract, organize the extracted information into an easy-to-understand format, such as a table or list, to facilitate subsequent use and analysis, so that the required single inquiry quotation page data can be effectively obtained and extracted.
[0036] Furthermore, if Figure 3 The figure shows a flow chart of data transmission in the original mode. Underwriters sometimes need to modify the data on the single inquiry quotation page, that is, client A wants to modify the data, and after the modification, call the application to save the data to the database, and then client B calls the application to pull the data, but client B does not know when the data is modified, and needs to refresh and pull it continuously. This is reflected in the inquiry and underwriting process, that is, the inquiry business personnel and the underwriter transfer the inquiry form back and forth, one party modifies and saves, and the other party refreshes the page to view, until they finally reach a consensus, and the communication is poor. Therefore, it is necessary to synchronize the modified data on the single inquiry quotation page based on the customer's modification requirements.
[0037] In an embodiment of the present invention, synchronous updating of page data means reflecting changes in backend data in real time in the user interface. When backend data (such as quotations, inventory, etc.) is updated, the front-end page automatically refreshes or updates relevant information, thereby updating the page data in real time.
[0038] In the embodiment of the present invention, the synchronous updating of the page data according to the preset customer demand includes:
[0039] Extract demand update data from preset customer requirements;
[0040] Extracting the target update field corresponding to the required update data;
[0041] Mapping the target update field with the field in the page data to obtain a mapping field;
[0042] The required update data is updated to the field corresponding to the page data according to the mapping field to obtain the synchronous update data corresponding to the page data.
[0043] In detail, customer demand refers to the customer's demand for modifying the page data of the inquiry quotation page, and the data to be modified is determined based on the modification requirements in the customer demand. For example, if the customer demand is to modify the quotation in the inquiry quotation page, the corresponding demand update data is the quotation data, and the field data corresponding to the demand update data is extracted. If the data to be updated is the quotation, the corresponding target update field is price, and a mapping relationship is defined to correspond the demand field to the page data field. If the target update field is price, the price field in the page data is extracted, that is, the same fields are mapped to obtain a mapping relationship, and the demand update data is traversed, the page data is updated according to the mapping relationship, and the updated pageData is reflected on the front-end page, thereby obtaining the corresponding updated data in the page data.
[0044] For example, suppose there is a product quotation page, and customer needs include updates to product prices and inventory quantities. Customer needs may include the following information: product ID: 123, updated price: $150, updated inventory: 20. The target update fields corresponding to the demand update data are extracted, and the target update fields include price and stock. Data is updated according to demand, and the mapping fields can be price mapped to price in page data, and stock mapped to stock in page data. The updated data in the customer needs is applied to the corresponding fields of the page data, so that the data updates in the customer needs can be successfully synchronized to the product quotation page, ensuring that the page information reflects the latest customer needs.
[0045] Furthermore, the updated page data is saved in a database, so that the database can monitor the changes in the page data, so that the relevant customers can open the updated page in real time.
[0046] S2. Monitor the update field corresponding to the synchronously updated page data in real time, and extract the update data corresponding to the update field.
[0047] In an embodiment of the present invention, the update field refers to a specific data item or column that is modified, changed or updated in the database. The field usually reflects the state change of an entity or record. For example, in a user table, the user's email, user name or last login time can be regarded as an update field. When the value of a field changes, the data change can be obtained by monitoring these update fields, and then the corresponding business logic is executed or the front-end display is updated. By monitoring the update fields in real time, it is ensured that the page data of the single inquiry quotation page is always the latest. The monitoring of the database can be a field or a piece of data or a table in the database, which depends on the user's own business needs and design.
[0048] In the embodiment of the present invention, the real-time monitoring of the update field corresponding to the synchronously updated page data includes:
[0049] Storing the page data in a preset database;
[0050] Using a preset driver instantiation to connect to the database, and extracting field data corresponding to the page data connected to the database;
[0051] Gather the field data into a field set, and monitor the change operations of the fields in the field set according to a pre-created data change stream;
[0052] The preset event listener is triggered according to the change operation of the field, and the triggered event listener extracts the update field corresponding to the synchronously updated page data.
[0053] In detail, after the client modifies the page data on the front end, the updated data will be obtained from the page, and the corresponding records will be updated using database queries. For example, the corresponding records can be updated through update statements, and the update operation will be checked to see if it is successful, and the corresponding success or error information will be returned, thereby ensuring that the updated page data is effectively stored in the database. In order to monitor the changes in page data in real time, it is necessary to monitor the changes in database fields in real time, so that the changes in page data can be monitored. To monitor the changes in database data, you can rely on the change Stream feature of mongo, that is, connect to the MongoDB database through a MongoClient in the MongoDBNode.js driver, that is, instantiate and connect the MongoClient to the specified MongoDB URI through the parser option, then the MongoClient is responsible for creating and managing the connection to the MongoDB database, and then extracting the field data corresponding to the page data through a computer statement with data capture.
[0054] Specifically, all the extracted field data are collected into a field collection, that is, the product name product_name, the quoted price price, the specifications specifications, the delivery time delivery_time, the supplier information supplier_info, and the discount information discount_info are collected in the collection, and a change stream (Change Stream) is created through client.db("dateBase_name").collection("collection_name").watch() to monitor the real-time update of the specified collection, that is, to monitor the real-time update of the field collection, and set an event listener changeStream.on("change",next=>{...}). When the data in the collection changes, the function is triggered, where the changes can be processed and the updated data can be sent to the client through SSE (Server Sent Events).
[0055] For example, if client A thinks there is a problem with the data on a certain page, he can modify it directly and then save it to the database. The database monitors the change of a certain field and sends the changed record to client B and client C on the same page through the application program. They see the data from the same database in real time.
[0056] Furthermore, the update data corresponding to the update field is extracted. When changes are monitored, the system should be able to identify which fields have changed and mark these update fields, and extract specific update content from the monitored changes, including obtaining the difference between the new value and the old value, so as to clarify which fields need to be updated, and match the extracted update data with the corresponding fields in the target database or page to ensure that the update information is accurately mapped to the correct location. The field update data refers to extracting the updated value according to the defined field name. For example, if the quoted amount price is updated, the updated amount value of the quoted amount price is extracted, wherein the update data corresponding to the update field can be extracted by a computer statement with data crawling function.
[0057] Furthermore, when a specific field changes, an update event is triggered. Based on the changed field, all customers who pay attention to the field are matched from the customer attention list, and an appropriate sending method is selected, such as email, SMS or in-app notification. Based on the changed page data, it needs to be sent in real time to the customers who pay attention to this data change. Therefore, it is necessary to determine the relevant customers corresponding to the page data.
[0058] S3. Determine the interactive customer corresponding to the single inquiry quotation page according to the preset interactive demand, and extract the demand quotation page corresponding to the interactive customer.
[0059] In an embodiment of the present invention, the interactive customer refers to a user related to a single inquiry quotation page, such as a salesperson and an underwriter who inquires for quotation. The update of the data of one party will be immediately updated on the page of the data of the other party, and the interactive assistance is smoother. The interactive customer can quickly obtain the quotation of the product or service, understand the detailed information, and can conveniently submit the inquiry request, such as: browsing products, filling out the inquiry form, viewing the quotation history, making comparisons, etc., so as to facilitate various users to quickly find the required information and provide a variety of filtering and sorting options to meet the needs of different customers.
[0060] In the embodiment of the present invention, determining the interactive customer corresponding to the single inquiry quotation page according to the preset interactive requirements includes:
[0061] Extract the quotation request identifier in the preset single inquiry quotation request;
[0062] Determining whether the preset interaction requirement includes the quotation requirement identifier;
[0063] When the interactive demand includes the quotation demand identifier, the user identifier corresponding to the single inquiry quotation page is extracted, and the interactive customer corresponding to the single inquiry quotation page is determined according to the user identifier.
[0064] In detail, the user's interaction demand data is obtained, and the pre-built interaction demand list is traversed to find out whether there are any keywords or identifiers related to "single inquiry and quotation". If not found, the process is recorded and ended. If the quotation demand identifier is found, the user identifier (such as user ID, role, session ID, etc.) is extracted from the requirement containing "single inquiry and quotation", and the customer database is queried based on the extracted user identifier. The corresponding customer information is searched through the user identifier, such as customer type (such as individual, enterprise), industry, historical transaction records, etc., so as to determine the interactive customers related to the single inquiry and quotation page.
[0065] Specifically, a unique quotation requirement identifier (such as an ID or code) is extracted from the preset single inquiry quotation requirement for subsequent matching. It is checked whether the preset interactive requirement contains the extracted quotation requirement identifier. If the interactive requirement contains the quotation requirement identifier, the subsequent steps are continued; if not, the process is terminated. Once a match is confirmed, the user identifier corresponding to the single inquiry quotation page is extracted. The user identifier may be a user ID or other unique identifier related to the quotation request. Based on the extracted user identifier, it is queried or mapped to the corresponding interactive customer. Finally, the relevant interactive customer information can be output or sent to ensure that they can receive quotation-related information in a timely manner.
[0066] Furthermore, each interactive customer will open a single inquiry quotation page, so it is necessary to determine the single inquiry quotation page corresponding to each interactive customer.
[0067] In an embodiment of the present invention, the demand quotation page refers to the quotation page corresponding to the customer, which usually contains detailed information of the relevant products or services, such as price, specifications, delivery time, preferential policies, etc., aiming to meet the specific needs of customers so as to facilitate them to make purchasing decisions.
[0068] In the embodiment of the present invention, extracting the demand quotation page corresponding to the interactive customer includes:
[0069] Extracting target page data corresponding to the interactive customer;
[0070] Comparing the page structure and page content of the single inquiry quotation page with the page structure and page content of the target page data;
[0071] When the compared page structures and page contents are consistent, the compared target page data is used as the demand quotation page corresponding to the interactive customer.
[0072] In detail, the page data browsed by the interactive customers are extracted from the database, and the page structure and page content of the pre-acquired single inquiry quotation page are compared with the page structure and page content of the target page. The page structure includes title, navigation bar, product / service description area, price information, pictures or videos, specifications or parameters, customer evaluation, contact information, etc. The page content includes detailed product description, pricing measurement, FAQ, delivery information, warranty and return policy.
[0073] Specifically, for each interactive customer, identify and extract the information and functions they need on the quotation page, compare the extracted target page data with the structure and content of the existing single inquiry quotation page, if the page structure and content are found to be consistent after comparison, that is, compare the layout of the functions required by each interactive customer on the page, check whether the arrangement of the navigation bar, sidebar, main content area, etc. is consistent; confirm whether all kinds of information are complete, such as product description, quotation, interactive elements (such as buttons, forms, prompts), check whether there is missing or redundant information, in the comparison process, if it is found that the structure and content of the existing single inquiry quotation page are consistent with the target data of the interactive customer, it can be confirmed that the page meets the needs of the customer, then confirm that the target page data is the demand quotation page corresponding to the interactive customer, and record the qualified target page data as the final demand quotation page, so as to ensure that the needs of different interactive customers are effectively reflected in the single inquiry quotation page. This not only improves the user experience, but also improves the efficiency and satisfaction of the system. Ultimately, the determined demand quotation page will become an effective tool for various users, helping them to better complete the work of inquiry and quotation.
[0074] Furthermore, according to the single inquiry quotation page corresponding to the interactive customer, the sending end of the page updated in real time by the interactive customer for the single inquiry quotation page can be determined. Therefore, it is necessary to determine the client end to which the data corresponding to the interactive customer is sent.
[0075] S4. Synchronously update the demand quotation page according to the updated data.
[0076] In the embodiment of the present invention, the demand quotation page corresponds to a client, and the target client refers to a sending client corresponding to the updated page data of the demand quotation page, wherein the target client corresponding to the demand quotation page can be extracted by a computer statement with a data crawling function.
[0077] In detail, identify the demand quotation page to be extracted, ensure that its specific identification (such as URL, ID) is clear, obtain all data related to the page from the database or system, including user interaction records, quotation requests, etc., analyze the obtained data, extract the target client information related to the page, and screen out the target clients that meet the requirements.
[0078] Specifically, check the accuracy of the updated data to ensure there are no errors or omissions, compare the new data with the old data to confirm the rationality of the updated content, import the processed data into the database of the quotation page, ensure that the data is compatible with the existing system to avoid system failures. Update the display logic of the quotation page to ensure that the new data can be displayed correctly, make necessary interface adjustments to improve the user experience, deploy the updated page to the production environment, collect user feedback on the new quotation page, and make further optimizations and adjustments based on the feedback.
[0079] Furthermore, the changes in the monitored field data can be synchronized to update the single inquiry quotation page, and the changed content in the database is sent to the client that opens the page, so as to achieve real-time update of all user pages that pay attention to the data.
[0080] In the embodiment of the present invention, the updated field data needs to be synchronously updated to the single inquiry quotation page corresponding to the corresponding target client, so that the relevant customers can receive the updated single inquiry quotation page in real time.
[0081] In an embodiment of the present invention, the synchronously updating the demand quotation page according to the updated data includes:
[0082] Extracting the page display content corresponding to the demand quotation page;
[0083] Mapping the field update data with the page display content in real time to obtain a real-time mapping relationship of the page;
[0084] The field update data is synchronously updated to the demand quotation page according to the real-time mapping relationship of the page through a preset update request.
[0085] In detail, extract the current display content, such as product description, price, image, etc., from the demand quotation page, map the data of the updated field with the extracted page display content, ensure that the updated data can correctly correspond to the corresponding part of the page, build an update request according to the mapping relationship, specify the fields to be updated and their new values, send the data of the updated field to the target client according to the real-time mapping relationship, ensure that the target client can receive and update the page content in real time to reflect the new data.
[0086] Specifically, all relevant display contents of the current quotation page are extracted using front-end technology (such as JavaScript), which can be implemented through DOM operations, such as using document.querySelector to obtain specific HTML elements, and saving the extracted content to a structured data format (such as JSON), creating a mapping function that accepts the update field data and the current page content as input, and for each field, checking whether the update data is different from the current page display content. If different, update the corresponding field, and build an update request according to the real-time mapping relationship. The update request is an API call to send the updated data to the server, and use fetch or other HTTP client libraries to send requests. Implement a listening mechanism on the target client to receive update requests from the server, which can be implemented through WebSocket, Server-Sent Events or long polling. When the update is received, parse the data and update the page display content. Implement an error handling mechanism to ensure that it can be properly handled when the request fails, and try to retry. For example, if the update request fails, a retry mechanism can be set to ensure that the page can adapt to real-time data changes, and use a timer or event-driven method to check for updates regularly.
[0087] Furthermore, all users who open the same page can be saved, and the page here is a quotation inquiry page, and then the changes in the database are sent to the client that opens the page, so as to achieve real-time update of all user pages that pay attention to the data.
[0088] S5. Send the synchronously updated demand quotation page to the target client in real time.
[0089] In the embodiment of the present invention, after the data is updated, a notification containing the latest quotation information is generated, and the updated quotation page data is sent to the target client through the selected sending mechanism, ensuring that the target client can receive and automatically render the updated quotation page.
[0090] In the embodiment of the present invention, the step of sending the synchronously updated demand quotation page to the client corresponding to the interactive customer in real time includes:
[0091] Create a streaming sending endpoint according to the preset data sending function and the preset listening function;
[0092] Connecting the streaming sending endpoint to the target client for data interaction;
[0093] The synchronously updated demand quotation page is sent in real time to the client corresponding to the interactive customer through the streaming sending endpoint after the data interactive connection.
[0094] In detail, define a preset data sending function, which is responsible for sending the updated data to the target client, such as defpush_data_to_client(data), and create a listening function to monitor the update of data and trigger the sending, then updated_data=get_updated_data(), get the updated data, use WebSocket or similar technology to establish a data interaction connection with the target client, and after the data is updated, send the synchronized updated demand quotation page to the target client in real time through the established streaming sending endpoint to ensure that the client can receive and confirm the successful data sending, that is, send the updated page data to the client through SSE streaming sending. SSE can maintain real-time communication between the client and the server, and then can actively send to multiple clients. Compared with the old websocket long connection, SSE consumes less resources and supports more types of sending events. So according to the above description, the change stream feature of mongoDB plus the SSE streaming sending technology can work together to send the changed data directly from the database to the user end in real time, so that the user end that pays attention to the data can share a copy of the real-time data.
[0095] Specifically, the updated page data is sent to the client, which can be sent to different clients, and the client can choose the subsequent operations according to its own needs, such as page rendering, WeChat notification, SMS or email sending, etc., so that the user no longer actively pulls data (needs to consume machine resources and bandwidth), but the server sends data in real time according to the changes (low consumption and high real-time performance), such as Figure 4 As shown, it is a schematic diagram of data transmission in the new mode. After client A modifies the data, it sends it to the application system, and then stores the modified data in the database, and the database actively sends the data to client B and client C.
[0096] For example, after the improvement, the salesperson and underwriter of the inquiry can work in a non-real-time manner without screenshots or emails. The update of one party's data will be immediately updated on the page of the other party's data; the interactive assistance is smoother; it can even change the situation where data can only be filled in by one party. The upstream and downstream parties of the inquiry form can fill in different data on the same page, which improves the filling speed of the document page, and it is also effective for other large pages. At the same time, the real-time communication between the two parties is more accurate, which can reduce a large number of historical records that flow back and forth and reduce the amount of data storage.
[0097] It can be seen that in the above scheme, the underwriter can modify the data directly in the browser, store the data in the database, trigger the listening program, and then send it to all online users. It can save all users who open the same quotation inquiry page, and then send the changed content in the database to the client that opens the page, so as to achieve real-time update of all user pages that pay attention to the changed data. In addition, if the salesperson is also browsing the same page, he will pay attention to the real-time changes of a certain write value, and he does not need to copy it manually. This can prevent errors, be quick and convenient, improve work efficiency and correctness, and solve the problem of low efficiency when sending data.
[0098] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0099] In one embodiment, a device for sending a single inquiry quotation in real time based on a long connection is provided, and the device for sending a single inquiry quotation in real time based on a long connection corresponds to the method for sending a single inquiry quotation in real time based on a long connection in the above embodiment. Figure 5 As shown, the single inquiry quotation real-time sending device based on long connection includes a page data updating module 101, a field update monitoring module 102, an interactive customer determination module 103, a demand quotation page updating module 104 and a demand quotation page sending module 105. The functional modules are described in detail as follows:
[0100] The page data updating module 101 is used to obtain a single inquiry quotation page, extract page data of the single inquiry quotation page, and synchronously update the page data according to preset customer requirements;
[0101] The field update monitoring module 102 is used to monitor the update fields corresponding to the synchronously updated page data in real time, and extract the update data corresponding to the update fields;
[0102] The interactive customer determination module 103 is used to determine the interactive customer corresponding to the single inquiry quotation page according to the preset interactive demand, and extract the demand quotation page corresponding to the interactive customer;
[0103] A demand quotation page updating module 104 is used to synchronously update the demand quotation page according to the updated data;
[0104] The demand quotation page sending module 105 is used to send the synchronously updated demand quotation page to the client corresponding to the interactive customer in real time.
[0105] In one embodiment, the page data updating module 101 is specifically used for:
[0106] Extract demand update data from preset customer requirements;
[0107] Extracting the target update field corresponding to the required update data;
[0108] Mapping the target update field with the field in the page data to obtain a mapping field;
[0109] The required update data is updated to the field corresponding to the page data according to the mapping field to obtain the synchronous update data corresponding to the page data.
[0110] In one embodiment, the field update monitoring module 102 is specifically configured to:
[0111] Storing the page data in a preset database;
[0112] Using a preset driver instantiation to connect to the database, and extracting field data corresponding to the page data connected to the database;
[0113] Gather the field data into a field set, and monitor the change operations of the fields in the field set according to a pre-created data change stream;
[0114] The preset event listener is triggered according to the change operation of the field, and the triggered event listener extracts the update field corresponding to the synchronously updated page data.
[0115] In one embodiment, the interactive client determination module 103 is further configured to:
[0116] Extract the quotation request identifier in the preset single inquiry quotation request;
[0117] Determining whether the preset interaction requirement includes the quotation requirement identifier;
[0118] When the interactive demand includes the quotation demand identifier, the user identifier corresponding to the single inquiry quotation page is extracted, and the interactive customer corresponding to the single inquiry quotation page is determined according to the user identifier.
[0119] In one embodiment, the interactive client determination module 103 is specifically configured to:
[0120] Extracting target page data corresponding to the interactive customer;
[0121] Comparing the page structure and page content of the single inquiry quotation page with the page structure and page content of the target page data;
[0122] When the compared page structures and page contents are consistent, the compared target page data is used as the demand quotation page corresponding to the interactive customer.
[0123] In one embodiment, the demand quotation page updating module 104 is specifically used to:
[0124] Extracting the page display content corresponding to the demand quotation page;
[0125] Mapping the field update data with the page display content in real time to obtain a real-time mapping relationship of the page;
[0126] The field update data is synchronously updated to the demand quotation page according to the real-time mapping relationship of the page through a preset update request.
[0127] In one embodiment, the single inquiry quotation page sending module 105 is specifically used to:
[0128] Create a streaming sending endpoint according to the preset data sending function and the preset listening function;
[0129] Connecting the streaming sending endpoint to the target client for data interaction;
[0130] The synchronously updated demand quotation page is sent in real time to the client corresponding to the interactive customer through the streaming sending endpoint after the data interactive connection.
[0131] In the embodiment of the present invention, the underwriter directly modifies the data in the browser, stores the data in the database, triggers the monitoring program, and then sends it to all online users. It can save all users who open the same inquiry and quotation page, and then send the changed content in the database to the client that opens the page, so as to achieve real-time update of all user pages that pay attention to the changed data. In addition, if the salesperson is also browsing the same page, he will pay attention to the real-time changes of a certain write value, and he does not need to copy it manually. This can prevent errors, is quick and convenient, and improves work efficiency and accuracy. Therefore, the method, device, equipment and medium for real-time sending of single inquiry and quotation based on long connection proposed by the present invention can solve the problem of low efficiency when sending data.
[0132] For the specific limitations of the device for sending single-inquiry quotations in real time based on long connections, please refer to the limitations of the intelligent question-and-answer method above, which will not be repeated here. Each module in the above-mentioned device for sending single-inquiry quotations in real time based on long connections can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0133] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external client via a network connection. When the computer program is executed by the processor, it realizes the functions or steps on the service side of a method for sending single-inquiry quotations in real time based on a long connection.
[0134] In one embodiment, a computer device is provided. The computer device may be a client, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external server through a network connection. When the computer program is executed by the processor, it realizes the functions or steps of the client side of a method for sending a single inquiry quotation in real time based on a long connection
[0135] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0136] Obtaining a single inquiry quotation page, extracting page data of the single inquiry quotation page, and synchronously updating the page data according to preset customer needs;
[0137] Monitor the update fields corresponding to the synchronously updated page data in real time, and extract the update data corresponding to the update fields;
[0138] Determine the interactive customer corresponding to the single inquiry quotation page according to the preset interactive demand, and extract the demand quotation page corresponding to the interactive customer;
[0139] Synchronously updating the demand quotation page according to the updated data;
[0140] The synchronously updated demand quotation page is sent in real time to the client corresponding to the interactive customer.
[0141] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0142] Obtaining a single inquiry quotation page, extracting page data of the single inquiry quotation page, and synchronously updating the page data according to preset customer needs;
[0143] Monitor the update fields corresponding to the synchronously updated page data in real time, and extract the update data corresponding to the update fields;
[0144] Determine the interactive customer corresponding to the single inquiry quotation page according to the preset interactive demand, and extract the demand quotation page corresponding to the interactive customer;
[0145] Synchronously updating the demand quotation page according to the updated data;
[0146] The synchronously updated demand quotation page is sent in real time to the client corresponding to the interactive customer.
[0147] It should be noted that the above functions or steps that can be implemented by the computer-readable storage medium or computer device can refer to the relevant descriptions on the server side and the client side in the aforementioned method embodiment. To avoid repetition, they will not be described one by one here.
[0148] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0149] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0150] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit them. If software tools or components other than those of the company appear in the application embodiments, they are only used for illustrative purposes and do not represent actual use. Although the present invention has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A method for sending a single inquiry quotation in real time based on a long connection, characterized in that: include: Obtaining a single inquiry quotation page, extracting page data of the single inquiry quotation page, and synchronously updating the page data according to preset customer needs; Monitor the update fields corresponding to the synchronously updated page data in real time, and extract the update data corresponding to the update fields; Determine the interactive customer corresponding to the single inquiry quotation page according to the preset interactive demand, and extract the demand quotation page corresponding to the interactive customer; Synchronously updating the demand quotation page according to the updated data; The synchronously updated demand quotation page is sent in real time to the client corresponding to the interactive customer.
2. The method for sending a single inquiry quotation in real time based on a long connection according to claim 1, characterized in that: The synchronously updating the page data according to the preset customer requirements includes: Extract demand update data from preset customer requirements; Extracting the target update field corresponding to the required update data; Mapping the target update field with the field in the page data to obtain a mapping field; The required update data is updated to the field corresponding to the page data according to the mapping field to obtain the synchronous update data corresponding to the page data.
3. The method for sending a single inquiry quotation in real time based on a long connection according to claim 1, characterized in that: The update fields corresponding to the page data after real-time monitoring and synchronization update include: Storing the page data in a preset database; Using a preset driver instantiation to connect to the database, and extracting field data corresponding to the page data connected to the database; Gather the field data into a field set, and monitor the change operations of the fields in the field set according to a pre-created data change stream; The preset event listener is triggered according to the change operation of the field, and the triggered event listener extracts the update field corresponding to the synchronously updated page data.
4. The method for sending a single inquiry quotation in real time based on a long connection according to claim 1, characterized in that: The step of determining the interactive customer corresponding to the single inquiry quotation page according to the preset interactive requirements includes: Extract the quotation request identifier in the preset single inquiry quotation request; Determining whether the preset interaction requirement includes the quotation requirement identifier; When the interactive demand includes the quotation demand identifier, the user identifier corresponding to the single inquiry quotation page is extracted, and the interactive customer corresponding to the single inquiry quotation page is determined according to the user identifier.
5. The method for sending a single inquiry quotation in real time based on a long connection according to claim 4, characterized in that: The extracting the demand quotation page corresponding to the interactive customer includes: Extracting target page data corresponding to the interactive customer; Comparing the page structure and page content of the single inquiry quotation page with the page structure and page content of the target page data; When the compared page structures and page contents are consistent, the compared target page data is used as the demand quotation page corresponding to the interactive customer.
6. The method for sending a single inquiry quotation in real time based on a long connection according to claim 1, characterized in that: The synchronously updating the demand quotation page according to the updated data includes: Extracting the page display content corresponding to the demand quotation page; Mapping the field update data with the page display content in real time to obtain a real-time mapping relationship of the page; The field update data is synchronously updated to the demand quotation page according to the real-time mapping relationship of the page through a preset update request.
7. The method for sending a single inquiry quotation in real time based on a long connection according to claim 1, characterized in that: The step of sending the synchronously updated demand quotation page to the client corresponding to the interactive customer in real time includes: Create a streaming sending endpoint according to the preset data sending function and the preset listening function; Connecting the streaming sending endpoint to the client for data interaction; The synchronously updated demand quotation page is sent in real time to the client corresponding to the interactive customer through the streaming sending endpoint after the data interactive connection.
8. An artificial intelligence-based, long-connection-based, single-inquiry quotation real-time sending device, characterized in that: include: A page data update module is used to obtain a single inquiry quotation page, extract page data of the single inquiry quotation page, and synchronously update the page data according to preset customer needs; A field update monitoring module is used to monitor the update fields corresponding to the synchronously updated page data in real time, and extract the update data corresponding to the update fields; An interactive customer determination module is used to determine the interactive customer corresponding to the single inquiry quotation page according to the preset interactive demand, and extract the demand quotation page corresponding to the interactive customer; A demand quotation page update module is used to synchronously update the demand quotation page according to the field update data; The demand quotation page sending module is used to send the synchronously updated demand quotation page to the target client corresponding to the interactive customer in real time.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method for real-time sending of single-inquiry quotation based on long connection as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method for sending a single inquiry quotation in real time based on a long connection as described in any one of claims 1 to 7 are implemented.