[go: up one dir, main page]

CN119759615A - Information type determining method and device and electronic equipment - Google Patents

Information type determining method and device and electronic equipment Download PDF

Info

Publication number
CN119759615A
CN119759615A CN202411954676.4A CN202411954676A CN119759615A CN 119759615 A CN119759615 A CN 119759615A CN 202411954676 A CN202411954676 A CN 202411954676A CN 119759615 A CN119759615 A CN 119759615A
Authority
CN
China
Prior art keywords
information
target
keyword
determining
type
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202411954676.4A
Other languages
Chinese (zh)
Inventor
蒋昊
朱江
贺伟
章庆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Telecom Bestpay Co Ltd
Original Assignee
China Telecom Bestpay Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Telecom Bestpay Co Ltd filed Critical China Telecom Bestpay Co Ltd
Priority to CN202411954676.4A priority Critical patent/CN119759615A/en
Publication of CN119759615A publication Critical patent/CN119759615A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明公开了一种信息类型的确定方法、装置及电子设备。其中,该方法包括:接收目标信息,其中,目标信息包括目标关键字;确定信息状态库中,是否存在与目标关键字匹配的历史关键字,得到匹配结果,其中,信息状态库用于存储历史关键字,历史关键字为历史信息对应的关键字;依据匹配结果,确定目标信息对应的信息类型,其中,信息类型包括:请求信息类型,响应信息类型。本发明解决了在接收到信息后,需要完整检查信息交互历史以判断信息的类型,占用大量计算资源,导致系统性能与效率下降的技术问题。

The present invention discloses a method, device and electronic device for determining information type. The method comprises: receiving target information, wherein the target information includes a target keyword; determining whether there is a historical keyword matching the target keyword in the information status library, and obtaining a matching result, wherein the information status library is used to store historical keywords, and the historical keywords are keywords corresponding to historical information; determining the information type corresponding to the target information based on the matching result, wherein the information type includes: request information type and response information type. The present invention solves the technical problem that after receiving the information, it is necessary to completely check the information interaction history to determine the type of information, which occupies a large amount of computing resources and leads to a decrease in system performance and efficiency.

Description

