Document processing methods, document processing devices, electronic devices and storage media

By sending consumption requests, performing word comparison, and managing update time in the file processing system, and utilizing multiple message queues to store data, the problem of low file update efficiency is solved, and efficient file updates are achieved.

CN115718667BActive Publication Date: 2026-11-10CHINA PING AN LIFE INSURANCE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211460505.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-17
Publication Date
2026-11-10
Estimated Expiration
2042-11-17

AI Technical Summary

Technical Problem

Existing file processing methods suffer from significant delays in updating file vocabulary, resulting in low file update efficiency.

Method used

By sending consumption requests to the service terminal, extracting target requests and performing word comparisons, obtaining comparison data and the current timestamp, and combining the update time of the preset storage server, the candidate word file of the preset model is updated. Multiple message queues are used for data storage and management to achieve efficient file updates.

Benefits of technology

It improves the accuracy and efficiency of word matching, ensures the rationality and balance of data storage, updates the candidate word file of the preset model in a timely manner, and improves the file update efficiency of the consumer terminal.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115718667B_ABST
    Figure CN115718667B_ABST
Patent Text Reader

Abstract

This application provides a file processing method, file processing apparatus, electronic device, and storage medium, belonging to the field of computer technology. The method is applied to a consumer terminal and includes: sending a consumption request to a service terminal; the consumption request is stored in a first message queue on a preset message queue terminal via the service terminal; retrieving the consumption request from the message queue terminal to obtain a target request; performing word comparison on the target request according to a preset model of the consumer terminal to obtain comparison data and a current timestamp, the current timestamp being the timestamp of the word comparison of the target request; sending the comparison data to the service terminal; the comparison data is stored in a second message queue on the message queue terminal via the service terminal; obtaining the update time of the candidate word file in the target model on a preset storage server; updating the candidate word file of the preset model according to the current timestamp and the update time to obtain the target word file. This application can improve file update efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a file processing method, a file processing device, an electronic device, and a storage medium. Background Technology

[0002] With the development of network technology, the amount of file content on the Internet is increasing day by day. However, the current file processing methods have a large delay in updating file vocabulary, which often leads to low file update efficiency. Therefore, how to improve the efficiency of file updates has become an urgent technical problem to be solved. Summary of the Invention

[0003] The main objective of this application is to provide a file processing method, file processing device, electronic device, and storage medium, which aim to improve the efficiency of file updates.

[0004] To achieve the above objectives, a first aspect of this application proposes a file processing method applied to a consumer terminal, the method comprising:

[0005] Send a consumption request to the service terminal; wherein the consumption request is used to store a first message queue in a preset message queue terminal of the service terminal;

[0006] The consumption request is extracted from the message queue to obtain the target request, wherein the target request contains a file of newly added words to be processed;

[0007] The target request is compared with words according to the preset model of the consumer terminal to obtain comparison data and current timestamp; wherein, the current timestamp is the timestamp of words in the target request, and the preset model stores multiple candidate word files;

[0008] The comparison data is sent to the service terminal; wherein the comparison data is stored in the second message queue at the message queue end through the service terminal.

[0009] Obtain the update time of the candidate word file in the target model on the preset storage server;

[0010] The candidate word file of the preset model is updated based on the current timestamp and the update time to obtain the target word file.

[0011] In some embodiments, updating the candidate word file of the preset model based on the current timestamp and the update time to obtain the target word file includes:

[0012] Compare the current timestamp with the update time;

[0013] If the current timestamp is consistent with the update time, then the candidate word file of the preset model is used as the target word file;

[0014] If the current timestamp is inconsistent with the update time, then the candidate word file of the target model is downloaded from the storage server, and the candidate word file of the target model is used as the target word file.

[0015] In some embodiments, if the current timestamp is inconsistent with the update time, downloading the candidate word file of the target model from the storage server and using the candidate word file of the target model as the target word file includes:

[0016] If the current timestamp is inconsistent with the update time, a content update request is sent to the service terminal;

[0017] Content update data is extracted from the message queue according to the content update request, wherein the content update data is used to store in a third message queue of the message queue through the service terminal;

[0018] The content update data is determined to be occupied based on the data occupancy status parameter of the third message queue.

[0019] If the content update data is not occupied, configure the content update permissions for the preset model;

[0020] Based on the content update permissions, the candidate word file of the target model at the update time is downloaded from the storage server as the target word file.

[0021] In some embodiments, determining whether the content update data is occupied based on the data occupancy status parameter of the third message queue includes:

[0022] Determine whether candidate key data exists in the third message queue;

[0023] If the candidate key data exists in the third message queue, the candidate key data is compared with the preset key-value pair data, the key-value pair data including a one-to-one corresponding reference key data and reference value data;

[0024] If there is no reference key data in the key-value pair data that is the same as the candidate key data, then the content update data is not occupied;

[0025] If there is a reference key in the key-value pair data that is the same as the candidate key data, then the content update data is occupied.

[0026] In some embodiments, downloading the candidate word file of the target model with the update time from the storage server as the target word file based on the content update permission includes:

[0027] Based on the content update permissions, the update time is verified;

