Message generation method and apparatus, and electronic device
The client receives business instructions and compiles the target source code to generate packets, which solves the problem of poor code readability when the non-Web system client interacts with the Web front-end, and achieves seamless interaction and code reusability.
Patent Information
- Application Number
- CN202410739877.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-06-07
AI Technical Summary
When a client of a non-Web system interacts with a front-end that supports a web system, the front-end code needs to be added or modified, resulting in poor code readability and high maintenance difficulty.
The client receives business instructions, compiles the target source code to generate the message body, and adds the message header to generate the first message, avoids adding code to the front-end, and processes the cookie field through the cache and network interaction unit to ensure the validity of the message and the front-end code. Independence.
It realizes seamless interaction between non-Web system clients and web front-end, avoids the problems of poor readability and high maintenance difficulties caused by strong coupling of front-end code, and ensures the reusability and maintainability of the code.
Smart Images

Figure CN119135780A_ABST
Abstract
Description
Background Art
[0002] In order to improve security, various browser kernels (i.e., Web engines) including Chrome browser prohibit the local file system from reading cookies in HTTP (Hypertext Transfer Protocol) message headers and assigning values to cookies. Since HTTP messages are written according to the Java Script method in HTML (HyperText Markup Language) files, under the aforementioned prohibition setting requirements on cookies, the Web front end can only deploy HTML files on the front-end server, but not on the local file system, so that under the aforementioned prohibition setting requirements, when users need to use the Web engine for search, query, etc., the Web engine can directly load the HTML files deployed by the Web front end on the front-end server.
[0003] However, the above method of directly loading HTML files mainly serves pure Web systems in which both the front end and the back end are deployed on Web servers. When a client of a non-Web system, such as a client with a programming language different from that of the Web system, such as C++, Python, etc., needs to load an HTML file, because the interface of the Web front end is fixed, and the code logic and / or programming language of the aforementioned client and the Web front end are different, under the premise that the aforementioned cookie-related operations are prohibited, the only way is to add code that interacts with the client to the Web front end so that the interface of the Web front end can be compatible with the messages of the aforementioned client, thereby meeting the needs of the client to interact with the Web front end. At the same time, it is also necessary to add code in the client that can interact with the Web front end code logic under the client code logic to ensure that the Web front end can process the client's message according to the HTML file after receiving the client's message, thereby sending the corresponding message to the back end server for the client. In order to meet the needs of the client of the non-Web system to send messages to the Web front end, the code added and / or modified in the Web front end is strongly coupled with the existing code for other services in the Web front end, resulting in the problem of poor readability of the Web front end code. Summary of the invention
[0004] The present application provides a message generation method, device and electronic device for generating a message body according to rules contained in a target source code, so as to solve the problem that when a client that does not support a Web system interacts with a target front-end that supports a Web system, it is necessary to add or modify the target front-end code, resulting in poor readability of the target front-end code.
[0005] In a first aspect, an embodiment of the present application provides a message generation method, including:
[0006] The client receives the business instruction;
[0007] In response to the business instruction, compile the acquired target source code to generate a message body corresponding to the business instruction; wherein the target source code includes a rule for generating the message body, the target source code is a source code of a target front end, the target front end supports a Web system, and the client does not support a Web system;
[0008] A message header is added to the message body to generate a first message.
[0009] In a possible implementation manner, compiling the acquired target source code to generate a message body corresponding to the business instruction includes:
[0010] Parsing the target source code to extract the rule for generating the message body;
[0011] The message body corresponding to the service instruction is generated by compiling the rules.
[0012] In a possible implementation manner, after adding a message header to the message body to generate the first message, the method further includes:
[0013] Sending the first message;
[0014] receiving a second message; wherein the response information to the first message in the second message includes a first cookie field;
[0015] The first cookie field is read and cached.
[0016] In a possible implementation manner, the adding a message header to the message body to generate the first message includes:
[0017] Determine the second cookie field of the latest cache;
[0018] The second cookie field is added to the message header, and the first message is generated.
[0019] In a possible implementation manner, the target source code is obtained according to the following method:
[0020] Get the target file;
[0021] In the target file, the target source code is determined.
[0022] In a possible implementation manner, the target file is an HTML file;
[0023] The target source code is JS source code
[0024] In a second aspect, an embodiment of the present application provides a client, wherein the client is used to execute the method described in the first aspect and any possible implementation manner.
[0025] In a possible implementation manner, the client includes an embedded engine and a network interaction unit; wherein,
[0026] The embedded engine is used to receive a business instruction; in response to the business instruction, compile the acquired target source code to generate a message body corresponding to the business instruction; wherein the target source code includes a rule for generating the message body, the target source code is the source code of the target front end, the target front end supports the Web system, and the client does not support the Web system;
[0027] The network interaction unit is used to add a message header to the message body to generate the first message.
[0028] In a third aspect, an embodiment of the present application provides a message generating device, including:
[0029] The instruction unit is used for the client to receive business instructions;
[0030] A source code unit, configured to compile the acquired target source code in response to the business instruction to generate a message body corresponding to the business instruction; wherein the target source code includes a rule for generating the message body, the target source code is a source code of a target front end, the target front end supports a Web system, and the client does not support a Web system;
[0031] A message unit is used to add a message header to the message body to generate the first message.
[0032] In a possible implementation manner, the source code unit is specifically used to parse the target source code to extract the rules for generating the message body; and to generate the message body corresponding to the business instruction by compiling the rules.
[0033] In a possible implementation manner, the device also includes a cache unit, which is used to send the first message; receive a second message; wherein the response information to the first message in the second message includes a first cookie field; read the first cookie field, and cache the first cookie field.
[0034] In a possible implementation manner, the message unit is further used to determine a second cookie field that is most recently cached; add the second cookie field to the message header, and generate the first message.
[0035] In a possible implementation manner, the device further includes a file unit, which is used to obtain a target file; and determine the target source code in the target file.
[0036] In a possible implementation, the target file is an HTML file; the target source code is a JS source code.
[0037] In a fourth aspect, an embodiment of the present application provides an electronic device, including:
[0038] A memory for storing program instructions;
[0039] The processor is used to call the program instructions stored in the memory, and execute the steps included in the method described in the first aspect and any possible implementation method according to the obtained program instructions.
[0040] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the method described in the first aspect and any possible implementation manner.
[0041] In a sixth aspect, an embodiment of the present application provides a computer program product, wherein the computer program product comprises: a computer program code, and when the computer program code runs on a computer, the computer executes the method described in the first aspect and any possible implementation manner.
[0042] One or more technical solutions provided in the embodiments of the present invention have at least the following technical effects:
[0043] In the message generation method provided in the embodiment of the present application, the client generates a message body through the target source code of the target front-end to construct a first message for accessing the target front-end. Since the message body is generated based on the target source code, the message body and the corresponding first message can match the specific business scenario (corresponding to the business instruction) in the server interface of the system where the target front-end is located. This avoids adding code to the target front-end, and further avoids the problems of poor readability and difficulty in maintenance caused by the strong coupling of the target front-end code, thereby ensuring the reusability of the target front-end code.
[0044] Other features and advantages of the present application will be described in the subsequent description, and partly become apparent from the description, or be understood by practicing the present application. The purposes and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. It should be understood that the above general description and the detailed description below are only exemplary and explanatory and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0046] Figure 1 A flowchart of a message generation method provided in an embodiment of the present application;
[0047] Figure 2 A schematic diagram of the structure of a client provided in an embodiment of the present application;
[0048] Figure 3 A schematic diagram of the structure of a client provided in an embodiment of the present application;
[0049] Figure 4 A schematic diagram of a method for generating a message by executing a client provided in an embodiment of the present application;
[0050] Figure 5 A schematic diagram of the structure of a message generating device provided in an embodiment of the present application;
[0051] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be arbitrarily combined with each other. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.
[0053] The terms "first" and "second" in the specification and claims of the present application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive protection. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. "Multiple" in the present application can mean at least two, for example, two, three or more, and the embodiments of the present application are not limited.
[0054] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description. It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, which should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0055] In the technical solution of this application, the acquisition, transmission, storage, and use of data are in compliance with the requirements of relevant national laws and regulations.
[0056] The following is a detailed description of the technical solution of the present application through the accompanying drawings and specific embodiments. The present application proposes a message generation method, which can be applied to the client of a non-Web system. The code interaction logic of the non-Web system is different from that of the Web system. The message generation method can avoid modifying the code of the Web front end, and solve the problem of poor readability and high maintenance difficulty of the front end code caused by the need to add relevant code to the Web front end when a third-party program of the current non-Web system interacts with the Web system. Please refer to Figure 1 , the method specifically includes the following implementation steps:
[0057] Step 101: The client receives a service instruction.
[0058] Specifically, the service instruction includes a user's service request, such as login, browsing, or query.
[0059] The service instruction may include user information, such as user password, mobile phone number, etc.
[0060] The business instruction also includes business information, such as querying the price of a certain type of goods.
[0061] Step 102: In response to the business instruction, compile the acquired target source code to generate a message body.
[0062] The target source code is the source code of the target front end, and the target front end supports the Web system. The target front end may be a Web front end.
[0063] The client does not support the Web system. For example, the client is an office. In this case, when the client interacts with the target front end, it is actually a cross-system interaction. Here, cross-system can refer to two systems with different business functions.
[0064] In some embodiments, after obtaining the target source code, the target source code may be introduced into a corresponding project of the client so as to save the target source code in a corresponding file directory to facilitate the execution of step 102 .
[0065] The target source code may be obtained before step 101 , or after step 101 and before step 102 .
[0066] Furthermore, the target source code can be directly obtained from the target front end.
[0067] Furthermore, since the target source code is generally embedded in a file, in order to improve the efficiency of obtaining the target source code, in some embodiments, the target file in which the target source code is embedded can be first obtained from the warehouse of the target front end. Specifically, the target file in which the aforementioned target source code is embedded can be first obtained. Then, in the target file, the target source code is determined, thereby avoiding the resource consumption and low efficiency caused by determining the target source code in the target front end or the target front end library.
[0068] Taking the target source code as JS source code as an example, the target file can be an HTML file. When determining the JS source code, CSS (Cascading Style Sheet) and HTML (HyperText Markup Language) in the HTML file can be deleted, and only the JS source code is retained. When the embedded engine in the client is a Web engine, the JS source code is easy to obtain through the HTML file, and is beneficial for the Web engine to directly reuse the JS source code, that is, reuse the corresponding method in the JS source code to generate the message body.
[0069] The target source code may be, for example, a JS (JavaScript) source code. The target source code includes rules for generating a message body. When generating a message body, the target source code may be parsed first to extract the rules for generating a message body from the target source code. Then, the rules are compiled to efficiently generate a message body.
[0070] The above rules actually specify the message body generation rules corresponding to the business instructions, so that the backend service can read the message body and respond after receiving the first message containing the message body.
[0071] In some embodiments, the message body can still use the target source code. Specifically, an embedded engine that can directly reuse the target source code can be embedded in the client. Then, after extracting the rules for generating the message body, the embedded engine can directly generate the message body by reusing the target source code compilation rules without making code modifications, so as to improve the efficiency of message body generation. For example, if the target source code is the JS source code of the web front end, the embedded engine is a Web engine. After compiling the rules in the JS source code, the Web engine can directly reuse the JS source code to generate the message body.
[0072] Alternatively, in some embodiments, the message body may use a target language. The target language is a programming language other than the target source code, for example, C++. Specifically, when the client does not contain the aforementioned embedded engine, or the embedded engine in the client cannot reuse the JS source code because it does not support the Web system, then after extracting the rules for generating the message body, the rules can be compiled in a programming language other than the target source code to generate the above message body. It can be seen that this embodiment has the advantage of a wide range of applications.
[0073] Furthermore, the message body corresponds to the business instruction. Specifically, the message body includes specific business information contained in the business instruction. Taking the login scenario as an example, the message body may include business information such as user name, password, or mobile phone number.
[0074] Step 103: Add a message header to the message body to generate a first message.
[0075] Specifically, the first message may be an HTTP message, and specifically may be an HTTP request message.
[0076] In some embodiments, the first message is a message from the client to the target front end to request login, and the message header includes data (time), content type (text type), connecting (connection status), server (service type), etc.
[0077] In this way, after the first message is generated, the first message can be sent to the backend service so that the backend service processes and responds to the first message. Specifically, the backend service can implement identity authentication for the client based on the first message, and then send a second message containing response information to the first message to the client. The response information includes a cookie field.
[0078] Then the second message is a response message of the backend service based on the first message. Therefore, the client can first send the first message to the backend service. Then receive the second message responded by the backend service based on the first message. The second message includes response information to the first message.
[0079] Then, the first cookie field in the second message can be read by any component or program in the client other than the Web engine to avoid the prohibition setting of the Web system on the cookie field. After reading the first cookie field, the first cookie field in the second message can also be cached.
[0080] Furthermore, the first message is a message for further interaction with the backend service after the client completes the login, such as querying sensitive data. At this time, the message header also includes the aforementioned cookie field issued by the backend service, so that when the client sends the first message to the backend service, the backend service can identify the identity of the client based on the cookie field. Specifically, the latest cached second cookie field can be determined first. The second cookie field may be the first cookie field or may not be the first cookie field. Then, the second cookie field is added to the message header, and the message header after adding the second cookie field is combined with the message body to generate the first message.
[0081] When determining the latest cached second cookie field, the third cookie field in each received second message can be read each time the second message is received, and the third cookie field can be compared with the first cookie field. If they are the same, it is determined that the first cookie field is the second cookie field, and the first cookie field in the message header does not need to be modified, and the aforementioned first cookie field cached in the cache area is not modified. If they are different, it is determined that the third cookie field is the latest cookie field, and the third cookie field is cached as the second cookie field, and the first cookie field is deleted.
[0082] Alternatively, the first cookie field in the cache area may be directly replaced with the second cookie field by reading the third cookie field in each received message each time the second message is received, and then using the third cookie field as the second cookie field.
[0083] Furthermore, when the first message is an HTTP message, the first message may be encapsulated by a third-party repository to obtain a first message that meets the format required by the HTTP protocol.
[0084] Furthermore, when the aforementioned second cookie field needs to be added to the message header so that the back-end service can efficiently identify the client, and in order to achieve efficient and low-cost generation of the message body in step 102, an embedded engine that can directly reuse the target source code is embedded in the client, when the message body is generated, in order to break through the current prohibition on cookie operations of the Web engine, the message body can be sent to a network interaction unit in the client other than the embedded engine through inter-process communication, and the network interaction unit executes step 103.
[0085] Based on the same inventive concept, the embodiment of the present application provides a client for executing Figure 1 The message processing method.
[0086] In some embodiments, please refer to Figure 2 , the above-mentioned client includes an embedded engine and a network interaction unit.
[0087] In some embodiments, the embedded engine is an engine that can directly reuse the target source code of the target front end. For example, the target front end is a Web front end, and the embedded engine is a Web engine. The Web engine is used to compile the acquired target source code in response to the received business instruction and generate a message body corresponding to the business instruction; wherein the target source code includes a rule for generating the message body, the target source code is the source code of the target front end, the target front end supports the Web system, and the client does not support the Web system.
[0088] The service instruction may be received by the Web engine, or may be received by a program other than the Web engine in the client.
[0089] The network interaction unit is used to add a message header to the message body to generate the first message, so as to avoid the Web engine being unable to add a message header to the first message due to the related prohibition setting of the cookie when the message header contains a cookie field.
[0090] In some embodiments, the embedded engine is a web engine, and in order to break through the aforementioned prohibition setting, that is, the setting that the web engine cannot read the cookie field, the network interaction unit can also be used to send a first message and receive a second message. The second message includes response information to the first message, and the response information includes the first cookie field.
[0091] Next, the first cookie field in the second message is read, and the first cookie field is cached.
[0092] In some embodiments, the above-mentioned embedded engine is a Web engine. In order to break through the aforementioned prohibition setting of the ookie field, the above-mentioned network interaction unit can also be used to determine the second cookie field of the latest cache; add the second cookie field to the message header, and generate the first message, thereby breaking through the limitation that the client cannot generate the first message because the Web engine cannot add the cookie field to the message.
[0093] In some embodiments, when the message header does not contain a cookie field, the embedded engine can be used to receive a business instruction; in response to the business instruction, compile the acquired target source code to generate a message body corresponding to the business instruction; wherein the target source code includes a rule for generating the message body, the target source code is a source code of a target front end, the target front end supports a Web system, and the client does not support a Web system; add a message header to the message body to generate the first message
[0094] The client can be a program, an APP, etc. The network interaction unit can be a collection of all programs in the client except the embedded engine. Figure 3 .
[0095] Please refer to Figure 4 , the following takes the target source code as JS source code and the embedded engine in the client as a Web engine as an example, and combines the above message generation method to explain the client:
[0096] First, you can import the target source code into the corresponding project / directory file in the client.
[0097] Then, when the client receives a business instruction from the user (for example, logging in, querying account information, etc.), the Web engine in the client can call the pre-introduced JS source code based on the business instruction to generate the HTTP request message body.
[0098] Then, the Web engine can transmit the message body to the network interaction unit through inter-process communication.
[0099] After receiving the message body, the network interaction unit may determine the HTTP message header corresponding to the message body based on the service instruction, and add the message header to the message body to obtain the HTTP request message.
[0100] Next, the network interaction unit sends an HTTP request message to achieve the purpose of initiating an HTTP request. Thereafter, the network interaction unit may receive a response message from the backend service to the HTTP request message. The cookie field may be read from the response message, and the cookie field read from the response message may be cached.
[0101] Based on the same inventive concept, the present application embodiment provides a message generating device, please refer to Figure 5 , the device comprises:
[0102] The instruction unit 501 is used for the client to receive service instructions.
[0103] The source code unit 502 is used to compile the acquired target source code in response to the business instruction and generate a message body corresponding to the business instruction.
[0104] The target source code includes rules for generating the message body, the target source code is the source code of the target front end, the target front end supports the Web system, and the client does not support the Web system.
[0105] The source code unit 502 is specifically used for:
[0106] The target source code is parsed to extract the rule for generating the message body; and the message body corresponding to the business instruction is generated by compiling the rule.
[0107] The message unit 503 is used to add a message header to the message body to generate the first message.
[0108] The device also includes a cache unit, which is used to send the first message; receive a second message; wherein the response information to the first message in the second message includes a first cookie field; read the first cookie field, and cache the first cookie field.
[0109] The message unit 503 is also used for:
[0110] Determine the most recently cached second cookie field; add the second cookie field to the message header, and generate the first message.
[0111] The device also includes a file unit, which is used to obtain a target file; in the target file, the target source code is determined.
[0112] The target file is an HTML file; then the target source code is a JS source code.
[0113] For the convenience of description, the above parts are divided into modules (or units) according to their functions and described separately. Of course, when implementing the present invention, the functions of each module (or unit) can be implemented in the same or multiple software or hardware.
[0114] After introducing the smart repayment method and device according to an exemplary embodiment of the present invention, next, an electronic device according to another exemplary embodiment of the present invention is introduced.
[0115] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".
[0116] Based on the same inventive concept as the above-mentioned message generation method, an electronic device is also provided in the embodiment of the present application, and the electronic device can implement the function of the above-mentioned message generation method. Please refer to Figure 6 In one embodiment, the electronic device comprises:
[0117] Memory 601, communication module 603 and one or more processors 602. Memory 601 is used to store computer programs executed by processor 602. Memory 601 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system; the data storage area may store various operation instruction sets, etc.
[0118] The memory 601 may be a volatile memory, such as a random-access memory (RAM); the memory 601 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); or the memory 601 may be any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 601 may be a combination of the above memories.
[0119] The processor 602 may include one or more central processing units (CPU) or a digital processing unit, etc. The processor 602 is configured to implement the above-mentioned message generation detection method when calling the computer program stored in the memory 601 .
[0120] The communication module 603 is used to communicate with terminal equipment, site equipment or other network equipment.
[0121] The specific connection medium between the memory 601, the communication module 603 and the processor 602 is not limited in the embodiment of the present application. Figure 6 In the embodiment, the memory 601 and the processor 602 are connected via a bus 604. The bus 604 is connected to the processor 602 via a bus 604. Figure 6 The connections between the other components are only for illustration and are not intended to be limiting. The bus 604 can be divided into an address bus, a data bus, a control bus, etc. For ease of description, Figure 6 The diagram shows that only one thick line is used, but this does not mean that there is only one bus or only one type of bus.
[0122] The memory 601 stores a computer storage medium, which stores computer executable instructions, and the computer executable instructions are used to implement the message generation detection method of the embodiment of the present application. The processor 602 is used to execute the message generation detection method of each of the above embodiments.
[0123] An embodiment of the present invention further provides a computer storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is used to enable a computer to execute the technical solution of the intelligent repayment method of the above embodiment.
[0124] An embodiment of the present invention further provides a computer program product, which includes: a computer program code, and when the computer program code runs on a computer, the computer executes the computer program to implement the technical solution of the intelligent repayment method in the above embodiment.
[0125] It can be understood by those skilled in the art that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions, the aforementioned program instructions belong to a computer program, the computer program can be stored in a computer-readable storage medium, and when the computer program is executed, the steps of the above method embodiments are executed; the readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0126] The program product of the embodiment of the present invention can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a computing device. However, the program product of the present invention is not limited to this. In this document, a readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with a command execution system, device or device.
[0127] The readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein the readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with a command execution system, apparatus, or device.
[0128] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0129] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the client computing device, partially on the client device, as a separate software package, partially on the client computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the client computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0130] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0131] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0132] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0133] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0134] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0135] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A message generation method, It is characterized in that include: The client receives the business instruction; In response to the business instruction, compile the acquired target source code to generate a message body corresponding to the business instruction; wherein the target source code includes a rule for generating the message body, the target source code is a source code of a target front end, the target front end supports a Web system, and the client does not support a Web system; A message header is added to the message body to generate a first message.
2. The method according to claim 1, It is characterized in that The step of compiling the acquired target source code to generate a message body corresponding to the business instruction includes: Parsing the target source code to extract the rule for generating the message body; The message body corresponding to the service instruction is generated by compiling the rules.
3. The method according to claim 1 or 2, It is characterized in that After adding a message header to the message body to generate the first message, the method further includes: Sending the first message; receiving a second message; wherein the response information to the first message in the second message includes a first cookie field; The first cookie field is read and cached.
4. The method according to claim 3, It is characterized in that The step of adding a message header to the message body to generate a first message includes: Determine the second cookie field of the latest cache; The second cookie field is added to the message header, and the first message is generated.
5. The method according to any one of claims 1 to 2, 4, It is characterized in that The target source code is obtained according to the following method: Get the target file; In the target file, the target source code is determined.
6. The method according to claim 5, It is characterized in that The target file is an HTML file; Then the target source code is JS source code.
7. A client, It is characterized in that The client is used to execute the method according to any one of claims 1 to 6.
8. The client according to claim 7, It is characterized in that The client includes an embedded engine and a network interaction unit; wherein, The embedded engine is used to receive a business instruction; in response to the business instruction, compile the acquired target source code to generate a message body corresponding to the business instruction; wherein the target source code includes a rule for generating the message body, the target source code is the source code of the target front end, the target front end supports the Web system, and the client does not support the Web system; The network interaction unit is used to add a message header to the message body to generate the first message.
9. A message generating device, It is characterized in that include: The instruction unit is used for the client to receive business instructions; A source code unit, configured to compile the acquired target source code in response to the business instruction to generate a message body corresponding to the business instruction; wherein the target source code includes a rule for generating the message body, the target source code is a source code of a target front end, the target front end supports a Web system, and the client does not support a Web system; The message unit is used to add a message header to the message body to generate a first message.
10. The device according to claim 9, It is characterized in that The source code unit is specifically used to parse the target source code and extract the rules for generating the message body; and generate the message body corresponding to the business instruction by compiling the rules.
11. The device according to claim 9 or 10, It is characterized in that The device also includes a cache unit, which is used to send the first message; receive a second message; wherein the response information to the first message in the second message includes a first cookie field; read the first cookie field, and cache the first cookie field.
12. The device according to claim 11, It is characterized in that The message unit is also used to determine the latest cached second cookie field; add the second cookie field to the message header, and generate the first message.
13. The device according to claim 9, 10 or 12, It is characterized in that The device also includes a file unit, which is used to obtain a target file; in the target file, the target source code is determined.
14. The device according to claim 13, It is characterized in that The target file is an HTML file; then the target source code is a JS source code.
15. An electronic device, It is characterized in that include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute the steps included in any one of claims 1-6 according to the obtained program instructions.
16. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the method according to any one of claims 1 to 6.
17. A computer program product, It is characterized in that The computer program product comprises: a computer program code, and when the computer program code is run on a computer, the computer is enabled to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Webpage display method and device, electronic equipment and computer readable storage medium
CN111723314A
Agent system and method supporting real-time analysis of GRPC request
CN113746851A
Page generation method and device, computer readable medium and electronic equipment
CN115373656A
Page information generation method and device, equipment and storage medium
CN115658063A
Cross-platform test method and device, computer equipment and storage medium
CN116932356A