Information type determining method and device and electronic equipment
Technical Field
The present invention relates to the field of data processing, and in particular, to a method and an apparatus for determining an information type, and an electronic device.
Background
The data exchange between the client and the server is one of the core functions of the Internet application, and plays an important role in realizing function requirements, finishing dynamic content updating, improving user interaction experience and the like. At present, data exchange between a client and a server is mainly realized by using gRPC by using a bidirectional streaming RPC mode, but when the method is adopted, after the server receives information, the information interaction history needs to be completely checked to judge the type of the information, so that the technical problems of greatly increasing the calculation amount of a system and reducing the performance and efficiency of the system exist.
In view of the above problems, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the invention provides a method, a device and electronic equipment for determining information types, which are used for at least solving the technical problems that after information is received, the information interaction history is required to be completely checked to judge the information types, a large amount of computing resources are occupied, and the system performance and efficiency are reduced.
According to one aspect of the embodiment of the invention, a method for determining information types is provided, wherein the method comprises the steps of receiving target information, determining whether a history keyword matched with the target keyword exists in an information state library or not to obtain a matching result, wherein the information state library is used for storing the history keyword which is a keyword corresponding to the history information, and determining the information type corresponding to the target information according to the matching result, wherein the information type comprises a request information type and a response information type.
Optionally, after determining the information type corresponding to the target information according to the matching result, determining a change keyword operation corresponding to the target information when the information type corresponding to the target information is a response information type, and changing the information state library according to the change keyword operation to obtain an updated state library.
Optionally, changing the information state library according to the operation of changing the keywords to obtain an updated state library comprises determining historical keywords matched with the target keywords based on the information state library, and deleting the historical keywords in the information state library to obtain the updated state library.
Optionally, after determining the information type corresponding to the target information according to the matching result, determining target response information corresponding to the target information under the condition that the information type corresponding to the target information is the request information type, wherein the target response information comprises the target keyword and the execution result, and sending the target response information to a target terminal, wherein the target terminal is a terminal sending the target information.
Optionally, determining the target response information corresponding to the target information when the information type corresponding to the target information is the request information type comprises determining an operation to be performed corresponding to the target information when the information type corresponding to the target information is the request information type, executing the operation to be performed to obtain an execution result, and determining the target response information corresponding to the target information according to the execution result.
Optionally, determining whether a history keyword matched with the target keyword exists in the information state library, and before obtaining a matching result, further comprising receiving a demand operation, determining demand information corresponding to the demand operation, and executing a demand terminal of the demand operation, wherein the demand information comprises a demand keyword, and sending the demand information to the demand terminal.
Optionally, determining whether a history keyword matched with the target keyword exists in the information state library to obtain a matching result includes determining a keyword recognition queue corresponding to the target information, distributing the target information to the keyword recognition queue, and receiving the matching result sent by the keyword recognition queue.
According to one aspect of the embodiment of the invention, a device for determining information types is provided, which comprises a receiving module, a first determining module and a second determining module, wherein the receiving module is used for receiving target information, the target information comprises target keywords, the first determining module is used for determining whether historical keywords matched with the target keywords exist in an information state library to obtain a matching result, the information state library is used for storing the historical keywords, the historical keywords are keywords corresponding to the historical information, and the second determining module is used for determining the information types corresponding to the target information according to the matching result, wherein the information types comprise request information types and response information types.
According to an aspect of an embodiment of the present invention, there is provided an electronic device including a processor, a memory for storing processor-executable instructions, wherein the processor is configured to execute the instructions to implement the method of determining the information type of any one of the above.
According to an aspect of an embodiment of the present invention, there is provided a computer-readable storage medium, which when executed by a processor of an electronic device, causes the electronic device to perform the method of determining the information type of any one of the above.
The method comprises the steps of receiving target information, determining whether a historical keyword matched with the target keyword exists in an information state library or not to obtain a matching result, wherein the information state library is used for storing the historical keyword which is a keyword corresponding to the historical information, and determining an information type corresponding to the target information according to the matching result, wherein the information type comprises a request information type and a response information type. By determining whether the historical keywords matched with the target keywords exist in the information state library or not, a matching result is obtained, and the effect of determining the information type corresponding to the target information according to the matching result is achieved. Because the history keywords are keywords corresponding to the history information, whether the target information is response information corresponding to the history information or new request information can be determined by determining whether the history keywords matched with the target keywords exist in the information state library, and further the technical problems that after the information is received, the information interaction history needs to be completely checked to judge the type of the information, a large amount of calculation resources are occupied, and the system performance and efficiency are reduced are solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
FIG. 1 is a flow chart of a method of determining a type of information according to an embodiment of the present invention;
fig. 2 is a flow chart of data transmission provided by an alternative embodiment of the present invention;
Fig. 3 is a block diagram of a configuration of an information type determining apparatus according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
First, partial terms or terminology appearing in the course of describing embodiments of the application are applicable to the following explanation:
RPC: remote procedure call (Remote Procedure Call) is a communication protocol that allows a procedure or function to be called between different computers or processes. With RPC, a computer program may call a program or function of a computer on another network without knowing the details of the underlying network protocol, nor how data is transferred between different systems.
GRPC A high performance, open source Remote Procedure Call (RPC) framework, gRPC is designed to provide an efficient, reliable and simple cross-language means of communication, particularly for inter-service communication in a micro-service architecture. It supports multiple programming languages, enabling seamless communication of microservices written in different languages.
Example 1
According to an embodiment of the present invention, there is provided an embodiment of a method of determining a type of information, it being noted that the steps shown in the flowcharts of the figures may be performed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowcharts, in some cases the steps shown or described may be performed in an order different from that herein.
Fig. 1 is a flowchart of a method of determining a type of information according to an embodiment of the present invention, as shown in fig. 1, the method including the steps of:
step S102, receiving target information, wherein the target information comprises a target keyword.
In the present application provides step S102, target information including a target keyword is received.
The target information refers to a specific message which needs to be processed or responded by a receiving end, for example, a request message sent to a server by a client or a response message returned to the client after being processed by the server.
Wherein, the target key word is referred to as an important identifier for identifying information. The target keyword is a key basis for judging and processing the received information by the receiving end, and can help the receiving end to identify the type of the information.
In this step, the receiving end acquires the target information including the target keyword, which is the starting point for the information type determination, and is the basic step for the subsequent type determination of the target information.
Step S104, determining whether a history keyword matched with the target keyword exists in an information state library to obtain a matching result, wherein the information state library is used for storing the history keyword, and the history keyword is a keyword corresponding to history information.
In the step S104 provided by the application, whether the history keywords matched with the target keywords exist in the information state library is determined, and a matching result is obtained.
In this context, an information state library refers to a database or a data structure for storing and managing history keywords, for example, a relational database, a key value storage database, a data structure in a memory, and the like, for recording history keywords.
The history keywords refer to information keywords corresponding to the history information, such as keywords corresponding to sent request messages, and the information keywords are stored in an information state library, so that message processing logic can identify the type of subsequent information according to the history keywords.
The matching result refers to whether the target keyword matches the matching result of the corresponding history keyword in the information state library, namely, the target keyword has the matched history keyword in the information state library and the target keyword has no matched history keyword in the information state library.
Wherein, the history information is related to the request information sent by the receiving end in the past.
In the step, after receiving the information containing the target keyword, the information state library of the receiving end is queried to find whether the historical keyword matched with the currently received target keyword exists or not, and a matching result is obtained. Through the step, the information type corresponding to the received information can be accurately judged, the communication history is effectively tracked and managed, the correct association of the request and the response is ensured, and the accuracy and the reliability of subsequent information processing are ensured.
It should be noted that in a distributed system, the information state library may need to be synchronized across multiple nodes or services to ensure that all communicating components have access to consistent state information. To improve performance and reliability, the information state library may be implemented using techniques such as a distributed hash table, a consistent hash algorithm, a distributed database, or a state storage service. These techniques can provide high availability, partition fault tolerance, and data consistency, ensuring the correctness and availability of critical state information even in the event of network partition or node failure. In addition, for the frequently accessed information state library, a caching strategy can be adopted to store the query result of the history key word in the cache, so that the access to the bottom layer storage is reduced, and the response speed and the response efficiency of the system are further improved. The use of the cache needs to balance read-write performance and consistency of state update, and communication errors caused by cache inconsistency are avoided.
Step S106, determining the information type corresponding to the target information according to the matching result, wherein the information type comprises a request information type and a response information type.
In the step S106, the information type corresponding to the target information is determined according to the matching result.
The information type refers to a category of classifying information according to the purpose of transmission, the information contained in the information and the position in a communication flow. The information types define basic attributes and processing rules of the information, and can distinguish between the characteristics and needs of different types of information for more efficient storage, transmission, and processing.
The request information type refers to information which is actively sent by a client or other service terminals and is used for requesting service or data. Such information contains specific business needs or operational requests, typically carrying a newly generated target key for tracking and identifying the request.
The response information type refers to information returned to the sending end after the client or other service ends complete request processing. The response information contains a reply to the request or a result of processing, and generally carries the same target key as the request information to indicate which request is the response to.
In the step, according to the matching condition of the target keyword and the history keyword in the information state library, namely, the matching result, the information type of the received target information is judged, namely, whether the target information belongs to the request information or the response information. If there is a matching target keyword in the information state library, the received information is a response information type, and if there is no matching target keyword in the information state library, the received information is a request information type.
Through the step, according to the matching result of the target keyword and the historical keyword in the information state library, the receiving end automatically judges the type of the information, the type and the source of the information can be rapidly determined, unnecessary state detection and information source verification are avoided, and extra inquiry or waiting time is reduced, so that the speed of data processing and the response efficiency of the system are improved, the processing delay and the calculation cost are reduced, the system can process large-scale concurrent communication more efficiently, and the overall throughput and the response time are improved.
It should be noted that, when processing the request information, a higher level policy, such as load balancing, priority scheduling, or data encryption, may be performed according to the attribute of the target key or the additional information. For example, the hash value of the target keyword is distributed to different processing queues to realize load balancing, or the order of message processing is adjusted according to the priority attribute of the target keyword to ensure that the high-priority request is processed in time. Meanwhile, in order to improve the efficiency and accuracy of target keyword matching, advanced data structures and algorithms, such as Bloom filters (Bloom filters), can be used to quickly judge whether the history keywords corresponding to the target keywords are likely to exist, so that unnecessary complete queries are reduced, or Hash tables (Hash tables) are used to improve the query speed of the target keywords. These optimization measures are particularly important for large-scale data processing and high concurrent communication scenarios, and can significantly improve the performance and user experience of the system.
Through the steps S102-S106, target information can be received, wherein the target information comprises target keywords, whether a history keyword matched with the target keywords exists in an information state library is determined, a matching result is obtained, the information state library is used for storing the history keywords, the history keywords are keywords corresponding to the history information, and information types corresponding to the target information are determined according to the matching result, wherein the information types comprise a request information type and a response information type. By determining whether the historical keywords matched with the target keywords exist in the information state library or not, a matching result is obtained, and the effect of determining the information type corresponding to the target information according to the matching result is achieved. Because the history keywords are keywords corresponding to the history information, whether the target information is response information corresponding to the history information or new request information can be determined by determining whether the history keywords matched with the target keywords exist in the information state library, and further the technical problems that after the information is received, the information interaction history needs to be completely checked to judge the type of the information, a large amount of calculation resources are occupied, and the system performance and efficiency are reduced are solved.
As an optional embodiment, after determining the information type corresponding to the target information according to the matching result, the method further comprises the steps of determining a change keyword operation corresponding to the target information when the information type corresponding to the target information is a response information type, and changing the information state library according to the change keyword operation to obtain an updated state library.
In this embodiment, a specific step of determining to update the state library in the case where the information type corresponding to the target information is the response information type is described.
Wherein, the change key operation is related to the update operation of the history key in the information state library, which is needed to be performed when the target information is determined to be the response information type.
The update state library is a state library obtained after the keyword changing operation is performed on the information state library.
In the step, after the received information is determined to be the response information type through the matching of the target keywords, determining specific keyword changing operation to be executed according to the target keywords, such as searching for a history keyword matched with the keywords in the response information, and updating the state of the history keyword. And then, updating the information state library according to the determined change key word operation to obtain an updated state library. This operation typically means that the history key is marked as processed or deleted from the information state library to indicate that the correspondence of the request to the response has been completed, avoiding subsequent repetitive processing or wasting of resources.
Through the step, the information state library is changed and updated, resources related to the request, such as a memory, a database connection or a calculation unit, can be released in time, redundant occupation of the resources is avoided, and the utilization rate of the resources is improved. Meanwhile, the accuracy of the communication state is ensured by updating the information state library, system errors or data loss caused by poor state management are avoided, and the stability and reliability of the system are enhanced.
It should be noted that, when processing the target information of the response information type, other additional operations may be performed besides changing the key operation, for example, performing business logic, that is, performing business logic related to the response information once the response information is confirmed, such as updating a user state in a database, triggering a subsequent processing procedure or generating a report, performing error processing and logging, if the response information includes an error code or abnormal information, performing the error processing procedure may include notifying a user, retrying an failed operation or logging an error log for subsequent analysis, performing performance monitoring and optimization, collecting performance indexes related to the response information processing, such as processing time, resource consumption, and the like, for monitoring an operation state of the system and optimizing a resource allocation policy. Through the flow, the response information in communication can be processed efficiently and accurately, the consistency of the system state can be further ensured, the resource utilization rate is improved, the safety is enhanced, and a foundation is provided for performance monitoring and optimization.
As an alternative embodiment, the method comprises the steps of changing the information state library according to a change keyword operation to obtain an updated state library, wherein the method comprises the steps of determining a history keyword matched with a target keyword based on the information state library, deleting the history keyword in the information state library, and obtaining the updated state library.
In this embodiment, the specific steps of changing the information state library according to the change key operation to obtain the updated state library are described.
In this step, when the received information type corresponding to the target information is the response information type, it is indicated that the target information is the response information corresponding to the previous certain request information, and first, the history keyword matched with the target keyword is searched in the information state library through the keyword in the response information, that is, the target keyword. After a matching history key is found, a delete operation is performed, i.e., the record associated with the history key is removed from the information state library, thereby updating the state library, indicating that the request has been responded to, that the state has been completed, and that no more records need to be tracked.
Through the step, the history keywords of the completed request are deleted, the storage space in the information state library is released, the maintenance cost of the system is reduced, and the performance is improved. Meanwhile, the retention time of the sensitive information in the system can be reduced by deleting the processed request information, the risk of data leakage is reduced, and the system safety is enhanced.
The method comprises the steps of determining a target response message corresponding to target information according to a matching result, determining the information type corresponding to the target information, and sending the target response message to a target terminal, wherein the target response message comprises a target keyword and an execution result, and the target terminal is a terminal sending the target information.
In this embodiment, a specific step of transmitting target response information to the target terminal in the case where the information type corresponding to the target information is the request information type is described.
The target response information is information which is generated as a response when the received target information is request information, and includes a processing result of the request and a target keyword.
The execution result refers to a result obtained after the receiving end processes the request information, for example, an execution state (such as success and failure) of an operation related in the request information, a calculated result or information of a query, and the like.
The target terminal refers to a terminal or a system which sends target information, and an initiating terminal of the request information needs to receive target response information.
In the step, under the condition that the information type corresponding to the target information is the request information type, corresponding business logic is executed according to the content and the requirement of the request information, target response information is generated, and the execution result and the target keyword are contained in the target response information. And then, the target response information is sent to a corresponding sending queue and is sent back to the target terminal, namely the initiator of the request information.
Through the step, the target response information carrying the target keywords is determined, one-to-one mapping between the request information and the response information is realized, the target response information can be accurately identified and processed after the target response information is sent back to the target terminal, such accurate association between the request information and the response information is ensured, the request information and the response information can be accurately tracked and matched even in a high concurrency environment, and the stability and the reliability of the system are improved.
Before the target response information is sent, data verification can be performed, so that the sent information is ensured to be accurate, and the communication safety and the data integrity are improved. In the scenario that a plurality of requests are processed in parallel, the sending sequence of the target response information can be determined according to the priority or the emergency degree of the requests, and the resource allocation and the response time are optimized.
As an alternative embodiment, in the case that the information type corresponding to the target information is the request information type, determining the target response information corresponding to the target information comprises determining an operation to be executed corresponding to the target information in the case that the information type corresponding to the target information is the request information type, executing the operation to be executed to obtain an execution result, and determining the target response information corresponding to the target information according to the execution result.
In this embodiment, a specific step of determining target response information corresponding to target information in the case where the information type corresponding to the target information is the request information type is described.
The to-be-executed operation refers to specific operation or business logic, such as database query, algorithm calculation, service call and the like, which is determined according to the content of the target information under the condition that the information type corresponding to the target information is the request information type.
In the step, under the condition that the information type corresponding to the target information is the request information type, firstly, analyzing the content in the target information, identifying the operation instruction or service logic requirement contained in the content, and determining the operation to be executed to determine the specific operation to be executed next. And then, processing according to the determined operation to be executed, for example, performing internal calculation, external service call or data query and the like, and obtaining an execution result. Finally, after the operation is executed and the execution result is obtained, target response information is generated, wherein the information comprises the execution result, so that the requester can know the execution state of the operation.
By the method, the specific steps of the operation to be executed by the target information are defined, so that the system can quickly respond to the request, the processing delay is reduced, and the overall performance of the system is improved. Meanwhile, the target response information is determined according to the execution result, and the obtained execution result is fed back, so that resources can be managed more effectively, and unnecessary repeated processing is avoided.
It should be noted that, if an error is encountered in the process of executing the operation to be executed, detailed error information may be recorded, and target response information including the error information may be generated and sent to the requester. In addition, a retry mechanism may be provided that allows the requestor to resend the request after receiving the error response to increase the success rate of the operation and the robustness of the system. Meanwhile, when the target response information is determined, the execution result can be encrypted to protect the safety of the data. In addition, authentication information may be included in the response information to ensure that the requestor is authorized to receive the response information.
As an optional embodiment, determining whether a historical keyword matched with the target keyword exists in the information state library, and before a matching result is obtained, further comprises receiving a demand operation, determining demand information corresponding to the demand operation, and executing a demand terminal of the demand operation, wherein the demand information comprises the demand keyword, and sending the demand information to the demand terminal.
In this embodiment, specific steps of transmitting the demand information to the demand terminal are explained.
The demand operation refers to a specific operation or a behavior request for calling a specific service, which is initiated by the receiving end and needs to be executed by other service ends or clients.
The requirement information refers to request information containing requirement operation, and the requirement information comprises specific content of the requirement operation to be executed and a data packet of a requirement keyword. The demand information is a carrier of demand operations that ensures the integrity and traceability of the operations.
Where a demand terminal is referred to, the demand terminal refers to a system or component that performs the demand operation, and is also the recipient of the demand information.
The demand keywords refer to unique identifiers of the demand information, and are used for matching the subsequent response information with the demand information, so that the operation request is ensured to correspond to the operation result.
In this step, first, an operation request, i.e., a demand operation, is received from an internal or external component, which request may be communicated via a network, message queue, or other communication mechanism. And secondly, analyzing the content of the demand operation, and converting the content into demand information containing all necessary information and parameters. At the same time, a demand key is generated for each demand information for subsequent matching and correlation. Thereafter, it is determined to which terminal or component the demand information should be sent. The demand terminal is responsible for receiving and executing operations in the demand information. And finally, distributing the demand information to a sending queue, sending the demand information to a demand terminal through a proper communication mechanism, and executing the operation by the demand terminal according to the demand keywords, the operation instructions and the parameters contained in the demand information.
Through the step, the demand information is generated, the operation request, the required data and the parameters are packaged together, the frequency and complexity of data transmission are reduced, and the communication efficiency is improved. The use of the demand information enables the system to flexibly distribute tasks, send different demand information to different demand terminals, and support the execution of parallel operation, namely, a plurality of demand terminals can process a plurality of demand information at the same time, so that the processing capacity and response speed of the system are greatly improved. Meanwhile, the demand keywords are generated and stored in the demand information, the execution state of each demand information is tracked, and a clear execution result of each demand information is ensured.
It should be noted that, the requirement information may be encrypted in the transmission process to protect the security of the data, and an authentication mechanism may be implemented to ensure that only authorized requirement terminals can receive and execute the requirement information, thereby enhancing the security of the system. In addition, the demand information can be dynamically distributed according to the load condition of the demand terminal, and the task is distributed to the terminal with lower load or richer resources so as to optimize the system performance and the resource utilization.
As an alternative embodiment, determining whether a history keyword matched with the target keyword exists in the information state library to obtain a matching result comprises determining a keyword recognition queue corresponding to the target information, distributing the target information to the keyword recognition queue, and receiving the matching result sent by the keyword recognition queue.
In this embodiment, a specific step of determining whether there is a history keyword matching with the target keyword in the information state library to obtain a matching result is described.
The key word recognition queue is a queue or thread pool designed for processing key word matching operation, and can process a plurality of key word matching requests in parallel, so that the processing capacity and response speed of the system are improved.
In this step, after receiving a target message, it is necessary to confirm whether the target message is associated with a previously processed request to determine how to further process. This is accomplished by a key identification queue. First, a corresponding keyword recognition queue is determined for target information. The receiving end comprises one or more keyword recognition queues, and each queue is responsible for processing information of different types or priorities. And secondly, sending target information comprising target keywords to corresponding keyword recognition queues, and waiting for a processing program in the queues to perform keyword matching operation. After the keyword recognition queue completes the matching operation, a matching result, namely whether a history keyword matched with the target keyword is found or not, is fed back to the receiving end. The receiving end decides the subsequent actions, such as generating response information, processing abnormality or updating a state library, etc., according to the matching result.
Through the step, the keyword recognition queue can process a plurality of keyword matching requests in parallel, so that the query efficiency of the information state library is greatly improved, resources can be distributed and utilized more efficiently, delay of request processing is reduced, resource waiting and waste are reduced, and the overall resource utilization rate of the system is improved. Meanwhile, the number of keyword recognition queues can be increased or decreased according to the load condition, the processing capacity can be dynamically adjusted, and the method is suitable for request processing requirements of different scales.
It should be noted that, the receiving end may monitor the processing performance of the keyword recognition queue in real time, such as the queue length, the average processing time, etc., so as to facilitate the subsequent performance tuning and system optimization. If insufficient queue processing power is found, the number of queues may be dynamically increased or the allocation of queue resources may be adjusted. The keyword recognition queue may encounter abnormal situations, such as queue fullness, database connection failure, etc., when performing the matching operation, and an exception handling mechanism, such as automatic retry, error log recording, notification manager, etc., may be designed to ensure the reliability of keyword matching.
Based on the foregoing embodiments and optional embodiments, an optional implementation is provided, and is specifically described below.
In the related art, gRPC is generally used to complete data exchange between a client and a server. gRPC provide four main streaming modes that allow data exchange between client and server in different ways, namely simple RPC (Unary RPC), server streaming RPC (Server Streaming RPC), client streaming RPC (Client Streaming RPC) and bi-directional streaming RPC (bidirectory STREAMING RPC). The bidirectional streaming RPC allows simultaneous streaming read-write between the client and the server, i.e. both sides can send and receive messages at any time point, and is often used in a scenario requiring bidirectional real-time communication.
However, this streaming mode also has some drawbacks, such as a difficulty in development, a developer needs to process more complex communication logic including transmission, reception, error processing, connection management, etc., a difficulty in state management, a difficulty in ensuring correctness and reliability of communication because communication is bi-directional and may involve interaction of a plurality of messages, and a complexity in message processing, and a server may need to process concurrent requests from a plurality of clients because both parties may transmit messages, which may increase complexity and resource consumption of message processing.
In view of this, an alternative embodiment of the present invention provides a high performance transmission method based on gRPC, which includes a KEY (KEY) generation function, generating a KEY each time a new message is sent, attaching the KEY to the message to be sent and storing the KEY in a database of a sender, and a send queue and a receive queue, where in the bidirectional streaming RPC mode of gRPC, the client or the server has two queues, a send queue and a receive queue. The KEY carried in the sending queue can be generated by the sender or obtained from the received message, the receiving queue is only responsible for receiving the message, the message is put into a thread pool for event processing after being received, the message type judging function judges that the message is a request message or a response message according to the KEY of the received message and the KEY stored in a local database (the same as the information state library), the memory sharing function maps the data of the local server into a memory, and the data is directly read from the memory to a client when the data is transmitted, so that the cost of disk input/output (I/O) is avoided.
Fig. 2 is a data transmission flow chart provided by an alternative embodiment of the present invention, as shown in fig. 2, a network Server (Web service), an algorithm service submits data to be transmitted to a communication service through a Local Server (Local Server), and the Local Server returns a corresponding message identifier (event_id) or batch identifier (batch_id). Local Server and client servers (CLIENT SERVER) synchronize state through Local databases (rediss) and synchronize data through shared memory. CLIENT SERVER maintains a transmission control protocol connection (TCP connection) with a Remote Server (Remote Server) of the target node through gRPC bi-directional flows. The Remote Server passes the required processing event message to the local event processing pool (EVENT CENTRE) through gRPC services. EVENT CENTRE calls a corresponding callback function (callback) through the message type (EVENT TYPE, the same as the information type above) and synchronizes the final event state to redis and sends it back to the initiator via CLIENT SERVER. The Redis service is mainly used for carrying out state synchronization among the services.
According to the high-performance transmission method based on gRPC provided by the alternative embodiment of the invention, a mechanism for storing the state and judging the state can be newly added on the existing gRPC, so that when gRPC processes a large number of concurrent messages, service requirements can be asynchronously processed without judging the sources of the messages one by one, and the processing efficiency is greatly improved.
The following are specific steps of a gRPC-based high-performance transmission method provided by an alternative embodiment of the present invention.
S1, receiving target information.
Messages can be sent in batches between the client and the server. The specific steps for receiving the target information will be described below by taking the example that the client sends the target information to the server.
Before receiving the target information, the client side firstly generates a KEY (KEY, the KEY is the same as the target KEY) and simultaneously stores the KEY in a local server of the client side, then attaches the KEY to the request message (the KEY is the same as the request information), adds the request message into a sending queue of the client side, and then asynchronously sends the request message to the server side.
The following are examples of three communication nodes that are provided in alternative embodiments of the present invention that communicate with each other.
In an example provided by an alternative embodiment of the present invention, there are communication nodes A, B and C, which communicate with each other.
A sends a request message X (same as the target information) to B, and A generates a KEY-k 1 (same as the target KEY), appends the KEY-k 1 to the request message X, stores the KEY-k 1 in a database (Redis) of the A node, and adds the request message X to the A sending queue.
C sends a request message Y (with the target information) to B, and C generates a KEY-k 2 (with the target KEY), appends the KEY-k 2 to the request message Y, stores the KEY-k 2 in the Redis of the C node, and adds the request message X to the sending queue of C.
After receiving the request message, the receiving queue of the server puts the received message into a local event processing pool, and an independent thread performs event processing.
In the example provided by an alternative embodiment of the present invention, the node B receive queue receives the message X, Y and places the message in the B's event processing pool.
S2, determining whether a history keyword matched with the target keyword exists in the information state library, and obtaining a matching result.
S3, determining the information type corresponding to the target information according to the matching result.
The server processes the event and judges the KEY in the message. If the message is consistent with the KEY stored in the local database (the information state library), the message is considered to be a response message (the response information), the round of request-response is completed, the KEY in the database is deleted, and if the message is inconsistent with the KEY stored in the local database, the message is considered to be a request message, and response needs to be processed by the user.
In the example provided by the alternative embodiment of the invention, the node B processes the X message sent by the node A, takes the KEY-k 1 in the message, searches and compares the X message in the local database (the same as the information state database) and finds that the KEY-k 1 is not in the database, so that the X message is considered to be the sent message, and responds and replies.
After the event processing of the X message is completed, the KEY-k 1 in the X is attached to the response message X1, and the response message X1 is sent to the A node and enters the receiving queue of the A node.
The node B processes the Y message sent by the node C and sends a response message Y1 with KEY-k 2 to the node C as the X message, and the response message Y1 enters a receiving queue of the node C.
It should be noted that, the server may send a response message to the client and simultaneously send a request message, where the request message follows the above operation steps, that is, the request message is attached with a newly generated KEY and stored in the database of the server, and the request message is put into the sending queue. The send queue contains request messages and response messages at this point.
In the example provided by the alternative embodiment of the present invention, the node B sends the request messages Z1 (same as the requirement information described above) and Z2 (same as the requirement information described above) to the A, C node, while the node B receives and returns the response message. B generates KEY-k 3 (same as the above-mentioned demand KEY), attaches KEY-k 3 to request message Z1, stores KEY-k 3 in Redis of node B, and adds request message Z1 to send queue of B, regenerates KEY-k 4 (same as the above-mentioned demand KEY), attaches KEY-k 4 to request message Z2, stores KEY-k 4 in Redis of node B, and adds request message Z2 to send queue of B, at this time stores two KEY in Redis of B, and send queue has two messages Z1 and Z2, and send queue and receive queue are not affected by each other.
It should be noted that, after the client receiving queue receives the message from the server, the received message is put into the local event processing pool, and an independent thread performs event processing, and the processing procedure follows the above operation steps, i.e. the information type is determined first, and then the information is processed.
In the example provided by the alternative embodiment of the invention, the A, B, C node sends the message to the other party and the message enters the receiving queue of the other party.
At this time, in the receiving queue of the a node, there are a request message Z1 sent by the B and a response message X1 returned by the B. The node A processes the Z1 message sent by the node B, takes the KEY-k 3 in the message, searches and compares the Z1 message in the database of the node A, and finds that the KEY-k 3 is not in the database, so that the Z1 message is regarded as the sent message, and response reply is required. After the event processing of the Z1 message by the A node is completed, a response message Z3 is generated, and the KEY-k 3 in the Z1 message is attached with the response message Z3 and is sent to the B node. The node A processes the X1 message returned by the node B, takes the KEY-k 1 in the message, searches and compares the message in the database, and finds the KEY-k 1 in the database, so that the X1 message is regarded as a response message, the KEY-k 1 in the database is deleted, and an independent thread processes the message, and the event is ended.
At this time, the receiving queue of the C node includes a request message Z2 sent by B and a response message Y1 returned by B. The C node processes the Z2 message sent by the B node, takes the KEY-k 4 in the message, searches and compares the Z2 message in the database of the C node, and finds that the KEY-k 4 is not in the database, so the Z2 message is regarded as the sent message, and response reply is required. After the event processing of the Z2 message by the C node is completed, a response message Z4 is generated, and the KEY-k 4 in the Z2 message is attached with the response message Z4 and is sent to the B node. C node processes Y1 message returned by B node, takes KEY-k 2 in the message, searches and compares in own database, finds KEY-k 2 in the database, so the Y1 message is regarded as response message, deletes KEY-k 2 in the database, has independent thread to process the message, and the event is ended.
The client and the server can receive and process the response message from the other party while sending the request message to each other, and the client and the server do not affect each other.
New messages Z3 and Z4 are now acquired in the node B receive queue and the messages are placed in the event processing pool. The node B processes the Z3 message, takes the KEY-k 3 in the message, searches and compares the message in the database, and finds k3 in the database, so that the Z3 message is considered as the response message of the node A, the node B deletes the KEY-k 3 in the database, and has a separate thread to process the event of the message, and the event is ended. Similarly, the node B processes the Z4 message, takes the KEY-k 4 in the message, searches and compares the message in the database, and finds k4 in the database, so that the Z4 message is regarded as the response message of the node C, the node B deletes the KEY-k 4 in the database, and the single thread processes the message, and the event is ended. So far, all message events are processed.
By the alternative embodiments, at least the following advantages can be achieved:
(1) The message source is not required to be detected in the message transmission process, and the message event can be automatically judged according to the attached KEY when the message event is processed, so that the correctness and reliability of the flow direction and the state of the message are ensured, and the complexity of message processing is reduced in a multiparty scene;
(2) The method has the advantages that the independent threads are used for processing the message event, the response of the message is not required to be waited, the processing efficiency of the event is improved, the receiving and transmitting queues are separated, and the development difficulty and the resource consumption are greatly reduced.
It should be noted that, for simplicity of description, the foregoing method embodiments are all described as a series of acts, but it should be understood by those skilled in the art that the present invention is not limited by the order of acts described, as some steps may be performed in other orders or concurrently in accordance with the present invention. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present invention.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method of the various embodiments of the present invention.
Example 2
There is further provided an apparatus for implementing the above-mentioned information type determining method according to an embodiment of the present invention, and fig. 3 is a block diagram of a structure of an information type determining apparatus according to an embodiment of the present invention, as shown in fig. 3, including a receiving module 302, a first determining module 304, and a second determining module 306, which will be described in detail below. The system comprises a receiving module 302, a first determining module 304, a second determining module 306 and a matching module, wherein the receiving module 302 is used for receiving target information, the target information comprises a target keyword, the first determining module 304 is connected to the receiving module 302 and is used for determining whether a history keyword matched with the target keyword exists in an information state library to obtain a matching result, the information state library is used for storing the history keyword, the history keyword is a keyword corresponding to the history information, and the second determining module 306 is connected to the first determining module 304 and is used for determining an information type corresponding to the target information according to the matching result, wherein the information type comprises a request information type and a response information type.
Here, the above-mentioned receiving module 302, the first determining module 304 and the second determining module 306 correspond to steps S102 to S106 in the determining method of implementing the information type, and the plurality of modules are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to those disclosed in the above-mentioned embodiment 1.
Example 3
According to another aspect of the embodiment of the invention, there is also provided an electronic device, including a processor and a memory for storing instructions executable by the processor, wherein the processor is configured to execute the instructions to implement the method for determining the information type of any one of the above.
Example 4
According to another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, which when executed by a processor of an electronic device, causes the electronic device to perform the method of determining the information type of any one of the above.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
In the foregoing embodiments of the present invention, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed technology may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, for example, may be a logic function division, and may be implemented in another manner, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. The storage medium includes a U disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, etc. which can store the program code.
The foregoing is merely a preferred embodiment of the present invention and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present invention, which are intended to be comprehended within the scope of the present invention.