[0028] If the update time is the latest time, then the candidate word file of the target model is downloaded from the storage server, and the candidate word file of the target model is used as the target word file.

[0029] To achieve the above objectives, a second aspect of this application provides a file processing method applied to a service terminal, the method comprising:

[0030] Obtain the consumption request sent by the consumer terminal;

[0031] The consumption request is stored in a preset message queue; wherein the message queue includes a first message queue and a second message queue, and the consumption request is placed in the first message queue.

[0032] Obtain the comparison data generated by the consumer terminal based on the consumption request, and store the comparison data in the second message queue;

[0033] Get content update request;

[0034] Based on the content update request, the content update data is stored in the third message queue of the message queue terminal.

[0035] To achieve the above objectives, a third aspect of this application provides a file processing apparatus applied to a consumer terminal, the apparatus comprising:

[0036] A consumption request sending module is used to send a consumption request to a service terminal; wherein the consumption request is used to store a first message queue in a preset message queue terminal through the service terminal;

[0037] The current request retrieval module is used to extract the consumption request from the message queue end to obtain the target request, wherein the target request contains a new word file to be processed;

[0038] The request consumption module is used to perform word comparison on the target request according to the preset model of the consumption terminal to obtain comparison data and current timestamp; wherein, the current timestamp is the timestamp of the word comparison of the target request, and the preset model stores multiple candidate word files;

[0039] A storage module is used to send the comparison data to the service terminal; wherein the comparison data is used to store the comparison data in a second message queue at the message queue terminal via the service terminal;

[0040] The update time acquisition module is used to obtain the update time of the candidate word file in the target model on the preset storage server;

[0041] The file update module is used to update the candidate word file of the preset model according to the current timestamp and the update time to obtain the target word file.

[0042] To achieve the above objectives, a fourth aspect of this application provides a file processing apparatus applied to a service terminal, the apparatus comprising:

[0043] The consumption request acquisition module is used to acquire consumption requests sent by the consumption terminal;

[0044] A request storage module is used to store the consumption request to a preset message queue terminal; wherein, the message queue terminal includes a first message queue and a second message queue, and the consumption request is placed in the first message queue;

[0045] The data acquisition module is used to acquire the comparison data generated by the consumer terminal according to the consumption request, and store the comparison data in the second message queue;

[0046] The update request retrieval module is used to retrieve content update requests;

[0047] The data storage module is updated to store the content update data in the third message queue of the message queue terminal according to the content update request.

[0048] To achieve the above objectives, a fifth aspect of the present application provides an electronic device, the electronic device including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method described in the first aspect or the method described in the second aspect.

[0049] To achieve the above objectives, a fourth aspect of the present application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in the first aspect or the method described in the second aspect.

[0050] The document processing method, device, electronic equipment, and storage medium proposed in this application involve sending a consumption request to a service terminal. The consumption request is stored in a first message queue at a preset message queue on the service terminal. The consumption request is then retrieved from the message queue to obtain a target request containing a new word file to be processed. A word comparison is performed on the target request according to a preset model to obtain comparison data and a current timestamp. The current timestamp is the timestamp used for the word comparison of the target request. The comparison data is then sent to the service terminal. The consumption data is stored in a second message queue at the service terminal. This method enables word comparison of the new word file and candidate word files based on the preset model, improving the accuracy and efficiency of word comparison and ensuring higher accuracy of the comparison data. Furthermore, storing the consumption request and comparison data in different message queues improves the rationality and balance of data storage. Furthermore, the update time of the candidate word file in the target model in the preset storage server is obtained; the candidate word file of the preset model is updated according to the current timestamp and update time to obtain the target word file. This makes it easier to determine whether the candidate word file stored in the preset model needs to be updated based on the current timestamp and update time, so as to update the word file stored in the preset model in a timely manner and improve the file update efficiency of the consumer terminal. Attached Figure Description

[0051] Figure 1 This is a flowchart of the file processing method provided in the embodiments of this application;

[0052] Figure 2 yes Figure 1 The flowchart of step S106 in the process;

[0053] Figure 3 yes Figure 2 The flowchart of step S203 in the process;

[0054] Figure 4 yes Figure 3 The flowchart of step S303 in the process;

[0055] Figure 5 yes Figure 3 The flowchart of step S305 in the document;

[0056] Figure 6 This is another flowchart of the document processing method provided in the embodiments of this application;

[0057] Figure 7 This is a schematic diagram of the structure of the document processing device provided in the embodiments of this application;

[0058] Figure 8 This is another structural schematic diagram of the document processing apparatus provided in the embodiments of this application;

[0059] Figure 9 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0060] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0061] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0062] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0063] First, let's analyze some of the terms used in this application:

[0064] Artificial intelligence (AI) is a new branch of computer science that studies, develops, and applies theories, methods, technologies, and systems to simulate, extend, and expand human intelligence. AI attempts to understand the essence of intelligence and produce intelligent machines that can react in a way similar to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing, and expert systems. AI can simulate the information processes of human consciousness and thought. Furthermore, AI utilizes digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceiving the environment, acquiring knowledge, and using that knowledge to achieve optimal results.

