Data processing method, device, equipment, storage medium and program
By calling multiple encryption algorithms in the terminal device using an interceptor to encrypt the packets, the problem of frequent modification of application code in the prior art is solved, and efficient encryption processing and stability guarantee is achieved.
Patent Information
- Application Number
- CN202110601820.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-31
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2041-05-31
AI Technical Summary
When encrypting packets, the prior art requires multiple modifications to the application's code, which leads to high labor and time costs and increases the risk of application operation stability.
By calling multiple encryption algorithms using an interceptor in the terminal device, the target encryption algorithm is determined, the encrypted packets are encrypted, and the encrypted packets are sent to the server to avoid modification of the application code.
It realizes encryption processing of packets without modifying application code, reduces labor and time costs, improves the operation stability of the application, and supports flexible switching of encryption algorithms.
Smart Images

Figure CN113221152B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a data processing method, device, equipment, storage medium and program. Background Art
[0002] Terminal devices can run various types of applications. During the application running process, data can be transmitted between the terminal device and the server through messages. During the message transmission process, the data in the message may be attacked.
[0003] In order to ensure the security of message transmission, the data in the message needs to be encrypted. In the related art, when encrypting the data in the message, the application code needs to be modified. Specifically, in the application code, for each generated message, one or more preset fields in the message are encrypted according to the specified encryption algorithm to obtain the encrypted message, and the encrypted message is sent to the server.
[0004] However, in the above-mentioned related technologies, since the message data is large, it is necessary to modify multiple codes of the application program, which costs a lot of manpower and time. Summary of the invention
[0005] The present application provides a data processing method, apparatus, device, storage medium and program for implementing encryption and decryption processing of messages without requiring multiple modifications to the application program.
[0006] In a first aspect, the present application provides a data processing method, comprising:
[0007] Determine the message to be encrypted;
[0008] Calling encryption information through the interceptor corresponding to the message to be encrypted, wherein the encryption information includes multiple encryption algorithms;
[0009] Determining a target encryption algorithm corresponding to the message to be encrypted from among the multiple encryption algorithms;
[0010] The target encryption algorithm is used to encrypt the message to be encrypted to obtain an encrypted message, and the encrypted message is sent to the server.
[0011] In a possible implementation, determining a target encryption algorithm corresponding to the message to be encrypted from among the multiple encryption algorithms includes:
[0012] Determining a first encryption type corresponding to the message to be encrypted;
[0013] According to the first encryption type, a target encryption algorithm corresponding to the message to be encrypted is determined from among the multiple encryption algorithms, and the type of the target encryption algorithm is the first encryption type.
[0014] In a possible implementation, determining the first encryption type corresponding to the message to be encrypted includes:
[0015] Determine the preset encryption type as the first encryption type corresponding to the message to be encrypted; or,
[0016] The first encryption type is selected from a plurality of preset encryption types.
[0017] In a possible implementation, selecting the first encryption type from a plurality of preset encryption types includes:
[0018] If the message to be encrypted is the first message sent to the server, randomly selecting the first encryption type from the multiple preset encryption types;
[0019] If the message to be encrypted is the Nth message sent to the server, the encryption type used for the N-1th message sent to the server is determined to be the first encryption type, where N is an integer greater than or equal to 2.
[0020] In a possible implementation, encrypting the message to be encrypted by using the target encryption algorithm to obtain an encrypted message includes:
[0021] Obtain a sending method corresponding to the message to be encrypted, wherein the sending method is an AJAX method or a FORM form method;
[0022] According to the sending mode, the message to be encrypted is format converted to obtain first data to be sent in a target format, where the target format is a format recognizable by the server;
[0023] The first data to be sent is encrypted using the target encryption algorithm to obtain the encrypted message.
[0024] In a possible implementation, the sending mode is AJAX mode, and the target format is JSON format; according to the sending mode, the message to be encrypted is format converted to obtain first data to be sent in the target format, including:
[0025] Obtaining a first JavaScript object in the message to be encrypted;
[0026] The first JavaScript object is converted into a first JSON string in JSON format, and the first data to be sent is the first JSON string.
[0027] In a possible implementation, the sending mode is a FORM form mode, and the target format is a JSON format; according to the sending mode, the message to be encrypted is format converted to obtain first data to be sent in a target format, including:
[0028] Obtaining at least one field in the message to be encrypted;
[0029] A second JSON string in JSON format is generated according to the at least one field, and the first data to be sent is the second JSON string.
[0030] In a possible implementation manner, sending the encrypted message to the server includes:
[0031] Encapsulating the encrypted message and the first encryption type to obtain an encapsulation result;
[0032] Performing format conversion processing on the encapsulation result to obtain second data to be sent in the target format;
[0033] Send the second data to be sent to the server.
[0034] In a second aspect, the present application provides a data processing method, comprising:
[0035] Receive a message to be decrypted from the client;
[0036] Calling decryption information through the interceptor corresponding to the message to be decrypted, wherein the decryption information includes multiple decryption algorithms;
[0037] determining a target decryption algorithm among the plurality of decryption algorithms;
[0038] The message to be decrypted is decrypted by the target decryption algorithm to obtain decrypted data.
[0039] In a possible implementation, determining a target decryption algorithm from among the multiple decryption algorithms includes:
[0040] Determining, in the decrypted message, a first message and a first encryption type corresponding to the first message, wherein the first message is a message encrypted by using an encryption algorithm of the first encryption type;
[0041] According to the first encryption type, a target decryption algorithm is determined among the plurality of decryption algorithms.
[0042] In a possible implementation, decrypting the message to be decrypted by using the target decryption algorithm to obtain decrypted data includes:
[0043] Decrypt the first message using the target decryption algorithm to obtain a decrypted JSON string;
[0044] The decrypted JSON string is formatted and converted to obtain the decrypted data.
[0045] In a third aspect, the present application provides a data processing device, including:
[0046] A first determination module, used to determine the message to be encrypted;
[0047] A calling processing module, used to call encryption information through an interceptor corresponding to the message to be encrypted, wherein the encryption information includes multiple encryption algorithms;
[0048] A second determination module, used to determine a target encryption algorithm corresponding to the message to be encrypted from among the multiple encryption algorithms;
[0049] The encryption processing module is used to encrypt the message to be encrypted through the target encryption algorithm to obtain the encrypted message, and send the encrypted message to the server.
[0050] In a possible implementation manner, the second determining module is specifically configured to:
[0051] Determining a first encryption type corresponding to the message to be encrypted;
[0052] According to the first encryption type, a target encryption algorithm corresponding to the message to be encrypted is determined from among the multiple encryption algorithms, and the type of the target encryption algorithm is the first encryption type.
[0053] In a possible implementation manner, the second determining module is specifically configured to:
[0054] Determine the preset encryption type as the first encryption type corresponding to the message to be encrypted; or,
[0055] The first encryption type is selected from a plurality of preset encryption types.
[0056] In a possible implementation manner, the second determining module is specifically configured to:
[0057] If the message to be encrypted is the first message sent to the server, randomly selecting the first encryption type from the multiple preset encryption types;
[0058] If the message to be encrypted is the Nth message sent to the server, the encryption type used for the N-1th message sent to the server is determined to be the first encryption type, where N is an integer greater than or equal to 2.
[0059] In a possible implementation, the encryption processing module is specifically used for:
[0060] Obtain a sending method corresponding to the message to be encrypted, wherein the sending method is an AJAX method or a FORM form method;
[0061] According to the sending mode, the message to be encrypted is format converted to obtain first data to be sent in a target format, where the target format is a format recognizable by the server;
[0062] The first data to be sent is encrypted using the target encryption algorithm to obtain the encrypted message.
[0063] In a possible implementation, the sending method is AJAX, the target format is JSON format; and the encryption processing module is specifically used for:
[0064] Obtaining a first JavaScript object in the message to be encrypted;
[0065] The first JavaScript object is converted into a first JSON string in JSON format, and the first data to be sent is the first JSON string.
[0066] In a possible implementation, the sending mode is a FORM form mode, and the target format is a JSON format; the encryption processing module is specifically used for:
[0067] Obtaining at least one field in the message to be encrypted;
[0068] A second JSON string in JSON format is generated according to the at least one field, and the first data to be sent is the second JSON string.
[0069] In a possible implementation, the encryption processing module is specifically used for:
[0070] Encapsulating the encrypted message and the first encryption type to obtain an encapsulation result;
[0071] Performing format conversion processing on the encapsulation result to obtain second data to be sent in the target format;
[0072] Send the second data to be sent to the server.
[0073] In a fourth aspect, the present application provides a data processing device, including:
[0074] A receiving module, used for receiving a message to be decrypted from a client;
[0075] A calling processing module, used to call decryption information through the interceptor corresponding to the message to be decrypted, wherein the decryption information includes multiple decryption algorithms;
[0076] A determination module, configured to determine a target decryption algorithm from among the plurality of decryption algorithms;
[0077] The decryption processing module is used to perform decryption processing on the message to be decrypted through the target decryption algorithm to obtain decrypted data.
[0078] In a possible implementation, the determining module is specifically configured to:
[0079] Determining, in the decrypted message, a first message and a first encryption type corresponding to the first message, wherein the first message is a message encrypted by using an encryption algorithm of the first encryption type;
[0080] According to the first encryption type, a target decryption algorithm is determined among the plurality of decryption algorithms.
[0081] In a possible implementation, the decryption processing module is specifically used to:
[0082] Decrypt the first message using the target decryption algorithm to obtain a decrypted JSON string;
[0083] The decrypted JSON string is formatted and converted to obtain the decrypted data.
[0084] In a fifth aspect, the present application provides an electronic device, comprising: a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to implement the method as described in any one of the first aspect, or implements the method as described in any one of the second aspect.
[0085] In a sixth aspect, the present application provides a computer-readable storage medium, comprising: a computer program, wherein when the computer program is executed by a processor, the computer program implements the method as described in any one of the first aspect, or implements the method as described in any one of the second aspect.
[0086] In a seventh aspect, the present application provides a computer program product, comprising: a computer program, wherein when the computer program is executed by a processor, the computer program implements the method as described in any one of the first aspect, or implements the method as described in any one of the second aspect.
[0087] The data processing method, device, equipment, storage medium and program provided by the present application include: determining the message to be encrypted, calling the encryption information through the interceptor corresponding to the message to be encrypted, determining the target encryption algorithm corresponding to the message to be encrypted from the multiple encryption algorithms included in the encryption information, and then encrypting the message to be encrypted through the target encryption algorithm to obtain the encrypted message, and sending the encrypted message to the server. Since the encryption process of the message is performed by the interceptor, the encryption process is imperceptible to the application, so there is no need to make multiple modifications to the application code to achieve unified encryption processing of all messages. On the one hand, it reduces the labor cost and time cost, and on the other hand, it reduces the invasiveness of the application code and ensures the stability of the application operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0088] 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 some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0089] Figure 1 A schematic diagram of a system architecture that may be applicable to the embodiments of the present application;
[0090] Figure 2 A flowchart of a data processing method provided in an embodiment of the present application;
[0091] Figure 3 A flowchart of another data processing method provided in an embodiment of the present application;
[0092] Figure 4 A flowchart of another data processing method provided in an embodiment of the present application;
[0093] Figure 5 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application;
[0094] Figure 6 A schematic diagram of the structure of another data processing device provided in an embodiment of the present application;
[0095] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0096] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0097] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0098] First, the terms and concepts involved in the embodiments of the present application are explained.
[0099] Java: A backend language for providing Internet services.
[0100] JavaScript: A front-end scripting language supported by browsers.
[0101] Asynchronous JavaScript and XML: AJAX (Asynchronous JavaScript And XML) is a web development technology for creating interactive, fast and dynamic web applications. It can update part of a web page without reloading the entire web page.
[0102] FORM form: It is mainly responsible for data collection in the web page. The web program can send messages to the background program through the FORM form.
[0103] Hypertext Markup Language (HTML) is an identification language that includes a series of tags that can be used to unify the document format on the Internet and connect scattered Internet network resources into a logical whole.
[0104] Springboot: It is an open source application framework on the Java platform that provides a container with inversion of control features.
[0105] Interceptor: refers to a computer program inserted before a message is sent or after a message is received.
[0106] JavaScript Object Notation (JSON) is a lightweight data exchange format that is easy for humans to read and write, and easy for machines to parse and generate.
[0107] base64: is an algorithm for encoding arbitrary byte data based on 64 printable ASCII characters.
[0108] Advanced Encryption Standard (AES): Also known as Rijndael encryption, it is a block encryption standard.
[0109] In order to facilitate the understanding of the technical solution of this application, Figure 1 The system architecture involved in the embodiments of the present application is introduced.
[0110] Figure 1 Schematic diagram of a system architecture that may be applicable to the embodiment of the present application. Figure 1 As shown, the system architecture 100 may include: a terminal device 101, a network 102 and a server 103. The network 102 is used to provide a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as: wired, wireless communication links, etc.
[0111] The terminal device 101 is a variety of electronic devices with a display screen and supporting Internet access, including but not limited to: handheld terminals (such as mobile phones, pads, etc.), laptops, desktop computers, tablet computers, vehicle terminals, smart wearable devices, etc. The terminal device 101 can run various types of applications, including but not limited to: social applications, financial applications, e-commerce applications, insurance applications, audio and video applications, etc.
[0112] In an example scenario, a terminal device can run a Web application. A Web application is an application that can be accessed through a Web browser. The terminal device only needs to install a browser, and no other software needs to be installed, which improves the convenience of users accessing the application. The terminal device 101 and the server 103 can interact during the operation of the Web application.
[0113] Server 103 may be a server that provides various services. For example, server 103 may be a server corresponding to a Web application. Server 103 may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in a cloud computing service system. The server may also be a server of a distributed system, or a server combined with a blockchain.
[0114] It should be understood that Figure 1 The number of terminal devices, networks, and servers in the embodiment is only for illustration. Any number of terminal devices, networks, and servers may be provided according to actual needs.
[0115] When the terminal device transmits a message to the server, the attacker can obtain the data in the message through technical means. Based on the obtained data, the attacker can further attack the server, thus causing double losses to the user and the service provider.
[0116] In order to ensure the security of message transmission, the data in the message needs to be encrypted. In the related art, when encrypting the data in the message, the application code needs to be modified. Specifically, in the application code, for each generated message, one or more preset fields in the message are encrypted according to the specified encryption algorithm to obtain an encrypted message, which includes the encrypted data corresponding to each preset field. The encrypted message is sent to the server.
[0117] However, the inventor discovered in the process of implementing the present application that in the above-mentioned related technologies, due to the large amount of message data, multiple codes of the application need to be modified, resulting in a time-consuming and laborious code modification process. In addition, during the code modification process, errors are easily introduced, reducing the operational stability of the application.
[0118] In addition, when the encryption algorithm needs to be replaced, the application code needs to be modified again according to the new encryption algorithm, which again costs more manpower and time.
[0119] In order to solve at least one of the above technical problems, the present application provides a data processing method, device, equipment, storage medium and program. In the technical solution of the present application, the message can be encrypted by an interceptor, so that there is no need to modify the code of the application. On the one hand, it reduces the labor cost and time cost, and on the other hand, it reduces the invasiveness of the application code and ensures the stability of the application operation. Furthermore, the interceptor can support multiple encryption algorithms, so that the encryption algorithm can be flexibly switched without modifying the code of the application.
[0120] The technical solution of the present application is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0121] Figure 2 The flowchart of a data processing method provided in an embodiment of the present application is shown in FIG. The method of this embodiment can be executed by a terminal device. Figure 2As shown, the method of this embodiment includes:
[0122] S201: Determine the message to be encrypted.
[0123] The message to be encrypted is a message to be sent by the terminal device to the server. The message in this embodiment can be an HTTP message, a TCP message, a UDP message, etc., or a message in a custom format agreed in advance between the terminal device and the server.
[0124] S202: Call encryption information through the interceptor corresponding to the message to be encrypted, where the encryption information includes multiple encryption algorithms.
[0125] Exemplarily, the encryption algorithm in this embodiment may include: base64 encryption algorithm, AES encryption algorithm, etc.
[0126] In this embodiment, the interceptor refers to a computer program added to the application. The interceptor can call encryption information, and the encryption information is used to implement the encryption processing of the message. In this embodiment, the encryption information can include multiple encryption algorithms. In other words, the encryption information can be used to encrypt the message using multiple encryption algorithms.
[0127] Exemplarily, the encrypted information may be one or more functions corresponding to the encryption processing logic, and the interceptor may be a calling statement of the function.
[0128] S203: Determine a target encryption algorithm corresponding to the message to be encrypted from among the multiple encryption algorithms.
[0129] In this embodiment, the interceptor supports multiple encryption algorithms. The interceptor can determine one of the multiple encryption algorithms as the target encryption algorithm corresponding to the message to be encrypted.
[0130] In one possible implementation, the interceptor can determine the target encryption algorithm corresponding to the message to be encrypted from multiple encryption algorithms in the following manner:
[0131] (1) Determine a first encryption type corresponding to the message to be encrypted.
[0132] In this embodiment, when the terminal device sends multiple messages, the encryption types corresponding to the multiple messages may be the same or different. It should be understood that when the encryption types corresponding to the multiple messages are different, the attacker must use the corresponding decryption algorithm to obtain the content of each message, which makes it more difficult for the attacker to crack the message and improves the security of the communication between the terminal device and the server.
[0133] For each message to be encrypted, the first encryption type corresponding to the message to be encrypted can be determined in the following ways:
[0134] In method 1, the preset encryption type may be determined as the first encryption type corresponding to the message to be encrypted.
[0135] Exemplarily, an encryption type may be preset according to the requirements of the application scenario, and the preset encryption type is determined as the first encryption type corresponding to the message to be encrypted. In this manner, the first encryption types corresponding to different messages are the same.
[0136] Method 2: Select the first encryption type from multiple preset encryption types.
[0137] Exemplarily, multiple encryption types may be preset according to the requirements of the application scenario. For each message to be encrypted, a first encryption type is selected from the multiple preset encryption types.
[0138] In this manner, the first encryption types corresponding to different messages may be different.
[0139] For example, assuming that there are three preset encryption types, namely encryption type 1, encryption type 2 and encryption type 3. For each message to be encrypted, one of the three preset encryption types may be randomly selected as the first encryption type corresponding to the message to be encrypted.
[0140] Alternatively, for each message to be encrypted, one of the three preset encryption types may be selected in the order of polling as the first encryption type corresponding to the message to be encrypted. For example, message 1 corresponds to encryption type 1, message 2 corresponds to encryption type 2, message 3 corresponds to encryption type 3, message 4 corresponds to encryption type 1, message 5 corresponds to encryption type 2, and so on.
[0141] In this manner, the first encryption types corresponding to different messages may also be the same. In a possible implementation, if the message to be encrypted is the first message sent to the server, the first encryption type is randomly selected from the multiple preset encryption types; if the message to be encrypted is the Nth message sent to the server, the encryption type used for the N-1th message sent to the server is determined to be the first encryption type, where N is an integer greater than or equal to 2.
[0142] It should be noted that in the above two methods, the preset encryption type may refer to the encryption type specified in the code of the application, for example, one or more encryption types may be preset in the code of the application. The preset encryption type may also refer to the encryption type specified in the configuration file of the application, for example, one or more encryption types may be preset in the configuration file of the application. The preset encryption type may also refer to the encryption type configured by the user to the application, for example, the user may configure one or more encryption types to the application.
[0143] (2) According to the first encryption type, determine a target encryption algorithm corresponding to the message to be encrypted from among the multiple encryption algorithms, where the type of the target encryption algorithm is the first encryption type.
[0144] In this embodiment, the encryption type corresponds to the encryption algorithm, and the encryption type refers to the type of the encryption algorithm. After determining the first encryption type corresponding to the message to be encrypted, the encryption algorithm of the first encryption type among the multiple encryption algorithms is determined as the target encryption algorithm corresponding to the message to be encrypted.
[0145] S204: Encrypt the message to be encrypted using the target encryption algorithm to obtain an encrypted message, and send the encrypted message to the server.
[0146] Specifically, after determining the target encryption algorithm, the encrypted message can be encrypted to obtain an encrypted message. For example, if the determined target encryption algorithm is the base64 algorithm, the base64 algorithm is used to encrypt the encrypted message to obtain an encrypted message. If the determined target encryption algorithm is the AES algorithm, the AES algorithm is used to encrypt the encrypted message to obtain an encrypted message.
[0147] In this embodiment, when the encrypted message is encrypted by the target encryption algorithm, the content of the entire message is encrypted as a whole, rather than encrypting each preset field in the message separately, which can improve the efficiency of the encryption process.
[0148] It should be understood that S202 to S204 in this embodiment are all executed by the interceptor. Exemplarily, in a possible implementation, an interceptor call statement can be added before the message sending statement in the application code, so that the application enters the interceptor according to the interceptor call statement before executing the message sending. The interceptor calls the encryption information, and determines the target encryption algorithm from the multiple encryption algorithms included in the encryption information, and then executes the target encryption algorithm through the interceptor to encrypt the message to obtain the encrypted message.
[0149] The data processing method provided in this embodiment includes: determining the message to be encrypted, calling encryption information through the interceptor corresponding to the message to be encrypted, determining the target encryption algorithm corresponding to the message to be encrypted from the multiple encryption algorithms included in the encryption information, and then encrypting the message to be encrypted through the target encryption algorithm to obtain the encrypted message, and sending the encrypted message to the server. In this embodiment, since the encryption process of the message is performed by the interceptor, the encryption process is imperceptible to the application, so there is no need to make multiple modifications to the application code to achieve unified encryption processing of all messages. On the one hand, it reduces the labor cost and time cost, and on the other hand, it reduces the invasiveness of the application code and ensures the stability of the application operation.
[0150] Furthermore, since the interceptor supports multiple encryption algorithms, when the encryption algorithm needs to be changed, it is only necessary to specify the encryption type of the message to the application, so that the encryption algorithm can be flexibly switched without modifying the application code.
[0151] Based on the above embodiments, the technical solution of the present application is described in more detail below in conjunction with a more specific embodiment.
[0152] Figure 3 A flow chart of another data processing method provided in an embodiment of the present application. Figure 3 As shown, the method of this embodiment may include:
[0153] S301: Determine the message to be encrypted.
[0154] S302: Call encryption information through the interceptor corresponding to the message to be encrypted, where the encryption information includes multiple encryption algorithms.
[0155] S303: Determine a target encryption algorithm corresponding to the message to be encrypted from among the multiple encryption algorithms.
[0156] It should be understood that the specific implementation of S301 to S303 can be found in Figure 2 The detailed description of the illustrated embodiment is not repeated here.
[0157] S304: Obtain a sending mode corresponding to the message to be encrypted, where the sending mode is an AJAX mode or a FORM form mode.
[0158] In this embodiment, taking a Web application as an example, there are two ways to send a message, namely, an AJAX way and a FORM form way. That is to say, for each message, the sending mode of the message can be an AJAX way or a FORM form way.
[0159] S305: According to the sending mode, the message to be encrypted is format converted to obtain first data to be sent in a target format, where the target format is a format recognizable by the server.
[0160] In this embodiment, different servers may recognize different formats (ie, target formats). Therefore, in different application scenarios, it is necessary to convert the encrypted message into different formats. For the convenience of description, the target format is JSON format as an example for illustration.
[0161] For messages sent by AJAX and messages sent by FORM, the data structures used in the two messages are different. For example, the data structure used in the message sent by AJAX is JavaScript object. The data structure used in the message sent by FORM is HTML format. Therefore, for the messages sent by the two sending methods, the format conversion processing methods used are different. They are explained below.
[0162] In one example, for a message sent via AJAX, format conversion processing can be performed in the following manner: a first JavaScript object is obtained from the message to be encrypted, and the first JavaScript object is converted into a first JSON string in JSON format, and the first data to be sent is the first JSON string.
[0163] In another example, for a message sent in FORM form mode, format conversion processing can be performed in the following manner: obtaining at least one field in the message to be encrypted; generating a second JSON string in JSON format according to the at least one field, and the first data to be sent is the second JSON string.
[0164] S306: Encrypt the first data to be sent using the target encryption algorithm to obtain the encrypted message.
[0165] Exemplarily, if the target encryption algorithm is the base64 algorithm, the base64 algorithm is used to encrypt the first data to be sent to obtain an encrypted message. If the target encryption algorithm is the AES algorithm, the AES algorithm is used to encrypt the message to be encrypted to obtain an encrypted message.
[0166] S307: Encapsulate the encrypted message and the first encryption type to obtain an encapsulation result.
[0167] Exemplarily, the encrypted message and the first encryption type are encapsulated into a second JavaScript object.
[0168] S308: Perform format conversion processing on the encapsulation result to obtain second data to be sent in the target format.
[0169] Exemplarily, the encapsulated second JavaScript object is converted into a third JSON string in JSON format. That is, the second data to be sent is the third JSON string.
[0170] S309: Send the second data to be sent to the server.
[0171] In this embodiment, the interceptor encapsulates the first encryption type into the encrypted message and transmits it to the server, so that the server can decrypt the encrypted message according to the first encryption type. In this way, there is no need to agree on the encryption type in advance between the terminal device and the server, which improves the flexibility of the encryption method.
[0172] In some examples, if the sending mode corresponding to the message to be encrypted is AJAX, the third JSON string is sent to the server using AJAX.
[0173] In other examples, if the sending mode corresponding to the message to be encrypted is the FORM form mode, the third JSON string is sent to the server using the FORM form mode.
[0174] In some other examples, when the sending mode corresponding to the message to be encrypted is the FORM form mode, the third JSON string can also be sent to the server in an AJAX mode.
[0175] In a specific implementation, before the encrypted message is encrypted, the default behavior of sending the message in the FORM form mode can be blocked by an interceptor. For example, jquery.form.js can be used to block the default behavior of sending the message in the FORM form mode. Further, after the encrypted message is encrypted to obtain the third JSON string, the third JSON string is sent to the server in an AJAX manner. For example, jquery.form.js is used to send the third JSON string to the server in an AJAX manner.
[0176] Through the above process, the interceptor is used to change the message sending method from FORM form to AJAX. Since there is no need to refresh the entire browser page when sending messages using AJAX, using AJAX to send messages can improve the user experience.
[0177] In this embodiment, a unified interceptor may be defined for different sending modes, or an interceptor may be defined for each sending mode, which is not limited in this embodiment.
[0178] In the data processing method provided in this embodiment, all messages sent by the application will enter the interceptor, which supports multiple encryption algorithms, and can perform encryption processing on messages sent in AJAX mode and FORM form mode. Since the encryption process of the message is implemented by the interceptor, the encryption process is imperceptible to the application, and there is no need to modify the application code. Therefore, unified encryption processing of all messages can be achieved without making multiple modifications to the application code. On the one hand, it reduces the labor cost and time cost, and on the other hand, it reduces the invasiveness of the application code and ensures the stability of the application operation.
[0179] Furthermore, since the interceptor supports multiple encryption algorithms, when the encryption algorithm needs to be changed, it is only necessary to specify the encryption type of the message to the application, so that the encryption algorithm can be flexibly switched without modifying the application code.
[0180] The above embodiment describes the encryption processing process of the terminal device on the message. The following describes the decryption processing process of the server on the message in conjunction with a specific embodiment.
[0181] Figure 4 A flowchart of another data processing method provided in an embodiment of the present application is shown below. The method of this embodiment can be executed by a server. Figure 4 As shown, the method of this embodiment includes:
[0182] S401: receiving a message to be decrypted from a client.
[0183] S402: calling decryption information through the interceptor corresponding to the message to be decrypted, wherein the decryption information includes multiple decryption algorithms.
[0184] Exemplarily, the decryption algorithm in this embodiment may include: base64 decryption algorithm, AES decryption algorithm, etc.
[0185] In this embodiment, the interceptor corresponding to the message to be decrypted refers to a computer program added to the server background program. The interceptor can call the decryption information, and the decryption information is used to implement the decryption process of the message. In this embodiment, the decryption information can include multiple decryption algorithms. In other words, the decryption information can be used to decrypt the message using multiple decryption algorithms.
[0186] Exemplarily, the decryption information may be one or more functions corresponding to the decryption processing logic, and the interceptor may be a calling statement of the function.
[0187] S403: Determine a target decryption algorithm from the multiple decryption algorithms.
[0188] The target decryption algorithm is a decryption algorithm corresponding to the encryption algorithm used by the message to be decrypted.
[0189] Optionally, the message to be decrypted carries a first message and a first encryption type corresponding to the first message, wherein the first message is a message encrypted by an encryption algorithm of the first encryption type. The interceptor can use Springboot technology to parse the message to be decrypted, and determine the first message and the first encryption type corresponding to the first message in the decrypted message; and then, according to the first encryption type, determine the target decryption algorithm from the multiple decryption algorithms.
[0190] Exemplarily, if the first encryption type is a base64 encryption type, the target decryption algorithm is determined to be a base64 decryption algorithm. If the first encryption type is an AES encryption type, the target decryption algorithm is determined to be an AES decryption algorithm.
[0191] S404: Decrypt the message to be decrypted using the target decryption algorithm to obtain decrypted data.
[0192] Exemplarily, the first message is decrypted by the target decryption algorithm to obtain a decrypted JSON string; the decrypted JSON string is format converted to obtain the decrypted data. For example, the decrypted JSON string is converted into an entity object, which is a data format used by the server, thereby obtaining the decrypted data.
[0193] It should be understood that S402 to S404 in this embodiment are all executed by the interceptor. Exemplarily, in a possible implementation, an interceptor call statement can be added after the message receiving statement in the server code, so that after receiving the message, the server will enter the interceptor according to the interceptor call statement. The decryption information is called by the interceptor, and the target decryption algorithm is determined from the multiple decryption algorithms included in the decryption information, and then the target decryption algorithm is executed by the interceptor to decrypt the message and obtain the decrypted data.
[0194] In this embodiment, since the decryption process of the message is executed by the interceptor, the decryption process is imperceptible to the server, so there is no need to make multiple modifications to the server code to achieve unified decryption processing of all messages. On the one hand, it reduces the labor cost and time cost, and on the other hand, it reduces the invasiveness of the server code and ensures the stability of the server operation. In addition, by encapsulating the first encryption type in the encrypted message for transmission, the server can decrypt the encrypted message according to the first encryption type. In this way, there is no need to agree on the encryption type in advance between the terminal device and the server, which improves the flexibility of the encryption method.
[0195] Figure 5 This is a schematic diagram of the structure of a data processing device provided in an embodiment of the present application. The device of this embodiment can be in the form of software and / or hardware. The device can be set in a terminal device. Figure 5 As shown, the data processing device 500 provided in this embodiment includes: a first determination module 501, a call processing module 502, a second determination module 503 and an encryption processing module 504.
[0196] Wherein, the first determination module 501 is used to determine the message to be encrypted;
[0197] A calling processing module 502 is used to call encryption information through an interceptor corresponding to the message to be encrypted, wherein the encryption information includes multiple encryption algorithms;
[0198] A second determination module 503, configured to determine a target encryption algorithm corresponding to the message to be encrypted from among the multiple encryption algorithms;
[0199] The encryption processing module 504 is used to encrypt the message to be encrypted by using the target encryption algorithm to obtain an encrypted message, and send the encrypted message to the server.
[0200] In a possible implementation, the second determining module 503 is specifically configured to:
[0201] Determining a first encryption type corresponding to the message to be encrypted;
[0202] According to the first encryption type, a target encryption algorithm corresponding to the message to be encrypted is determined from among the multiple encryption algorithms, and the type of the target encryption algorithm is the first encryption type.
[0203] In a possible implementation, the second determining module 503 is specifically configured to:
[0204] Determine the preset encryption type as the first encryption type corresponding to the message to be encrypted; or,
[0205] The first encryption type is selected from a plurality of preset encryption types.
[0206] In a possible implementation, the second determining module 503 is specifically configured to:
[0207] If the message to be encrypted is the first message sent to the server, randomly selecting the first encryption type from the multiple preset encryption types;
[0208] If the message to be encrypted is the Nth message sent to the server, the encryption type used for the N-1th message sent to the server is determined to be the first encryption type, where N is an integer greater than or equal to 2.
[0209] In a possible implementation, the encryption processing module 504 is specifically used for:
[0210] Obtain a sending method corresponding to the message to be encrypted, wherein the sending method is an AJAX method or a FORM form method;
[0211] According to the sending mode, the message to be encrypted is format converted to obtain first data to be sent in a target format, where the target format is a format recognizable by the server;
[0212] The first data to be sent is encrypted using the target encryption algorithm to obtain the encrypted message.
[0213] In a possible implementation, the sending method is AJAX, and the target format is JSON format; the encryption processing module 504 is specifically used for:
[0214] Obtaining a first JavaScript object in the message to be encrypted;
[0215] The first JavaScript object is converted into a first JSON string in JSON format, and the first data to be sent is the first JSON string.
[0216] In a possible implementation, the sending mode is a FORM form mode, and the target format is a JSON format; the encryption processing module 504 is specifically used for:
[0217] Obtaining at least one field in the message to be encrypted;
[0218] A second JSON string in JSON format is generated according to the at least one field, and the first data to be sent is the second JSON string.
[0219] In a possible implementation, the encryption processing module 504 is specifically used for:
[0220] Encapsulating the encrypted message and the first encryption type to obtain an encapsulation result;
[0221] Performing format conversion processing on the encapsulation result to obtain second data to be sent in the target format;
[0222] Send the second data to be sent to the server.
[0223] The data processing device provided in this embodiment can be used to execute the data processing method executed by the terminal device in any of the above method embodiments. Its implementation principle and technical effects are similar and will not be described in detail here.
[0224] Figure 6 This is a schematic diagram of the structure of another data processing device provided in an embodiment of the present application; the device of this embodiment can be in the form of software and / or hardware. The device can be set in a server. Figure 6 As shown, the data processing device 600 provided in this embodiment includes: a receiving module 601, a calling processing module 602, a determining module 603 and a decryption processing module 604.
[0225] The receiving module 601 is used to receive a message to be decrypted from a client;
[0226] A calling processing module 602 is used to call decryption information through an interceptor corresponding to the message to be decrypted, wherein the decryption information includes multiple decryption algorithms;
[0227] A determination module 603, configured to determine a target decryption algorithm from among the multiple decryption algorithms;
[0228] The decryption processing module 604 is used to perform decryption processing on the message to be decrypted by using the target decryption algorithm to obtain decrypted data.
[0229] In a possible implementation, the determining module 603 is specifically configured to:
[0230] Determining, in the decrypted message, a first message and a first encryption type corresponding to the first message, wherein the first message is a message encrypted by using an encryption algorithm of the first encryption type;
[0231] According to the first encryption type, a target decryption algorithm is determined among the plurality of decryption algorithms.
[0232] In a possible implementation, the decryption processing module 604 is specifically used for:
[0233] Decrypt the first message using the target decryption algorithm to obtain a decrypted JSON string;
[0234] The decrypted JSON string is formatted and converted to obtain the decrypted data.
[0235] The data processing device provided in this embodiment can be used to execute the data processing method executed by the server in any of the above method embodiments. Its implementation principle and technical effects are similar and will not be described in detail here.
[0236] Figure 7Schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device of this embodiment can be a terminal device or a server. Figure 7 As shown, the electronic device 700 provided in this embodiment may include: a processor 701 and a memory 702 .
[0237] The memory 702 is used to store computer programs; the processor 701 is used to execute the computer programs stored in the memory to implement the data processing method executed by the terminal device or the data processing method executed by the server in the above embodiment. For details, please refer to the relevant description in the above method embodiment, the implementation principle and technical effect are similar, and this embodiment will not be repeated here.
[0238] Optionally, the memory 702 may be independent or integrated with the processor 701 .
[0239] When the memory 702 is a device independent of the processor 701 , the electronic device 700 may further include: a bus 703 for connecting the memory 702 and the processor 701 .
[0240] An embodiment of the present application also provides a computer-readable storage medium, which includes a computer program. The computer program is used to implement the data processing method executed by the terminal device in the above method embodiment, or the data processing method executed by the server. The implementation principle and technical effect are similar and will not be repeated here.
[0241] An embodiment of the present application also provides a chip, including: a memory and a processor, wherein the memory stores a computer program, and the processor runs the computer program to execute the data processing method executed by the terminal device in the above method embodiment, or the data processing method executed by the server, and its implementation principle and technical effect are similar and will not be elaborated here.
[0242] An embodiment of the present application also provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the data processing method executed by the terminal device in the above method embodiment, or the data processing method executed by the server. The implementation principle and technical effects are similar and will not be repeated here.
[0243] In the several embodiments provided in the present application, 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 is only a logical function division. There may be other division methods in actual implementation, such as multiple modules 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 an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0244] The modules described as separate components may or may not be physically separated, and the components shown as modules 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 modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0245] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The above-mentioned module-composed unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
[0246] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present application.
[0247] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the application may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.
[0248] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.
[0249] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0250] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.
[0251] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic device or a main control device.
[0252] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0253] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A data processing method, characterized in that: include: Determine the message to be encrypted; Calling encryption information through the interceptor corresponding to the message to be encrypted, wherein the encryption information includes multiple encryption algorithms; Determining a first encryption type corresponding to the message to be encrypted; According to the first encryption type, determining a target encryption algorithm corresponding to the message to be encrypted from the multiple encryption algorithms, where the type of the target encryption algorithm is the first encryption type; Obtain a sending method corresponding to the message to be encrypted, wherein the sending method is an AJAX method or a FORM form method; According to the sending mode, the message to be encrypted is format converted to obtain first data to be sent in a target format, where the target format is a format recognizable by the server; Encrypting the first data to be sent by using the target encryption algorithm to obtain the encrypted message; Encapsulating the encrypted message and the first encryption type to obtain an encapsulation result; Performing format conversion processing on the encapsulation result to obtain second data to be sent in a target format; Sending the second data to be sent to the server; The sending mode is AJAX mode, and the target format is JSON format; the format conversion process is performed on the message to be encrypted according to the sending mode to obtain the first data to be sent in the target format, including: Obtaining a first JavaScript object in the message to be encrypted; Convert the first JavaScript object into a first JSON string in JSON format, wherein the first data to be sent is the first JSON string; The sending mode is a FORM form mode, and the target format is a JSON format; according to the sending mode, the message to be encrypted is format converted to obtain first data to be sent in a target format, including: Obtaining at least one field in the message to be encrypted; A second JSON string in JSON format is generated according to the at least one field, and the first data to be sent is the second JSON string.
2. The method according to claim 1, characterized in that Determining a first encryption type corresponding to the message to be encrypted includes: Determine the preset encryption type as the first encryption type corresponding to the message to be encrypted; or, The first encryption type is selected from a plurality of preset encryption types.
3. The method according to claim 2, characterized in that Selecting the first encryption type from a plurality of preset encryption types includes: If the message to be encrypted is the first message sent to the server, randomly selecting the first encryption type from the multiple preset encryption types; If the message to be encrypted is the Nth message sent to the server, the encryption type used for the N-1th message sent to the server is determined to be the first encryption type, where N is an integer greater than or equal to 2.
4. A data processing method, characterized in that: include: Receive a message to be decrypted from the client; The message to be decrypted is obtained by encapsulating the encrypted message and the first encryption type to obtain an encapsulation result by the interceptor corresponding to the message to be encrypted, and performing format conversion on the encapsulation result; Calling decryption information through the interceptor corresponding to the message to be decrypted, wherein the decryption information includes multiple decryption algorithms; Determine in the decrypted message the first message and the first encryption type corresponding to the first message, the first message being a message encrypted by an encryption algorithm of the first encryption type; the encrypted message is obtained by performing format conversion processing on the message to be encrypted according to the sending mode corresponding to the message to be encrypted, obtaining first data to be sent in a target format, and encrypting the first data to be sent by using a target encryption algorithm; the sending mode is an AJAX mode or a FORM form mode, and the target format is a format recognizable by the server; the sending mode is an AJAX mode, the target format is a JSON format, the first data to be sent is a first JSON string, and the first JSON string is obtained by obtaining a first JavaScript object in the message to be encrypted and converting the first JavaScript object; the sending mode is a FORM form mode, the target format is a JSON format, the first data to be sent is a second JSON string, and the second JSON string is generated by obtaining at least one field in the message to be encrypted and according to the at least one field; According to the first encryption type, determining a target decryption algorithm from among the multiple decryption algorithms; Decrypting the message to be decrypted by using the target decryption algorithm to obtain decrypted data; Decrypting the message to be decrypted by the target decryption algorithm to obtain decrypted data includes: Decrypt the first message using the target decryption algorithm to obtain a decrypted JSON string; The decrypted JSON string is formatted and converted to obtain the decrypted data.
5. A data processing device, characterized in that: include: A first determination module, used to determine the message to be encrypted; A calling processing module, used to call encryption information through an interceptor corresponding to the message to be encrypted, wherein the encryption information includes multiple encryption algorithms; A second determination module is used to determine a first encryption type corresponding to the message to be encrypted; according to the first encryption type, determine a target encryption algorithm corresponding to the message to be encrypted from the multiple encryption algorithms, the type of the target encryption algorithm being the first encryption type; An encryption processing module, used to encrypt the message to be encrypted by using the target encryption algorithm to obtain an encrypted message; encapsulate the encrypted message and the first encryption type to obtain an encapsulation result; perform format conversion on the encapsulation result to obtain second data to be sent in a target format; and send the second data to be sent to the server; The encryption processing module is specifically used to obtain a sending mode corresponding to the message to be encrypted, wherein the sending mode is an AJAX mode or a FORM form mode; according to the sending mode, the message to be encrypted is format converted to obtain a first data to be sent in a target format, wherein the target format is a format recognizable by the server; the first data to be sent is encrypted by the target encryption algorithm to obtain the encrypted message; The sending mode is AJAX mode, and the target format is JSON format; the encryption processing module is specifically used to obtain a first JavaScript object in the message to be encrypted; convert the first JavaScript object into a first JSON string in JSON format, and the first data to be sent is the first JSON string; The sending mode is the FORM form mode, and the target format is the JSON format; the encryption processing module is specifically used to obtain at least one field in the message to be encrypted; generate a second JSON string in JSON format according to the at least one field, and the first data to be sent is the second JSON string.
6. A data processing device, characterized in that: include: A receiving module, used for receiving a message to be decrypted from a client; The message to be decrypted is obtained by encapsulating the encrypted message and the first encryption type to obtain an encapsulation result by the interceptor corresponding to the message to be encrypted, and performing format conversion on the encapsulation result; A calling processing module, used to call decryption information through the interceptor corresponding to the message to be decrypted, wherein the decryption information includes multiple decryption algorithms; A determination module, used to determine the first encryption type corresponding to the first message and the first message in the decrypted message, the first message is a message encrypted by the encryption algorithm of the first encryption type; according to the first encryption type, determine a target decryption algorithm among the multiple decryption algorithms; the encrypted message is obtained by format conversion processing of the message to be encrypted according to the sending mode corresponding to the message to be encrypted, obtaining first data to be sent in a target format, and encrypting the first data to be sent by the target encryption algorithm; the sending mode is AJAX mode or FORM form mode, and the target format is a format recognizable by the server; the sending mode is AJAX mode, the target format is JSON format, the first data to be sent is a first JSON string, and the first JSON string is obtained by obtaining a first JavaScript object in the message to be encrypted and converting the first JavaScript object; the sending mode is FORM form mode, the target format is JSON format, the first data to be sent is a second JSON string, and the second JSON string is generated by obtaining at least one field in the message to be encrypted according to the at least one field; A decryption processing module, used to decrypt the message to be decrypted by using the target decryption algorithm to obtain decrypted data; The decryption processing module is specifically used to decrypt the first message through the target decryption algorithm to obtain a decrypted JSON string; and perform format conversion on the decrypted JSON string to obtain the decrypted data.
7. An electronic device, characterized in that: include: A memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to implement the method according to any one of claims 1 to 3, or implements the method according to claim 4.
8. A computer-readable storage medium, characterized in that: include: A computer program, wherein when the computer program is executed by a processor, the computer program implements the method according to any one of claims 1 to 3, or the computer program implements the method according to claim 4.
9. A computer program product, characterized in that include: A computer program, wherein when the computer program is executed by a processor, the computer program implements the method according to any one of claims 1 to 3, or the computer program implements the method according to claim 4.