Claims (10)

1. A method for determining a type of information, comprising:
receiving target information, wherein the target information comprises a target keyword;
Determining whether a history keyword matched with the target keyword exists in an information state library to obtain a matching result, wherein the information state library is used for storing the history keyword, and the history keyword is a keyword corresponding to history information;
And determining an information type corresponding to the target information according to the matching result, wherein the information type comprises a request information type and a response information type.
2. The method according to claim 1, further comprising, after determining the information type corresponding to the target information according to the matching result:
Determining a change keyword operation corresponding to the target information under the condition that the information type corresponding to the target information is a response information type;
and changing the information state library according to the change key operation to obtain an updated state library.
3. The method of claim 2, wherein modifying the information state library according to the modification key operation to obtain an updated state library comprises:
determining a history keyword matched with the target keyword based on the information state library;
and deleting the historical keywords in the information state library to obtain the updated state library.
4. The method according to claim 1, further comprising, after determining the information type corresponding to the target information according to the matching result:
Determining target response information corresponding to the target information under the condition that the information type corresponding to the target information is a request information type, wherein the target response information comprises the target keyword and an execution result;
and sending the target response information to a target terminal, wherein the target terminal is a terminal sending the target information.
5. The method according to claim 4, wherein, in the case where the information type corresponding to the target information is the request information type, determining target response information corresponding to the target information includes:
determining an operation to be executed corresponding to the target information under the condition that the information type corresponding to the target information is a request information type;
Executing the operation to be executed to obtain an execution result;
and determining target response information corresponding to the target information according to the execution result.
6. The method of claim 1, wherein determining whether there are historical keywords in the information state library that match the target keyword, prior to obtaining a match result, further comprises:
Receiving a demand operation;
determining demand information corresponding to the demand operation and a demand terminal executing the demand operation, wherein the demand information comprises a demand keyword;
and sending the demand information to the demand terminal.
7. The method according to any one of claims 1 to 6, wherein in the determination of the information state library,
Whether a history keyword matched with the target keyword exists or not, and obtaining a matching result comprises the following steps:
determining a keyword recognition queue corresponding to the target information;
distributing the target information to the keyword recognition queue;
And receiving the matching result sent by the keyword recognition queue.
8. An information type determining apparatus, comprising:
the receiving module is used for receiving target information, wherein the target information comprises a target keyword;
The first determining module is used for determining whether a historical keyword matched with the target keyword exists in the information state library or not to obtain a matching result, wherein the information state library is used for storing the historical keyword, and the historical keyword is a keyword corresponding to the historical information;
And the second determining module is used for determining the information type corresponding to the target information according to the matching result, wherein the information type comprises a request information type and a response information type.
9. An electronic device, comprising:
A processor;
a memory for storing the processor-executable instructions;
Wherein the processor is configured to execute the instructions to implement the method of determining the type of information as claimed in any one of claims 1 to 7.
10. A computer readable storage medium, characterized in that instructions in the computer readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the method of determining the type of information as claimed in any one of claims 1 to 7.
CN202411954676.4A 2024-12-27 2024-12-27 Information type determining method and device and electronic equipment Pending CN119759615A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411954676.4A CN119759615A (en) 2024-12-27 2024-12-27 Information type determining method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411954676.4A CN119759615A (en) 2024-12-27 2024-12-27 Information type determining method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN119759615A true CN119759615A (en) 2025-04-04