[0065] Natural Language Processing (NLP): NLP uses computers to process, understand, and utilize human language (such as Chinese and English). NLP is a branch of artificial intelligence and an interdisciplinary field of computer science and linguistics, often referred to as computational linguistics. NLP includes syntactic analysis, semantic analysis, and discourse understanding. It is commonly used in machine translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, intent recognition, information extraction and filtering, text classification and clustering, sentiment analysis, and opinion mining. It involves data mining, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research, and linguistic research related to language computation.

[0066] Information Extraction (NER) is a text processing technique that extracts specific types of factual information, such as entities, relationships, and events, from natural language text and outputs them as structured data. Information extraction is a technique for extracting specific information from text data. Text data is composed of specific units, such as sentences, paragraphs, and chapters. Text information is composed of smaller, specific units, such as characters, words, phrases, sentences, paragraphs, or combinations of these units. Extracting noun phrases, names of people, and place names from text data is an example of text information extraction. Of course, text information extraction techniques can extract information of various types.

[0067] Redis (Remote Dictionary Server) is an open-source, ANSI C-based, network-enabled, in-memory or persistent, log-structured key-value database that provides APIs for multiple languages. Redis is a key-value storage system that supports a wider range of value types, including strings, lists, sets, sorted sets (zsets), and hashes. These data types support push / pop, add / remove, intersection, union, difference, and more complex operations, all of which are atomic. Redis also supports various sorting methods. To ensure efficiency, Redis caches data in memory and periodically writes updated data to disk or appends changes to a log file, implementing master-slave synchronization.

[0068] Message queue: A container that stores messages during message transmission.

[0069] Key-value pairs: These allow you to retrieve a value from a key. For example, in object-oriented programming, you often use `FormEnable = True` or `Fail`, which encapsulate a value using a series of API functions. The registry manages various information through keys and subkeys. All information in the registry is stored as key-value entries in various formats. The right window of the registry editor displays these key-value entries. A key-value entry consists of three parts: key name, data type, and value, formatted as "key name: data type: value". The format of a key-value pair is...<key,va l ue> .

[0070] With the development of network technology, the amount of file content on the Internet is increasing day by day. However, the current file processing methods have a large delay in updating file vocabulary, which often leads to low file update efficiency. Therefore, how to improve the efficiency of file updates has become an urgent technical problem to be solved.

[0071] Based on this, embodiments of this application provide a file processing method, a file processing apparatus, an electronic device, and a storage medium, aiming to improve the efficiency of file updates.

[0072] The file processing method, file processing device, electronic device and storage medium provided in the embodiments of this application are specifically described through the following embodiments. First, the file processing method in the embodiments of this application is described.

[0073] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0074] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0075] The file processing method provided in this application relates to the field of artificial intelligence technology. The file processing method provided in this application can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application implementing the file processing method, but is not limited to the above forms.

[0076] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0077] It should be noted that the file processing method of this application embodiment can be applied to file processing systems in various business scenarios. This file processing system includes a service terminal, a consumer terminal, a message queue terminal, and a storage server. The service terminal receives consumption requests or content update requests from the consumer terminal and stores the consumption requests in a message queue of the message queue terminal, or stores the content update data in another message queue of the message queue terminal based on the content update request. The service terminal also stores the content update data in the storage server to update the model files in the storage server. The model files can be text processing models such as BERT models. The consumer terminal sends consumption requests to the service terminal and consumes the request data from the message queue terminal based on the consumption requests. The consumer terminal also sends content update requests to the service terminal and identifies the content update data in the message queue terminal based on the content update requests. Based on the identification results, it downloads the relevant model files and content update data from the storage server to update the preset model in the consumer terminal.

[0078] Figure 1 This is an optional flowchart of the file processing method provided in the embodiments of this application, applied to a consumer terminal. Figure 1 The method may include, but is not limited to, steps S101 to S106.

[0079] Step S101: Send a consumption request to the service terminal; wherein, the consumption request is used to store the first message queue in the preset message queue terminal of the service terminal.

[0080] Step S102: Extract the consumption request from the message queue to obtain the target request, wherein the target request contains the new word file to be processed;

[0081] Step S103: Perform word comparison on the target request according to the preset model of the consumer terminal to obtain comparison data and current timestamp; wherein, the current timestamp is the timestamp of word comparison of the target request, and the preset model stores multiple candidate word files;

[0082] Step S104: Send the comparison data to the service terminal; wherein the comparison data is used to store the data in the second message queue at the message queue end of the service terminal.

[0083] Step S105: Obtain the update time of the candidate word file in the target model on the preset storage server;

[0084] Step S106: Update the candidate word file of the preset model according to the current timestamp and update time to obtain the target word file.

