A method, device, intelligent terminal and storage medium for obtaining a serial number
By obtaining the file stream of sharing images with QR code information from the chat tool, analyzing the QR code link and redirecting to the long link, and using regular expressions to obtain the flow number, the problem of the inability to parse the flow number of the QR code picture in the existing technology is solved, and a more comprehensive data sharing statistics are achieved.
Patent Information
- Application Number
- CN202211380020.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-04
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2042-11-04
AI Technical Summary
In the prior art, pictures with QR code information cannot be parsed and obtained related flow numbers, which limits the way of contacting data sharing in chat tools.
By obtaining the file stream of sharing pictures with QR code information from the session message, parsing the QR code link, determining whether it is a short link, redirecting to a long link, and using regular expressions to obtain the flow number.
It realizes the acquisition of the flow numbers on the picture with QR code information, solves the limitations of the contact method, and improves the statistical and analysis capabilities of data sharing.
Smart Images

Figure CN115795188B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular, to a method, device, intelligent terminal and storage medium for obtaining a serial number. Background Art
[0002] Data sharing is a common customer acquisition method in current chat tools. In financial institutions, financial managers will share data with customers during conversations. Moreover, by performing operations such as burying points on the link sharing in data sharing, the serial number in the link can be parsed and obtained, and the click operation record of the link can be obtained, so as to count the reading situation of the content in the link and realize the operation of customers.
[0003] In the customer acquisition method of chat conversations, in addition to sharing links, data sharing also includes sharing pictures. Financial managers share pictures with personal associated QR code information to customers, so that customers can obtain services or information from the pictures, and can also enter the link bound with the personal information of the financial manager through the QR code information on the pictures to understand more specific services or activity details, and purchase corresponding financial services through the link.
[0004] However, in the prior art, the picture with QR code information cannot be parsed to obtain the serial number related to the QR code information, which greatly limits the customer acquisition method. Summary of the Invention
[0005] Embodiments of this application provide a method, device, intelligent terminal and storage medium for obtaining a serial number to solve the problems in the above background art.
[0006] In a first aspect, embodiments of this application provide a method for obtaining a serial number, and the method includes:
[0007] Obtain a target session message to be processed from the session message. When the message type of the target session message is a shared picture with QR code information, obtain the file stream of the shared picture with QR code information;
[0008] Parse the file stream to obtain a QR code link corresponding to the QR code information, and use the QR code link as the target processing link;
[0009] Judge whether the target processing link is a short link. If so, obtain the link domain name of the target processing link;
[0010] Judge whether the link domain name matches the domain name in the preset link domain name. If so, redirect the target processing link to obtain the long link of the target processing link;
[0011] Obtain the serial number of the target session message according to the regular expression and the long link of the target processing link.
[0012] In some embodiments, the parsing the file stream to obtain the QR code link corresponding to the QR code information includes:
[0013] Parse the file stream through a preset open source package and an opencv application package to obtain the QR code link corresponding to the QR code information.
[0014] In some embodiments, the parsing the file stream through a preset open source package and an opencv application package to obtain the QR code link corresponding to the QR code information includes:
[0015] Perform a preliminary parse of the file stream through a preset open source package and determine whether the parse is successful;
[0016] If so, obtain the QR code link corresponding to the QR code information;
[0017] If not, perform a deep parse of the file stream through the opencv toolkit to obtain the QR code link corresponding to the QR code information.
[0018] In some embodiments, the obtaining the target session message to be processed from the session message, when the message type of the target session message is a shared picture with QR code information, obtaining the file stream of the shared picture with QR code information includes:
[0019] Obtain the target session message to be processed from the session message, determine the message type of the target session message, and the message type includes a shared link and a shared picture with QR code information;
[0020] When the message type of the target session message is a shared link, use the shared link as the target processing link.
[0021] In some embodiments, after the parsing the file stream to obtain the QR code link corresponding to the QR code information and using the QR code link as the target processing link, it further includes:
[0022] Judge whether the target processing link is valid. If so, judge whether the target processing link is a short link.
[0023] In some embodiments, the obtaining the serial number of the target session message according to the regular expression and the long link of the target processing link includes:
[0024] Obtain the link keyword in the long link of the target processing link;
[0025] Obtain the serial number of the target session message according to the regular expression and the link keyword.
[0026] In some embodiments, the determining whether the link domain name matches the domain name in the preset link domain name. If so, redirect the target processing link and obtain the long link of the target processing link, including:
[0027] Determine whether the link domain name matches the domain name in the preset link domain name. If not, write the target session message into a preset record table.
[0028] In a second aspect, an embodiment of the present application further provides a device for obtaining a serial number. The device includes:
[0029] A first obtaining unit, configured to obtain a target session message to be processed from the session message. When the message type of the target session message is a shared picture with QR code information, obtain the file stream of the shared picture with QR code information;
[0030] An analysis unit, configured to analyze the file stream, obtain a QR code link corresponding to the QR code information, and use the QR code link as the target processing link;
[0031] A first judgment unit, configured to judge whether the target processing link is a short link. If so, obtain the link domain name of the target processing link;
[0032] A second judgment unit, configured to judge whether the link domain name matches the domain name in the preset link domain name. If so, redirect the target processing link and obtain the long link of the target processing link;
[0033] A second obtaining unit, configured to obtain the serial number of the target session message according to the regular expression and the long link of the target processing link.
[0034] In a third aspect, an embodiment of the present application further provides an intelligent terminal, including a memory and a processor. The memory is used to store instructions and data, and the processor is used to execute the method for obtaining a serial number described above.
[0035] In a fourth aspect, an embodiment of the present application further provides a storage medium. A plurality of instructions are stored in the storage medium, and the instructions are suitable for being loaded by a processor to execute the method for obtaining a serial number described above.
[0036] In the method for obtaining a serial number in the embodiments of the present application, when the target session message is a shared picture with QR code information, the file stream of the picture is obtained, the file stream is parsed to obtain the corresponding QR code link, through the processing of the QR code link, the corresponding long link is obtained, and the serial number of the target session message is obtained through a regular expression and the obtained long link, so as to realize obtaining the serial number related to the QR code information on the picture with QR code information. Brief Description of the Drawings
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the accompanying drawings required for the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those skilled in the art, without creative efforts, other accompanying drawings can also be obtained based on these drawings.
[0038] Figure 1 It is a flowchart of a method for obtaining a serial number provided by an embodiment of the present application.
[0039] Figure 2 It is a schematic structural diagram of a device for obtaining a serial number provided by an embodiment of the present application.
[0040] Figure 3 It is a schematic structural diagram of an intelligent terminal provided by an embodiment of the present application. Detailed Embodiments
[0041] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, rather than all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application.
[0042] In the description of the embodiments of the present application, it should be understood that the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of the described features. In the description of the embodiments of the present application, "a plurality" means two or more, unless otherwise specifically defined.
[0043] The following description is provided to enable any person skilled in the art to implement and use the present application. In the following description, details are set forth for purposes of explanation. It should be understood that those of ordinary skill in the art can recognize that the present application can be implemented without the use of these specific details. In other instances, well-known processes are not elaborated in detail to avoid obscuring the description of the embodiments of the present application with unnecessary details. Therefore, the present application is not intended to be limited to the embodiments shown, but rather to be consistent with the broadest scope that conforms to the principles and features disclosed in the embodiments of the present application.
[0044] Embodiments of the present application provide a method, apparatus, intelligent terminal, and storage medium for obtaining a serial number, which will be described in detail below respectively.
[0045] Please refer to Figure 1 , Figure 1 which is a flowchart of a method for obtaining a serial number provided by an embodiment of the present application. The method includes the following:
[0046] 101. Obtain a target session message to be processed from the session message. When the message type of the target session message is a shared picture with QR code information, obtain the file stream of the shared picture with QR code information.
[0047] In an embodiment of the present application, session messages are obtained from a chat tool. The chat tool includes, but is not limited to, applications with chat functions such as Tencent QQ, WeChat, and Enterprise WeChat. The session message can be a message in the session content and is a message sent by any participant in the session. The chat tool is connected to a customer acquisition tool, which can be an enterprise WeChat application, and the session messages in the chat tool are obtained through the customer acquisition tool.
[0048] During the session, any participant in the session can send the information to be shared to the session page. After the information to be shared is sent to the session page, these shared information all belong to the session messages. That is to say, in addition to the input text session messages, the session messages also include forwarded, copied, or uploaded messages, and these messages can be considered as shared session messages.
[0049] In an embodiment of the present application, the message types of the session messages include shared links and shared pictures. The shared link is a link forwarded or copied by any participant in the session, and the shared picture is a picture forwarded or uploaded by any participant in the session.
[0050] Among them, the shared pictures include pictures without QR code information and pictures with QR code information. Since the QR code information itself corresponds to a link, the pictures without QR code information are simple pictures and cannot be parsed into links. Therefore, in this application, only the shared pictures with QR code information and the shared links are processed to obtain the serial number.
[0051] Optionally, the target session message can be obtained from the session message by initiating a request to obtain the serial number, and the subsequent processing in the obtaining process is performed through the target session message.
[0052] For example, a bank wealth manager initiates a request to obtain the serial number on a bank system or other system that can initiate a request to obtain the serial number. The request should include the initiator information and the type and keyword of the session message targeted. After receiving the request, the system automatically obtains the target session message according to the initiator information and the keyword of the session message targeted.
[0053] For example, a bank wealth manager initiates a request to obtain the serial number on a bank system or other system that can initiate a request to obtain the serial number. The request is targeted at a shared picture with the QR code information of the bank wealth manager sent on WeChat. Then, after receiving the request, the system obtains the pictures sent by the bank wealth manager on WeChat according to the personal information of the bank wealth manager, and analyzes the obtained pictures to find the pictures with the personal information of the bank wealth manager as the determined shared pictures targeted by the request, and uses the shared pictures as the target session message.
[0054] Optionally, the customer acquisition tool polls the session messages of the target session participants in the target chat tool to obtain the shared session messages among them, and writes these session messages into a pre-constructed message queue. When it is necessary to process the serial number of a certain shared session message among them, the tool with data processing function reads the session messages in the message queue from the message queue and identifies the target session message to be processed from the read session messages.
[0055] For example, a bank wealth manager initiates a request to obtain a serial number on a bank system or other system that can initiate a request to obtain a serial number. This request is for a shared picture with the QR code information of the bank wealth manager sent on WeChat. Then, after receiving this request, the system, based on the personal information of the bank wealth manager, uses the customer engagement tool to poll the conversation messages of the bank wealth manager on WeChat to obtain the shared pictures sent by the bank wealth manager, and writes these shares into a pre - constructed message queue. When it is necessary to process the target shared picture for obtaining a serial number, a tool with data - processing capabilities reads the shared pictures in the message queue from the message queue and identifies the target shared picture to be processed as the target conversation message from the read shared pictures.
[0056] When the message type of the target conversation message is a shared picture with QR code information, obtain the file stream of the shared picture with QR code information. It can be, in determining that the target conversation message is a shared picture with QR code information, determine the target chat tool corresponding to the shared picture, and obtain the file stream of the shared picture from the target chat tool through the corresponding material download interface.
[0057] In some embodiments, after obtaining the target conversation message to be processed from the conversation messages, if the message type of the target conversation message is a shared link, no operation step of obtaining the file stream is performed.
[0058] 102. Analyze the file stream, obtain the QR code link corresponding to the QR code information, and use the QR code link as the target processing link.
[0059] Optionally, in some embodiments, after obtaining the target conversation message to be processed from the conversation messages, determine the message type of the target conversation message. If the message type of the target conversation message is a shared link, use the shared link as the target processing link.
[0060] That is to say, when the obtained target conversation message is in the form of a shared link, directly use this shared link as the target processing link to process to obtain the serial number of this shared link. The serial number of the shared link is actually also the serial number of the target conversation message. When the obtained target conversation message is in the form of a shared picture with QR code information, obtain the file stream of this shared picture, and through analyzing the file stream, obtain the QR code link corresponding to the QR code information, and use the QR code link as the target processing link to process to obtain the serial number of this link. The serial number of the QR code link is actually also the serial number of the shared picture with QR code information.
[0061] Optionally, in some embodiments, the file stream is parsed through a preset open-source package and an opencv application package to obtain the QR code link corresponding to the QR code information. The preset open-source package is the google open-source package.
[0062] Optionally, in some embodiments, the file stream is initially parsed through a preset open-source package to determine whether the parsing is successful. If so, the QR code link corresponding to the QR code information is obtained. If not, the file stream is deeply parsed through the opencv toolkit to obtain the QR code link corresponding to the QR code information.
[0063] That is to say, when the target session message is a shared picture with QR code information, the file stream of the shared picture is obtained, and the file stream is initially parsed through a preset open-source package to determine whether the QR code link corresponding to the QR code information can be obtained. When the QR code link corresponding to the QR code information is obtained, the file stream will no longer be processed through the opencv application package. When the QR code link corresponding to the QR code information cannot be obtained through the parsing of the file stream by the preset open-source package, the file stream is deeply parsed through the opencv application package to obtain the QR code link corresponding to the QR code information.
[0064] Optionally, in some embodiments, after parsing the file stream to obtain the QR code link corresponding to the QR code information and using the QR code link as the target processing link, it is determined whether the target processing link is valid. If it is valid, subsequent operation steps are carried out.
[0065] The validity of the link can be understood as the validity in terms of time. For example, when a certain link is generated, based on the generation time, an expiration time is set, and the link will become invalid after the expiration time.
[0066] Time validity is only one way proposed in the embodiments of the present application to set the validity of the link. In addition, the validity of the link can also be set through other means, which will not be elaborated here.
[0067] 103. Determine whether the target processing link is a short link. If so, obtain the link domain name of the target processing link.
[0068] A short link is to convert a long URL into a short URL string through methods such as program calculation.
[0069] When the obtained target session message is in the form of a shared picture with QR code information, the file stream of the shared picture is obtained, the file stream is parsed, the QR code link corresponding to the QR code information is obtained, this QR code link is used as the target processing link, and it is determined whether the target processing link is a short link.
[0070] When the obtained target session message is in the form of a shared link, directly use the shared link as the target processing link, and determine whether the target processing link is a short link.
[0071] Optionally, in some embodiments, determine whether the target processing link is valid. If so, determine whether the target processing link is a short link.
[0072] The validity of a link can be understood as the validity in terms of time. For example, when a certain link is generated, based on the generation time, a valid time is set, and after the valid time has passed, the link will become invalid.
[0073] Time validity is only one way proposed in the embodiments of the present application to set the validity of a link. In addition to this, the validity of a link can also be set by other means, which will not be elaborated here.
[0074] Only when the target processing link is a valid link will the operation step of determining whether the target processing link is a short link be performed; otherwise, end.
[0075] 104. Determine whether the link domain name matches the domain name in the preset link domain names. If so, redirect the target processing link to obtain the long link of the target processing link.
[0076] A domain name, also known as a web domain, is the name of a certain computer or computer group on the Internet composed of a string of names separated by dots, and is used for positioning and identifying a computer during data transmission.
[0077] For example, if a certain link is https: / / im.qq.com / mobileqq / , the domain name of this link can be qq.com.
[0078] For example, the preset link domain names include domain names such as qq.com and weixin.com. When the domain name of the target processing link is qq.com or weixin.com, the link domain name of the target processing link matches the domain name in the preset link domain names.
[0079] After the link domain name matches the domain name in the preset link domain names, perform an operation to redirect the target processing link; otherwise, end.
[0080] Or, determine whether the link domain name matches the domain name in the preset link domain names. If not, write the target session message into a preset record table.
[0081] Optionally, set a timed sending task for the record table. After the timed sending task is triggered, the system automatically sends the record table to the terminals of relevant personnel.
[0082] Redirect means redirecting various network requests to other locations through various methods. For example, web page redirection, domain name redirection, and changes in routing selection are also a type of redirection of the path through which data packets pass.
[0083] In the embodiments of the present application, redirecting the target processing link means redirecting the domain name of the target processing link.
[0084] Optionally, the link domain name of the target processing link can be determined whether it matches the domain name in the preset link domain name in the form of key-value pairs.
[0085] A long connection means that multiple data packets can be continuously sent on one connection. During the connection maintenance period, if no data packets are sent, both parties need to send link detection packets. By redirecting the target processing link that is a short link, the long link of the target processing link can be obtained.
[0086] 105. Obtain the serial number of the target session message according to the regular expression and the long link of the target processing link.
[0087] A regular expression, also known as a rule expression, is a text pattern that includes ordinary characters (for example, letters between a and z) and special characters (called "meta-characters"), which is a concept in computer science. A regular expression uses a single string to describe and match a series of strings that conform to a certain syntactic rule, and is usually used to retrieve and replace texts that conform to a certain pattern (rule).
[0088] Optionally, in some embodiments, obtain the link keyword in the long link of the target processing link, and obtain the serial number of the target session message according to the regular expression and the link keyword.
[0089] For example, the long link of a target processing link is:
[0090] Link https: / / ...?e...=...&activity_FlowId=m_C0O5W1arxmCO4NlyN834...
[0091] Then, the keyword of this long link is activity_FlowId, and the serial number obtained based on the keyword and the regular expression is m_C0O5W1arxmCO4NlyN834.
[0092] The method for obtaining a serial number in the embodiments of the present application includes obtaining a target session message to be processed from a session message. When the message type of the target session message is a shared picture with QR code information, obtaining the file stream of the shared picture with QR code information; parsing the file stream to obtain a QR code link corresponding to the QR code information, and using the QR code link as a target processing link; determining whether the target processing link is a short link. If so, obtaining the link domain name of the target processing link; determining whether the link domain name matches the domain name in the preset link domain names. If so, redirecting the target processing link to obtain the long link of the target processing link; obtaining the serial number of the target session message according to the regular expression and the long link of the target processing link. Through the above method, not only can the serial number of a directly shared link be obtained, but also the serial number related to the QR code information on the picture with QR code information can be obtained, solving the problem of the limitation of customer contact methods.
[0093] Please refer to Figure 2 , Figure 2 which is a schematic structural diagram of a device for obtaining a serial number provided by the embodiments of the present application. The device 200 for obtaining a serial number includes the following units:
[0094] The first obtaining unit 201 is used to obtain a target session message to be processed from a session message. When the message type of the target session message is a shared picture with QR code information, obtaining the file stream of the shared picture with QR code information.
[0095] In the embodiments of the present application, session messages are obtained from a chat tool, and the chat tool includes but is not limited to applications with chat functions such as Tencent QQ, WeChat, and enterprise WeChat. The session message can be a message in the session content and is a message sent by any participant in the session. The chat tool is connected to a customer contact tool, and the customer contact tool can be an enterprise WeChat application, and session messages in the chat tool are obtained through the customer contact tool.
[0096] During the session, any participant in the session can send the information to be shared to the session page. After the information to be shared is sent to the session page, these shared information all belong to the session message. That is to say, in addition to the input text session message, the session message also includes forwarded, copied, or uploaded messages, and these messages can be considered as shared session messages.
[0097] In the embodiments of the present application, the message types of session messages include shared links and shared pictures. The shared link is a link forwarded or copied by any session participant, and the shared picture is a picture forwarded or uploaded by any session participant.
[0098] Among them, the shared pictures include pictures without QR code information and pictures with QR code information. Since the QR code information itself corresponds to a link, the pictures without QR code information are simple pictures and cannot be parsed into links. Therefore, in this application, only the shared pictures with QR code information and the shared links are processed to obtain the serial number.
[0099] Optionally, the target session message can be obtained from the session message by initiating a request for obtaining the serial number, and subsequent processing in the obtaining process is performed through the target session message.
[0100] For example, a bank financial manager initiates a request for obtaining the serial number on a bank system or other systems that can initiate a request for obtaining the serial number. The request should include the initiator information and the type and keyword of the session message targeted. The system receives the request and automatically obtains the target session message according to the initiator information and the keyword of the session message targeted.
[0101] For example, a bank financial manager initiates a request for obtaining the serial number on a bank system or other systems that can initiate a request for obtaining the serial number. The request is targeted at a shared picture with the QR code information of the bank financial manager sent on WeChat. Then, after receiving the request, the system obtains the pictures sent by the bank financial manager on WeChat according to the personal information of the bank financial manager, and analyzes the obtained pictures to find the picture with the personal information of the bank financial manager as the determined shared picture targeted by the request, and uses this shared picture as the target session message.
[0102] Optionally, the customer acquisition tool polls the session messages of the target session participants in the target chat tool to obtain the shared session messages among them, and writes these session messages into a pre-constructed message queue. When it is necessary to process a certain shared session message among them to obtain the serial number, the tool with data processing function reads the session messages in the message queue from the message queue and identifies the target session message to be processed from the read session messages.
[0103] For example, a bank financial manager initiates a request to obtain a serial number on a bank system or other system that can initiate a request to obtain a serial number. The request is for a shared picture with the bank financial manager's QR code information sent on WeChat. Then, after receiving the request, the system polls the bank financial manager's conversation messages on WeChat through the customer contact tool based on the bank financial manager's personal information, obtains the shared pictures sent by the bank financial manager, and writes these shares into a pre-built message queue. When it is necessary to process the shared target shared pictures to obtain the serial number, the tool with data processing function reads the shared pictures in the message queue from the message queue, and identifies the target shared pictures to be processed from the read shared pictures as the target conversation message.
[0104] When the message type of the target conversation message is a shared picture with QR code information, the file stream of the shared picture with the QR code information can be obtained by, when determining that the target conversation message is a shared picture with the QR code information, determining the target chat tool corresponding to the shared picture, and obtaining the file stream of the shared picture from the target chat tool through the corresponding material download interface.
[0105] In some embodiments, a target session message to be processed is obtained from the session message. When the message type of the target session message is a sharing link, the operation step of obtaining the file stream is not performed.
[0106] The parsing unit 202 is used to parse the file stream, obtain the two-dimensional code link corresponding to the two-dimensional code information, and use the two-dimensional code link as the target processing link.
[0107] Optionally, in some embodiments, after obtaining the target session message to be processed from the session message, the message type of the target session message is determined, and when the message type of the target session message is a sharing link, the sharing link is used as the target processing link.
[0108] That is, when the target session message is in the form of a shared link, the shared link is directly processed as the target processing link to obtain the serial number of the shared link, and the serial number of the shared link is actually the serial number of the target session message. When the target session message is in the form of a shared picture with QR code information, the file stream of the shared picture is obtained, and the QR code link corresponding to the QR code information is obtained by parsing the file stream, and the QR code link is processed as the target processing link to obtain the serial number of the link, and the serial number of the QR code link is actually the serial number of the shared picture with the QR code information.
[0109] Optionally, in some embodiments, the file stream is parsed through a preset open-source package and an opencv application package to obtain the QR code link corresponding to the QR code information. Among them, the preset open-source package is the google open-source package.
[0110] Optionally, in some embodiments, the file stream is initially parsed through a preset open-source package to determine whether the parsing is successful. If so, the QR code link corresponding to the QR code information is obtained. If not, the file stream is deeply parsed through the opencv toolkit to obtain the QR code link corresponding to the QR code information.
[0111] That is to say, when the target session message is a shared picture with QR code information, the file stream of the shared picture is obtained, and the file stream is initially parsed through a preset open-source package to determine whether the QR code link of the QR code information is obtained. When the QR code link of the QR code information is obtained, the file stream will no longer be processed through the opencv application package. When the QR code link of the QR code information is not obtained through the parsing of the file stream by the preset open-source package, the file stream is deeply parsed through the opencv application package to obtain the QR code link of the QR code information.
[0112] Optionally, in some embodiments, after parsing the file stream to obtain the QR code link corresponding to the QR code information and using the QR code link as the target processing link, it is determined whether the target processing link is valid. If it is valid, the subsequent operation steps are performed.
[0113] The validity of the link can be understood as the validity in terms of time. For example, when a certain link is generated, based on the generation time, an expiration time is set, and the link will become invalid after the expiration time.
[0114] Time validity is only a way proposed in the embodiments of the present application to set the validity of the link. In addition to this, the validity of the link can also be set in other ways, which will not be elaborated here.
[0115] The first determination unit 203 is used to determine whether the target processing link is a short link. If so, the link domain name of the target processing link is obtained.
[0116] A short link is to convert a long URL into a short URL string through methods such as program calculation.
[0117] When the obtained target session message is in the form of a shared picture with QR code information, the file stream of the shared picture is obtained, the file stream is parsed, the QR code link corresponding to the QR code information is obtained, this QR code link is used as the target processing link, and it is determined whether the target processing link is a short link.
[0118] When the obtained target session message is in the form of a shared link, directly use the shared link as the target processing link, and determine whether the target processing link is a short link.
[0119] Optionally, in some embodiments, determine whether the target processing link is valid. If so, determine whether the target processing link is a short link.
[0120] The validity of a link can be understood as the validity in terms of time. For example, when a certain link is generated, based on the generation time, a valid time is set, and after the valid time has passed, the link will become invalid.
[0121] Time validity is only one way proposed in the embodiments of the present application to set the validity of a link. In addition to this, the validity of a link can also be set by other means, which will not be elaborated here.
[0122] Only when the target processing link is a valid link will the operation step of determining whether the target processing link is a short link be performed; otherwise, end.
[0123] The second determination unit 204 is used to determine whether the link domain name matches the domain name in the preset link domain name. If so, redirect the target processing link to obtain the long link of the target processing link.
[0124] The domain name, also known as the network domain, is the name of a certain computer or computer group on the Internet composed of a string of names separated by dots, and is used for positioning and identifying the computer during data transmission.
[0125] For example, if a certain link is https: / / im.qq.com / mobileqq / , the domain name of this link can be qq.com.
[0126] For example, the preset link domain name includes domain names such as qq.com and weixin.com. When the domain name of the target processing link is qq.com or weixin.com, the link domain name of the target processing link matches the domain name in the preset link domain name.
[0127] After the link domain name matches the domain name in the preset link domain name, perform the operation of redirecting the target processing link; otherwise, end.
[0128] Alternatively, determine whether the link domain name matches the domain name in the preset link domain name. If not, write the target session message into a preset record table.
[0129] Optionally, set a scheduled sending task for the record table. After the scheduled sending task is triggered, the system automatically sends the record table to the terminals of relevant personnel.
[0130] Redirect means redirecting various network requests to other locations through various methods. For example, web page redirection, domain name redirection, and changes in routing selection are also a type of redirection of the data packet's transmission path.
[0131] In the embodiments of the present application, redirecting the target processing link means redirecting the domain name of the target processing link.
[0132] Optionally, the link domain name of the target processing link can be determined whether it matches the domain name in the preset link domain name in the form of key-value pairs.
[0133] A long connection means that multiple data packets can be continuously sent on a connection. During the connection maintenance period, if no data packets are sent, both parties need to send link detection packets. By redirecting the target processing link that is a short link, the long link of the target processing link can be obtained.
[0134] The second acquisition unit 205 is used to acquire the sequence number of the target session message according to the regular expression and the long link of the target processing link.
[0135] A regular expression, also known as a rule expression, is a text pattern that includes ordinary characters (such as letters between a and z) and special characters (called "meta-characters"), which is a concept in computer science. A regular expression uses a single string to describe and match a series of strings that match a certain syntactic rule, and is usually used to retrieve and replace the text that conforms to a certain pattern (rule).
[0136] Optionally, in some embodiments, the link keyword in the long link of the target processing link is acquired, and the sequence number of the target session message is acquired according to the regular expression and the link keyword.
[0137] For example, the long link of a target processing link is:
[0138] The link https: / / ...?e...=...&activity_FlowId=m_C0O5W1arxmCO4NlyN834...
[0139] Then, the keyword of this long link is activity_FlowId, and the sequence number obtained based on the keyword and the regular expression is m_C0O5W1arxmCO4NlyN834.
[0140] Optionally, the device 200 for acquiring the sequence number in the embodiments of the present application further includes other units and subunits, which will not be elaborated here.
[0141] The device 200 for obtaining a serial number according to an embodiment of the present application includes a first obtaining unit 201, configured to obtain a target session message to be processed from a session message. When the message type of the target session message is a shared picture with QR code information, obtain a file stream of the shared picture with QR code information; a parsing unit 202, configured to parse the file stream, obtain a QR code link corresponding to the QR code information, and use the QR code link as a target processing link; a first determination unit 203, configured to determine whether the target processing link is a short link. If so, obtain the link domain name of the target processing link; a second determination unit 204, configured to determine whether the link domain name matches a domain name in a preset link domain name. If so, redirect the target processing link to obtain a long link of the target processing link; a second obtaining unit 205, configured to obtain the serial number of the target session message according to a regular expression and the long link of the target processing link. Through the above device, not only can the serial number of a directly shared link be obtained, but also the serial number related to the QR code information on a picture with QR code information can be obtained, solving the problem of the limitation of the customer acquisition method.
[0142] Please refer to Figure 3 , Figure 3 which is a schematic structural diagram of an intelligent terminal provided by an embodiment of the present application. The intelligent terminal 300 may be an intelligent terminal device such as a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC, Personal Computer), a personal digital assistant (Personal Digital Assistant, PDA), etc. The intelligent terminal 300 includes a processor 301 with one or more processing cores, a memory 302 with one or more computer-readable storage media, and a computer program stored in the memory 302 and executable on the processor 301. Among them, the processor 301 is electrically connected to the memory 302. Those skilled in the art can understand that the structure of the intelligent terminal shown in the figure does not limit the intelligent terminal, and it may include more or fewer components than shown in the figure, or combine some components, or arrange different components.
[0143] The processor 301 is the control center of the intelligent terminal 300, connecting various parts of the entire intelligent terminal 300 through various interfaces and lines. By running or loading software programs and / or modules stored in the memory 302, and calling data stored in the memory 302, it executes various functions of the intelligent terminal 300 and processes data, thereby monitoring the intelligent terminal 300 as a whole.
[0144] In an embodiment of the present application, the processor 301 in the intelligent terminal 300 will load the instructions corresponding to the processes of one or more application programs into the memory 302 according to the following steps, and the processor 301 will run the application programs stored in the memory 302 to implement various functions:
[0145] Obtain the target session message to be processed from the session message. When the message type of the target session message is a shared picture with QR code information, obtain the file stream of the shared picture with QR code information.
[0146] Parse the file stream, obtain the QR code link corresponding to the QR code information, and use the QR code link as the target processing link.
[0147] Determine whether the target processing link is a short link. If so, obtain the link domain name of the target processing link.
[0148] Determine whether the link domain name matches the domain name in the preset link domain name. If so, redirect the target processing link to obtain the long link of the target processing link.
[0149] Obtain the serial number of the target session message according to the regular expression and the long link of the target processing link.
[0150] For the specific implementation of each of the above operations, reference may be made to the previous embodiments and will not be elaborated here.
[0151] Optionally, the intelligent terminal 300 further includes a touch display screen 303, an input unit 304, and a power supply 305. Among them, the processor 301 is electrically connected to the touch display screen 303, the input unit 304, and the power supply 305. Those skilled in the art can understand that Figure 3 the intelligent terminal structure shown in does not constitute a limitation on the intelligent terminal, and may include more or fewer components than shown in the figure, or combine some components, or arrange different components.
[0152] The touch display screen 303 can be used to display a graphical user interface and receive operation instructions generated by a user acting on the graphical user interface. The touch display screen 303 may include a display panel and a touch panel. Among them, the display panel can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the computer device. These graphical user interfaces can be composed of graphics, text, icons, videos, and any combination thereof. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. The touch panel can be used to collect touch operations of the user on or near it (such as operations of the user using a finger, a stylus, or any suitable object or accessory on or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute the corresponding program. Optionally, the touch panel can include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the touch orientation of the user, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 301, and can receive and execute the commands sent by the processor 301. The touch panel can cover the display panel. After the touch panel detects a touch operation on or near it, it is transmitted to the processor 301 to determine the type of touch event. Subsequently, the processor 301 provides a corresponding visual output on the display panel according to the type of touch event. In the embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 303 to implement input and output functions. However, in some embodiments, the touch panel and the touch panel can be implemented as two independent components to implement input and output functions. That is, the touch display screen 303 can also be used as a part of the input unit 304 to implement the input function.
[0153] The input unit 304 can be used to receive input digital, character information, or user characteristic information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
[0154] The power supply 305 is used to supply power to each component of the smart terminal 300. Optionally, the power supply 305 can be logically connected to the processor 301 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system. The power supply 305 can also include any components such as one or more DC or AC power supplies, a recharge system, a power failure detection circuit, a power converter or inverter, and a power status indicator.
[0155] Although Figure 3Not shown in the figure, the smart terminal 300 may further include sensors, radio frequency modules, etc., which will not be elaborated here.
[0156] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0157] As can be seen from the above, the smart terminal 300 provided in this embodiment obtains the target session message to be processed from the session message. When the message type of the target session message is a shared picture with QR code information, it obtains the file stream of the shared picture with QR code information; parses the file stream to obtain the QR code link corresponding to the QR code information, and uses the QR code link as the target processing link; determines whether the target processing link is a short link. If so, it obtains the link domain name of the target processing link; determines whether the link domain name matches the domain name in the preset link domain name. If so, it redirects the target processing link to obtain the long link of the target processing link; according to the regular expression and the long link of the target processing link, it obtains the serial number of the target session message.
[0158] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by controlling relevant hardware through instructions. The instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0159] Therefore, an embodiment of the present application provides a computer-readable storage medium, in which multiple computer programs are stored. The computer programs can be loaded by a processor to execute the steps in any method for obtaining a serial number provided in the embodiments of the present application. For example, the computer program can execute the following steps:
[0160] Obtain the target session message to be processed from the session message. When the message type of the target session message is a shared picture with QR code information, obtain the file stream of the shared picture with QR code information;
[0161] Parse the file stream to obtain the QR code link corresponding to the QR code information, and use the QR code link as the target processing link;
[0162] Determine whether the target processing link is a short link. If so, obtain the link domain name of the target processing link;
[0163] Determine whether the link domain name matches the domain name in the preset link domain name. If so, redirect the target processing link to obtain the long link of the target processing link;
[0164] According to the regular expression and the long link of the target processing link, obtain the serial number of the target session message.
[0165] For the specific implementation of each of the above operations, reference may be made to the previous embodiments, which will not be elaborated herein.
[0166] Among them, the storage medium may include: read-only memory (ROM, Re client account d Only Memory), random access memory (R client account M, R client account ndom client account ccess Memory), magnetic disk or optical disk, etc.
[0167] Since the computer program stored in the storage medium can execute the steps in any of the methods for obtaining a serial number provided in the embodiments of the present application, the beneficial effects achievable by any of the methods for obtaining a serial number provided in the embodiments of the present application can be achieved. For details, refer to the previous embodiments, which will not be elaborated herein.
[0168] The above has introduced in detail a method, device, intelligent terminal and storage medium for obtaining a serial number provided in the embodiments of the present application. Specific examples are used herein to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. At the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. A method for obtaining a serial number, characterized in that, The method includes: Obtain a target session message to be processed from the session message. When the message type of the target session message is a shared picture with QR code information, obtain the file stream of the shared picture with QR code information; Parse the file stream to obtain a QR code link corresponding to the QR code information, and use the QR code link as the target processing link; Determine whether the target processing link is a short link. If so, obtain the link domain name of the target processing link; Determine whether the link domain name matches the domain name in the preset link domain names. If so, redirect the target processing link to obtain the long link of the target processing link; Obtain the link keyword in the long link of the target processing link; According to the regular expression and the link keyword, obtain the serial number of the target session message.
2. The method for obtaining a serial number according to claim 1, wherein The parsing the file stream to obtain a QR code link corresponding to the QR code information includes: Parse the file stream through a preset open source package and an opencv application package to obtain a QR code link corresponding to the QR code information.
3. The method for obtaining a serial number according to claim 2, wherein The parsing the file stream through a preset open source package and an opencv application package to obtain a QR code link corresponding to the QR code information includes: Perform a preliminary parse of the file stream through a preset open source package and determine whether the parse is successful; If so, obtain a QR code link corresponding to the QR code information; If not, perform a deep parse of the file stream through the opencv toolkit to obtain a QR code link corresponding to the QR code information.
4. The method for obtaining a serial number according to claim 1, wherein The obtaining a target session message to be processed from the session message. When the message type of the target session message is a shared picture with QR code information, obtaining the file stream of the shared picture with QR code information includes: Obtain a target session message to be processed from the session message, and determine the message type of the target session message. The message types include a shared link and a shared picture with QR code information; When the message type of the target session message is a shared link, use the shared link as the target processing link.
5. The method for obtaining a serial number according to claim 1, wherein After the parsing the file stream to obtain a QR code link corresponding to the QR code information and using the QR code link as the target processing link, it further includes: Determine whether the target processing link is valid. If so, determine whether the target processing link is a short link.
6. The method for obtaining a serial number according to claim 1, wherein The determining whether the link domain name matches the domain name in the preset link domain names. If so, redirecting the target processing link to obtain the long link of the target processing link includes: Determine whether the link domain name matches the domain name in the preset link domain names. If not, write the target session message into a preset record table.
7. An apparatus for obtaining a serial number, characterized in that, The device includes: A first obtaining unit, configured to obtain a target session message to be processed from the session message. When the message type of the target session message is a shared picture with QR code information, obtain the file stream of the shared picture with QR code information; A parsing unit, configured to parse the file stream to obtain a QR code link corresponding to the QR code information, and use the QR code link as the target processing link; The first judgment unit is used to judge whether the target processing link is a short link. If so, obtain the link domain name of the target processing link. The second judgment unit is used to judge whether the link domain name matches the domain name in the preset link domain name. If so, redirect the target processing link and obtain the long link of the target processing link. The second acquisition unit is used to acquire the link keyword in the long link of the target processing link, and according to the regular expression and the link keyword, acquire the serial number of the target session message.
8. An intelligent terminal, characterized in that, It includes a memory and a processor. The memory is used to store instructions and data, and the processor is used to execute the method for obtaining the serial number according to any one of claims 1-6.
9. A storage medium, characterized in that, Multiple instructions are stored in the storage medium, and the instructions are suitable for being loaded by the processor to execute the method for obtaining the serial number according to any one of claims 1-6.
Citation Information
Patent Citations
Resource transfer video quality detection method, device, equipment, medium and product
CN114520912A
Invoice generation method and device, electronic equipment and storage medium
CN115271835A