Family

ID=95183126

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411954676.4A Pending CN119759615A (en) 2024-12-27 2024-12-27 Information type determining method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN119759615A (en)

Similar Documents

Publication Publication Date Title
US11775501B2 (en) Trace and span sampling and analysis for instrumented software
US7644408B2 (en) System for assigning and monitoring grid jobs on a computing grid
US12105735B2 (en) Asynchronous accounting method and apparatus for blockchain, medium and electronic device
WO2016169237A1 (en) Data processing method and device
CN112685499A (en) Method, device and equipment for synchronizing process data of work service flow
US11816511B1 (en) Virtual partitioning of a shared message bus
CN110069670A (en) Purpose data classifying method, device, equipment and computer readable storage medium
CN111488373B (en) Method and system for processing request
US20220067047A1 (en) Method, apparatus, device and storage medium for generating and processing a distributed graph database
US20220044144A1 (en) Real time model cascades and derived feature hierarchy
CN115809301B (en) Database processing method, device, electronic device and readable storage medium
CN117632445A (en) Request processing method and device, task execution method and device
CN113448775B (en) Multi-source heterogeneous data backup method and device
CN119759615A (en) Information type determining method and device and electronic equipment
CN112632033B (en) Cluster data migration method, device and electronic equipment
WO2023155437A1 (en) Online-consultation-based data processing method, apparatus, and computer device
CN111782428B (en) Data calling system and method
CN114185949A (en) Information registration method, information registration apparatus, computer device, storage medium, and program product
CN116521383A (en) Method, device, equipment and storage medium for detecting multimedia data
CN117573730B (en) Data processing method, apparatus, device, readable storage medium, and program product
CN120509854B (en) Collaborative processing method and system for cross-department data
CN116016374B (en) Blockchain-based data processing method, device, equipment, and readable storage medium
HK40084292A (en) Blockchain-based data processing method, apparatus, device, and readable storage medium
CN120455110A (en) Data resource positioning method and system based on identification analysis
d'ABATE Analysis and extension of radon: a general distributed computing platform

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Country or region after: China

Address after: 100037 No. 31, Fuchengmenwai Street, Xicheng District, Beijing 4th Floor, Room 429D

Applicant after: Tianyi Payment Technology Co.,Ltd.

Address before: 429D, 4th Floor, No. 31 Fuchengmenwai Street, Xicheng District, Beijing

Applicant before: TIANYI ELECTRONIC COMMERCE Co.,Ltd.

Country or region before: China

CB02 Change of applicant information