[0085] Steps S101 to S106 of this embodiment involve sending a consumption request to a service terminal; wherein the consumption request is stored in a first message queue at a preset message queue terminal via the service terminal; retrieving the consumption request from the message queue terminal to obtain a target request, which contains a new word file to be processed; performing word comparison on the target request according to a preset model to obtain comparison data and a current timestamp; and sending the comparison data to the service terminal; wherein the comparison data is stored in a second message queue at the message queue terminal via the service terminal, enabling word comparison of the new word file and candidate word files based on the preset model, improving the accuracy and efficiency of word comparison, and also enabling the comparison data to have higher accuracy. Furthermore, storing the consumption request and comparison data based on different message queues can improve the rationality and balance of data storage. Furthermore, the update time of the candidate word file in the target model on the preset storage server is obtained; the candidate word file of the preset model is updated according to the current timestamp and update time to obtain the target word file. This makes it easier to determine whether the candidate word file of the preset model needs to be updated based on the current timestamp and update time, so as to update the candidate word file of the preset model in a timely manner and improve the file update efficiency of the consumer terminal.

[0086] In step S101 of some embodiments, the consumer terminal can be an algorithm server capable of text processing, and the service terminal can be a server capable of providing online file processing services to users. The consumer terminal can send consumption requests to the service terminal via wireless or wired communication. These consumption requests can include text update requests, text deletion requests, etc. When the consumption request is a text update request, it contains a file of newly added words to be processed. The service terminal is equipped with a service interface. After the consumer terminal sends a consumption request to the service terminal, the service terminal can receive the consumption request through the service interface and store it in a first message queue at the message queue end. The message queue end contains multiple Redis queues, and the first message queue is one of these Redis queues. These Redis queues are used to store different data and implement different message processing functions.

[0087] In step S102 of some embodiments, according to the consumption instruction issued by the service terminal or a preset time interval, each consumer terminal extracts a consumption request from the first message queue at the message queue end to obtain a target request. The target request is all or part of the consumption requests in the first message queue. The target request includes a new word file to be processed. The main purpose of the target request is to request the consumer terminal to confirm the new word file and determine whether the new word file is the same as the candidate word file. If they are different, the new word needs to be added to the candidate word file of the preset model to update the content of the candidate word file. In this way, the consumer terminal can extract from the first message queue within a preset time period, improving the uniformity of consumption request extraction.

[0088] In step S103 of some embodiments, the consumer terminal performs word comparison on the target request according to a preset model to obtain comparison data and a current timestamp. The current timestamp is the timestamp for the word comparison of the target request. The consumer terminal can obtain the consumption timestamp of the preset model through a timer or similar means. The preset model can be a text processing model such as BERT. The preset model parses the request content of the target request to obtain a new word file in the request text data. This new word file contains at least one word to be compared. The candidate word file in the preset model is compared with the new word file to determine if there are any identical words. Comparison data is generated based on the judgment result. For example, if a target request is to identify a target word in a sentence, the preset model will extract this sentence data from the target request, perform word segmentation on this sentence data, and then use the candidate word file in the preset model to identify words in each sentence segment, thereby determining whether the target word exists in the sentence data, etc. For example, if a target request is to filter target words in a sentence of data, the pre-defined model will replace the target words in the sentence with empty strings or mask symbols, etc., to obtain sentence data that does not contain the target words. This sentence data is the consumed data. This method can perform word matching based on the pre-defined model, improving the accuracy and efficiency of word matching, and also enabling the matched data to have higher accuracy.

[0089] In step S104 of some embodiments, the consumer terminal can send the comparison data to the service terminal via wireless or wired communication. After the consumer terminal sends the comparison data to the service terminal, the service terminal can receive the comparison data through the service interface and store the comparison data in the second message queue of the message queue end. Using multiple message queues at the message queue end to store consumption requests and comparison data separately can improve the rationality of data storage. Managing various requests and data storage based on the message queue end can achieve system load balancing and improve the file processing performance of the file processing system.

[0090] In step S105 of some embodiments, the consumer terminal may send an update time acquisition request to the service terminal. The service terminal acquires the update time of the candidate word file in the target model on the preset storage server and stores the update time in the message queue, so that the consumer terminal can acquire the update time of the target model on the preset storage server from the fourth message queue of the message queue.

[0091] Please see Figure 2 In some embodiments, step S106 may include, but is not limited to, steps S201 to S203:

[0092] Step S201: Compare the current timestamp with the update time;

[0093] Step S202: If the current timestamp is consistent with the update time, then the candidate word file of the preset model is used as the target word file;

[0094] Step S203: If the current timestamp is inconsistent with the update time, download the candidate word file of the target model from the storage server and use the candidate word file of the target model as the target word file.

[0095] In step S201 of some embodiments, the current timestamp and the update time are compared to determine whether the current timestamp of the preset model is consistent with the update time of the candidate word file in the target model. If the current timestamp of the preset model is consistent with the update time of the candidate word file in the target model, it indicates that the candidate word file of the preset model is up-to-date. If the current timestamp of the preset model is inconsistent with the update time of the candidate word file in the target model, it indicates that the candidate word file of the preset model is not up-to-date and needs to be updated so that the content of the candidate word file on the consumer terminal is up-to-date, thereby achieving rapid content updates.

[0096] In step S202 of some embodiments, if the current timestamp of the preset model is consistent with the update time of the candidate word file in the target model, it indicates that the candidate word file of the preset model is the latest, and the candidate word file of the preset model can be used as the target word file.

[0097] In step S203 of some embodiments, if the current timestamp is inconsistent with the update time, it indicates that the candidate word file of the preset model is not up-to-date and needs to be updated. In this case, the candidate word file of the target model is downloaded from the storage server and used as the target word file, so that the content of the word file of the consumer terminal is up-to-date.

[0098] Through the above steps S201 to S203, it is relatively convenient to determine whether the candidate word file of the preset model needs to be updated based on the current timestamp and update time, so as to update the candidate word file of the preset model in a timely manner and improve the update efficiency of the file content of the consumer terminal.

[0099] Please see Figure 3 In some embodiments, step S203 may include, but is not limited to, steps S301 to S305:

[0100] Step S301: If the current timestamp is inconsistent with the update time, a content update request is sent to the service terminal.

[0101] Step S302: Extract content update data from the message queue end according to the content update request, wherein the content update data is used to store the content update data in the third message queue of the message queue end through the service terminal;

[0102] Step S303: Determine whether the content update data is occupied based on the data occupancy status parameter of the third message queue;

[0103] Step S304: If the content update data is not occupied, configure the content update permissions for the preset model;

[0104] Step S305: Based on content update permissions, download the candidate word file of the target model with the update time from the storage server as the target word file.

[0105] In step S301 of some embodiments, if the current timestamp is inconsistent with the update time, the consumer terminal can send a content update request to the service terminal via wireless or wired communication. The content update request may include the number and type of words that need to be updated, etc.

[0106] In step S302 of some embodiments, after the consumer terminal sends a content update request to the service terminal, the service terminal can receive the content update request through a service interface and store the content update data corresponding to the request content in a third message queue at the message queue end according to the request content. Therefore, the consumer terminal can extract content update data from the third message queue at the message queue end in real time or at fixed intervals according to the content update request. The content update data includes newly added target words, newly added target sentences, etc., to be processed.

[0107] In step S303 of some embodiments, the data occupancy status parameter includes a key-value tag generated by the consuming terminal to determine the consumption of a certain data, such as key data. Therefore, it can be determined whether the content update data is occupied based on the preset key-value pair data and the data occupancy status parameter of the third message queue. For example, it can be determined whether there is candidate key data in the content update data. If there is candidate key data in the content update data, the candidate key data is compared with the reference key data in the preset key-value pair. If there is no reference key data in the key-value pair data that is the same as the candidate key data, it indicates that other consuming terminals have not consumed the content update data, and the content update data is not occupied.

[0108] In step S304 of some embodiments, if the content update data is not occupied, the content update permission of the preset model is configured so that the preset model can update the candidate word file stored by itself according to the content update permission.

[0109] In step S305 of some embodiments, when the preset model obtains content update permission, it can download the candidate word file of the target model with the update time from the storage server as the target word file.

[0110] Through the above steps S301 to S305, the candidate word file of the preset model can be updated based on a dual judgment method. That is, firstly, it is determined whether the content update data is occupied. After it is determined that the content update data is not occupied, the content update permission is configured for the preset model. After the preset model has the content update permission, the model file is updated. This can ensure the security of file updates. At the same time, in the consumer terminal, the candidate word file of the preset model is stored inside the model, which can make the candidate word files of different preset models stored separately, realizing the independent storage of candidate word files.

[0111] Please see Figure 4 In some embodiments, step S303 may include, but is not limited to, steps S401 to S404:

[0112] Step S401: Determine whether candidate key data exists in the third message queue;

[0113] Step S402: If candidate key data exists in the third message queue, the candidate key data is compared with the preset key-value pair data. The key-value pair data includes a one-to-one corresponding reference key data and reference value data.

[0114] Step S403: If there is no reference key data in the key-value pair data that is the same as the candidate key data, then the content update data is not occupied;

[0115] Step S404: If there is a reference key in the key-value pair data that is the same as the candidate key data, then the content update data is occupied.

[0116] In step S401 of some embodiments, it is first determined whether the content update data is occupied, that is, it is determined whether there is candidate key data in the third message queue, and the data type of the third message queue is identified. The type of the third message queue includes key data, value data, etc., and data belonging to the key data category in the third message queue is taken as candidate key data.

[0117] In step S402 of some embodiments, if candidate key data exists in the third message queue, it indicates that there may be unoccupied content update data in the third message queue. The candidate key data is then compared with key-value pair data, which contains consumption markers corresponding to all consuming terminals. That is, when a consuming terminal determines to consume content update data from the third message queue, it stores its corresponding reference key data (i.e., consumption marker) in the third message queue, enabling the binding of its reference key data with this update content. This serves as a reminder to other consuming terminals not to consume the update content, avoiding duplicate consumption.

[0118] In step S403 of some embodiments, if there is no reference key data in the key-value pair data that is the same as the candidate key data, it indicates that no other consumer terminal has determined to consume the content update data, indicating that the content update data is not occupied.

[0119] In step S404 of some embodiments, if there is reference key data in the key-value pair data that is the same as the candidate key data, it indicates that there are other consumer terminals that determine to consume the content update data, indicating that the content update data is occupied.

[0120] Through the above steps S401 to S404, the occupancy of content update data can be identified relatively easily. Based on the identification results, it can be determined whether a preset model is needed to consume the content update data. In this process, multiple preset models can perform content identification work simultaneously, realizing high concurrency of content detection, which can improve the efficiency and accuracy of content detection and help improve the system performance of the file processing system.

[0121] Please see Figure 5 In some embodiments, step S305 may include, but is not limited to, steps S501 to S502:

[0122] Step S501: Verify the update time based on content update permissions;

[0123] In step S502, if the update time is the latest time, download the candidate word file of the target model from the storage server and use the candidate word file of the target model as the target word file.

[0124] In step S501 of some embodiments, the preset model is configured with content update permissions. After the preset model has content update permissions, the update time of the candidate word file of the target model in the storage server is checked again, and the update time of the candidate word file of the target model is determined based on the check results.

[0125] In step S502 of some embodiments, if the update time is the latest time, it indicates that the candidate word file of the target model is the latest. In this case, the candidate word file of the target model is downloaded from the storage server and used as the target word file. If the update time is not the latest time, it indicates that the candidate word file of the target model is not the latest. In this case, the candidate word file of the target model is updated, and then the candidate word file of the target model is downloaded to the local machine and used as the target word file.

[0126] The file processing method of this application embodiment involves sending a consumption request to a service terminal; wherein the consumption request is stored in a first message queue at a preset message queue end; retrieving the consumption request from the message queue end to obtain a target request, the target request containing a new word file to be processed; performing word comparison on the target request according to a preset model to obtain comparison data and a current timestamp; wherein the current timestamp is the timestamp of the word comparison of the target request by the preset model; and sending the comparison data to the service terminal; wherein the comparison data is stored in a second message queue at the message queue end through the service terminal, which enables word comparison of the request based on the preset model, improving the accuracy and efficiency of word comparison, and also enabling the comparison data to have higher accuracy. Furthermore, storing the consumption request and comparison data based on different message queues can improve the rationality and balance of data storage. Furthermore, the update time of the candidate word file in the target model on the preset storage server is obtained; the candidate word file of the preset model is updated according to the current timestamp and update time to obtain the target word file. It is relatively convenient to determine whether the candidate word file of the preset model needs to be updated based on the current timestamp and update time, so as to update the candidate word file of the preset model in a timely manner, thereby improving the file update efficiency of the consumer terminal. When determining whether to update the candidate word file of the preset model, it is first to identify whether there is updatable content in the content update data. Based on the identification result, it is determined whether the preset model needs to consume the content update data. In this process, multiple preset models can perform content identification work simultaneously, realizing high concurrency of content detection, which can improve the efficiency and accuracy of content detection, thereby improving the overall file update efficiency.

[0127] Figure 6 This is another optional flowchart of the file processing method provided in the embodiments of this application, applied to a service terminal. Figure 6 The method may include, but is not limited to, steps S601 to S605.

[0128] Step S601: Obtain the consumption request sent by the consumer terminal;

[0129] Step S602: Store the consumption request in a preset message queue; wherein the message queue includes a first message queue and a second message queue, and the consumption request is placed in the first message queue.

[0130] Step S603: Obtain the comparison data generated by the consumer terminal based on the consumption request, and store the comparison data in the second message queue;

[0131] Step S604: Obtain the content update request;

[0132] Step S605: Based on the content update request, store the content update data in the third message queue of the message queue.

[0133] In step S601 of some embodiments, the service terminal is provided with a service interface. After the consumer terminal sends a consumption request to the service terminal, the service terminal can receive the consumption request through the service interface.

[0134] In step S602 of some embodiments, after the service terminal obtains the consumption request sent by the consumer terminal, the consumption request can be stored in the first message queue of the message queue terminal. The message queue terminal includes multiple Redis queues, and the first message queue and the second message queue are one of these Redis queues. These Redis queues can be used to store different data and implement different message processing functions.

[0135] In step S603 of some embodiments, after the consumer terminal sends comparison data to the service terminal, the service terminal can receive the comparison data through the service interface and store the comparison data in the second message queue of the message queue terminal. By using multiple message queues at the message queue terminal to store consumption requests and comparison data respectively, the rationality of data storage can be improved. At the same time, managing various consumption requests and comparison data based on the message queue terminal can achieve system load balancing and improve the file processing performance of the file processing system.

[0136] In step S604 of some embodiments, the service terminal can receive the content update request through the service interface.

[0137] In step S605 of some embodiments, after the consumer terminal sends a content update request to the service terminal, the service terminal can receive the content update request through the service interface, and store the content update data corresponding to the request content in the third message queue of the message queue end according to the request content of the content update request. This allows the consumer terminal to perform content recognition on the third message queue of the message queue end, select the content update data that it should update, and download the corresponding candidate word file of the target model from the storage server to update its own candidate word file.

[0138] The file processing method of this application embodiment can conveniently obtain the consumption requests and content update requests of the consumer terminal, and store the corresponding data in the message queue according to different requests. The data is then sent to the consumer terminal through the message queue, so that the service terminal and the consumer terminal can be decoupled and can work independently. This improves the working independence and working stability of the service terminal and the consumer terminal, thereby improving the file update efficiency of the file processing system.

[0139] Please see Figure 7 This application also provides a file processing apparatus for use in a consumer terminal, which can implement the file processing method of the first aspect described above. The apparatus includes:

[0140] The consumption request sending module 701 is used to send a consumption request to the service terminal; wherein, the consumption request is used to store the first message queue in the preset message queue terminal of the service terminal.

[0141] Currently, the request retrieval module 702 is used to extract consumption requests from the message queue end to obtain target requests, wherein the target requests contain new word files to be processed;

[0142] The request consumption module 703 is used to perform word comparison on the target request according to the preset model of the consumption terminal to obtain comparison data and the current timestamp; wherein, the current timestamp is the timestamp of the word comparison of the target request, and the preset model stores multiple candidate word files;

[0143] Storage module 704 is used to send comparison data to the service terminal; wherein, the comparison data is used to store the comparison data in the second message queue at the message queue end through the service terminal;

[0144] The update time acquisition module 705 is used to acquire the update time of the candidate word file in the target model on the preset storage server.

[0145] The file update module 706 is used to update the candidate word file of the preset model according to the current timestamp and update time to obtain the target word file.

[0146] The specific implementation of the document processing device is basically the same as the specific embodiment of the document processing method described above, and will not be repeated here.

[0147] Please see Figure 8 This application also provides a file processing apparatus for use in a service terminal, which can implement the file processing method of the second aspect described above. The apparatus includes:

[0148] The consumption request acquisition module 801 is used to acquire consumption requests sent by the consumption terminal;

[0149] The request storage module 802 is used to store consumption requests to a preset message queue; wherein the message queue includes a first message queue and a second message queue, and the consumption request is placed in the first message queue;

[0150] The data acquisition module 803 is used to acquire the comparison data generated by the consumer terminal according to the consumption request, and store the comparison data in the second message queue;

[0151] Update request retrieval module 804 is used to retrieve content update requests;

[0152] The data storage module 805 is updated to store the content update data to the third message queue at the message queue end according to the content update request.

[0153] This application also provides an electronic device, which includes: a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for communication between the processor and the memory. When the program is executed by the processor, it implements the aforementioned file processing method. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.

[0154] Please see Figure 9 , Figure 9 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes:

[0155] The processor 901 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.

[0156] The memory 902 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 902 and is called and executed by the processor 901 using the file processing method of the embodiments of this application.

[0157] The input / output interface 903 is used to implement information input and output;

[0158] The communication interface 904 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0159] Bus 905 transmits information between various components of the device (e.g., processor 901, memory 902, input / output interface 903, and communication interface 904);

[0160] The processor 901, memory 902, input / output interface 903, and communication interface 904 are connected to each other within the device via bus 905.

[0161] This application also provides a computer-readable storage medium that stores one or more programs, which can be executed by one or more processors to implement the above-described file processing method.

[0162] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0163] The file processing method, file processing apparatus, electronic device, and computer-readable storage medium provided in this application embodiment send a consumption request to a service terminal. The consumption request is stored in a first message queue at a preset message queue. The consumption request is extracted from the message queue to obtain a target request, which contains a new word file to be processed. The target request is then compared with words according to a preset model to obtain comparison data. The consumption data is then sent to the service terminal. The comparison data is stored in a second message queue at the service terminal, enabling word comparison of the request based on the preset model, thus improving the accuracy and efficiency of word comparison and ensuring higher accuracy of the comparison data. Furthermore, storing the consumption request and comparison data in different message queues improves the rationality and balance of data storage. Furthermore, the consumption timestamp of the preset model is obtained to obtain the current timestamp; where the current timestamp is the timestamp of the preset model performing word comparison on the target request; the update time of the candidate word file in the target model on the preset storage server is obtained; the candidate word file of the preset model is updated according to the current timestamp and the update time to obtain the target word file. This allows for a relatively convenient determination of whether the candidate word file of the preset model needs to be updated based on the current timestamp and the update time, so as to update the candidate word file of the preset model in a timely manner, thereby improving the file update efficiency of the consumer terminal. When determining whether the candidate word file of the preset model needs to be updated, the existence of updatable content in the content update data is first identified. Based on the identification result, it is determined whether the preset model needs to consume the content update data. In this process, multiple preset models can perform content identification work simultaneously, realizing high concurrency of content detection and improving the efficiency and accuracy of content detection. In addition, the service terminal sends data to the consumer terminal through the message queue, so that the service terminal and the consumer terminal can be decoupled and can work independently, improving the work independence and stability of the service terminal and the consumer terminal, thereby improving the overall file update efficiency.

[0164] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0165] It will be understood by those skilled in the art that Figure 1-6 The technical solutions shown do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0166] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0167] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0168] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0169] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0170] In the several embodiments provided in this application, 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 instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0171] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0172] Furthermore, the functional units in the various embodiments of this application 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. The integrated unit can be implemented in hardware or as a software functional unit.

[0173] 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 computer-readable storage medium. Based on this understanding, the technical solution of this application, 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 multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0174] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.

Claims

1. A file processing method, characterized in that, Applied to consumer terminals, the method includes: Send a consumption request to the service terminal; wherein the consumption request is used to store a first message queue in a preset message queue terminal of the service terminal; The consumption request is extracted from the message queue to obtain the target request, wherein the target request contains a file of newly added words to be processed; The target request is compared using a preset model of the consumer terminal to obtain comparison data and a current timestamp; wherein the current timestamp is the timestamp of the word comparison of the target request, and the preset model stores multiple candidate word files; The comparison data is sent to the service terminal; wherein the comparison data is stored in the second message queue at the message queue end through the service terminal. Obtain the update time of the candidate word file in the target model on the preset storage server; The candidate word file of the preset model is updated based on the current timestamp and the update time to obtain the target word file.

2. The file processing method according to claim 1, characterized in that, The step of updating the candidate word file of the preset model according to the current timestamp and the update time to obtain the target word file includes: Compare the current timestamp with the update time; If the current timestamp is consistent with the update time, then the candidate word file of the preset model is used as the target word file; If the current timestamp is inconsistent with the update time, then the candidate word file of the target model is downloaded from the storage server, and the candidate word file of the target model is used as the target word file.

3. The file processing method according to claim 2, characterized in that, If the current timestamp is inconsistent with the update time, then download the candidate word file of the target model from the storage server and use the candidate word file of the target model as the target word file, including: If the current timestamp is inconsistent with the update time, a content update request is sent to the service terminal; Content update data is extracted from the message queue according to the content update request, wherein the content update data is used to store in a third message queue of the message queue through the service terminal; The content update data is determined to be occupied based on the data occupancy status parameter of the third message queue. If the content update data is not occupied, configure the content update permissions for the preset model; Based on the content update permissions, the candidate word file of the target model at the update time is downloaded from the storage server as the target word file.

4. The file processing method according to claim 3, characterized in that, The step of determining whether the content update data is occupied based on the data occupancy status parameter of the third message queue includes: Determine whether candidate key data exists in the third message queue; If the candidate key data exists in the third message queue, the candidate key data is compared with the preset key-value pair data, which includes a one-to-one corresponding reference key data and reference value data. If there is no reference key data in the key-value pair data that is the same as the candidate key data, then the content update data is not occupied; If there is a reference key in the key-value pair data that is the same as the candidate key data, then the content update data is occupied.

5. The document processing method according to claim 3, characterized in that, The step of downloading the candidate word file of the target model with the update time from the storage server as the target word file based on the content update permission includes: Based on the content update permissions, the update time is verified; If the update time is the latest time, then the candidate word file of the target model is downloaded from the storage server, and the candidate word file of the target model is used as the target word file.

6. A file processing method, characterized in that, Applied to a service terminal, the method includes: The consumer terminal receives a consumption request sent by the consumer terminal, and the consumer terminal executes the file processing method as described in any one of claims 1-5; The consumption request is stored in a preset message queue; wherein the message queue includes a first message queue and a second message queue, and the consumption request is placed in the first message queue. Obtain the comparison data generated by the consumer terminal based on the consumption request, and store the comparison data in the second message queue; Get content update request; Based on the content update request, the content update data is stored in the third message queue of the message queue terminal.

7. A document processing device, characterized in that, The device, applied to a consumer terminal, includes: A consumption request sending module is used to send a consumption request to a service terminal; wherein the consumption request is used to store a first message queue in a preset message queue terminal through the service terminal; The current request retrieval module is used to extract the consumption request from the message queue end to obtain the target request, wherein the target request contains a new word file to be processed; The request consumption module is used to perform word comparison on the target request according to the preset model of the consumption terminal to obtain comparison data and current timestamp; wherein, the current timestamp is the timestamp of the word comparison of the target request, and the preset model stores multiple candidate word files; A storage module is used to send the comparison data to the service terminal; wherein the comparison data is used to store the comparison data in a second message queue at the message queue terminal via the service terminal; The update time acquisition module is used to obtain the update time of the candidate word file in the target model on the preset storage server; The file update module is used to update the candidate word file of the preset model according to the current timestamp and the update time to obtain the target word file.

8. A document processing device, characterized in that, The device is applied to a service terminal and includes: A consumption request acquisition module is used to acquire consumption requests sent by a consumption terminal, wherein the consumption terminal executes the file processing method as described in any one of claims 1-5; A request storage module is used to store the consumption request to a preset message queue terminal; wherein, the message queue terminal includes a first message queue and a second message queue, and the consumption request is placed in the first message queue; The data acquisition module is used to acquire the comparison data generated by the consumer terminal according to the consumption request, and store the comparison data in the second message queue; The update request retrieval module is used to retrieve content update requests; The data storage module is updated to store the content update data in the third message queue of the message queue terminal according to the content update request.

9. An electronic device, characterized in that, The electronic device includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement: The document processing method as described in any one of claims 1 to 5; or, The file processing method as described in claim 6.

10. A computer-readable storage medium storing a computer program, characterized in that, The computer program is executed by the processor to achieve the following: The document processing method as described in any one of claims 1 to 5; or, The file processing method as described in claim 6.

Citation Information

Patent Citations

  • Dialogue dictionary updating method and device, electronic equipment and storage medium

    CN113553836A